8e86ffb8b3183f7bd5a5510f1b1d4f264d7f8926
[util-vserver.git] / sysv / Makefile-files
1 ## $Id: Makefile-files,v 1.8 2004/03/24 01:44:43 ensc Exp $  -*- makefile -*-
2
3 ## Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
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; either version 2, or (at your option)
8 ## any later version.
9 ##  
10 ## This program is distributed in the hope that it will be useful,
11 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 ## GNU General Public License for more details.
14 ##  
15 ## You should have received a copy of the GNU General Public License
16 ## along with this program; if not, write to the Free Software
17 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 ##  
19
20 AM_INSTALLCHECK_STD_OPTIONS_EXEMPT +=   \
21                         $(sysv_src_SCRPTS) \
22                         $(sysv_gen_SCRPTS)
23
24 sysv_src_SCRPTS =       sysv/rebootmgr \
25                         sysv/vprocunhide \
26                         sysv/vservers-default \
27                         sysv/vservers-legacy
28 sysv_gen_SCRPTS =       sysv/v_gated \
29                         sysv/v_httpd \
30                         sysv/v_named \
31                         sysv/v_portmap \
32                         sysv/v_sendmail \
33                         sysv/v_smb \
34                         sysv/v_sshd \
35                         sysv/v_xinetd
36 sysv_conf_DTA =         sysv/vservers.conf
37
38 sysconf_DATA +=         $(sysv_conf_DTA)
39 EXTRA_DIST +=           sysv/v_gated.subst \
40                         sysv/v_httpd.subst \
41                         sysv/v_named.subst \
42                         sysv/v_portmap.subst \
43                         sysv/v_sendmail.subst \
44                         sysv/v_smb.subst \
45                         sysv/v_sshd.subst \
46                         sysv/v_xinetd.subst \
47                         $(sysv_src_SCRPTS) \
48                         $(sysv_conf_DTA)
49
50 initrd_SCRIPTS +=       $(sysv_src_SCRPTS) \
51                         $(sysv_gen_SCRPTS)
52
53 CLEANFILES +=           $(sysv_gen_SCRPTS)
54
55 sysv_SUBSTRULE =        s!/usr/lib/util-vserver!$(pkglibdir)!g; \
56                         s!^USR_SBIN=/usr/sbin$$!USR_SBIN=$(sbindir)!g; \
57                         s!^DEFAULT_VSERVERDIR=/vservers$$!DEFAULT_VSERVERDIR=$(vserverdir)!g
58
59 sysv/%:                 sysv/%.subst
60                         @mkdir -p $$(dirname '$@')
61                         sed -e '$(sysv_SUBSTRULE)' '$<' >'$@.tmp'
62                         @rm -f '$@'
63                         @if cmp -s '$<' '$@.tmp'; then \
64                                 cp -p '$<' '$@'; \
65                         else \
66                                 mv -f '$@.tmp' '$@'; \
67                         fi
68                         @rm -f '$@.tmp'
69                         @chmod a-w '$@'