/
rules
executable file
·69 lines (61 loc) · 2.93 KB
/
rules
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
#!/usr/bin/make -f
CODENAME := $(shell lsb_release -cs)
DOCS_DIR := debian/intelmq/usr/share/doc/intelmq
export INTELMQ_SKIP_REDIS=1
export INTELMQ_SKIP_INTERNET=1
# Compile list of bot READMEs
BOTROOT := intelmq/bots
BOTCATEGORIES := collectors experts outputs parsers
BOTCATEGORIES := $(foreach cat,$(BOTCATEGORIES),$(BOTROOT)/$(cat))
BOTS := $(foreach bot,$(BOTCATEGORIES),$(wildcard $(bot)/*))
BOTDOCS := $(foreach bot,$(BOTS),$(wildcard $(bot)/*.md))
# This file is based on a version
# automatically generated by stdeb 0.8.5 at
# Wed, 23 Mar 2016 17:49:26 +0000
export PYBUILD_NAME=intelmq
%:
dh $@ --with python3 --without python2 --buildsystem=pybuild --with quilt --with systemd
build:
if [ $(CODENAME) = 'xenial' ] || [ $(CODENAME) = 'jessie' ]; then\
patch -p1 setup.py debian/patches/fix-dnspython-name.patch;\
fi
dh build --with python3 --without python2 --buildsystem=pybuild --with quilt --with systemd
# This tests frequently failes on ubuntu and debian systems.
# On some systems this command will be executed twice, so -f
rm -rf intelmq/tests/bots/collectors/tcp/
override_dh_auto_build:
override_dh_auto_install: $(BOTDOCS)
rm intelmq/bin/rewrite_config_files.py
rm intelmq/bin/intelmq_gen_docs.py intelmq/tests/bin/test_gen_docs.py
sed -i -e '/#!\/usr\/bin\//d' intelmq/bin/*.py
find . -type f -exec sed -i -f debian/sedfile {} \;
python3 setup.py install --root=debian/intelmq --prefix=/usr
mv debian/intelmq/etc/intelmq/examples/* debian/intelmq/etc/intelmq/
rmdir debian/intelmq/etc/intelmq/examples
# these are already in /usr/bin/
#rm %{buildroot}/%{python3_sitelib}/intelmq/bots/experts/maxmind_geoip/update-geoip-data
#rm %{buildroot}/%{python3_sitelib}/intelmq/bots/experts/asn_lookup/update-asn-data
#rm %{buildroot}/%{python3_sitelib}/intelmq/bots/experts/tor_nodes/update-tor-nodes
# and rename those in /usr/bin
mv debian/intelmq/usr/bin/update-geoip-data debian/intelmq/usr/bin/intelmq-update-geoip-data
mv debian/intelmq/usr/bin/update-asn-data debian/intelmq/usr/bin/intelmq-update-asn-data
mv debian/intelmq/usr/bin/update-tor-nodes debian/intelmq/usr/bin/intelmq-update-tor-nodes
# create directories
mkdir -p debian/intelmq/var/log/intelmq
mkdir -p debian/intelmq/var/lib/intelmq/bots/file-output
mkdir -p debian/intelmq/etc/logrotate.d
mkdir -p debian/intelmq/var/lib/intelmq/bots/modify/
## BOTS
# Include all bot READMEs
for readme in $(foreach bot,$(BOTDOCS),$(subst intelmq/bots/,,$(bot))); \
do \
mkdir -p $(DOCS_DIR)/bots/$$(dirname $$readme); \
cp intelmq/bots/$$readme $(DOCS_DIR)/bots/$$(dirname $$readme); \
done
override_dh_install:
dh_install
install -Dm 644 contrib/logcheck/ignore debian/intelmq/etc/logcheck/ignore.d.server/intelmq
install -Dm 644 contrib/logcheck/violations debian/intelmq/etc/logcheck/violations.d/intelmq
install -Dm 644 contrib/logcheck/logcheck.logfiles debian/intelmq/etc/logcheck/logcheck.logfiles.d/intelmq
override_dh_systemd_start:
dh_systemd_start --restart-after-upgrade