]> arthur.barton.de Git - netatalk.git/blob - distrib/initscripts/Makefile.am
new configure option --with-init-dir=PATH
[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 "SuSE" style sysv scripts:
97 #
98
99 if USE_SUSE_SYSV
100
101 sysvdir = $(INIT_DIR)
102 sysv_SCRIPTS = netatalk
103
104 $(sysv_SCRIPTS): rc.suse
105         cp -f rc.suse $(sysv_SCRIPTS)
106         chmod a+x $(sysv_SCRIPTS)
107
108 install-data-hook:
109         -insserv $(sysv_SCRIPTS)
110
111 uninstall-startup:
112         -insserv -d $(sysv_SCRIPTS)
113         rm -f $(DESTDIR)$(sysvdir)/$(sysv_SCRIPTS)
114
115 endif
116
117 #
118 # checking for NetBSD init scripts
119 #
120
121 if USE_NETBSD
122
123 sysvdir = $(INIT_DIR)
124 sysv_SCRIPTS = netatalk
125
126 netatalk: rc.netbsd
127         cp -f $< $@
128         chmod a+x $@
129
130 install-data-hook:
131
132 uninstall-hook:
133
134 uninstall-startup: uninstall-am
135
136 endif
137
138 #
139 # checking for Solaris init scripts
140 #
141
142 if USE_SOLARIS
143
144 servicedir = $(INIT_DIR)
145 service_DATA = netatalk.xml
146
147 install-data-hook:
148         svccfg import netatalk.xml
149
150 uninstall-startup:
151         svccfg delete network/netatalk
152
153 endif
154
155 #
156 # checking for "Gentoo" style sysv scripts:
157 #
158
159 if USE_GENTOO
160
161 sysvdir = $(INIT_DIR)
162 sysv_SCRIPTS = netatalk
163
164 $(sysv_SCRIPTS): rc.gentoo
165         cp -f rc.gentoo $(sysv_SCRIPTS)
166         chmod a+x $(sysv_SCRIPTS)
167
168 install-data-hook:
169 #       -rc-update add $(sysv_SCRIPTS) default
170
171 uninstall-startup:
172 #       -rc-update del $(sysv_SCRIPTS) default
173 #       rm -f $(DESTDIR)$(sysvdir)/$(sysv_SCRIPTS)
174
175 endif
176
177 #
178 # checking for "Debian" style sysv scripts:
179 #
180
181 if USE_DEBIAN
182
183 sysvdir = $(INIT_DIR)
184 sysv_SCRIPTS = netatalk
185
186 $(sysv_SCRIPTS): rc.debian
187         cp -f rc.debian $(sysv_SCRIPTS)
188         chmod a+x $(sysv_SCRIPTS)
189
190 install-data-hook:
191 #       update-rc.d $(sysv_SCRIPTS) defaults 90 10
192
193 uninstall-startup:
194 #       rm -f $(DESTDIR)$(sysvdir)/$(sysv_SCRIPTS)
195 #       update-rc.d netatalk remove
196
197 endif
198
199
200 #
201 # defaults, no init scripts installed
202 #
203
204 if USE_UNDEF
205
206 install-data-hook:
207
208 uninstall-hook:
209
210 uninstall-startup: uninstall-am
211
212 endif
213