File: rules

package info (click to toggle)
ntopng 2.4%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 15,888 kB
  • ctags: 8,091
  • sloc: cpp: 21,442; ansic: 10,999; sh: 1,627; makefile: 423; pascal: 312; ruby: 34; exp: 4
file content (121 lines) | stat: -rwxr-xr-x 4,409 bytes parent folder | download
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
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@ --with systemd

override_dh_auto_configure:
	./autogen.sh
	dh_auto_configure

override_dh_auto_build:
	dh_auto_build
	mkdir -p debian/generated-code/
	coffee -c -o debian/generated-code/ debian/missing-sources/gauge.coffee

override_dh_auto_install:

override_dh_strip:
	dh_strip --dbgsym-migration='ntopng-dbg (<< 2.4+dfsg1-1~)'

override_dh_install-indep:
	dh_install --indep \
	    --exclude=.source-map.js \
	    --exclude=README.gauge \
	    --exclude=font-awesome \
	    --exclude=redis.lua
	rm -fr $(CURDIR)/debian/ntopng-data/usr/share/ntopng/httpdocs/bootstrap
	find $(CURDIR)/debian/ntopng-data/usr/share -type f -exec chmod a-x {} \;
	rm -fr $(CURDIR)/debian/ntopng-data/usr/share/ntopng/httpdocs/ssl

override_dh_install-arch:
	dh_install --arch

override_dh_auto_clean:
	dh_auto_clean
	rm -fr debian/generated-code/

DEB_UPSTREAM_VERSION=$(shell dpkg-parsechangelog \
		     | sed -rne 's/^Version: ([^-]+).*/\1/p')
PACKAGE=ntopng
SRC_VERSION := $(shell dpkg-parsechangelog | sed -ne 's/^Version: \(\([0-9]\+\):\)\?\(.*\)-.*/\3/p')
SVN_REVISION := $(shell echo $(SRC_VERSION) | grep -o '[+~]svn[0-9]\+' | sed -e 's/[+~]svn//')
UPSTREAM_VERSION := $(shell echo $(SRC_VERSION) | cut -d + -f 1)
TARBALL=$(PACKAGE)_$(SRC_VERSION).orig.tar.gz
UPSTREAM_SVN_REPO = https://svn.ntop.org/svn/ntop/trunk/ntopng/

get-orig-source:
	@echo DEB_UPSTREAM_VERSION $(DEB_UPSTREAM_VERSION)
	@echo SRC_VERSION $(SRC_VERSION)
	@echo SVN_REVISION $(SVN_REVISION)
	@echo UPSTREAM_VERSION $(UPSTREAM_VERSION)
ifneq ($(findstring svn,$(SRC_VERSION)),)
	# Download SVN version and prepare for possible repackaging
	rm -rf get-orig-source ../$(TARBALL)
	mkdir get-orig-source
	svn export -r $(SVN_REVISION) $(UPSTREAM_SVN_REPO) \
	    get-orig-source/$(PACKAGE)-$(SRC_VERSION).orig
else
    ifneq ($(findstring +dfsg,$(SRC_VERSION)),)
	# Download upstream tarball and prepare for repackaging
	uscan --verbose --force-download --download-version $(UPSTREAM_VERSION)
	rm -rf get-orig-source ../$(TARBALL)
	mkdir get-orig-source
	tar zxf ../$(PACKAGE)_$(UPSTREAM_VERSION).orig.tar.gz -C get-orig-source
	mv get-orig-source/* get-orig-source/$(PACKAGE)-$(SRC_VERSION).orig
    else
	# Download and use upstream vanilla tarball
	uscan --verbose --download-version $(UPSTREAM_VERSION)
    endif
endif
ifneq ($(findstring +dfsg,$(SRC_VERSION)),)
	# We need to repackage.
	# Remove unused 3rd party libs
	rm -fr get-orig-source/*/httpdocs/bootstrap_3
	rm -fr get-orig-source/*/httpdocs/css/Rickshaw
	rm -fr get-orig-source/*/httpdocs/js/Rickshaw
	rm -fr get-orig-source/*/httpdocs/js/handlebars-1.0.0.0.beta.6.js
	rm -fr get-orig-source/*/httpdocs/js/serializeCFJSON-0.1.js
	rm -fr get-orig-source/*/third-party/LuaJIT-*
	rm -fr get-orig-source/*/third-party/hiredis
	rm -fr get-orig-source/*/third-party/json-c
	rm -fr get-orig-source/*/third-party/rrdtool-*
	rm -fr get-orig-source/*/third-party/zeromq-*
	# Remove unused nDPI library
	rm -fr get-orig-source/*/nDPI
	# Remove pre-compiled and automatically generated files
	find get-orig-source/ '(' -name .libs -or -name .svn -or \
	    -name autom4te.cache ')' -prune -exec rm -fr {} \;
	find get-orig-source/*/third-party/EWAHBoolArray/ \
	    -type f -perm /111 -delete || true
	find get-orig-source/ '(' \
	    -name '*.a' -or -name '*.la' -or \
	    -name '*.o' -or -name '*.lo' -or \
	    -name '*.so' -or -name '*.so.*' -or \
	    -name '*~' -or -name '#*#' -or \
	    -name 'Geo*.dat' ')' -delete
	# Remove unsed files without source.
	rm -f get-orig-source/*/httpdocs/js/highlight.min.js
	rm -f get-orig-source/*/httpdocs/js/prettify.js
	rm -f get-orig-source/*/httpdocs/css/prettify.css
	rm -f get-orig-source/*/httpdocs/js/pdfmake.js
	rm -f get-orig-source/*/httpdocs/js/vfs_fonts.js
	# Remove documentation without source.
	rm -fr get-orig-source/*/doc/UserGuide.*
	# Remove .git tree.
	rm -fr get-orig-source/*/.git
endif
ifneq ($(or $(findstring +dfsg,$(SRC_VERSION)), $(findstring +dfsg,$(SRC_VERSION))),)
	# Need to create orig tarball.
	GZIP='--best --no-name' tar czf ../$(TARBALL) -C get-orig-source \
	     $(PACKAGE)-$(SRC_VERSION).orig
	rm -rf get-orig-source
endif

.PHONY: override_dh_auto_install override_dh_strip override_dh_install-indep
.PHONY: override_dh_install-arch get-orig-source