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