Browse code

Revert "pkg/kamailio/deb: fix tlsa build"

This reverts commit 6f162fc63d0503637c4c3c96ab4b13189239250f.

Victor Seva authored on 18/06/2022 23:41:54
Showing 1 changed files
... ...
@@ -109,9 +109,9 @@ LD_EXTRA_OPTS := $(shell dpkg-buildflags --get LDFLAGS)
109 109
 # https://wiki.debian.org/ReproducibleBuilds/
110 110
 CC_EXTRA_OPTS += -DVERSION_NODATE
111 111
 
112
-#tlsa
113
-export LIBSSL_STATIC_SRCLIB=yes
114
-export LIBSSL_STATIC_SRCPATH=/usr/$(LIBDIR)
112
+# "function" to get package short name out of a dir/module_name
113
+# it also transforms db_foo into foo
114
+mod_name=$(subst db_,,$(lastword $(subst /, ,$(1))))
115 115
 
116 116
 define PACKAGE_GRP_BUILD_template
117 117
 	# package all the modules in PACKAGE_GROUPS in separate packages
Browse code

pkg/kamailio/deb: fix tlsa build

* remove unused mod_name definition

Victor Seva authored on 18/06/2022 22:38:03
Showing 1 changed files
... ...
@@ -109,9 +109,9 @@ LD_EXTRA_OPTS := $(shell dpkg-buildflags --get LDFLAGS)
109 109
 # https://wiki.debian.org/ReproducibleBuilds/
110 110
 CC_EXTRA_OPTS += -DVERSION_NODATE
111 111
 
112
-# "function" to get package short name out of a dir/module_name
113
-# it also transforms db_foo into foo
114
-mod_name=$(subst db_,,$(lastword $(subst /, ,$(1))))
112
+#tlsa
113
+export LIBSSL_STATIC_SRCLIB=yes
114
+export LIBSSL_STATIC_SRCPATH=/usr/$(LIBDIR)
115 115
 
116 116
 define PACKAGE_GRP_BUILD_template
117 117
 	# package all the modules in PACKAGE_GROUPS in separate packages
Browse code

pkg/kamailio/deb: rework rules [skip ci]

* define list elements per line. It helps to remove/add them in
backports scripts
* remove unused definitions
* include dpkg-dev helper makefile files with definitions
* rework backports scripts

Victor Seva authored on 17/06/2022 09:33:47
Showing 1 changed files
... ...
@@ -1,54 +1,113 @@
1 1
 #!/usr/bin/make -f
2
-# Sample debian/rules that uses debhelper.
3
-# GNU copyright 1997 to 1999 by Joey Hess.
4 2
 
5
-DEBVERSION:=$(shell head -n 1 debian/changelog \
6
-                    | sed -e 's/^[^(]*(\([^)]*\)).*/\1/')
7
-UPVERSION:=$(shell dpkg-parsechangelog | sed -ne 's/^Version: \(\([0-9]\+\):\)\?\(.*\)-.*/\3/p')
8
-
9
-FILENAME := kamailio_$(UPVERSION).orig.tar.gz
10
-URL := http://www.kamailio.org/pub/kamailio/$(UPVERSION)/src/kamailio-$(UPVERSION)_src.tar.gz
11
-
12
-DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
3
+# Uncomment this to turn on verbose mode.
4
+#export DH_VERBOSE=1
13 5
 
14 6
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
15 7
 DPKG_EXPORT_BUILDFLAGS = 1
8
+
9
+include /usr/share/dpkg/architecture.mk
16 10
 include /usr/share/dpkg/buildflags.mk
11
+include /usr/share/dpkg/pkg-info.mk
17 12
 
18
-# Uncomment this to turn on verbose mode.
19
-#export DH_VERBOSE=1
13
+# Enable parallel builds.
14
+NUMJOBS = 1
15
+ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
16
+  NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
17
+  MAKEFLAGS += -j$(NUMJOBS)
18
+endif
20 19
 
21 20
 export RADCLI=1
22 21
 
23
-# modules not in the "main" kamailio package
24
-EXCLUDED_MODULES= java nats
25
-
26
-# extra modules to skip, because they are not compilable now
27
-# - regardless if they go to the main kamailio package or to some module package,
28
-# they will be excluded from compile and install of all
29
-EXTRA_EXCLUDED_MODULES=bdb dbtext oracle pa iptrtpproxy mi_xmlrpc dnssec secsipid
30
-
31
-# module groups that are packaged in separate packages
32
-# (with the name kamailio-$(group_name)-modules)
22
+# Modules not in the "main" kamailio package:
23
+EXCLUDED_MODULES =
24
+
25
+# Extra modules to skip, because they are not compilable now:
26
+# - regardless if they go to the main kamailio package or to some module
27
+#   package, they will be excluded from compile and install of all.
28
+EXTRA_EXCLUDED_MODULES += bdb
29
+EXTRA_EXCLUDED_MODULES += dbtext
30
+EXTRA_EXCLUDED_MODULES += oracle
31
+EXTRA_EXCLUDED_MODULES += pa
32
+EXTRA_EXCLUDED_MODULES += iptrtpproxy
33
+EXTRA_EXCLUDED_MODULES += dnssec
34
+EXTRA_EXCLUDED_MODULES += java
35
+EXTRA_EXCLUDED_MODULES += secsipid
36
+EXTRA_EXCLUDED_MODULES += nats
37
+## --EXCLUDED--
38
+
39
+
40
+# Module groups that are packaged in seperate packages (with the name
41
+# kamailio-$(group_name)-modules).
33 42
 # Note: the order is important (should be in dependency order, the one
34 43
 # on which other depend first)
35
-PACKAGE_GROUPS=mysql postgres berkeley unixodbc radius presence \
36
-			   ldap xml perl utils lua memcached \
37
-			   snmpstats carrierroute xmpp cpl redis python geoip geoip2 \
38
-			   sqlite json mono ruby ims sctp \
39
-			   tls outbound websocket autheph kazoo cnxcc \
40
-			   erlang systemd phonenum mongodb rabbitmq python3 mqtt lwsc
44
+PACKAGE_GROUPS += mysql
45
+PACKAGE_GROUPS += postgres
46
+PACKAGE_GROUPS += berkeley
47
+PACKAGE_GROUPS += unixodbc
48
+PACKAGE_GROUPS += radius
49
+PACKAGE_GROUPS += presence
50
+PACKAGE_GROUPS += ldap
51
+PACKAGE_GROUPS += xml
52
+PACKAGE_GROUPS += perl
53
+PACKAGE_GROUPS += utils
54
+PACKAGE_GROUPS += lua
55
+PACKAGE_GROUPS += memcached
56
+PACKAGE_GROUPS += snmpstats
57
+PACKAGE_GROUPS += carrierroute
58
+PACKAGE_GROUPS += xmpp
59
+PACKAGE_GROUPS += cpl
60
+PACKAGE_GROUPS += redis
61
+PACKAGE_GROUPS += python
62
+PACKAGE_GROUPS += geoip
63
+PACKAGE_GROUPS += geoip2
64
+PACKAGE_GROUPS += sqlite
65
+PACKAGE_GROUPS += json
66
+PACKAGE_GROUPS += mono
67
+PACKAGE_GROUPS += ruby
68
+PACKAGE_GROUPS += ims
69
+PACKAGE_GROUPS += sctp
70
+PACKAGE_GROUPS += tls
71
+PACKAGE_GROUPS += outbound
72
+PACKAGE_GROUPS += websocket
73
+PACKAGE_GROUPS += autheph
74
+PACKAGE_GROUPS += kazoo
75
+PACKAGE_GROUPS += cnxcc
76
+PACKAGE_GROUPS += erlang
77
+PACKAGE_GROUPS += systemd
78
+PACKAGE_GROUPS += phonenum
79
+PACKAGE_GROUPS += mongodb
80
+PACKAGE_GROUPS += rabbitmq
81
+PACKAGE_GROUPS += python3
82
+PACKAGE_GROUPS += mqtt
83
+PACKAGE_GROUPS += lwsc
84
+
85
+# Module groups to be packaged onto kamailio-extra-modules.
86
+EXTRA_GROUPS += ev
87
+EXTRA_GROUPS += gzcompress
88
+EXTRA_GROUPS += jansson
89
+EXTRA_GROUPS += uuid
90
+EXTRA_GROUPS += http_async
91
+
92
+D = $(CURDIR)/debian/$(DEB_SOURCE)
93
+
94
+# Name of libdir in the path for libraries (e.g., the multiarch triplet).
95
+export LIBDIR ?= lib/$(DEB_HOST_MULTIARCH)
41 96
 
42
-# module groups to be packaged onto kamailio-extra-modules
43
-EXTRA_GROUPS=gzcompress uuid ev jansson http_async
97
+# Directories with possible duplicate libraries (that should be deleted
98
+# from current module* packages).
99
+DUP_LIBS_DIRS = $(D)/usr/$(LIBDIR)/kamailio \
100
+                $(D)-db-modules/usr/$(LIBDIR)/kamailio
44 101
 
45
-# name of libdir in the path for libraries (e.g., lib for 32b, lib64 for 64b)
46
-export LIBDIR ?= lib/$(DEB_HOST_MULTIARCH)
102
+# CFLAGS + CPPFLAGS -> CC_EXTRA_OPTS
103
+CC_EXTRA_OPTS := $(shell dpkg-buildflags --get CPPFLAGS)
104
+CC_EXTRA_OPTS += $(shell dpkg-buildflags --get CFLAGS)
105
+CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS)
106
+# LDFLAGS -> LD_EXTRA_OPTS
107
+LD_EXTRA_OPTS := $(shell dpkg-buildflags --get LDFLAGS)
47 108
 
48
-# directories with possible duplicate libraries (that should be deleted
49
-# from current module* packages)
50
-DUP_LIBS_DIRS=$(CURDIR)/debian/kamailio/usr/$(LIBDIR)/kamailio \
51
-			$(CURDIR)/debian/kamailio-db-modules/usr/$(LIBDIR)/kamailio
109
+# https://wiki.debian.org/ReproducibleBuilds/
110
+CC_EXTRA_OPTS += -DVERSION_NODATE
52 111
 
53 112
 # "function" to get package short name out of a dir/module_name
54 113
 # it also transforms db_foo into foo
... ...
@@ -64,18 +123,18 @@ endef
64 123
 define PACKAGE_GRP_INSTALL_template
65 124
 	$(foreach grp,$(PACKAGE_GROUPS),\
66 125
 		$(MAKE) install-modules-all LIBDIR=$(LIBDIR) group_include="k$(grp)" \
67
-		BASEDIR=$(CURDIR)/debian/kamailio-$(grp)-modules \
68
-		cfg_prefix=$(CURDIR)/debian/kamailio-$(grp)-modules \
69
-		doc-dir=share/doc/kamailio-$(grp)-modules quiet=verbose
126
+		BASEDIR=$(D)-$(grp)-modules \
127
+		cfg_prefix=$(D)-$(grp)-modules \
128
+		doc-dir=share/doc/$(DEB_SOURCE)-$(grp)-modules quiet=verbose
70 129
 		# eliminate duplicate libs
71 130
 		-for d in $(DUP_LIBS_DIRS); do \
72
-			test "$$d" != "$(CURDIR)/debian/kamailio-$(grp)-modules/usr/$(LIBDIR)/kamailio" &&\
131
+			test "$$d" != "$(D)-$(grp)-modules/usr/$(LIBDIR)/kamailio" &&\
73 132
 			for r in `find $$d -name 'lib*'|xargs`; do \
74 133
 				echo "removing $(grp) lib `basename $$r` present also in $$d";\
75
-				rm -f $(CURDIR)/debian/kamailio-$(grp)-modules/usr/$(LIBDIR)/kamailio/`basename "$$r"` ; \
134
+				rm -f $(D)-$(grp)-modules/usr/$(LIBDIR)/kamailio/`basename "$$r"` ; \
76 135
 			done ; \
77 136
 		done
78
-		find $(CURDIR)/debian/kamailio-$(grp)-modules -depth -empty -type d -exec rmdir {} \;
137
+		find $(D)-$(grp)-modules -depth -empty -type d -exec rmdir {} \;
79 138
 	)
80 139
 endef
81 140
 
... ...
@@ -89,38 +148,28 @@ endef
89 148
 define PACKAGE_EXTRA_INSTALL_template
90 149
 	$(foreach grp,$(EXTRA_GROUPS),\
91 150
 		$(MAKE) install-modules-all LIBDIR=$(LIBDIR) group_include="k$(grp)" \
92
-		BASEDIR=$(CURDIR)/debian/kamailio-extra-modules \
93
-		cfg_prefix=$(CURDIR)/debian/kamailio-extra-modules \
94
-		doc-dir=share/doc/kamailio-extra-modules quiet=verbose
151
+		BASEDIR=$(D)-extra-modules \
152
+		cfg_prefix=$(D)-extra-modules \
153
+		doc-dir=share/doc/$(DEB_SOURCE)-extra-modules quiet=verbose
95 154
 	)
96 155
 	# eliminate duplicate libs
97 156
 	-for d in $(DUP_LIBS_DIRS); do \
98
-		test "$$d" != "$(CURDIR)/debian/kamailio-extra-modules/usr/$(LIBDIR)/kamailio" &&\
157
+		test "$$d" != "$(D)-extra-modules/usr/$(LIBDIR)/kamailio" &&\
99 158
 		for r in `find $$d -name 'lib*'|xargs`; do \
100 159
 			echo "removing extra lib `basename $$r` present also in $$d";\
101
-			rm -f $(CURDIR)/debian/kamailio-extra-modules/usr/$(LIBDIR)/kamailio/`basename "$$r"` ; \
160
+			rm -f $(D)-extra-modules/usr/$(LIBDIR)/kamailio/`basename "$$r"` ; \
102 161
 		done ; \
103 162
 	done
104
-	find $(CURDIR)/debian/kamailio-extra-modules -depth -empty -type d -exec rmdir {} \;
163
+	find $(D)-extra-modules -depth -empty -type d -exec rmdir {} \;
105 164
 endef
106 165
 
107
-# CFLAGS + CPPFLAGS -> CC_EXTRA_OPTS
108
-CC_EXTRA_OPTS := $(shell dpkg-buildflags --get CPPFLAGS)
109
-CC_EXTRA_OPTS += $(shell DEB_CFLAGS_MAINT_STRIP=-O2 dpkg-buildflags --get CFLAGS)
110
-CXXFLAGS := $(shell DEB_CXXFLAGS_MAINT_STRIP=-O2 dpkg-buildflags --get CXXFLAGS)
111
-# LDFLAGS -> LD_EXTRA_OPTS
112
-LD_EXTRA_OPTS := $(shell dpkg-buildflags --get LDFLAGS)
113
-
114
-# https://wiki.debian.org/ReproducibleBuilds/
115
-CC_EXTRA_OPTS += -DVERSION_NODATE
116
-
117 166
 configure: configure-stamp
118 167
 configure-stamp:
119 168
 	dh_testdir
120 169
 	# Add here commands to configure the package.
121
-	$(MAKE) FLAVOUR=kamailio cfg prefix=/usr cfg_prefix=$(CURDIR)/debian/kamailio \
170
+	$(MAKE) FLAVOUR=kamailio cfg prefix=/usr cfg_prefix=$(D) \
122 171
 			cfg_target=/etc/kamailio/ \
123
-			BASEDIR=$(CURDIR)/debian/kamailio \
172
+			BASEDIR=$(D) \
124 173
 			skip_modules="$(EXCLUDED_MODULES) $(EXTRA_EXCLUDED_MODULES)" \
125 174
 			CC_EXTRA_OPTS="$(CC_EXTRA_OPTS)" \
126 175
 			LD_EXTRA_OPTS="$(LD_EXTRA_OPTS)" \
... ...
@@ -159,13 +208,13 @@ install: build
159 208
 	# make group packages
160 209
 	$(call PACKAGE_GRP_INSTALL_template)
161 210
 	$(call PACKAGE_EXTRA_INSTALL_template)
162
-	mv $(CURDIR)/debian/kamailio-berkeley-modules/usr/sbin/kambdb_recover \
163
-		$(CURDIR)/debian/kamailio-berkeley-bin/usr/sbin/kambdb_recover
211
+	mv $(D)-berkeley-modules/usr/sbin/kambdb_recover \
212
+		$(D)-berkeley-bin/usr/sbin/kambdb_recover
164 213
 	# install /etc/default/kamailio file
165
-	mkdir -p $(CURDIR)/debian/kamailio/etc/default
166
-	cp -f debian/kamailio.default $(CURDIR)/debian/kamailio/etc/default/kamailio
214
+	mkdir -p $(D)/etc/default
215
+	cp -f debian/kamailio.default $(D)/etc/default/kamailio
167 216
 	# delete /run/kamailio dir
168
-	rm -rf $(CURDIR)/debian/kamailio/usr/local
217
+	rm -rf $(D)/usr/local
169 218
 
170 219
 
171 220
 # This single target is used to build all the packages, all at once, or
... ...
@@ -213,16 +262,5 @@ binary-arch: build install
213 262
 binary-%: build install
214 263
 	$(MAKE) -f debian/rules binary-common DH_OPTIONS=-p$*
215 264
 
216
-print-version:
217
-	@@echo "Debian version:          $(DEBVERSION)"
218
-	@@echo "Upstream version:        $(UPVERSION)"
219
-
220
-get-orig-source:
221
-	@@dh_testdir
222
-	@@[ -d ../tarballs/. ]||mkdir -p ../tarballs
223
-	@@echo Downloading $(FILENAME) from $(URL) ...
224
-	@@wget -nv -T10 -t3 -O ../tarballs/$(FILENAME) $(URL)
225
-
226 265
 binary: binary-indep binary-arch
227 266
 .PHONY: build clean binary-indep binary-arch binary install configure
228
-
Browse code

pkg: Fix typos

Bastian Triller authored on 05/05/2022 16:20:11 • Henning Westerholt committed on 08/05/2022 15:30:14
Showing 1 changed files
... ...
@@ -28,7 +28,7 @@ EXCLUDED_MODULES= java nats
28 28
 # they will be excluded from compile and install of all
29 29
 EXTRA_EXCLUDED_MODULES=bdb dbtext oracle pa iptrtpproxy mi_xmlrpc dnssec secsipid
30 30
 
31
-# module groups that are packaged in seperate packages
31
+# module groups that are packaged in separate packages
32 32
 # (with the name kamailio-$(group_name)-modules)
33 33
 # Note: the order is important (should be in dependency order, the one
34 34
 # on which other depend first)
Browse code

pkg::deb: Missing spaces

fixes the deleted space after "erlang"
introduced by a593f518dd62fd68c330eb42470ce5d5e1dce636

Matthias Urlichs authored on 25/02/2022 14:42:18 • Henning Westerholt committed on 25/02/2022 14:49:57
Showing 1 changed files
... ...
@@ -37,7 +37,7 @@ PACKAGE_GROUPS=mysql postgres berkeley unixodbc radius presence \
37 37
 			   snmpstats carrierroute xmpp cpl redis python geoip geoip2 \
38 38
 			   sqlite json mono ruby ims sctp \
39 39
 			   tls outbound websocket autheph kazoo cnxcc \
40
-			   erlangsystemd phonenum mongodb rabbitmq python3 mqtt lwsc
40
+			   erlang systemd phonenum mongodb rabbitmq python3 mqtt lwsc
41 41
 
42 42
 # module groups to be packaged onto kamailio-extra-modules
43 43
 EXTRA_GROUPS=gzcompress uuid ev jansson http_async
Browse code

pkg/kamailio/deb: fix rules

Victor Seva authored on 17/02/2022 23:18:03
Showing 1 changed files
... ...
@@ -37,7 +37,7 @@ PACKAGE_GROUPS=mysql postgres berkeley unixodbc radius presence \
37 37
 			   snmpstats carrierroute xmpp cpl redis python geoip geoip2 \
38 38
 			   sqlite json mono ruby ims sctp \
39 39
 			   tls outbound websocket autheph kazoo cnxcc \
40
-			   erlang systemd phonenum mongodb rabbitmq python3 mqtt lwsc nats
40
+			   erlangsystemd phonenum mongodb rabbitmq python3 mqtt lwsc
41 41
 
42 42
 # module groups to be packaged onto kamailio-extra-modules
43 43
 EXTRA_GROUPS=gzcompress uuid ev jansson http_async
Browse code

pkg/kamailio/deb: kamailio-nats-modules

for now just for sid, libnats-dev not yet in bookworm

Victor Seva authored on 17/02/2022 22:27:27
Showing 1 changed files
... ...
@@ -21,7 +21,7 @@ include /usr/share/dpkg/buildflags.mk
21 21
 export RADCLI=1
22 22
 
23 23
 # modules not in the "main" kamailio package
24
-EXCLUDED_MODULES= java
24
+EXCLUDED_MODULES= java nats
25 25
 
26 26
 # extra modules to skip, because they are not compilable now
27 27
 # - regardless if they go to the main kamailio package or to some module package,
... ...
@@ -37,7 +37,7 @@ PACKAGE_GROUPS=mysql postgres berkeley unixodbc radius presence \
37 37
 			   snmpstats carrierroute xmpp cpl redis python geoip geoip2 \
38 38
 			   sqlite json mono ruby ims sctp \
39 39
 			   tls outbound websocket autheph kazoo cnxcc \
40
-			   erlang systemd phonenum mongodb rabbitmq python3 mqtt lwsc
40
+			   erlang systemd phonenum mongodb rabbitmq python3 mqtt lwsc nats
41 41
 
42 42
 # module groups to be packaged onto kamailio-extra-modules
43 43
 EXTRA_GROUPS=gzcompress uuid ev jansson http_async
Browse code

pkg/kamailio/deb: missing lwsc module files [skip ci]

fixes #2749

Victor Seva authored on 27/05/2021 12:03:01
Showing 1 changed files
... ...
@@ -37,7 +37,7 @@ PACKAGE_GROUPS=mysql postgres berkeley unixodbc radius presence \
37 37
 			   snmpstats carrierroute xmpp cpl redis python geoip geoip2 \
38 38
 			   sqlite json mono ruby ims sctp \
39 39
 			   tls outbound websocket autheph kazoo cnxcc \
40
-			   erlang systemd phonenum mongodb rabbitmq python3 mqtt lwcs
40
+			   erlang systemd phonenum mongodb rabbitmq python3 mqtt lwsc
41 41
 
42 42
 # module groups to be packaged onto kamailio-extra-modules
43 43
 EXTRA_GROUPS=gzcompress uuid ev jansson http_async
Browse code

pkg/kamailio/deb: add lwcs module

* enable only the ones with libwebsockets >= 3.1

Victor Seva authored on 15/04/2021 11:46:50
Showing 1 changed files
... ...
@@ -37,7 +37,7 @@ PACKAGE_GROUPS=mysql postgres berkeley unixodbc radius presence \
37 37
 			   snmpstats carrierroute xmpp cpl redis python geoip geoip2 \
38 38
 			   sqlite json mono ruby ims sctp \
39 39
 			   tls outbound websocket autheph kazoo cnxcc \
40
-			   erlang systemd phonenum mongodb rabbitmq python3 mqtt 
40
+			   erlang systemd phonenum mongodb rabbitmq python3 mqtt lwcs
41 41
 
42 42
 # module groups to be packaged onto kamailio-extra-modules
43 43
 EXTRA_GROUPS=gzcompress uuid ev jansson http_async
Browse code

pkg/kamailio/deb: add secsipid package for supported releases [skip ci]

Victor Seva authored on 19/02/2021 14:04:39
Showing 1 changed files
... ...
@@ -26,7 +26,7 @@ EXCLUDED_MODULES= java
26 26
 # extra modules to skip, because they are not compilable now
27 27
 # - regardless if they go to the main kamailio package or to some module package,
28 28
 # they will be excluded from compile and install of all
29
-EXTRA_EXCLUDED_MODULES=bdb dbtext oracle pa iptrtpproxy mi_xmlrpc dnssec
29
+EXTRA_EXCLUDED_MODULES=bdb dbtext oracle pa iptrtpproxy mi_xmlrpc dnssec secsipid
30 30
 
31 31
 # module groups that are packaged in seperate packages
32 32
 # (with the name kamailio-$(group_name)-modules)
... ...
@@ -37,7 +37,7 @@ PACKAGE_GROUPS=mysql postgres berkeley unixodbc radius presence \
37 37
 			   snmpstats carrierroute xmpp cpl redis python geoip geoip2 \
38 38
 			   sqlite json mono ruby ims sctp \
39 39
 			   tls outbound websocket autheph kazoo cnxcc \
40
-			   erlang systemd phonenum mongodb rabbitmq python3 mqtt
40
+			   erlang systemd phonenum mongodb rabbitmq python3 mqtt 
41 41
 
42 42
 # module groups to be packaged onto kamailio-extra-modules
43 43
 EXTRA_GROUPS=gzcompress uuid ev jansson http_async
Browse code

pkg/kamailio/deb: add focal support

fixes #2338

Victor Seva authored on 04/08/2020 10:15:52
Showing 1 changed files
1 1
new file mode 100755
... ...
@@ -0,0 +1,228 @@
1
+#!/usr/bin/make -f
2
+# Sample debian/rules that uses debhelper.
3
+# GNU copyright 1997 to 1999 by Joey Hess.
4
+
5
+DEBVERSION:=$(shell head -n 1 debian/changelog \
6
+                    | sed -e 's/^[^(]*(\([^)]*\)).*/\1/')
7
+UPVERSION:=$(shell dpkg-parsechangelog | sed -ne 's/^Version: \(\([0-9]\+\):\)\?\(.*\)-.*/\3/p')
8
+
9
+FILENAME := kamailio_$(UPVERSION).orig.tar.gz
10
+URL := http://www.kamailio.org/pub/kamailio/$(UPVERSION)/src/kamailio-$(UPVERSION)_src.tar.gz
11
+
12
+DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
13
+
14
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
15
+DPKG_EXPORT_BUILDFLAGS = 1
16
+include /usr/share/dpkg/buildflags.mk
17
+
18
+# Uncomment this to turn on verbose mode.
19
+#export DH_VERBOSE=1
20
+
21
+export RADCLI=1
22
+
23
+# modules not in the "main" kamailio package
24
+EXCLUDED_MODULES= java
25
+
26
+# extra modules to skip, because they are not compilable now
27
+# - regardless if they go to the main kamailio package or to some module package,
28
+# they will be excluded from compile and install of all
29
+EXTRA_EXCLUDED_MODULES=bdb dbtext oracle pa iptrtpproxy mi_xmlrpc dnssec
30
+
31
+# module groups that are packaged in seperate packages
32
+# (with the name kamailio-$(group_name)-modules)
33
+# Note: the order is important (should be in dependency order, the one
34
+# on which other depend first)
35
+PACKAGE_GROUPS=mysql postgres berkeley unixodbc radius presence \
36
+			   ldap xml perl utils lua memcached \
37
+			   snmpstats carrierroute xmpp cpl redis python geoip geoip2 \
38
+			   sqlite json mono ruby ims sctp \
39
+			   tls outbound websocket autheph kazoo cnxcc \
40
+			   erlang systemd phonenum mongodb rabbitmq python3 mqtt
41
+
42
+# module groups to be packaged onto kamailio-extra-modules
43
+EXTRA_GROUPS=gzcompress uuid ev jansson http_async
44
+
45
+# name of libdir in the path for libraries (e.g., lib for 32b, lib64 for 64b)
46
+export LIBDIR ?= lib/$(DEB_HOST_MULTIARCH)
47
+
48
+# directories with possible duplicate libraries (that should be deleted
49
+# from current module* packages)
50
+DUP_LIBS_DIRS=$(CURDIR)/debian/kamailio/usr/$(LIBDIR)/kamailio \
51
+			$(CURDIR)/debian/kamailio-db-modules/usr/$(LIBDIR)/kamailio
52
+
53
+# "function" to get package short name out of a dir/module_name
54
+# it also transforms db_foo into foo
55
+mod_name=$(subst db_,,$(lastword $(subst /, ,$(1))))
56
+
57
+define PACKAGE_GRP_BUILD_template
58
+	# package all the modules in PACKAGE_GROUPS in separate packages
59
+	$(foreach grp,$(PACKAGE_GROUPS),\
60
+		$(MAKE) every-module group_include="k$(grp)" quiet=verbose
61
+	)
62
+endef
63
+
64
+define PACKAGE_GRP_INSTALL_template
65
+	$(foreach grp,$(PACKAGE_GROUPS),\
66
+		$(MAKE) install-modules-all LIBDIR=$(LIBDIR) group_include="k$(grp)" \
67
+		BASEDIR=$(CURDIR)/debian/kamailio-$(grp)-modules \
68
+		cfg_prefix=$(CURDIR)/debian/kamailio-$(grp)-modules \
69
+		doc-dir=share/doc/kamailio-$(grp)-modules quiet=verbose
70
+		# eliminate duplicate libs
71
+		-for d in $(DUP_LIBS_DIRS); do \
72
+			test "$$d" != "$(CURDIR)/debian/kamailio-$(grp)-modules/usr/$(LIBDIR)/kamailio" &&\
73
+			for r in `find $$d -name 'lib*'|xargs`; do \
74
+				echo "removing $(grp) lib `basename $$r` present also in $$d";\
75
+				rm -f $(CURDIR)/debian/kamailio-$(grp)-modules/usr/$(LIBDIR)/kamailio/`basename "$$r"` ; \
76
+			done ; \
77
+		done
78
+		find $(CURDIR)/debian/kamailio-$(grp)-modules -depth -empty -type d -exec rmdir {} \;
79
+	)
80
+endef
81
+
82
+define PACKAGE_EXTRA_BUILD_template
83
+	# package all the modules in EXTRA_GROUPS in separate packages
84
+	$(foreach grp,$(EXTRA_GROUPS),\
85
+		$(MAKE) every-module group_include="k$(grp)" quiet=verbose
86
+	)
87
+endef
88
+
89
+define PACKAGE_EXTRA_INSTALL_template
90
+	$(foreach grp,$(EXTRA_GROUPS),\
91
+		$(MAKE) install-modules-all LIBDIR=$(LIBDIR) group_include="k$(grp)" \
92
+		BASEDIR=$(CURDIR)/debian/kamailio-extra-modules \
93
+		cfg_prefix=$(CURDIR)/debian/kamailio-extra-modules \
94
+		doc-dir=share/doc/kamailio-extra-modules quiet=verbose
95
+	)
96
+	# eliminate duplicate libs
97
+	-for d in $(DUP_LIBS_DIRS); do \
98
+		test "$$d" != "$(CURDIR)/debian/kamailio-extra-modules/usr/$(LIBDIR)/kamailio" &&\
99
+		for r in `find $$d -name 'lib*'|xargs`; do \
100
+			echo "removing extra lib `basename $$r` present also in $$d";\
101
+			rm -f $(CURDIR)/debian/kamailio-extra-modules/usr/$(LIBDIR)/kamailio/`basename "$$r"` ; \
102
+		done ; \
103
+	done
104
+	find $(CURDIR)/debian/kamailio-extra-modules -depth -empty -type d -exec rmdir {} \;
105
+endef
106
+
107
+# CFLAGS + CPPFLAGS -> CC_EXTRA_OPTS
108
+CC_EXTRA_OPTS := $(shell dpkg-buildflags --get CPPFLAGS)
109
+CC_EXTRA_OPTS += $(shell DEB_CFLAGS_MAINT_STRIP=-O2 dpkg-buildflags --get CFLAGS)
110
+CXXFLAGS := $(shell DEB_CXXFLAGS_MAINT_STRIP=-O2 dpkg-buildflags --get CXXFLAGS)
111
+# LDFLAGS -> LD_EXTRA_OPTS
112
+LD_EXTRA_OPTS := $(shell dpkg-buildflags --get LDFLAGS)
113
+
114
+# https://wiki.debian.org/ReproducibleBuilds/
115
+CC_EXTRA_OPTS += -DVERSION_NODATE
116
+
117
+configure: configure-stamp
118
+configure-stamp:
119
+	dh_testdir
120
+	# Add here commands to configure the package.
121
+	$(MAKE) FLAVOUR=kamailio cfg prefix=/usr cfg_prefix=$(CURDIR)/debian/kamailio \
122
+			cfg_target=/etc/kamailio/ \
123
+			BASEDIR=$(CURDIR)/debian/kamailio \
124
+			skip_modules="$(EXCLUDED_MODULES) $(EXTRA_EXCLUDED_MODULES)" \
125
+			CC_EXTRA_OPTS="$(CC_EXTRA_OPTS)" \
126
+			LD_EXTRA_OPTS="$(LD_EXTRA_OPTS)" \
127
+			group_include="kstandard" quiet=verbose
128
+
129
+	touch configure-stamp
130
+
131
+
132
+build: build-stamp
133
+build-arch: build-stamp
134
+build-indep: build-stamp
135
+build-stamp: configure-stamp
136
+	dh_testdir
137
+	# Add here commands to compile the package.
138
+	$(MAKE) all quiet=verbose
139
+	# make groups
140
+	$(call PACKAGE_GRP_BUILD_template)
141
+	$(call PACKAGE_EXTRA_BUILD_template)
142
+	touch build-stamp
143
+
144
+clean:
145
+	dh_testdir
146
+	dh_testroot
147
+	rm -f build-stamp configure-stamp
148
+	# Add here commands to clean up after the build process.
149
+	$(MAKE) maintainer-clean
150
+	dh_clean
151
+
152
+install: build
153
+	dh_testdir
154
+	dh_testroot
155
+	dh_prep
156
+	dh_installdirs
157
+	# Add here commands to install the package into debian/kamailio
158
+	$(MAKE) install group_include="kstandard"
159
+	# make group packages
160
+	$(call PACKAGE_GRP_INSTALL_template)
161
+	$(call PACKAGE_EXTRA_INSTALL_template)
162
+	mv $(CURDIR)/debian/kamailio-berkeley-modules/usr/sbin/kambdb_recover \
163
+		$(CURDIR)/debian/kamailio-berkeley-bin/usr/sbin/kambdb_recover
164
+	# install /etc/default/kamailio file
165
+	mkdir -p $(CURDIR)/debian/kamailio/etc/default
166
+	cp -f debian/kamailio.default $(CURDIR)/debian/kamailio/etc/default/kamailio
167
+	# delete /run/kamailio dir
168
+	rm -rf $(CURDIR)/debian/kamailio/usr/local
169
+
170
+
171
+# This single target is used to build all the packages, all at once, or
172
+# one at a time. So keep in mind: any options passed to commands here will
173
+# affect _all_ packages. Anything you want to only affect one package
174
+# should be put in another target, such as the install target.
175
+binary-common:
176
+	dh_testdir
177
+	dh_testroot
178
+	dh_installdebconf
179
+	dh_installdocs
180
+	dh_installexamples -Xobsoleted -Xsr
181
+	dh_installmenu
182
+	dh_systemd_enable -pkamailio
183
+	dh_installinit -pkamailio -- defaults 23
184
+	dh_systemd_start -pkamailio
185
+	dh_installcron
186
+	dh_installman
187
+	dh_installinfo
188
+	dh_lintian
189
+	dh_installchangelogs ChangeLog
190
+	dh_link
191
+	dh_strip --dbg-package=kamailio-dbg
192
+	dh_compress
193
+	dh_fixperms
194
+	dh_makeshlibs
195
+	dh_installdeb
196
+	dh_shlibdeps
197
+	dh_gencontrol
198
+	dh_md5sums
199
+	dh_builddeb
200
+
201
+# Build architecture-independent packages using the common target
202
+binary-indep: build install
203
+# (Uncomment this next line if you have such packages.)
204
+#        $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
205
+# We have nothing to do by default.
206
+
207
+
208
+# Build architecture-dependent packages using the common target
209
+binary-arch: build install
210
+	$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
211
+
212
+# Any other binary targets build just one binary package at a time.
213
+binary-%: build install
214
+	$(MAKE) -f debian/rules binary-common DH_OPTIONS=-p$*
215
+
216
+print-version:
217
+	@@echo "Debian version:          $(DEBVERSION)"
218
+	@@echo "Upstream version:        $(UPVERSION)"
219
+
220
+get-orig-source:
221
+	@@dh_testdir
222
+	@@[ -d ../tarballs/. ]||mkdir -p ../tarballs
223
+	@@echo Downloading $(FILENAME) from $(URL) ...
224
+	@@wget -nv -T10 -t3 -O ../tarballs/$(FILENAME) $(URL)
225
+
226
+binary: binary-indep binary-arch
227
+.PHONY: build clean binary-indep binary-arch binary install configure
228
+