]>
Commit | Line | Data |
---|---|---|
74456259 | 1 | dnl |
c4dcf3cc | 2 | dnl "$Id: cups-opsys.m4,v 1.5.2.8 2004/06/29 03:46:29 mike Exp $" |
74456259 | 3 | dnl |
4 | dnl Operating system stuff for the Common UNIX Printing System (CUPS). | |
5 | dnl | |
5aad2002 | 6 | dnl Copyright 1997-2004 by Easy Software Products, all rights reserved. |
74456259 | 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 | |
c4dcf3cc | 18 | dnl Hollywood, Maryland 20636-3142 USA |
74456259 | 19 | dnl |
c4dcf3cc | 20 | dnl Voice: (301) 373-9600 |
74456259 | 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` | |
27 | uversion=`uname -r | sed -e '1,$s/[[^0-9]]//g'` | |
28 | if test x$uname = xIRIX64; then | |
29 | uname="IRIX" | |
30 | fi | |
31 | ||
32 | dnl Determine the correct username and group for this OS... | |
33 | AC_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 | ||
55 | AC_ARG_WITH(cups-group, [ --with-cups-group set default group for CUPS], | |
56 | CUPS_GROUP="$withval", | |
57 | AC_MSG_CHECKING(for default print group) | |
e02e59e4 | 58 | if test -f /etc/group; then |
59 | if test x$uname = xDarwin; then | |
60 | GROUP_LIST="lp admin" | |
61 | else | |
62 | GROUP_LIST="sys system root" | |
63 | fi | |
74456259 | 64 | |
e02e59e4 | 65 | CUPS_GROUP="" |
66 | for group in $GROUP_LIST; do | |
67 | if test "`grep \^${group}: /etc/group`" != ""; then | |
68 | CUPS_GROUP="$group" | |
69 | AC_MSG_RESULT($group) | |
70 | break; | |
fa7a2446 | 71 | fi |
e02e59e4 | 72 | done |
73 | ||
74 | if test x$CUPS_GROUP = x; then | |
74456259 | 75 | CUPS_GROUP="${GROUP:=nobody}" |
e02e59e4 | 76 | AC_MSG_RESULT(not found, using "$CUPS_GROUP") |
74456259 | 77 | fi |
e02e59e4 | 78 | else |
79 | CUPS_GROUP="${GROUP:=nobody}" | |
80 | AC_MSG_RESULT(no group file, using "$CUPS_GROUP") | |
74456259 | 81 | fi) |
82 | ||
83 | AC_SUBST(CUPS_USER) | |
84 | AC_SUBST(CUPS_GROUP) | |
85 | ||
86 | AC_DEFINE_UNQUOTED(CUPS_DEFAULT_USER, "$CUPS_USER") | |
87 | AC_DEFINE_UNQUOTED(CUPS_DEFAULT_GROUP, "$CUPS_GROUP") | |
88 | ||
89 | dnl | |
c4dcf3cc | 90 | dnl "$Id: cups-opsys.m4,v 1.5.2.8 2004/06/29 03:46:29 mike Exp $" |
74456259 | 91 | dnl |