]> git.ipfire.org Git - thirdparty/cups.git/blame - config-scripts/cups-opsys.m4
Load cups into easysw/current.
[thirdparty/cups.git] / config-scripts / cups-opsys.m4
CommitLineData
ef416fc2 1dnl
fa73b229 2dnl "$Id: cups-opsys.m4 4960 2006-01-20 16:41:20Z mike $"
ef416fc2 3dnl
4dnl Operating system stuff for the Common UNIX Printing System (CUPS).
5dnl
6dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
7dnl
8dnl These coded instructions, statements, and computer programs are the
9dnl property of Easy Software Products and are protected by Federal
10dnl copyright law. Distribution and use rights are outlined in the file
11dnl "LICENSE.txt" which should have been included with this file. If this
12dnl file is missing or damaged please contact Easy Software Products
13dnl at:
14dnl
15dnl Attn: CUPS Licensing Information
16dnl Easy Software Products
17dnl 44141 Airport View Drive, Suite 204
18dnl Hollywood, Maryland 20636 USA
19dnl
20dnl Voice: (301) 373-9600
21dnl EMail: cups-info@cups.org
22dnl WWW: http://www.cups.org
23dnl
24
25dnl Get the operating system and version number...
26uname=`uname`
fa73b229 27uversion=`uname -r | sed -e '1,$s/^[[^0-9]]*\([[0-9]]*\)\.\([[0-9]]*\).*/\1\2/'`
28
ef416fc2 29case "$uname" in
30 GNU* | GNU/*)
31 uname="GNU"
32 ;;
33 IRIX*)
34 uname="IRIX"
35 ;;
36 Linux*)
37 uname="Linux"
38 ;;
39esac
40
41dnl Determine the correct username and group for this OS...
42AC_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
64AC_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
92AC_SUBST(CUPS_USER)
93AC_SUBST(CUPS_GROUP)
94
95AC_DEFINE_UNQUOTED(CUPS_DEFAULT_USER, "$CUPS_USER")
96AC_DEFINE_UNQUOTED(CUPS_DEFAULT_GROUP, "$CUPS_GROUP")
97
98dnl
fa73b229 99dnl "$Id: cups-opsys.m4 4960 2006-01-20 16:41:20Z mike $"
ef416fc2 100dnl