Fixed unprivileged 'rpm' builds.
[captive.git] / src / client / sandbox-server / Makefile.am
1 # $Id$
2 # automake source for sandbox filesystem sandbox server
3 # Copyright (C) 2003 Jan Kratochvil <project-captive@jankratochvil.net>
4
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; exactly version 2 of June 1991 is required
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
18
19 include $(top_srcdir)/Makefile-head.am
20
21 captive_sandbox_server_SOURCES= \
22                 main.c
23 captive_sandbox_server_CFLAGS=$(ORBIT_CFLAGS) $(LINC_CFLAGS) $(GNOME_VFS_CFLAGS) $(LIBXML_CFLAGS) 
24 captive_sandbox_server_LDADD =$(ORBIT_LIBS)   $(LINC_LIBS)   $(GNOME_VFS_LIBS)   $(LIBXML_LIBS)   $(captive_library) $(INTLLIBS)
25 libexec_PROGRAMS=captive-sandbox-server
26 EXTRA_DIST+=.gdbinit
27
28 install-data-hook:
29         $(mkinstalldirs) $(DESTDIR)$(CAPTIVE_SANDBOX_CHROOT)
30         $(mkinstalldirs) $(DESTDIR)$(CAPTIVE_SANDBOX_CHROOT)/tmp
31         chmod 1777 $(DESTDIR)$(CAPTIVE_SANDBOX_CHROOT)/tmp
32
33 # Do not: libexecPROGRAMS_INSTALL=${INSTALL} -o root -g root -m 4755
34 # as it works only on Fedora Core based systems, at least SuSE 10.0 correctly fails.
35 #       https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=176708
36
37 install-exec-hook:
38         if test `id -u` -eq 0 -a -z "$(DESTDIR)";then \
39                 chown root.root $(DESTDIR)/$(libexecdir)/captive-sandbox-server; \
40                 chmod 4755      $(DESTDIR)/$(libexecdir)/captive-sandbox-server; \
41                 if grep -q '^$(CAPTIVE_SANDBOX_SETGID):' /etc/group;then true;else \
42                         echo "ERROR: Add '$(CAPTIVE_SANDBOX_SETGID)' to your '/etc/group'; see README and groupadd(8)"; \
43                         exit 1; \
44                 fi; \
45                 if grep -q '^$(CAPTIVE_SANDBOX_SETUID):' /etc/passwd;then true;else \
46                         echo "ERROR: Add '$(CAPTIVE_SANDBOX_SETUID)' to your '/etc/passwd'; see README and useradd(8)"; \
47                         exit 1; \
48                 fi; \
49         fi
50
51 EXTRA_DIST+=captive-sandbox-server.pod.pl.in
52 CLEANFILES+=captive-sandbox-server.pod captive-sandbox-server.1
53 if ENABLE_MAN_PAGES
54 captive_sandbox_server_man_cond=captive-sandbox-server.1
55 endif
56 man_MANS=$(captive_sandbox_server_man_cond)