aboutsummaryrefslogtreecommitdiff
path: root/packages/ubuntu
diff options
context:
space:
mode:
authorToni <matzeton@googlemail.com>2020-11-03 11:36:40 +0100
committerGitHub <noreply@github.com>2020-11-03 11:36:40 +0100
commit8e84abfa0e9beedaeebaa34e4b84eb7acb03bd68 (patch)
treec858a2aadeaaf536671376f0c900e5a1f47b9101 /packages/ubuntu
parenta9547da138871ff019aaa51092544d9ca005dffd (diff)
Fix/packaging (#1047)
* Fix OpenWrt build. Signed-off-by: Toni Uhlig <matzeton@googlemail.com> * Fixed Debian/Ubuntu packaging. Signed-off-by: Toni Uhlig <matzeton@googlemail.com> * Added DPKG package build to a CI job. Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'packages/ubuntu')
-rw-r--r--packages/ubuntu/Makefile.in41
-rw-r--r--packages/ubuntu/README12
-rwxr-xr-xpackages/ubuntu/configure6
-rw-r--r--packages/ubuntu/configure.in6
-rwxr-xr-xpackages/ubuntu/debian/rules77
5 files changed, 55 insertions, 87 deletions
diff --git a/packages/ubuntu/Makefile.in b/packages/ubuntu/Makefile.in
index 0e131e52b..919f3827c 100644
--- a/packages/ubuntu/Makefile.in
+++ b/packages/ubuntu/Makefile.in
@@ -1,46 +1,17 @@
-#
-# Change it according to your setup
-#
NDPI_HOME=$(PWD)/../..
-NDPI_BUILD=${NDPI_HOME}/packages/ubuntu
+NDPI_BUILD="$(realpath ${NDPI_HOME}/packages/ubuntu)"
all: clean ndpi
ndpi:
- \rm -rf ./debian/ndpi-tmp ./debian/ndpi-dev-tmp ./debian/ndpi ./debian/ndpi-dev
- mkdir -p ./debian/ndpi-tmp ./debian/ndpi-dev-tmp
- mkdir -p ./debian/ndpi-tmp/usr/lib ./debian/ndpi-tmp/usr/bin
- mkdir -p ./debian/ndpi-dev-tmp/usr/lib ./debian/ndpi-dev-tmp/usr/include/ndpi
- cd ${NDPI_HOME}; ./autogen.sh; ./configure; make
- cp $(NDPI_HOME)/src/lib/libndpi.so.@NDPI_VERS@ ./debian/ndpi-tmp/usr/lib/
- cd ./debian/ndpi-tmp/usr/lib/; ln -s libndpi.so.@NDPI_VERS@ libndpi.so; cd -
- cd ./debian/ndpi-tmp/usr/lib/; ln -s libndpi.so.@NDPI_VERS@ libndpi.so.@MAJOR_RELEASE@; cd -
- cp $(NDPI_HOME)/src/lib/libndpi.a ./debian/ndpi-dev-tmp/usr/lib/
- cp $(NDPI_HOME)/example/ndpiReader ./debian/ndpi-tmp/usr/bin/
- cp $(NDPI_HOME)/src/include/*.h ./debian/ndpi-dev-tmp/usr/include/ndpi/
- -rm -fr ./debian/ndpi-dev-tmp/usr/include/ndpi/ndpi_win32.h*
- @echo
- @find ./debian/ndpi-tmp -name "*~" -exec /bin/rm {} ';'
- @find ./debian/ndpi-dev-tmp -name "*~" -exec /bin/rm {} ';'
- dpkg-buildpackage -rfakeroot -d -us -uc
- dpkg-sig --sign builder -k D1EB60BE ../ndpi*deb
- @\rm -f ../ndpi*dsc ../ndpi*.gz ../ndpi*changes
- @/bin/mv ../ndpi*deb .
- @echo
- @echo "Package built."
- @/bin/ls ndpi*deb
- @echo "-------------------------------"
- -dpkg --contents ndpi_*.deb
- @echo "-------------------------------"
- @echo "-------------------------------"
- -dpkg --contents ndpi-dev_*.deb
- @echo "-------------------------------"
+ cd ${NDPI_HOME}; ./autogen.sh --prefix="/usr"; make
distclean:
- echo "dummy distclean"
+ -cd ${NDPI_HOME} && make distclean
install:
- echo "dummy install"
+ cd ${NDPI_HOME}; make install DESTDIR="${NDPI_BUILD}/debian/tmp" AM_UPDATE_INFO_DIR=no
clean:
- -rm -rf *~ *deb ./usr ./debian/ndpi ./debian/ndpi-dev ./debian/ndpi-tmp ./debian/ndpi-dev-tmp
+ -cd ${NDPI_HOME} && make clean
+ -rm -rf *~ *deb ./usr ./debian/ndpi ./debian/ndpi-dev ./debian/ndpi ./debian/ndpi-dev
diff --git a/packages/ubuntu/README b/packages/ubuntu/README
new file mode 100644
index 000000000..9d08aca27
--- /dev/null
+++ b/packages/ubuntu/README
@@ -0,0 +1,12 @@
+Howto Build Debian packages
+---------------------------
+
+Initial configuration and debian/changelog generation:
+./configure
+
+Build a binary (GPG signed) nDPI package with:
+dpkg-buildpackage -b
+
+Or build a binary (unsigned) nDPI package with:
+dpkg-buildpackage -b -us -uc
+
diff --git a/packages/ubuntu/configure b/packages/ubuntu/configure
index c67f37e88..dc69d1dcb 100755
--- a/packages/ubuntu/configure
+++ b/packages/ubuntu/configure
@@ -1705,9 +1705,9 @@ else
fi
fi
-NDPI_VERS=`../version.sh --release`
-MAJOR_RELEASE=`../version.sh --major-release`
-GIT_REVISION=`../version.sh --revision`
+NDPI_VERS=`$(dirname "${0}")/../version.sh --release`
+MAJOR_RELEASE=`$(dirname "${0}")/../version.sh --major-release`
+GIT_REVISION=`$(dirname "${0}")/../version.sh --revision`
ac_config_files="$ac_config_files Makefile debian/changelog debian/files debian/control"
diff --git a/packages/ubuntu/configure.in b/packages/ubuntu/configure.in
index a6f490308..3b9d59c9a 100644
--- a/packages/ubuntu/configure.in
+++ b/packages/ubuntu/configure.in
@@ -24,9 +24,9 @@ else
fi
fi
-NDPI_VERS=`../version.sh --release`
-MAJOR_RELEASE=`../version.sh --major-release`
-GIT_REVISION=`../version.sh --revision`
+NDPI_VERS=`$(dirname "${0}")/../version.sh --release`
+MAJOR_RELEASE=`$(dirname "${0}")/../version.sh --major-release`
+GIT_REVISION=`$(dirname "${0}")/../version.sh --revision`
AC_CONFIG_FILES([Makefile debian/changelog debian/files debian/control])
diff --git a/packages/ubuntu/debian/rules b/packages/ubuntu/debian/rules
index a72ae122f..7d4e02758 100755
--- a/packages/ubuntu/debian/rules
+++ b/packages/ubuntu/debian/rules
@@ -1,50 +1,35 @@
#!/usr/bin/make -f
-# Uncomment this to turn on verbose mode.
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DH_VERBOSE=1
-package=ndpi
-
-build: build-stamp
-build-stamp:
- dh_testdir
-
-clean:
- dh_testdir
- dh_testroot
- dh_clean
-
-install: build
- dh_testdir
- dh_testroot
- dh_clean -k
- dh_installdirs
-
-# Build architecture-independent files here.
-binary-indep: build install
-# We have nothing to do by default.
-
-# Build architecture-dependent files here.
-binary-arch: build install
- dh_testdir
- dh_testroot
- dh_prep
- #dh_clean -k
- dh_installdirs
- dh_installinit
- dh_installman
- dh_link
- dh_strip
- dh_compress
- dh_fixperms
- dh_installdeb
- mkdir -p ./debian/ndpi ./debian/ndpi-dev
- cp -r ./debian/ndpi-tmp/* ./debian/ndpi/
- cp -r ./debian/ndpi-dev-tmp/* ./debian/ndpi-dev/
- -find ./debian/ndpi -executable -type f | xargs strip
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install
+DPKG_EXPORT_BUILDFLAGS = 1
+
+include /usr/share/dpkg/buildflags.mk
+include /usr/share/dpkg/pkg-info.mk
+
+
+%:
+ dh $@
+
+override_dh_auto_test:
+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
+ cd ../../tests && LD_LIBRARY_PATH=$(CURDIR)/src/lib ./do.sh
+ cd ../../tests && LD_LIBRARY_PATH=$(CURDIR)/src/lib ./do-unit.sh
+endif
+
+override_dh_installdocs:
+ # FIXME: nDPI does currently not have any up2date doc
+
+override_dh_auto_install:
+ make -j1 install DESTDIR="$(CURDIR)/debian/tmp" AM_UPDATE_INFO_DIR=no
+ # ndpi package
+ mkdir -p "$(CURDIR)/debian/ndpi/usr/"
+ mv -v "$(CURDIR)/debian/tmp/usr/bin" "$(CURDIR)/debian/ndpi/usr/"
+ mv -v "$(CURDIR)/debian/tmp/usr/lib" "$(CURDIR)/debian/ndpi/usr/"
+ mv -v "$(CURDIR)/debian/tmp/usr/share" "$(CURDIR)/debian/ndpi/usr/"
+ # ndpi-dev package
+ mkdir -p "$(CURDIR)/debian/ndpi-dev/usr/include"
+ mv -v "$(CURDIR)/debian/tmp/usr/include/ndpi" "$(CURDIR)/debian/ndpi-dev/usr/include/"
+
+.PHONY: override_dh_auto_configure override_dh_installdocs override_dh_auto_install