]> git.ipfire.org Git - thirdparty/cups.git/blame - config-scripts/cups-opsys.m4
Copyright updates.
[thirdparty/cups.git] / config-scripts / cups-opsys.m4
CommitLineData
ee1fd936 1dnl
fa27cf64 2dnl "$Id: cups-opsys.m4,v 1.14 2005/01/03 19:29:45 mike Exp $"
ee1fd936 3dnl
4dnl Operating system stuff for the Common UNIX Printing System (CUPS).
5dnl
fa27cf64 6dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
ee1fd936 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
fa27cf64 18dnl Hollywood, Maryland 20636 USA
ee1fd936 19dnl
4edc032d 20dnl Voice: (301) 373-9600
ee1fd936 21dnl EMail: cups-info@cups.org
22dnl WWW: http://www.cups.org
23dnl
24
25dnl Get the operating system and version number...
ee1fd936 26uname=`uname`
27uversion=`uname -r | sed -e '1,$s/[[^0-9]]//g'`
e6762b58 28case "$uname" in
29 GNU* | GNU/*)
30 uname="GNU"
31 ;;
32 IRIX*)
33 uname="IRIX"
34 ;;
35 Linux*)
36 uname="Linux"
37 ;;
38esac
ee1fd936 39
bf905723 40dnl Determine the correct username and group for this OS...
2a60d798 41AC_ARG_WITH(cups-user, [ --with-cups-user set default user for CUPS],
bf905723 42 CUPS_USER="$withval",
43 AC_MSG_CHECKING(for default print user)
44 if test -f /etc/passwd; then
45 CUPS_USER=""
46 for user in lp lpd guest daemon nobody; do
a59ea083 47 if test "`grep \^${user}: /etc/passwd`" != ""; then
bf905723 48 CUPS_USER="$user"
49 AC_MSG_RESULT($user)
50 break;
51 fi
52 done
53
54 if test x$CUPS_USER = x; then
55 CUPS_USER="${USER:=nobody}"
56 AC_MSG_RESULT(not found, using "$CUPS_USER")
57 fi
58 else
59 CUPS_USER="${USER:=nobody}"
60 AC_MSG_RESULT(no password file, using "$CUPS_USER")
61 fi)
62
2a60d798 63AC_ARG_WITH(cups-group, [ --with-cups-group set default group for CUPS],
bf905723 64 CUPS_GROUP="$withval",
65 AC_MSG_CHECKING(for default print group)
df349624 66 if test -f /etc/group; then
67 if test x$uname = xDarwin; then
68 GROUP_LIST="lp admin"
69 else
70 GROUP_LIST="sys system root"
71 fi
bf905723 72
df349624 73 CUPS_GROUP=""
74 for group in $GROUP_LIST; do
75 if test "`grep \^${group}: /etc/group`" != ""; then
76 CUPS_GROUP="$group"
77 AC_MSG_RESULT($group)
78 break;
79e622fd 79 fi
df349624 80 done
81
82 if test x$CUPS_GROUP = x; then
bf905723 83 CUPS_GROUP="${GROUP:=nobody}"
df349624 84 AC_MSG_RESULT(not found, using "$CUPS_GROUP")
bf905723 85 fi
df349624 86 else
87 CUPS_GROUP="${GROUP:=nobody}"
88 AC_MSG_RESULT(no group file, using "$CUPS_GROUP")
bf905723 89 fi)
90
91AC_SUBST(CUPS_USER)
92AC_SUBST(CUPS_GROUP)
93
3d3304e0 94AC_DEFINE_UNQUOTED(CUPS_DEFAULT_USER, "$CUPS_USER")
95AC_DEFINE_UNQUOTED(CUPS_DEFAULT_GROUP, "$CUPS_GROUP")
bf905723 96
ee1fd936 97dnl
fa27cf64 98dnl "$Id: cups-opsys.m4,v 1.14 2005/01/03 19:29:45 mike Exp $"
ee1fd936 99dnl