]> arthur.barton.de Git - netatalk.git/blob - distrib/initscripts/Makefile.am
ecc150b28ea33151cd1f6973b63480714931e775
[netatalk.git] / distrib / initscripts / Makefile.am
1 ## Makefile for distrib/initscripts/
2
3 SUFFIXES = .tmpl .
4
5 pkgconfdir = @PKGCONFDIR@
6
7 #
8 # Template Generation
9 #
10
11 .tmpl:
12         sed -e s@:BINDIR:@${bindir}@ \
13             -e s@:SBINDIR:@${sbindir}@ \
14             -e s@:ETCDIR:@${pkgconfdir}@ \
15             <$< >$@
16
17 GENERATED_FILES = \
18         rc.afpd.netbsd          \
19         rc.atalk.redhat         \
20         rc.atalk.tru64          \
21         rc.atalk.bsd            \
22         rc.atalkd.netbsd        \
23         rc.atalk.suse           \
24         rc.cnid_metad.netbsd    \
25         rc.papd.netbsd          \
26         rc.timelord.netbsd      \
27         rc.atalk.sysv           \
28         rc.atalk.gentoo         \
29         rc.atalk.debian
30
31 TEMPLATES = \
32         rc.afpd.netbsd.tmpl             \
33         rc.atalk.redhat.tmpl            \
34         rc.atalk.tru64.tmpl             \
35         rc.atalk.bsd.tmpl               \
36         rc.atalkd.netbsd.tmpl           \
37         rc.atalk.suse.tmpl              \
38         rc.cnid_metad.netbsd.tmpl       \
39         rc.papd.netbsd.tmpl             \
40         rc.timelord.netbsd.tmpl         \
41         rc.atalk.sysv.tmpl              \
42         rc.atalk.gentoo.tmpl            \
43         rc.atalk.debian.tmpl
44
45 CLEANFILES = $(GENERATED_FILES) atalk afpd atalkd papd timelord
46 EXTRA_DIST = $(TEMPLATES) rc.atalk.cobalt
47
48 # overwrite automake uninstall
49 # not beautiful, but this way we can call the OS specific init script
50 # tools, like chkconfig, insserv or rc-update
51
52 uninstall: uninstall-startup
53
54 #
55 # checking for "redhat" style sysv scripts:
56 #
57
58 if USE_REDHAT
59
60 sysvdir = /etc/rc.d/init.d
61 sysv_SCRIPTS = atalk
62
63 atalk: rc.atalk.redhat
64         cp -f rc.atalk.redhat atalk
65         chmod a+x atalk
66
67 install-data-hook:
68         -chkconfig --add atalk
69
70 uninstall-startup:
71         -chkconfig --del atalk
72         rm -f /etc/rc.d/init.d/atalk
73
74 endif
75
76 #
77 # checking for "SuSE" style sysv scripts:
78 #
79
80 if USE_SUSE
81
82 sysvdir = /etc/init.d
83 sysv_SCRIPTS = atalk
84
85 atalk: rc.atalk.suse
86         cp -f rc.atalk.suse atalk
87         chmod a+x atalk
88
89 install-data-hook:
90         -insserv atalk
91
92 uninstall-startup:
93         -insserv -d atalk
94         rm -f /etc/init.d/atalk
95
96 endif
97
98 #
99 # checking for "cobalt" style sysv scripts:
100 #
101
102 if USE_COBALT
103
104 sysvdir = /etc/rc.d/init.d
105 sysv_SCRIPTS = atalk
106
107 atalk: rc.atalk.cobalt
108         cp -f rc.atalk.cobalt atalk
109         chmod a+x atalk
110
111 install-data-hook:
112
113 uninstall-hook:
114
115 uninstall-startup: uninstall-am
116
117 endif
118
119 #
120 # checking for "tru64" style sysv scripts:
121 #
122
123 if USE_TRU64
124
125 sysvdir = /sbin/init.d
126 sysv_SCRIPTS = atalk
127
128 atalk: rc.atalk.tru64
129         cp -f rc.atalk.tru64 atalk
130         chmod a+x atalk
131
132 install-data-hook:
133
134 uninstall-hook:
135
136 uninstall-startup: uninstall-am
137
138 endif
139
140 #
141 # checking for NetBSD init scripts
142 #
143
144 if USE_NETBSD
145
146 sysvdir = /etc/rc.d
147 sysv_SCRIPTS = afpd atalkd papd timelord
148
149 afpd: rc.afpd.netbsd
150         cp -f $< $@
151
152 atalkd: rc.atalkd.netbsd
153         cp -f $< $@
154         chmod a+x $@
155
156 papd: rc.papd.netbsd
157         cp -f $< $@
158         chmod a+x $@
159
160 timelord: rc.timelord.netbsd
161         cp -f $< $@
162         chmod a+x $@
163
164 install-data-hook:
165
166 uninstall-hook:
167
168 uninstall-startup: uninstall-am
169
170 endif
171
172 #
173 # checking for Solaris init scripts
174 #
175
176 if USE_SOLARIS
177
178 sysvdir = /etc/init.d
179 sysv_SCRIPTS = atalk
180
181 atalk: rc.atalk.sysv
182         cp -f rc.atalk.sysv $@
183         chmod a+x $@
184
185 install-data-hook:
186         rm -f /etc/rc2.d/S90atalk
187         -ln -s ../init.d/atalk /etc/rc2.d/S90atalk
188         rm -f /etc/rc0.d/K04atalk
189         -ln -s ../init.d/atalk /etc/rc0.d/K04atalk
190
191 uninstall-startup:
192         rm -f /etc/init.d/atalk /etc/rc2.d/S90atalk /etc/rc0.d/K04atalk
193
194 endif
195
196 #
197 # checking for "Gentoo" style sysv scripts:
198 #
199
200 if USE_GENTOO
201
202 sysvdir = /etc/init.d
203 sysv_SCRIPTS = atalk
204
205 atalk: rc.atalk.gentoo
206         cp -f rc.atalk.gentoo atalk
207         chmod a+x atalk
208
209 install-data-hook:
210         -rc-update add atalk default
211
212 uninstall-startup:
213         -rc-update del atalk default
214         rm -f /etc/init.d/atalk
215
216 endif
217
218 #
219 # checking for "Debian" style sysv scripts:
220 #
221
222 if USE_DEBIAN
223
224 sysvdir = /etc/init.d
225 sysv_SCRIPTS = atalk
226
227 atalk: rc.atalk.debian
228         cp -f rc.atalk.debian atalk
229         chmod a+x atalk
230
231 install-data-hook:
232         update-rc.d atalk defaults 90 10
233
234 uninstall-startup:
235         rm -f /etc/init.d/atalk
236         update-rc.d atalk remove
237
238 endif
239
240 #
241 # defaults, no init scripts installed
242 #
243
244 if USE_UNDEF
245
246 install-data-hook:
247
248 uninstall-hook:
249
250 uninstall-startup: uninstall-am
251
252 endif
253