forked from svarshavchik/vera
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.am
399 lines (335 loc) · 12 KB
/
Makefile.am
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
SUBDIRS = po
ACLOCAL_AMFLAGS = -I m4
AM_CXXFLAGS = -std=c++20 @YAMLCPPFLAGS@
export LC_ALL=C
sbin_PROGRAMS=vera vera-init
noinst_SCRIPTS=vlad
pkgdata_SCRIPTS=rc.sysvinit.vera rc.local.vera rc.local_shutdown.vera \
rc.controllers \
vera-logrotate vera-logrotate-migrate vera-rcm vera-rck \
update-logrotate
noinst_PROGRAMS=\
testcontroller \
testcontroller2 \
testcontroller2fdleak \
testcontroller3 \
testcontroller4 \
testdepcomputations \
testhook \
testinittab \
testpoller \
testprocloader \
testswitchlog
EXTRA_DIST= \
cgroup.controllers \
packaging/slackware/doinst.sh \
packaging/slackware/uninst.sh \
packaging/slackware/networkmanager-wait-online \
slack-desc \
testinittab.sh \
testinittab.txt \
testlogrotate.sh \
testprocloader.sh \
vera-logrotate-migrate \
vera-rck \
vera-rcm
BUILT_SOURCES=configdirs.h
CLEANFILES=configdirs.h
noinst_LIBRARIES=libvera.a
libvera_a_SOURCES= \
current_containers_infofwd.H \
current_containers_info.H \
external_filedesc.H \
external_filedesc.C \
external_filedesc_privcmdsocket.H \
external_filedesc_privcmdsocket.C \
hook.C \
hook.H \
inittab.C \
inittab.H \
log.C \
log.H \
log_current_time.C \
messages.H \
parsed_yaml.C \
parsed_yaml.H \
poller.C \
poller.H \
privrequest.C \
privrequest.H \
proc_container.C \
proc_container.H \
proc_container2.C \
proc_containerfwd.H \
proc_container_group.C \
proc_container_group.H \
proc_container_runner.C \
proc_container_runner.H \
proc_container_runnerfwd.H \
proc_container_run_info.H \
proc_container_state.C \
proc_container_state.H \
proc_container_statefwd.H \
proc_container_timer.C \
proc_container_timer.H \
proc_container_timerfwd.H \
proc_loader.C \
proc_loader.H \
proc_loaderfwd.H \
proc_loader2.C \
proc_loader3.C \
switchlog.C \
switchlog.H \
unit_test.H \
verac_connect_sun_socket.c \
verac_check_hook.c \
verac_parseinittab.c \
verac_runsysinit.c \
verac.h \
yaml_writer.C \
yaml_writer.H
configdirs.h: config.status Makefile
echo '#define INSTALLCONFIGDIR "$(INSTALLCONFIGDIR)"' >configdirs.h.tmp
echo '#define CONFIGDIR "$(CONFIGDIR)"' >>configdirs.h.tmp
echo '#define RUNLEVELCONFIG "$(RUNLEVELCONFIG)"' >>configdirs.h.tmp
echo '#define ENVIRONCONFIG "$(ENVIRONCONFIG)"' >>configdirs.h.tmp
echo '#define LOCALCONFIGDIR "$(LOCALCONFIGDIR)"' >>configdirs.h.tmp
echo '#define OVERRIDECONFIGDIR "$(OVERRIDECONFIGDIR)"' >>configdirs.h.tmp
echo '#define LOCALSTATEDIR "$(localstatedir)"' >>configdirs.h.tmp
echo '#define LOCALEDIR "$(localedir)"' >> configdirs.h.tmp
echo '#define PKGDATADIR "$(pkgdatadir)"' >>configdirs.h.tmp
echo '#define SBINDIR "$(sbindir)"' >>configdirs.h.tmp
echo '#define SWITCHLOGDIR "$(SWITCHLOGDIR)"' >>configdirs.h.tmp
mv configdirs.h.tmp configdirs.h
vera_SOURCES=vera.C
vera_LDADD=libvera.a @YAMLLIBS@
vera_init_SOURCES=vera-init.c
vera_init_LDADD=libvera.a
vlad: vera
rm -f vlad; ln vera vlad
CLEANFILES += vlad
testcontroller_SOURCES=testcontroller.C unit_test.C
testcontroller_LDADD=libvera.a @YAMLLIBS@
testcontroller2_SOURCES=testcontroller2.C unit_test.C
testcontroller2_LDADD=libvera.a @YAMLLIBS@
testcontroller2fdleak_SOURCES=testcontroller2fdleak.C
testcontroller3_SOURCES=testcontroller3.C unit_test.C
testcontroller3_LDADD=libvera.a @YAMLLIBS@
testcontroller4_SOURCES=testcontroller4.C unit_test.C
testcontroller4_LDADD=libvera.a @YAMLLIBS@ -lpthread
testdepcomputations_SOURCES=testdepcomputations.C unit_test.C
testdepcomputations_LDADD=libvera.a @YAMLLIBS@
testprocloader_SOURCES=testprocloader.C unit_test.C
testprocloader_LDADD=libvera.a @YAMLLIBS@
testpoller_SOURCES=testpoller.C unit_test.C
testpoller_LDADD=libvera.a @YAMLLIBS@
testinittab_SOURCES=testinittab.C parsed_yaml.C inittab.C yaml_writer.C \
proc_loader.C proc_container2.C
testinittab_LDADD=libvera.a @YAMLLIBS@
testhook_SOURCES=testhook.C
testhook_LDADD=libvera.a
testswitchlog_SOURCES=testswitchlog.C
testswitchlog_LDADD=libvera.a
UNITFILES=update-logrotate v2-controllers
CLEANFILES += $(UNITFILES)
EXTRA_DIST += $(patsubst %,%.in,$(UNITFILES))
all: $(UNITFILES)
define unitfile_dependency
$(1): $(1).in
sed 's@~PKGDATADIR~@'"`echo $(pkgdatadir)`"'@;s@~INSTALLCONFIGDIR~@'"`echo $(INSTALLCONFIGDIR)`"'@' <$(srcdir)/[email protected] >$$@
endef
$(eval $(foreach F,$(UNITFILES), \
$(call unitfile_dependency,$(F)) \
) \
)
install-exec-hook:
rm -f $(DESTDIR)$(sbindir)/vlad
ln $(DESTDIR)$(sbindir)/vera $(DESTDIR)$(sbindir)/vlad
install-data-local:
$(MKDIR_P) $(DESTDIR)$(INSTALLCONFIGDIR)/system
$(INSTALL_DATA) update-logrotate \
$(DESTDIR)$(INSTALLCONFIGDIR)/system/update-logrotate
$(INSTALL_DATA) v2-controllers \
$(DESTDIR)$(INSTALLCONFIGDIR)/system/v2-controllers
$(MKDIR_P) $(DESTDIR)$(CONFIGDIR)
$(MKDIR_P) $(DESTDIR)$(localstatedir)
$(MKDIR_P) $(DESTDIR)$(SWITCHLOGDIR)
chmod 700 $(DESTDIR)$(SWITCHLOGDIR)
$(MKDIR_P) $(DESTDIR)$(LOCALCONFIGDIR)
$(MKDIR_P) $(DESTDIR)$(OVERRIDECONFIGDIR)
chmod 755 $(DESTDIR)$(INSTALLCONFIGDIR)
chmod 755 $(DESTDIR)$(CONFIGDIR)
$(INSTALL_DATA) $(srcdir)/cgroup.controllers $(DESTDIR)$(CONFIGDIR)/cgroup.controllers
chmod 644 $(DESTDIR)$(CONFIGDIR)/cgroup.controllers
chmod 755 $(DESTDIR)$(LOCALCONFIGDIR)
chmod 755 $(DESTDIR)$(OVERRIDECONFIGDIR)
umask 022; ./testprocloader genrunlevels \
$(DESTDIR)$(RUNLEVELCONFIG) \
$(DESTDIR)$(INSTALLCONFIGDIR)/system \
$(DESTDIR)$(ENVIRONCONFIG) && \
$(INSTALL_DATA) $(srcdir)/packaging/slackware/networkmanager-wait-online \
$(DESTDIR)$(INSTALLCONFIGDIR)/system && \
./testinittab -c $(DESTDIR)$(INSTALLCONFIGDIR) \
-l $(DESTDIR)$(LOCALCONFIGDIR) \
-p $(DESTDIR)${pkgdatadir} \
-o $(DESTDIR)$(OVERRIDECONFIGDIR) \
-r $(DESTDIR)$(RUNLEVELCONFIG) >/dev/null
test "$(TESTDIR)" = "" || exit 0; $(DESTDIR)$(sbindir)/vlad rehook || true
uninstall-hook:
rm -rf $(DESTDIR)$(INSTALLCONFIGDIR)/system
rm -rf $(DESTDIR)$(localstatedir)/vera.priv
rm -rf $(DESTDIR)$(localstatedir)/vera.pub
rm -rf $(DESTDIR)$(SWITCHLOGDIR)
rm -rf $(DESTDIR)$(sysconfdir)/vera
uninstall-local:
rm -f $(DESTDIR)$(RUNLEVELCONFIG)
rm -f $(DESTDIR)$(sbindir)/vlad
check-am:
$(VALGRIND) ./testdepcomputations
$(VALGRIND) ./testcontroller
./testcontroller sysdown
export VALGRIND='$(VALGRIND)'; sh $(srcdir)/testprocloader.sh
$(VALGRIND) ./testpoller
./testcontroller2
$(VALGRIND) ./testcontroller2 testreexec_nofork
./testcontroller2 testreexec_do '$(VALGRIND) ./testcontroller2'
./testcontroller3 respawn1 "$(VALGRIND)"
./testcontroller3 respawn2
./testcontroller3 respawn3 "$(VALGRIND)"
./testcontroller3 respawn4
./testcontroller4
$(VALGRIND) ./testcontroller3 testnoreexec
export VALGRIND='$(VALGRIND)'; \
export srcdir=$(srcdir); \
sh $(srcdir)/testinittab.sh
./testhook
./testswitchlog
srcdir="$(srcdir)"; export srcdir; $(SHELL) $(srcdir)/testlogrotate.sh
man8_MANS=vera.8 vlad.8 vera.extras.8 vera.logs.8 vera.runlevels.8 vera.units.8
EXTRA_DIST += init.8 vlad.8 vera.8.in \
vera.extras.8.in \
vera.logs.8.in \
vera.runlevels.8.in \
vera.units.8.in
MANEXPAND = \
set -vx; sed 's~@''INSTALLCONFIGDIR@''~$(INSTALLCONFIGDIR)~g; \
s~@''LOCALCONFIGDIR@''~$(LOCALCONFIGDIR)~g; \
s~@''OVERRIDECONFIGDIR@''~$(OVERRIDECONFIGDIR)~g; \
s~@''RUNLEVELCONFIG@''~$(RUNLEVELCONFIG)~g; \
s~@''ENVIRONCONFIG@''~$(ENVIRONCONFIG)~g; \
s~@''CONFIGDIR@''~$(CONFIGDIR)~g'
vera.8: vera.8.in Makefile
$(MANEXPAND) <$(srcdir)/vera.8.in >vera.8.tmp
mv -f vera.8.tmp vera.8
vera.extras.8: vera.extras.8.in Makefile
$(MANEXPAND) <$(srcdir)/vera.extras.8.in >vera.extras.8.tmp
mv -f vera.extras.8.tmp vera.extras.8
vera.logs.8: vera.logs.8.in Makefile
$(MANEXPAND) <$(srcdir)/vera.logs.8.in >vera.logs.8.tmp
mv -f vera.logs.8.tmp vera.logs.8
vera.runlevels.8: vera.runlevels.8.in Makefile
$(MANEXPAND) <$(srcdir)/vera.runlevels.8.in >vera.runlevels.8.tmp
mv -f vera.runlevels.8.tmp vera.runlevels.8
vera.units.8: vera.units.8.in Makefile
$(MANEXPAND) <$(srcdir)/vera.units.8.in >vera.units.8.tmp
mv -f vera.units.8.tmp vera.units.8
CLEANFILES += vera.8 vera.extras.8 vera.logs.8 vera.runlevels.8 vera.units.8
EXTRA_DIST += INSTALL
BUILT_SOURCES += INSTALL
if HAVE_DOCS
init.8: vera.man.stamp
touch init.8
vera.8.in: vera.man.stamp
touch vera.8.in
vera.extras.8.in: vera.man.stamp
touch vera.extras.8.in
vera.logs.8.in: vera.man.stamp
touch vera.logs.8.in
vera.runlevels.8.in: vera.man.stamp
touch vera.runlevels.8.in
vera.units.8.in: vera.man.stamp
touch vera.units.8.in
vlad.8: vera.man.stamp
touch vlad.8
vera.man.stamp: vera.xml
rm -rf veraman.tmp
mkdir -p veraman.tmp
xsltproc --nonet -o veraman.tmp/ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/vera.xml
mv veraman.tmp/vera.8 veraman.tmp/vera.8.in
mv veraman.tmp/vera.extras.8 veraman.tmp/vera.extras.8.in
mv veraman.tmp/vera.logs.8 veraman.tmp/vera.logs.8.in
mv veraman.tmp/vera.runlevels.8 veraman.tmp/vera.runlevels.8.in
mv veraman.tmp/vera.units.8 veraman.tmp/vera.units.8.in
mv veraman.tmp/* .
rm -rf veraman.tmp
touch vera.man.stamp
CLEANFILES += init.8 vera.8.in \
vera.extras.8 vera.logs.8 vera.runlevels.8.in vera.units.8.in \
vlad.8 vera.man.stamp
INSTALL: vera.html.stamp
touch INSTALL
vera.html.stamp: vera.xml
rm -rf html.tmp
xsltproc --nonet -o html.tmp/ \
--stringparam chunk.first.sections 1 \
--stringparam use.id.as.filename 1 \
http://docbook.sourceforge.net/release/xsl/current/xhtml/chunk.xsl \
vera.xml
$(HTML2TXT) <html.tmp/INSTALL.html >INSTALL.tmp
mv INSTALL.tmp INSTALL
rm -rf html.tmp
touch vera.html.stamp
CLEANFILES += INSTALL
endif
# Make a Slackware package
NVR:=$(PACKAGE)-$(VERSION)-$(shell uname -m)-1
slackpkg: dist
sudo rm -rf $(PACKAGE)-$(VERSION)
tar xf $(PACKAGE)-$(VERSION).tar.xz
cd $(PACKAGE)-$(VERSION) && \
./configure --prefix=/usr --sysconfdir=/etc --sbindir=/sbin \
--libdir=/lib --localstatedir=/run \
--with-switchlogdir=/var/log/vera \
--localedir=/usr/share/locale && \
make -j `grep '^processor' /proc/cpuinfo | wc -l` && \
strip vera && strip vera-init
sudo $(MAKE) slackpkg-sudo
cp $(NVR).txz $(NVR).txz.tmp
mv -f $(NVR).txz.tmp $(NVR).txz
slackpkg-sudo:
cd $(PACKAGE)-$(VERSION) && \
$(MAKE) install DESTDIR=inst && \
cd inst && \
find lib/vera/system/inittab \
lib/vera/system/rc \
lib/vera/system/rc.M* -type f -print | xargs rm -f && \
mkdir install && \
cp ../../packaging/slackware/doinst.sh \
install/doinst.sh && \
chmod +x install/doinst.sh && \
cp ../../slack-desc install && \
gzip usr/share/man/*/* && \
mkdir -p var/lib/pkgtools/douninst.sh && \
cp ../../packaging/slackware/uninst.sh \
var/lib/pkgtools/douninst.sh/$(NVR) && \
chmod +x var/lib/pkgtools/douninst.sh/$(NVR) && \
/sbin/makepkg -c y -l y \
../../$(NVR).txz
rm -rf $(PACKAGE)-$(VERSION)
RELEASETAG=$(VERSION)
release:
scp slackware:src/vera/$(PACKAGE)-$(VERSION).tar.xz .
scp slackware:src/vera/$(PACKAGE)-$(VERSION)-*.txz .
gpg --detach-sign --default-key [email protected] $(PACKAGE)-$(VERSION).tar.xz
gpg --detach-sign --default-key [email protected] $(PACKAGE)-$(VERSION)-*.txz
-git tag $(RELEASETAG)
git push --tags -f
git push --tags -f github
gh release create $(RELEASETAG) \
-t "Release $(VERSION)" \
-n '' \
--latest \
'$(PACKAGE)-$(VERSION).tar.xz#$(PACKAGE)-$(VERSION).tar.xz: source code' \
'$(PACKAGE)-$(VERSION).tar.xz.sig#$(PACKAGE)-$(VERSION).tar.xz.sig: source code signature' \
"`echo $(PACKAGE)-$(VERSION)-*.txz`"'#'"`echo $(PACKAGE)-$(VERSION)-*.txz`"': slackware64 package' \
"`echo $(PACKAGE)-$(VERSION)-*.txz.sig`"'#'"`echo $(PACKAGE)-$(VERSION)-*.txz.sig`"': slackware64 package signature'