]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | dnl |
fa73b229 | 2 | dnl "$Id: cups-opsys.m4 4960 2006-01-20 16:41:20Z mike $" |
ef416fc2 | 3 | dnl |
4 | dnl Operating system stuff for the Common UNIX Printing System (CUPS). | |
5 | dnl | |
6 | dnl Copyright 1997-2005 by Easy Software Products, all rights reserved. | |
7 | dnl | |
8 | dnl These coded instructions, statements, and computer programs are the | |
9 | dnl property of Easy Software Products and are protected by Federal | |
10 | dnl copyright law. Distribution and use rights are outlined in the file | |
11 | dnl "LICENSE.txt" which should have been included with this file. If this | |
12 | dnl file is missing or damaged please contact Easy Software Products | |
13 | dnl at: | |
14 | dnl | |
15 | dnl Attn: CUPS Licensing Information | |
16 | dnl Easy Software Products | |
17 | dnl 44141 Airport View Drive, Suite 204 | |
18 | dnl Hollywood, Maryland 20636 USA | |
19 | dnl | |
20 | dnl Voice: (301) 373-9600 | |
21 | dnl EMail: cups-info@cups.org | |
22 | dnl WWW: http://www.cups.org | |
23 | dnl | |
24 | ||
25 | dnl Get the operating system and version number... | |
26 | uname=`uname` | |
fa73b229 | 27 | uversion=`uname -r | sed -e '1,$s/^[[^0-9]]*\([[0-9]]*\)\.\([[0-9]]*\).*/\1\2/'` |
28 | ||
ef416fc2 | 29 | case "$uname" in |
30 | GNU* | GNU/*) | |
31 | uname="GNU" | |
32 | ;; | |
33 | IRIX*) | |
34 | uname="IRIX" | |
35 | ;; | |
36 | Linux*) | |
37 | uname="Linux" | |
38 | ;; | |
39 | esac | |
40 | ||
41 | dnl Determine the correct username and group for this OS... | |
42 | AC_ARG_WITH(cups-user, [ --with-cups-user set default user for CUPS], | |
43 | CUPS_USER="$withval", | |
44 | AC_MSG_CHECKING(for default print user) | |
45 | if test -f /etc/passwd; then | |
46 | CUPS_USER="" | |
47 | for user in lp lpd guest daemon nobody; do | |
48 | if test "`grep \^${user}: /etc/passwd`" != ""; then | |
49 | CUPS_USER="$user" | |
50 | AC_MSG_RESULT($user) | |
51 | break; | |
52 | fi | |
53 | done | |
54 | ||
55 | if test x$CUPS_USER = x; then | |
56 | CUPS_USER="${USER:=nobody}" | |
57 | AC_MSG_RESULT(not found, using "$CUPS_USER") | |
58 | fi | |
59 | else | |
60 | CUPS_USER="${USER:=nobody}" | |
61 | AC_MSG_RESULT(no password file, using "$CUPS_USER") | |
62 | fi) | |
63 | ||
64 | AC_ARG_WITH(cups-group, [ --with-cups-group set default group for CUPS], | |
65 | CUPS_GROUP="$withval", | |
66 | AC_MSG_CHECKING(for default print group) | |
67 | if test -f /etc/group; then | |
68 | if test x$uname = xDarwin; then | |
69 | GROUP_LIST="lp admin" | |
70 | else | |
71 | GROUP_LIST="lpadmin sys system root" | |
72 | fi | |
73 | ||
74 | CUPS_GROUP="" | |
75 | for group in $GROUP_LIST; do | |
76 | if test "`grep \^${group}: /etc/group`" != ""; then | |
77 | CUPS_GROUP="$group" | |
78 | AC_MSG_RESULT($group) | |
79 | break; | |
80 | fi | |
81 | done | |
82 | ||
83 | if test x$CUPS_GROUP = x; then | |
84 | CUPS_GROUP="${GROUP:=nobody}" | |
85 | AC_MSG_RESULT(not found, using "$CUPS_GROUP") | |
86 | fi | |
87 | else | |
88 | CUPS_GROUP="${GROUP:=nobody}" | |
89 | AC_MSG_RESULT(no group file, using "$CUPS_GROUP") | |
90 | fi) | |
91 | ||
92 | AC_SUBST(CUPS_USER) | |
93 | AC_SUBST(CUPS_GROUP) | |
94 | ||
95 | AC_DEFINE_UNQUOTED(CUPS_DEFAULT_USER, "$CUPS_USER") | |
96 | AC_DEFINE_UNQUOTED(CUPS_DEFAULT_GROUP, "$CUPS_GROUP") | |
97 | ||
98 | dnl | |
fa73b229 | 99 | dnl "$Id: cups-opsys.m4 4960 2006-01-20 16:41:20Z mike $" |
ef416fc2 | 100 | dnl |