modernized; use '+=' syntax
[util-vserver.git] / util-vserver / sysv / Makefile-files
1 ## $Id$  -*- 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/vprocunhide
25 sysv_gen_SCRPTS =       sysv/rebootmgr \
26                         sysv/v_gated \
27                         sysv/v_httpd \
28                         sysv/v_named \
29                         sysv/v_portmap \
30                         sysv/v_sendmail \
31                         sysv/v_smb \
32                         sysv/v_sshd \
33                         sysv/v_xinetd \
34                         sysv/vservers
35 sysv_conf_DTA =         sysv/vservers.conf
36
37 sysconf_DATA +=         $(sysv_conf_DTA)
38 EXTRA_DIST +=           sysv/rebootmgr.subst \
39                         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/vservers.subst \
48                         $(sysv_src_SCRPTS) \
49                         $(sysv_conf_DTA)
50
51 initrd_SCRIPTS +=       $(sysv_src_SCRPTS) \
52                         $(sysv_gen_SCRPTS)
53
54 CLEANFILES +=           $(sysv_gen_SCRPTS)
55
56 sysv_SUBSTRULE =        s!/usr/lib/util-vserver!$(pkglibdir)!g; \
57                         s!^USR_SBIN=/usr/sbin$$!USR_SBIN=$(sbindir)!g; \
58                         s!^DEFAULT_VSERVERDIR=/vservers$$!DEFAULT_VSERVERDIR=$(vserverdir)!g
59
60 sysv/%:                 sysv/%.subst
61                         @mkdir -p $$(dirname '$@')
62                         sed -e '$(sysv_SUBSTRULE)' '$<' >'$@.tmp'
63                         @rm -f '$@'
64                         @if cmp -s '$<' '$@.tmp'; then \
65                                 cp -p '$<' '$@'; \
66                         else \
67                                 mv -f '$@.tmp' '$@'; \
68                         fi
69                         @rm -f '$@.tmp'
70                         @chmod a-w '$@'