Rework Debian packaging to fix build issue, fully rename to ngcp-* naming schema and get rid of kernel-module/debian/

This package now builds:

  ngcp-mediaproxy-ng_0.1_amd64.deb
  ngcp-mediaproxy-ng-daemon_0.1_amd64.deb
  ngcp-mediaproxy-ng-iptables_0.1_amd64.deb
  ngcp-mediaproxy-ng-kernel-dkms_0.1_all.deb
  ngcp-mediaproxy-ng-kernel-source_0.1_all.deb

with all required files and dropping kernel-module/debian/ but providing
all targets within debian/ itself.

NOTE: Needs further testing and disussion whether the ngcp* is wanted
inside the kernel module as well.

From: Michael Prokop <mprokop@sipwise.com>
remotes/origin/2.0
Michael Prokop 14 years ago
parent d149f3c8c0
commit b22bc3ebf0

@ -1,5 +1,5 @@
mediaproxy-ng-kernel for Debian
-------------------------------
ngcp-mediaproxy-ng-kernel for Debian
------------------------------------
This package only works with kernels >= 2.6.32.
@ -9,17 +9,17 @@ Instructions for usage
1) module-assistant:
% sudo apt-get install linux-headers-$(uname -r)
% sudo apt-get install mediaproxy-ng-kernel-source
% sudo apt-get install ngcp-mediaproxy-ng-kernel-source
% sudo m-a prepare
% sudo m-a -v -f -l $(uname -r) -k /usr/src/linux-headers-$(uname -r) a-b mediaproxy-ng-kernel
% sudo m-a -v -f -l $(uname -r) -k /usr/src/linux-headers-$(uname -r) a-b ngcp-mediaproxy-ng-kernel
How to debug build process:
% sudo m-a -d -v --text-mode -l $(uname -r) -k /usr/src/linux-headers-$(uname -r) a-i mediaproxy-ng-kernel
% sudo m-a -d -v --text-mode -l $(uname -r) -k /usr/src/linux-headers-$(uname -r) a-i ngcp-mediaproxy-ng-kernel
2) DKMS:
% sudo apt-get install mediaproxy-ng-kernel-dkms
% sudo dkms add -m mediaproxy-ng -v 0.0.1
% sudo dkms build --kernelsourcedir /usr/src/linux-headers-$(uname -r) -m mediaproxy-ng -v 0.0.1
% sudo dkms install -m mediaproxy-ng -v 0.0.1
% sudo apt-get install ngcp-mediaproxy-ng-kernel-dkms
% sudo dkms add -m ngcp-mediaproxy-ng -v 0.0.1
% sudo dkms build --kernelsourcedir /usr/src/linux-headers-$(uname -r) -m ngcp-mediaproxy-ng -v 0.0.1
% sudo dkms install -m ngcp-mediaproxy-ng -v 0.0.1

21
debian/control vendored

@ -1,9 +1,9 @@
Source: ngcp-mediaproxy-ng
Section: net
Priority: extra
Maintainer: Michael Prokop <mprokop@sipwise.com>
Maintainer: Richard Fuchs <rfuchs@sipwise.com>
Build-Depends: debhelper (>= 5), iptables-dev, libglib2.0-dev, libpcre3-dev
Standards-Version: 3.8.4
Standards-Version: 3.9.1
Homepage: http://sipwise.com/
Package: ngcp-mediaproxy-ng-daemon
@ -26,3 +26,20 @@ Description: NGCP RTP/media proxy - meta package.
This is a meta package for easy installation of all three parts of the NGCP
media proxy. It will install the user-space daemon, the kernel-space IPtables
module, and the IPtables extension module.
Package: ngcp-mediaproxy-ng-kernel-source
Architecture: all
Depends: debhelper (>= 5), module-assistant, ${misc:Depends}
Description: IPtables kernel module for the NGCP media proxy - source.
Provides the kernel-space part of the NGCP media proxy for high-
performance packet forwarding.
This package contains the source to be built with module-assistant or
kernel-package.
Package: ngcp-mediaproxy-ng-kernel-dkms
Architecture: all
Depends: dkms (>= 1.95), ${misc:Depends}
Description: IPtables kernel module for the NGCP media proxy - DKMS.
Provides the kernel-space part of the NGCP media proxy for high-
performance packet forwarding.
This package contains the source to be built with dkms.

2
debian/copyright vendored

@ -1,5 +1,5 @@
Upstream Author: The Sipwise Team - http://sipwise.com/
Copyright: Copyright (c) 2007-2010 Sipwise GmbH, Austria
Copyright: Copyright (c) 2007-2011 Sipwise GmbH, Austria
License: All software included in this package is
Copyright (c) Sipwise GmbH, Austria.
All rights reserved. You may not copy, distribute

@ -1,4 +1,4 @@
PACKAGE_NAME="mediaproxy-ng"
PACKAGE_NAME="ngcp-mediaproxy-ng"
PACKAGE_VERSION="__VERSION__"
MAKE[0]="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build"
CLEAN="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build clean"

@ -2,8 +2,8 @@
set -e
package=mediaproxy-ng-kernel-dkms
name=mediaproxy-ng
package=ngcp-mediaproxy-ng-kernel-dkms
name=ngcp-mediaproxy-ng
version=`dpkg-query -W -f='${Version}' "$package" \
|rev|cut -d- -f2-|rev|cut -d':' -f2|tr -d "\n"`

@ -2,8 +2,8 @@
set -e
package=mediaproxy-ng-kernel-dkms
name=mediaproxy-ng
package=ngcp-mediaproxy-ng-kernel-dkms
name=ngcp-mediaproxy-ng
version=`dpkg-query -W -f='${Version}' "$package" \
|rev|cut -d- -f2-|rev|cut -d':' -f2|tr -d "\n"`

@ -1 +1 @@
/usr/share/modass/packages/default.sh /usr/share/modass/overrides/mediaproxy-ng-kernel-source
/usr/share/modass/packages/default.sh /usr/share/modass/overrides/ngcp-mediaproxy-ng-kernel-source

88
debian/rules vendored

@ -7,9 +7,30 @@
# This special exception was added by Craig Small in version 0.37 of dh-make.
# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
# export DH_VERBOSE=1
b=$(CURDIR)/debian/build
b=$(CURDIR)/debian
## kernel package specific stuff
# Name of the source package
psource:=ngcp-mediaproxy-ng-kernel-source
# Name of the dkms package
pdkms:=ngcp-mediaproxy-ng-kernel-dkms
# short upstream name, used for module source directory
sname:=ngcp-mediaproxy-ng
# Source version
sversion:=$(shell dpkg-parsechangelog|grep "^Version:"|cut -d" " -f2|rev|cut -d- -f2-|rev|cut -d':' -f2)
PACKAGE=ngcp-mediaproxy-ng-kernel
MA_DIR ?= /usr/share/modass
-include $(MA_DIR)/include/generic.make
-include $(MA_DIR)/include/common-rules.make
kdist_configure: prep-deb-files
kdist_clean: clean
$(MAKE) $(MFLAGS) -f debian/rules clean
## end of kernel package specific stuff
build: build-stamp
@ -22,6 +43,7 @@ build-stamp:
clean:
dh_testdir
dh_testroot
cd daemon && $(MAKE) clean && cd ..
rm -f build-stamp
rm -f iptables-extension/libipt_MEDIAPROXY.so
rm -f daemon/mediaproxy-ng daemon/build_time.h daemon/.depend kernel-module/.ipt_MEDIAPROXY.o.d
@ -35,6 +57,62 @@ install: build
dh_clean -k
dh_installdirs
# Create the directories to install the source into
dh_installdirs -p$(psource) usr/src/modules/$(sname)/debian
dh_installdirs -p$(pdkms) usr/src/$(sname)-$(sversion)
# Copy only the driver source to the proper locations
cd kernel-module && cp Makefile *.c *.h ../debian/$(psource)/usr/src/modules/$(sname)
cd kernel-module && cp Makefile *.c *.h ../debian/$(pdkms)/usr/src/$(sname)-$(sversion)
# Copy the needed debian/ pieces to the proper location
cp debian/*.modules.in* debian/$(psource)/usr/src/modules/$(sname)/debian
cp debian/control debian/changelog debian/copyright debian/README.Debian \
debian/compat debian/$(psource)/usr/src/modules/$(sname)/debian/
install -m 0755 debian/rules.modules debian/$(psource)/usr/src/modules/$(sname)/debian/rules
cd debian/$(psource)/usr/src && tar c modules | bzip2 -9 > $(sname).tar.bz2 && rm -rf modules
# Prepare dkms.conf from the dkms.conf.in template
sed "s/__VERSION__/$(sversion)/g" debian/dkms.conf.in > debian/$(pdkms)/usr/src/$(sname)-$(sversion)/dkms.conf
dh_install
ngcp-mediaproxy-ng-kernel-source: install
@echo "--- Building: $@"
dh_installdirs -p$@ -P$(b)/$@
dh_link -p$@ -P$(b)/$@
dh_installdocs -p$@ -P$(b)/$@
dh_installchangelogs -p$@ -P$(b)/$@
dh_install -p$@ -P$(b)/$@
dh_strip -p$@ -P$(b)/$@
dh_compress -p$@ -P$(b)/$@
dh_fixperms -p$@ -P$(b)/$@
dh_makeshlibs -p$@ -P$(b)/$@ -V
dh_installdeb -p$@ -P$(b)/$@
dh_shlibdeps -p$@ -P$(b)/$@
dh_installdebconf -p$@ -P$(b)/$@
dh_gencontrol -p$@ -P$(b)/$@
dh_md5sums -p$@ -P$(b)/$@
dh_builddeb -p$@ -P$(b)/$@
ngcp-mediaproxy-ng-kernel-dkms: install
@echo "--- Building: $@"
dh_installdirs -p$@ -P$(b)/$@
dh_link -p$@ -P$(b)/$@
dh_installdocs -p$@ -P$(b)/$@
dh_installchangelogs -p$@ -P$(b)/$@
dh_install -p$@ -P$(b)/$@
dh_strip -p$@ -P$(b)/$@
dh_compress -p$@ -P$(b)/$@
dh_fixperms -p$@ -P$(b)/$@
dh_makeshlibs -p$@ -P$(b)/$@ -V
dh_installdeb -p$@ -P$(b)/$@
dh_shlibdeps -p$@ -P$(b)/$@
dh_installdebconf -p$@ -P$(b)/$@
dh_gencontrol -p$@ -P$(b)/$@
dh_md5sums -p$@ -P$(b)/$@
dh_builddeb -p$@ -P$(b)/$@
ngcp-mediaproxy-ng-daemon: install
@echo "--- Building: $@"
dh_installdirs -p$@ -P$(b)/$@
@ -93,7 +171,9 @@ ngcp-mediaproxy-ng: install
binary-all: build install
# Build architecture-independent files here.
binary-indep: build install ngcp-mediaproxy-ng-daemon ngcp-mediaproxy-ng-iptables ngcp-mediaproxy-ng
binary-indep: build install \
ngcp-mediaproxy-ng-daemon ngcp-mediaproxy-ng-iptables ngcp-mediaproxy-ng \
ngcp-mediaproxy-ng-kernel-dkms ngcp-mediaproxy-ng-kernel-source
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
.PHONY: build clean binary-indep binary-arch binary install kdist kdist_configure kdist_image kdist_clean

@ -12,17 +12,17 @@ else
endif
# Name of the source package
psource:=mediaproxy-ng-kernel-source
psource:=ngcp-mediaproxy-ng-kernel-source
# The short upstream name, used for the module source directory
sname:=mediaproxy-ng
sname:=ngcp-mediaproxy-ng
### KERNEL SETUP
### Setup the stuff needed for making kernel module packages
### taken from /usr/share/kernel-package/sample.module.rules
# prefix of the target package name
PACKAGE=mediaproxy-ng-kernel-modules
PACKAGE=ngcp-mediaproxy-ng-kernel-modules
# modifieable for experiments or debugging m-a
MA_DIR ?= /usr/share/modass
# load generic variable handling

@ -1,6 +0,0 @@
ngcp-mediaproxy-ng-kernel (0.0.1) unstable; urgency=low
* Initial release.
-- Andreas Granig <agranig@sipwise.com> Tue, 26 Apr 2011 20:45:24 +0200

@ -1,26 +0,0 @@
Source: ngcp-mediaproxy-ng-kernel
Section: kernel
Priority: optional
Maintainer: Richard Fuchs <rfuchs@sipwise.com>
Build-Depends: debhelper (>= 5), quilt (>= 0.40)
Build-Depends-Indep: bzip2
Standards-Version: 3.9.1
Homepage: http://sipwise.com/
Package: ngcp-mediaproxy-ng-kernel-source
Architecture: all
Depends: debhelper (>= 5), module-assistant, ${misc:Depends}
Description: IPtables kernel module for the NGCP media proxy - source.
Provides the kernel-space part of the NGCP media proxy for high-
performance packet forwarding.
This package contains the source to be built with module-assistant or
kernel-package.
Package: ngcp-mediaproxy-ng-kernel-dkms
Architecture: all
Depends: dkms (>= 1.95), ${misc:Depends}
Description: IPtables kernel module for the NGCP media proxy - DKMS.
Provides the kernel-space part of the NGCP media proxy for high-
performance packet forwarding.
This package contains the source to be built with dkms.

@ -1,8 +0,0 @@
Upstream Author: The Sipwise Team - http://sipwise.com/
Copyright: Copyright (c) 2007-2011 Sipwise GmbH, Austria
License: All software included in this package is
Copyright (c) Sipwise GmbH, Austria.
All rights reserved. You may not copy, distribute
or modify without prior written permission from
Sipwise GmbH, Austria.

@ -1,3 +0,0 @@
[DEFAULT]
pristine-tar = True
builder=debuild -i\.git -I.git

@ -1,104 +0,0 @@
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# include /usr/share/quilt/quilt.make
# Name of the source package
psource:=mediaproxy-ng-kernel-source
# Name of the dkms package
pdkms:=mediaproxy-ng-kernel-dkms
# The short upstream name, used for the module source directory
sname:=mediaproxy-ng
# Source version
sversion:=$(shell dpkg-parsechangelog|grep "^Version:"|cut -d" " -f2|rev|cut -d- -f2-|rev|cut -d':' -f2)
### KERNEL SETUP
### Setup the stuff needed for making kernel module packages
### taken from /usr/share/kernel-package/sample.module.rules
# prefix of the target package name
PACKAGE=mediaproxy-ng-kernel
# modifieable for experiments or debugging m-a
MA_DIR ?= /usr/share/modass
# load generic variable handling
-include $(MA_DIR)/include/generic.make
# load default rules, including kdist, kdist_image, ...
-include $(MA_DIR)/include/common-rules.make
# module assistant calculates all needed things for us and sets
# following variables:
# KSRC (kernel source directory), KVERS (kernel version string), KDREV
# (revision of the Debian kernel-image package), CC (the correct
# compiler), VERSION (the final package version string), PKGNAME (full
# package name with KVERS included), DEB_DESTDIR (path to store DEBs)
# The kdist_configure target is called by make-kpkg modules_config and
# by kdist* rules by dependency. It should configure the module so it is
# ready for compilation (mostly useful for calling configure).
# prep-deb-files from module-assistant creates the neccessary debian/ files
kdist_configure: prep-deb-files
# the kdist_clean target is called by make-kpkg modules_clean and from
# kdist* rules. It is responsible for cleaning up any changes that have
# been made by the other kdist_commands (except for the .deb files created)
kdist_clean: clean
$(MAKE) $(MFLAGS) -f debian/rules clean
#
### end KERNEL SETUP
build:
clean:
dh_testdir
dh_clean
install: DH_OPTIONS=
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
# Create the directories to install the source into
dh_installdirs -p$(psource) usr/src/modules/$(sname)/debian
dh_installdirs -p$(pdkms) usr/src/$(sname)-$(sversion)
# Copy only the driver source to the proper locations
cp -a Makefile *.c *.h debian/$(psource)/usr/src/modules/$(sname)
cp -a Makefile *.c *.h debian/$(pdkms)/usr/src/$(sname)-$(sversion)
# Copy the needed debian/ pieces to the proper location
cp debian/*.modules.in* debian/$(psource)/usr/src/modules/$(sname)/debian
cp debian/control debian/changelog debian/copyright debian/README.Debian \
debian/compat debian/$(psource)/usr/src/modules/$(sname)/debian/
install -m 0755 debian/rules.modules debian/$(psource)/usr/src/modules/$(sname)/debian/rules
cd debian/$(psource)/usr/src && tar c modules | bzip2 -9 > $(sname).tar.bz2 && rm -rf modules
# Prepare dkms.conf from the dkms.conf.in template
sed "s/__VERSION__/$(sversion)/g" debian/dkms.conf.in > debian/$(pdkms)/usr/src/$(sname)-$(sversion)/dkms.conf
dh_install
binary-arch: build install
binary-indep: build install
dh_testdir
dh_testroot
dh_installdocs
dh_installchangelogs
dh_install
dh_link
dh_compress
dh_fixperms
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install kdist kdist_configure kdist_image kdist_clean
Loading…
Cancel
Save