]> arthur.barton.de Git - netatalk.git/blob - distrib/initscripts/Makefile.am
NEW: configure option "--with-init-style=debian-systemd" for Debian 8 jessieand later
[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             -e s@:NETATALK_VERSION:@${NETATALK_VERSION}@ \
16             -e s@:PATH_NETATALK_LOCK:@${PATH_NETATALK_LOCK}@ \
17             <$< >$@
18
19 GENERATED_FILES = \
20         rc.bsd \
21         rc.debian \
22         rc.gentoo \
23         rc.netbsd \
24         rc.redhat \
25         rc.solaris \
26         rc.suse \
27         service.systemd \
28         netatalk.xml
29
30 TEMPLATES = \
31         rc.bsd.tmpl \
32         rc.debian.tmpl \
33         rc.gentoo.tmpl \
34         rc.netbsd.tmpl \
35         rc.redhat.tmpl \
36         rc.solaris.tmpl \
37         rc.suse.tmpl \
38         service.systemd.tmpl \
39         netatalk.xml.tmpl
40
41 CLEANFILES = $(GENERATED_FILES) $(sysv_SCRIPTS) $(service_DATA) afpd cnid_metad
42 EXTRA_DIST = $(TEMPLATES)
43 noinst_DATA = $(GENERATED_FILES)
44
45 # overwrite automake uninstall
46 # not beautiful, but this way we can call the OS specific init script
47 # tools, like chkconfig, insserv or rc-update
48
49 uninstall: uninstall-startup
50
51 #
52 # checking for "redhat" style sysv scripts:
53 #
54
55 if USE_REDHAT_SYSV
56
57 sysvdir = $(INIT_DIR)
58 sysv_SCRIPTS = netatalk
59
60 $(sysv_SCRIPTS): rc.redhat
61         cp -f rc.redhat $(sysv_SCRIPTS)
62         chmod a+x $(sysv_SCRIPTS)
63
64 install-data-hook:
65         -chkconfig --add $(sysv_SCRIPTS)
66
67 uninstall-startup:
68         -chkconfig --del $(sysv_SCRIPTS)
69         rm -f $(DESTDIR)$(sysvdir)/$(sysv_SCRIPTS)
70
71 endif
72
73 #
74 # checking for general systemd scripts:
75 #
76
77 if USE_SYSTEMD
78
79 servicedir      = $(INIT_DIR)
80 service_DATA    = netatalk.service
81
82 netatalk.service: service.systemd
83         cp -f service.systemd netatalk.service
84
85 install-data-hook:
86         -systemctl daemon-reload
87
88 uninstall-startup:
89         -systemctl disable $(service_DATA)
90         rm -f $(DESTDIR)$(servicedir)/netatalk.service
91         -systemctl daemon-reload
92
93 endif
94
95 #
96 # checking for "Debian" style systemd scripts:
97 #
98
99 if USE_DEBIAN_SYSTEMD
100
101 servicedir      = $(INIT_DIR)
102 service_DATA    = netatalk.service
103
104 netatalk.service: service.systemd
105         cp -f service.systemd netatalk.service
106
107 install-data-hook:
108         -systemctl daemon-reload
109
110 uninstall-startup:
111         -systemctl disable $(service_DATA)
112         rm -f $(DESTDIR)$(servicedir)/netatalk.service
113         -systemctl daemon-reload
114
115 endif
116
117 #
118 # checking for "SuSE" style sysv scripts:
119 #
120
121 if USE_SUSE_SYSV
122
123 sysvdir = $(INIT_DIR)
124 sysv_SCRIPTS = netatalk
125
126 $(sysv_SCRIPTS): rc.suse
127         cp -f rc.suse $(sysv_SCRIPTS)
128         chmod a+x $(sysv_SCRIPTS)
129
130 install-data-hook:
131         -insserv $(sysv_SCRIPTS)
132
133 uninstall-startup:
134         -insserv -d $(sysv_SCRIPTS)
135         rm -f $(DESTDIR)$(sysvdir)/$(sysv_SCRIPTS)
136
137 endif
138
139 #
140 # checking for NetBSD init scripts
141 #
142
143 if USE_NETBSD
144
145 sysvdir = $(INIT_DIR)
146 sysv_SCRIPTS = netatalk
147
148 netatalk: rc.netbsd
149         cp -f $< $@
150         chmod a+x $@
151
152 install-data-hook:
153
154 uninstall-hook:
155
156 uninstall-startup: uninstall-am
157
158 endif
159
160 #
161 # checking for Solaris init scripts
162 #
163
164 if USE_SOLARIS
165
166 servicedir = $(INIT_DIR)
167 service_DATA = netatalk.xml
168
169 install-data-hook:
170         svccfg import netatalk.xml
171
172 uninstall-startup:
173         svccfg delete network/netatalk
174
175 endif
176
177 #
178 # checking for "Gentoo" style sysv scripts:
179 #
180
181 if USE_GENTOO
182
183 sysvdir = $(INIT_DIR)
184 sysv_SCRIPTS = netatalk
185
186 $(sysv_SCRIPTS): rc.gentoo
187         cp -f rc.gentoo $(sysv_SCRIPTS)
188         chmod a+x $(sysv_SCRIPTS)
189
190 install-data-hook:
191 #       -rc-update add $(sysv_SCRIPTS) default
192
193 uninstall-startup:
194 #       -rc-update del $(sysv_SCRIPTS) default
195 #       rm -f $(DESTDIR)$(sysvdir)/$(sysv_SCRIPTS)
196
197 endif
198
199 #
200 # checking for "Debian" style sysv scripts:
201 #
202
203 if USE_DEBIAN_SYSV
204
205 sysvdir = $(INIT_DIR)
206 sysv_SCRIPTS = netatalk
207
208 $(sysv_SCRIPTS): rc.debian
209         cp -f rc.debian $(sysv_SCRIPTS)
210         chmod a+x $(sysv_SCRIPTS)
211
212 install-data-hook:
213 #       update-rc.d $(sysv_SCRIPTS) defaults 90 10
214
215 uninstall-startup:
216 #       rm -f $(DESTDIR)$(sysvdir)/$(sysv_SCRIPTS)
217 #       update-rc.d netatalk remove
218
219 endif
220
221
222 #
223 # defaults, no init scripts installed
224 #
225
226 if USE_UNDEF
227
228 install-data-hook:
229
230 uninstall-hook:
231
232 uninstall-startup: uninstall-am
233
234 endif
235