]> arthur.barton.de Git - netatalk.git/blob - distrib/initscripts/Makefile.am
Makefile.am was using absolute paths which broke make distcheck
[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 = $(DESTDIR)$(sysconfdir)/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 $(DESTDIR)$(sysconfdir)/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 = $(DESTDIR)$(sysconfdir)/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 $(DESTDIR)$(sysconfdir)/init.d/atalk
95
96 endif
97
98 #
99 # checking for "cobalt" style sysv scripts:
100 #
101
102 if USE_COBALT
103
104 sysvdir = $(DESTDIR)$(sysconfdir)/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 = $(DESTDIR)$(sysconfdir)/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 = $(DESTDIR)$(sysconfdir)/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 = $(DESTDIR)$(sysconfdir)/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 $(DESTDIR)$(sysconfdir)/rc2.d/S90atalk
187         -ln -s ../init.d/atalk $(DESTDIR)$(sysconfdir)/rc2.d/S90atalk
188         rm -f $(DESTDIR)$(sysconfdir)/rc0.d/K04atalk
189         -ln -s ../init.d/atalk $(DESTDIR)$(sysconfdir)/rc0.d/K04atalk
190
191 uninstall-startup:
192         rm -f $(DESTDIR)$(sysconfdir)/init.d/atalk \
193                 $(DESTDIR)$(sysconfdir)/rc2.d/S90atalk \
194                 $(DESTDIR)$(sysconfdir)/rc0.d/K04atalk
195
196 endif
197
198 #
199 # checking for "Gentoo" style sysv scripts:
200 #
201
202 if USE_GENTOO
203
204 sysvdir = $(DESTDIR)$(sysconfdir)/init.d
205 sysv_SCRIPTS = atalk
206
207 atalk: rc.atalk.gentoo
208         cp -f rc.atalk.gentoo atalk
209         chmod a+x atalk
210
211 install-data-hook:
212         -rc-update add atalk default
213
214 uninstall-startup:
215         -rc-update del atalk default
216         rm -f $(DESTDIR)$(sysconfdir)/init.d/atalk
217
218 endif
219
220 #
221 # checking for "Debian" style sysv scripts:
222 #
223
224 if USE_DEBIAN
225
226 sysvdir = $(DESTDIR)$(sysconfdir)/init.d
227 sysv_SCRIPTS = atalk
228
229 atalk: rc.atalk.debian
230         cp -f rc.atalk.debian atalk
231         chmod a+x atalk
232
233 install-data-hook:
234         update-rc.d atalk defaults 90 10
235
236 uninstall-startup:
237         rm -f $(DESTDIR)$(sysconfdir)/init.d/atalk
238         update-rc.d atalk remove
239
240 endif
241
242 #
243 # defaults, no init scripts installed
244 #
245
246 if USE_UNDEF
247
248 install-data-hook:
249
250 uninstall-hook:
251
252 uninstall-startup: uninstall-am
253
254 endif
255