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