Browse code

updates from master

emvondo authored on 18/06/2022 09:39:28
Showing 128 changed files
... ...
@@ -93,6 +93,9 @@
93 93
 #       block if more than 16 requests in 2 seconds and ban for 300 seconds)
94 94
 #     - define WITH_ANTIFLOOD
95 95
 #
96
+# *** To load htable module execute:
97
+#     - define WITH_HTABLE
98
+#
96 99
 # *** To block 3XX redirect replies execute:
97 100
 #     - define WITH_BLOCK3XX
98 101
 #
... ...
@@ -148,6 +151,11 @@ import_file "kamailio-local.cfg"
148 151
 #!define MULTIDOMAIN 0
149 152
 #!endif
150 153
 
154
+#!ifdef WITH_ANTIFLOOD
155
+# - hash table 'ipban' used to store blocked IP addresses
156
+#!trydef WITH_HTABLE
157
+#!endif
158
+
151 159
 # - flags
152 160
 #   FLT_ - per transaction (message) flags
153 161
 #!define FLT_ACC 1
... ...
@@ -315,8 +323,11 @@ loadmodule "rtpproxy.so"
315 323
 loadmodule "tls.so"
316 324
 #!endif
317 325
 
318
-#!ifdef WITH_ANTIFLOOD
326
+#!ifdef WITH_HTABLE
319 327
 loadmodule "htable.so"
328
+#!endif
329
+
330
+#!ifdef WITH_ANTIFLOOD
320 331
 loadmodule "pike.so"
321 332
 #!endif
322 333
 
... ...
@@ -482,11 +493,15 @@ modparam("tls", "config", "/usr/local/etc/kamailio/tls.cfg")
482 493
 modparam("pike", "sampling_time_unit", 2)
483 494
 modparam("pike", "reqs_density_per_unit", 16)
484 495
 modparam("pike", "remove_latency", 4)
496
+#!endif
485 497
 
498
+#!ifdef WITH_HTABLE
486 499
 # ----- htable params -----
500
+#!ifdef WITH_ANTIFLOOD
487 501
 /* ip ban htable with autoexpire after 5 minutes */
488 502
 modparam("htable", "htable", "ipban=>size=8;autoexpire=300;")
489 503
 #!endif
504
+#!endif
490 505
 
491 506
 #!ifdef WITH_DEBUG
492 507
 # ----- debugger params -----
... ...
@@ -1,7 +1,7 @@
1 1
 Source: kamailio
2 2
 Section: net
3 3
 Priority: optional
4
-Maintainer: Debian VoIP Team <pkg-voip-maintainers@lists.alioth.debian.org>
4
+Maintainer: Kamailio Admin Group <kadmin.hq@lists.kamailio.org>
5 5
 Uploaders:
6 6
  Victor Seva <vseva@debian.org>,
7 7
 Build-Depends:
... ...
@@ -59,8 +59,8 @@ Build-Depends:
59 59
  zlib1g-dev,
60 60
 Standards-Version: 4.6.0.1
61 61
 Homepage: http://www.kamailio.org/
62
-Vcs-Git: https://salsa.debian.org/pkg-voip-team/kamailio.git
63
-Vcs-Browser: https://salsa.debian.org/pkg-voip-team/kamailio/
62
+Vcs-Git: https://github.com/kamailio/kamailio.git
63
+Vcs-Browser: https://github.com/kamailio/kamailio/
64 64
 Rules-Requires-Root: no
65 65
 
66 66
 Package: kamailio
... ...
@@ -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 lwsc
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 += lwsc
37
+EXTRA_EXCLUDED_MODULES += nats
38
+## --EXCLUDED--
39
+
40
+
41
+# Module groups that are packaged in seperate packages (with the name
42
+# kamailio-$(group_name)-modules).
33 43
 # Note: the order is important (should be in dependency order, the one
34 44
 # 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
45
+PACKAGE_GROUPS += mysql
46
+PACKAGE_GROUPS += postgres
47
+PACKAGE_GROUPS += berkeley
48
+PACKAGE_GROUPS += unixodbc
49
+PACKAGE_GROUPS += radius
50
+PACKAGE_GROUPS += presence
51
+PACKAGE_GROUPS += ldap
52
+PACKAGE_GROUPS += xml
53
+PACKAGE_GROUPS += perl
54
+PACKAGE_GROUPS += utils
55
+PACKAGE_GROUPS += lua
56
+PACKAGE_GROUPS += memcached
57
+PACKAGE_GROUPS += snmpstats
58
+PACKAGE_GROUPS += carrierroute
59
+PACKAGE_GROUPS += xmpp
60
+PACKAGE_GROUPS += cpl
61
+PACKAGE_GROUPS += redis
62
+PACKAGE_GROUPS += python
63
+PACKAGE_GROUPS += geoip
64
+PACKAGE_GROUPS += geoip2
65
+PACKAGE_GROUPS += sqlite
66
+PACKAGE_GROUPS += json
67
+PACKAGE_GROUPS += mono
68
+PACKAGE_GROUPS += ruby
69
+PACKAGE_GROUPS += ims
70
+PACKAGE_GROUPS += sctp
71
+PACKAGE_GROUPS += tls
72
+PACKAGE_GROUPS += outbound
73
+PACKAGE_GROUPS += websocket
74
+PACKAGE_GROUPS += autheph
75
+PACKAGE_GROUPS += kazoo
76
+PACKAGE_GROUPS += cnxcc
77
+PACKAGE_GROUPS += erlang
78
+PACKAGE_GROUPS += systemd
79
+PACKAGE_GROUPS += phonenum
80
+PACKAGE_GROUPS += mongodb
81
+PACKAGE_GROUPS += rabbitmq
82
+PACKAGE_GROUPS += python3
83
+PACKAGE_GROUPS += mqtt
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
-
... ...
@@ -1,7 +1,7 @@
1 1
 Source: kamailio
2 2
 Section: net
3 3
 Priority: optional
4
-Maintainer: Debian VoIP Team <pkg-voip-maintainers@lists.alioth.debian.org>
4
+Maintainer: Kamailio Admin Group <kadmin.hq@lists.kamailio.org>
5 5
 Uploaders:
6 6
  Victor Seva <vseva@debian.org>,
7 7
 Build-Depends:
... ...
@@ -59,8 +59,8 @@ Build-Depends:
59 59
  zlib1g-dev,
60 60
 Standards-Version: 4.6.0.1
61 61
 Homepage: http://www.kamailio.org/
62
-Vcs-Git: https://salsa.debian.org/pkg-voip-team/kamailio.git
63
-Vcs-Browser: https://salsa.debian.org/pkg-voip-team/kamailio/
62
+Vcs-Git: https://github.com/kamailio/kamailio.git
63
+Vcs-Browser: https://github.com/kamailio/kamailio/
64 64
 Rules-Requires-Root: no
65 65
 
66 66
 Package: kamailio
... ...
@@ -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 python
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 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 += python
36
+## --EXCLUDED--
37
+
38
+
39
+# Module groups that are packaged in seperate packages (with the name
40
+# kamailio-$(group_name)-modules).
33 41
 # Note: the order is important (should be in dependency order, the one
34 42
 # 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 redisgeoip geoip2 \
38
-			   sqlite json mono ruby ims sctp \
39
-			   tls outbound websocket autheph kazoo cnxcc \
40
-			   erlang systemd phonenum mongodb rabbitmq python3 mqtt secsipid lwsc nats
43
+PACKAGE_GROUPS += mysql
44
+PACKAGE_GROUPS += postgres
45
+PACKAGE_GROUPS += berkeley
46
+PACKAGE_GROUPS += unixodbc
47
+PACKAGE_GROUPS += radius
48
+PACKAGE_GROUPS += presence
49
+PACKAGE_GROUPS += ldap
50
+PACKAGE_GROUPS += xml
51
+PACKAGE_GROUPS += perl
52
+PACKAGE_GROUPS += utils
53
+PACKAGE_GROUPS += lua
54
+PACKAGE_GROUPS += memcached
55
+PACKAGE_GROUPS += snmpstats
56
+PACKAGE_GROUPS += carrierroute
57
+PACKAGE_GROUPS += xmpp
58
+PACKAGE_GROUPS += cpl
59
+PACKAGE_GROUPS += redis
60
+PACKAGE_GROUPS += geoip
61
+PACKAGE_GROUPS += geoip2
62
+PACKAGE_GROUPS += sqlite
63
+PACKAGE_GROUPS += json
64
+PACKAGE_GROUPS += mono
65
+PACKAGE_GROUPS += ruby
66
+PACKAGE_GROUPS += ims
67
+PACKAGE_GROUPS += sctp
68
+PACKAGE_GROUPS += tls
69
+PACKAGE_GROUPS += outbound
70
+PACKAGE_GROUPS += websocket
71
+PACKAGE_GROUPS += autheph
72
+PACKAGE_GROUPS += kazoo
73
+PACKAGE_GROUPS += cnxcc
74
+PACKAGE_GROUPS += erlang
75
+PACKAGE_GROUPS += systemd
76
+PACKAGE_GROUPS += phonenum
77
+PACKAGE_GROUPS += mongodb
78
+PACKAGE_GROUPS += rabbitmq
79
+PACKAGE_GROUPS += python3
80
+PACKAGE_GROUPS += mqtt
81
+PACKAGE_GROUPS += secsipid
82
+PACKAGE_GROUPS += lwsc
83
+PACKAGE_GROUPS += nats
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
-
... ...
@@ -1,7 +1,7 @@
1 1
 Source: kamailio
2 2
 Section: net
3 3
 Priority: optional
4
-Maintainer: Debian VoIP Team <pkg-voip-maintainers@lists.alioth.debian.org>
4
+Maintainer: Kamailio Admin Group <kadmin.hq@lists.kamailio.org>
5 5
 Uploaders:
6 6
  Victor Seva <vseva@debian.org>,
7 7
 Build-Depends:
... ...
@@ -60,8 +60,8 @@ Build-Depends:
60 60
  zlib1g-dev,
61 61
 Standards-Version: 4.6.0.1
62 62
 Homepage: http://www.kamailio.org/
63
-Vcs-Git: https://salsa.debian.org/pkg-voip-team/kamailio.git
64
-Vcs-Browser: https://salsa.debian.org/pkg-voip-team/kamailio/
63
+Vcs-Git: https://github.com/kamailio/kamailio.git
64
+Vcs-Browser: https://github.com/kamailio/kamailio/
65 65
 Rules-Requires-Root: no
66 66
 
67 67
 Package: kamailio
... ...
@@ -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
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 += nats
36
+## --EXCLUDED--
37
+
38
+
39
+# Module groups that are packaged in seperate packages (with the name
40
+# kamailio-$(group_name)-modules).
33 41
 # Note: the order is important (should be in dependency order, the one
34 42
 # 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 secsipid lwsc
43
+PACKAGE_GROUPS += mysql
44
+PACKAGE_GROUPS += postgres
45
+PACKAGE_GROUPS += berkeley
46
+PACKAGE_GROUPS += unixodbc
47
+PACKAGE_GROUPS += radius
48
+PACKAGE_GROUPS += presence
49
+PACKAGE_GROUPS += ldap
50
+PACKAGE_GROUPS += xml
51
+PACKAGE_GROUPS += perl
52
+PACKAGE_GROUPS += utils
53
+PACKAGE_GROUPS += lua
54
+PACKAGE_GROUPS += memcached
55
+PACKAGE_GROUPS += snmpstats
56
+PACKAGE_GROUPS += carrierroute
57
+PACKAGE_GROUPS += xmpp
58
+PACKAGE_GROUPS += cpl
59
+PACKAGE_GROUPS += redis
60
+PACKAGE_GROUPS += python
61
+PACKAGE_GROUPS += geoip
62
+PACKAGE_GROUPS += geoip2
63
+PACKAGE_GROUPS += sqlite
64
+PACKAGE_GROUPS += json
65
+PACKAGE_GROUPS += mono
66
+PACKAGE_GROUPS += ruby
67
+PACKAGE_GROUPS += ims
68
+PACKAGE_GROUPS += sctp
69
+PACKAGE_GROUPS += tls
70
+PACKAGE_GROUPS += outbound
71
+PACKAGE_GROUPS += websocket
72
+PACKAGE_GROUPS += autheph
73
+PACKAGE_GROUPS += kazoo
74
+PACKAGE_GROUPS += cnxcc
75
+PACKAGE_GROUPS += erlang
76
+PACKAGE_GROUPS += systemd
77
+PACKAGE_GROUPS += phonenum
78
+PACKAGE_GROUPS += mongodb
79
+PACKAGE_GROUPS += rabbitmq
80
+PACKAGE_GROUPS += python3
81
+PACKAGE_GROUPS += mqtt
82
+PACKAGE_GROUPS += secsipid
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
-
... ...
@@ -1,7 +1,7 @@
1 1
 Source: kamailio
2 2
 Section: net
3 3
 Priority: optional
4
-Maintainer: Debian VoIP Team <pkg-voip-maintainers@lists.alioth.debian.org>
4
+Maintainer: Kamailio Admin Group <kadmin.hq@lists.kamailio.org>
5 5
 Uploaders:
6 6
  Victor Seva <vseva@debian.org>,
7 7
 Build-Depends:
... ...
@@ -59,8 +59,8 @@ Build-Depends:
59 59
  zlib1g-dev,
60 60
 Standards-Version: 4.6.0.1
61 61
 Homepage: http://www.kamailio.org/
62
-Vcs-Git: https://salsa.debian.org/pkg-voip-team/kamailio.git
63
-Vcs-Browser: https://salsa.debian.org/pkg-voip-team/kamailio/
62
+Vcs-Git: https://github.com/kamailio/kamailio.git
63
+Vcs-Browser: https://github.com/kamailio/kamailio/
64 64
 Rules-Requires-Root: no
65 65
 
66 66
 Package: kamailio
... ...
@@ -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 lwsc
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 += lwsc
37
+EXTRA_EXCLUDED_MODULES += nats
38
+## --EXCLUDED--
39
+
40
+
41
+# Module groups that are packaged in seperate packages (with the name
42
+# kamailio-$(group_name)-modules).
33 43
 # Note: the order is important (should be in dependency order, the one
34 44
 # 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
45
+PACKAGE_GROUPS += mysql
46
+PACKAGE_GROUPS += postgres
47
+PACKAGE_GROUPS += berkeley
48
+PACKAGE_GROUPS += unixodbc
49
+PACKAGE_GROUPS += radius
50
+PACKAGE_GROUPS += presence
51
+PACKAGE_GROUPS += ldap
52
+PACKAGE_GROUPS += xml
53
+PACKAGE_GROUPS += perl
54
+PACKAGE_GROUPS += utils
55
+PACKAGE_GROUPS += lua
56
+PACKAGE_GROUPS += memcached
57
+PACKAGE_GROUPS += snmpstats
58
+PACKAGE_GROUPS += carrierroute
59
+PACKAGE_GROUPS += xmpp
60
+PACKAGE_GROUPS += cpl
61
+PACKAGE_GROUPS += redis
62
+PACKAGE_GROUPS += python
63
+PACKAGE_GROUPS += geoip
64
+PACKAGE_GROUPS += geoip2
65
+PACKAGE_GROUPS += sqlite
66
+PACKAGE_GROUPS += json
67
+PACKAGE_GROUPS += mono
68
+PACKAGE_GROUPS += ruby
69
+PACKAGE_GROUPS += ims
70
+PACKAGE_GROUPS += sctp
71
+PACKAGE_GROUPS += tls
72
+PACKAGE_GROUPS += outbound
73
+PACKAGE_GROUPS += websocket
74
+PACKAGE_GROUPS += autheph
75
+PACKAGE_GROUPS += kazoo
76
+PACKAGE_GROUPS += cnxcc
77
+PACKAGE_GROUPS += erlang
78
+PACKAGE_GROUPS += systemd
79
+PACKAGE_GROUPS += phonenum
80
+PACKAGE_GROUPS += mongodb
81
+PACKAGE_GROUPS += rabbitmq
82
+PACKAGE_GROUPS += python3
83
+PACKAGE_GROUPS += mqtt
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
-
... ...
@@ -6,43 +6,37 @@ DIST=bionic
6 6
 rm -rf ${DIST}
7 7
 cp -r debian ${DIST}
8 8
 
9
-# No mi_xmlrpc module
10
-sed -i -e '/libxmlrpc-c3-dev/d' -e '/^Package: kamailio-xmlrpc-modules/,/^$/d' \
11
-	${DIST}/control
12
-sed -i -e 's/ mi_xmlrpc[ ,$]*/ /' ${DIST}/rules
13
-sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ mi_xmlrpc/' ${DIST}/rules
14
-
15 9
 # No dnssec module:
16 10
 sed -i -e '/libval-dev/d' -e '/^Package: kamailio-dnssec-modules/,/^$/d' \
17 11
   ${DIST}/control
18
-sed -i -e 's/ dnssec[ ,$]*/ /' ${DIST}/rules
19
-sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ dnssec/' ${DIST}/rules
12
+sed -i -e '/^PACKAGE_GROUPS += dnssec/d' ${DIST}/rules
13
+sed -i -e '/--EXCLUDED--/i EXTRA_EXCLUDED_MODULES += dnssec' ${DIST}/rules
20 14
 
21 15
 # No app_java due lack of gcj-jdk
22 16
 sed -i -e '/gcj-jdk/d' -e '/^Package: kamailio-java-modules/,/^$/d' \
23 17
   ${DIST}/control
24 18
 sed -i -e '/^export JAVA_HOME/d' ${DIST}/rules
25
-sed -i -e 's/ java[ ,$]*/ /' ${DIST}/rules
26
-sed -i -e '/^EXCLUDED_MODULES=/s/$/ java/' ${DIST}/rules
19
+sed -i -e '/^PACKAGE_GROUPS += java/d' ${DIST}/rules
20
+sed -i -e '/--EXCLUDED--/i EXTRA_EXCLUDED_MODULES += java' ${DIST}/rules
27 21
 
28 22
 # No secsipid module
29 23
 sed -i -e '/libsecsipid-dev/d' -e '/^Package: kamailio-secsipid-modules/,/^$/d' \
30 24
 	${DIST}/control
31
-sed -i -e 's/ secsipid[ ,$]*/ /' ${DIST}/rules
32
-sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ secsipid/' ${DIST}/rules
25
+sed -i -e '/^PACKAGE_GROUPS += secsipid/d' ${DIST}/rules
26
+sed -i -e '/--EXCLUDED--/i EXTRA_EXCLUDED_MODULES += secsipid' ${DIST}/rules
33 27
 
34 28
 # libwebsockets >= 3.1
35 29
 sed -i -e '/libwebsockets-dev/d' -e '/^Package: kamailio-lwsc-modules/,/^$/d' \
36 30
 	${DIST}/control
37
-sed -i -e 's/ lwsc[ ,$]*/ /' ${DIST}/rules
38
-sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ lwsc/' ${DIST}/rules
31
+sed -i -e '/^PACKAGE_GROUPS += lwsc/d' ${DIST}/rules
32
+sed -i -e '/--EXCLUDED--/i EXTRA_EXCLUDED_MODULES += lwsc' ${DIST}/rules
39 33
 
40 34
 # no libnats-dev
41 35
 sed -i -e '/^ libnats-dev,/d' \
42 36
   -e '/^Package: kamailio-nats-modules/,/^$/d' \
43 37
   ${DIST}/control
44
-sed -i -e 's/ nats[ ,$]*//' ${DIST}/rules
45
-sed -i -e '/^EXCLUDED_MODULES=/s/$/ nats/' ${DIST}/rules
38
+sed -i -e '/^PACKAGE_GROUPS += nats/d' ${DIST}/rules
39
+sed -i -e '/--EXCLUDED--/i EXTRA_EXCLUDED_MODULES += nats' ${DIST}/rules
46 40
 
47 41
 wrap-and-sort -sat -d ${DIST}
48 42
 
... ...
@@ -6,24 +6,18 @@ DIST=bookworm
6 6
 rm -rf ${DIST}
7 7
 cp -r debian ${DIST}
8 8
 
9
-# No mi_xmlrpc module
10
-sed -i -e '/libxmlrpc-c3-dev/d' -e '/^Package: kamailio-xmlrpc-modules/,/^$/d' \
11
-	${DIST}/control
12
-sed -i -e 's/ mi_xmlrpc[ ,$]*/ /' ${DIST}/rules
13
-sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ mi_xmlrpc/' ${DIST}/rules
14
-
15 9
 # No dnssec module:
16 10
 sed -i -e '/libval-dev/d' -e '/^Package: kamailio-dnssec-modules/,/^$/d' \
17 11
   ${DIST}/control
18
-sed -i -e 's/ dnssec[ ,$]*/ /' ${DIST}/rules
19
-sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ dnssec/' ${DIST}/rules
12
+sed -i -e '/^PACKAGE_GROUPS += dnssec/d' ${DIST}/rules
13
+sed -i -e '/--EXCLUDED--/i EXTRA_EXCLUDED_MODULES += dnssec' ${DIST}/rules
20 14
 
21 15
 # No app_java due lack of gcj-jdk
22 16
 sed -i -e '/gcj-jdk/d' -e '/^Package: kamailio-java-modules/,/^$/d' \
23 17
   ${DIST}/control
24 18
 sed -i -e '/^export JAVA_HOME/d' ${DIST}/rules
25
-sed -i -e 's/ java[ ,$]*/ /' ${DIST}/rules
26
-sed -i -e '/^EXCLUDED_MODULES=/s/$/ java/' ${DIST}/rules
19
+sed -i -e '/^PACKAGE_GROUPS += java/d' ${DIST}/rules
20
+sed -i -e '/--EXCLUDED--/i EXTRA_EXCLUDED_MODULES += java' ${DIST}/rules
27 21
 
28 22
 # no dh-systemd
29 23
 sed -i -e '/dh-systemd/d' ${DIST}/control
... ...
@@ -32,8 +26,8 @@ sed -i -e '/dh-systemd/d' ${DIST}/control
32 26
 sed -i -e '/^ python,/d' -e '/python-dev/d' \
33 27
   -e '/^Package: kamailio-python-modules/,/^$/d' \
34 28
   ${DIST}/control
35
-sed -i -e 's/ python [ ,$]*//' ${DIST}/rules
36
-sed -i -e '/^EXCLUDED_MODULES=/s/$/ python/' ${DIST}/rules
29
+sed -i -e '/^PACKAGE_GROUPS += python$/d' ${DIST}/rules
30
+sed -i -e '/--EXCLUDED--/i EXTRA_EXCLUDED_MODULES += python' ${DIST}/rules
37 31
 
38 32
 wrap-and-sort -sat -d ${DIST}
39 33
 
... ...
@@ -6,34 +6,28 @@ DIST=bullseye
6 6
 rm -rf ${DIST}
7 7
 cp -r debian ${DIST}
8 8
 
9
-# No mi_xmlrpc module
10
-sed -i -e '/libxmlrpc-c3-dev/d' -e '/^Package: kamailio-xmlrpc-modules/,/^$/d' \
11
-	${DIST}/control
12
-sed -i -e 's/ mi_xmlrpc[ ,$]*/ /' ${DIST}/rules
13
-sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ mi_xmlrpc/' ${DIST}/rules
14
-
15 9
 # No dnssec module:
16 10
 sed -i -e '/libval-dev/d' -e '/^Package: kamailio-dnssec-modules/,/^$/d' \
17 11
   ${DIST}/control
18
-sed -i -e 's/ dnssec[ ,$]*/ /' ${DIST}/rules
19
-sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ dnssec/' ${DIST}/rules
12
+sed -i -e '/^PACKAGE_GROUPS += dnssec/d' ${DIST}/rules
13
+sed -i -e '/--EXCLUDED--/i EXTRA_EXCLUDED_MODULES += dnssec' ${DIST}/rules
20 14
 
21 15
 # No app_java due lack of gcj-jdk
22 16
 sed -i -e '/gcj-jdk/d' -e '/^Package: kamailio-java-modules/,/^$/d' \
23 17
   ${DIST}/control
24 18
 sed -i -e '/^export JAVA_HOME/d' ${DIST}/rules
25
-sed -i -e 's/ java[ ,$]*/ /' ${DIST}/rules
26
-sed -i -e '/^EXCLUDED_MODULES=/s/$/ java/' ${DIST}/rules
19
+sed -i -e '/^PACKAGE_GROUPS += java/d' ${DIST}/rules
20
+sed -i -e '/--EXCLUDED--/i EXTRA_EXCLUDED_MODULES += java' ${DIST}/rules
27 21
 
28
-# No dh-systemd
22
+# no dh-systemd
29 23
 sed -i -e '/dh-systemd/d' ${DIST}/control
30 24
 
31 25
 # no libnats-dev
32 26
 sed -i -e '/^ libnats-dev,/d' \
33 27
   -e '/^Package: kamailio-nats-modules/,/^$/d' \
34 28
   ${DIST}/control
35
-sed -i -e 's/ nats[ ,$]*//' ${DIST}/rules
36
-sed -i -e '/^EXCLUDED_MODULES=/s/$/ nats/' ${DIST}/rules
29
+sed -i -e '/^PACKAGE_GROUPS += nats/d' ${DIST}/rules
30
+sed -i -e '/--EXCLUDED--/i EXTRA_EXCLUDED_MODULES += nats' ${DIST}/rules
37 31
 
38 32
 wrap-and-sort -sat -d ${DIST}
39 33
 
... ...
@@ -6,43 +6,37 @@ DIST=buster
6 6
 rm -rf ${DIST}
7 7
 cp -r debian ${DIST}
8 8
 
9
-# No mi_xmlrpc module
10
-sed -i -e '/libxmlrpc-c3-dev/d' -e '/^Package: kamailio-xmlrpc-modules/,/^$/d' \
11
-	${DIST}/control
12
-sed -i -e 's/ mi_xmlrpc[ ,$]*/ /' ${DIST}/rules
13
-sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ mi_xmlrpc/' ${DIST}/rules
14
-
15 9
 # No dnssec module:
16 10
 sed -i -e '/libval-dev/d' -e '/^Package: kamailio-dnssec-modules/,/^$/d' \
17 11
   ${DIST}/control
18
-sed -i -e 's/ dnssec[ ,$]*/ /' ${DIST}/rules
19
-sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ dnssec/' ${DIST}/rules
12
+sed -i -e '/^PACKAGE_GROUPS += dnssec/d' ${DIST}/rules
13
+sed -i -e '/--EXCLUDED--/i EXTRA_EXCLUDED_MODULES += dnssec' ${DIST}/rules
20 14
 
21 15
 # No app_java due lack of gcj-jdk
22 16
 sed -i -e '/gcj-jdk/d' -e '/^Package: kamailio-java-modules/,/^$/d' \
23 17
   ${DIST}/control
24 18
 sed -i -e '/^export JAVA_HOME/d' ${DIST}/rules
25
-sed -i -e 's/ java[ ,$]*/ /' ${DIST}/rules
26
-sed -i -e '/^EXCLUDED_MODULES=/s/$/ java/' ${DIST}/rules
19
+sed -i -e '/^PACKAGE_GROUPS += java/d' ${DIST}/rules
20
+sed -i -e '/--EXCLUDED--/i EXTRA_EXCLUDED_MODULES += java' ${DIST}/rules
27 21
 
28 22
 # No secsipid module
29 23
 sed -i -e '/libsecsipid-dev/d' -e '/^Package: kamailio-secsipid-modules/,/^$/d' \
30 24
 	${DIST}/control
31
-sed -i -e 's/ secsipid[ ,$]*/ /' ${DIST}/rules
32
-sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ secsipid/' ${DIST}/rules
25
+sed -i -e '/^PACKAGE_GROUPS += secsipid/d' ${DIST}/rules
26
+sed -i -e '/--EXCLUDED--/i EXTRA_EXCLUDED_MODULES += secsipid' ${DIST}/rules
33 27
 
34 28
 # libwebsockets >= 3.1
35 29
 sed -i -e '/libwebsockets-dev/d' -e '/^Package: kamailio-lwsc-modules/,/^$/d' \
36 30
 	${DIST}/control
37
-sed -i -e 's/ lwsc[ ,$]*/ /' ${DIST}/rules
38
-sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ lwsc/' ${DIST}/rules
31
+sed -i -e '/^PACKAGE_GROUPS += lwsc/d' ${DIST}/rules
32
+sed -i -e '/--EXCLUDED--/i EXTRA_EXCLUDED_MODULES += lwsc' ${DIST}/rules
39 33
 
40 34
 # no libnats-dev
41 35
 sed -i -e '/^ libnats-dev,/d' \
42 36
   -e '/^Package: kamailio-nats-modules/,/^$/d' \
43 37
   ${DIST}/control
44
-sed -i -e 's/ nats[ ,$]*//' ${DIST}/rules
45
-sed -i -e '/^EXCLUDED_MODULES=/s/$/ nats/' ${DIST}/rules
38
+sed -i -e '/^PACKAGE_GROUPS += nats/d' ${DIST}/rules
39
+sed -i -e '/--EXCLUDED--/i EXTRA_EXCLUDED_MODULES += nats' ${DIST}/rules
46 40
 
47 41
 wrap-and-sort -sat -d ${DIST}
48 42
 
... ...
@@ -6,37 +6,31 @@ DIST=focal
6 6
 rm -rf ${DIST}
7 7
 cp -r debian ${DIST}
8 8
 
9
-# No mi_xmlrpc module
10
-sed -i -e '/libxmlrpc-c3-dev/d' -e '/^Package: kamailio-xmlrpc-modules/,/^$/d' \
11
-	${DIST}/control
12
-sed -i -e 's/ mi_xmlrpc[ ,$]*/ /' ${DIST}/rules
13
-sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ mi_xmlrpc/' ${DIST}/rules
14
-
15 9
 # No dnssec module:
16 10
 sed -i -e '/libval-dev/d' -e '/^Package: kamailio-dnssec-modules/,/^$/d' \
17 11
   ${DIST}/control
18
-sed -i -e 's/ dnssec[ ,$]*/ /' ${DIST}/rules
19
-sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ dnssec/' ${DIST}/rules
12
+sed -i -e '/^PACKAGE_GROUPS += dnssec/d' ${DIST}/rules
13
+sed -i -e '/--EXCLUDED--/i EXTRA_EXCLUDED_MODULES += dnssec' ${DIST}/rules
20 14
 
21 15
 # No app_java due lack of gcj-jdk
22 16
 sed -i -e '/gcj-jdk/d' -e '/^Package: kamailio-java-modules/,/^$/d' \
23 17
   ${DIST}/control
24 18
 sed -i -e '/^export JAVA_HOME/d' ${DIST}/rules
25
-sed -i -e 's/ java[ ,$]*/ /' ${DIST}/rules
26
-sed -i -e '/^EXCLUDED_MODULES=/s/$/ java/' ${DIST}/rules
19
+sed -i -e '/^PACKAGE_GROUPS += java/d' ${DIST}/rules
20
+sed -i -e '/--EXCLUDED--/i EXTRA_EXCLUDED_MODULES += java' ${DIST}/rules
27 21