]> git.ipfire.org Git - thirdparty/cups.git/blame - config-scripts/cups-opsys.m4
This commit was manufactured by cvs2svn to create branch 'branch-1.2'.
[thirdparty/cups.git] / config-scripts / cups-opsys.m4
CommitLineData
74456259 1dnl
2dnl "$Id: cups-opsys.m4,v 1.5 2001/07/24 20:23:03 mike Exp $"
3dnl
4dnl Operating system stuff for the Common UNIX Printing System (CUPS).
5dnl
6dnl Copyright 1997-2001 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-3111 USA
19dnl
20dnl Voice: (301) 373-9603
21dnl EMail: cups-info@cups.org
22dnl WWW: http://www.cups.org
23dnl
24
25dnl Get the operating system and version number...
26uname=`uname`
27uversion=`uname -r | sed -e '1,$s/[[^0-9]]//g'`
28if test x$uname = xIRIX64; then
29 uname="IRIX"
30fi
31
32dnl Determine the correct username and group for this OS...
33AC_ARG_WITH(cups-user, [ --with-cups-user set default user for CUPS],
34 CUPS_USER="$withval",
35 AC_MSG_CHECKING(for default print user)
36 if test -f /etc/passwd; then
37 CUPS_USER=""
38 for user in lp lpd guest daemon nobody; do
39 if test "`grep \^${user}: /etc/passwd`" != ""; then
40 CUPS_USER="$user"
41 AC_MSG_RESULT($user)
42 break;
43 fi
44 done
45
46 if test x$CUPS_USER = x; then
47 CUPS_USER="${USER:=nobody}"
48 AC_MSG_RESULT(not found, using "$CUPS_USER")
49 fi
50 else
51 CUPS_USER="${USER:=nobody}"
52 AC_MSG_RESULT(no password file, using "$CUPS_USER")
53 fi)
54
55AC_ARG_WITH(cups-group, [ --with-cups-group set default group for CUPS],
56 CUPS_GROUP="$withval",
57 AC_MSG_CHECKING(for default print group)
58 if test -f /etc/group; then
59 CUPS_GROUP=""
60 for group in sys system root; do
61 if test "`grep \^${group}: /etc/group`" != ""; then
62 CUPS_GROUP="$group"
63 AC_MSG_RESULT($group)
64 break;
65 fi
66 done
67
68 if test x$CUPS_GROUP = x; then
69 CUPS_GROUP="${GROUP:=nobody}"
70 AC_MSG_RESULT(not found, using "$CUPS_GROUP")
71 fi
72 else
73 CUPS_GROUP="${GROUP:=nobody}"
74 AC_MSG_RESULT(no group file, using "$CUPS_GROUP")
75 fi)
76
77AC_SUBST(CUPS_USER)
78AC_SUBST(CUPS_GROUP)
79
80AC_DEFINE_UNQUOTED(CUPS_DEFAULT_USER, "$CUPS_USER")
81AC_DEFINE_UNQUOTED(CUPS_DEFAULT_GROUP, "$CUPS_GROUP")
82
83dnl
84dnl "$Id: cups-opsys.m4,v 1.5 2001/07/24 20:23:03 mike Exp $"
85dnl