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