aboutsummaryrefslogtreecommitdiff
path: root/packages
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
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')
-rw-r--r--packages/openwrt/Makefile92
-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
6 files changed, 119 insertions, 115 deletions
diff --git a/packages/openwrt/Makefile b/packages/openwrt/Makefile
index 5d56e18ad..3e12d45b0 100644
--- a/packages/openwrt/Makefile
+++ b/packages/openwrt/Makefile
@@ -1,57 +1,93 @@
#
-# Copyright (C) 2018-20 - ntop.org
+# Copyright (C) 2017 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=libndpi
-PKG_VERSION:=17022020
+PKG_VERSION:=3.4
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://github.com/ntop/nDPI.git
-PKG_SOURCE_VERSION:=1f921562d1d7962f1d23ca5b59c25f9b65073460
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_PROTO:=git
-
-PKG_MAINTAINER:=Luca Deri <deri@ntop.org>
-PKG_LICENSE:=GPL3
-PKG_BUILD_DEPENDS:=
-PKG_BUILD_PARALLEL:=1
+PKG_SOURCE_URL:=https://codeload.github.com/ntop/nDPI/tar.gz/$(PKG_VERSION)?
+PKG_HASH:=dc9b291c7fde94edb45fb0f222e0d93c93f8d6d37f4efba20ebd9c655bfcedf9
+PKG_BUILD_DIR:=$(BUILD_DIR)/nDPI-$(PKG_VERSION)
+
+PKG_MAINTAINER:=Banglang Huang <banglang.huang@foxmail.com>, Toni Uhlig <matzeton@googlemail.com>
+PKG_LICENSE:=LGPL-3.0-or-later
+PKG_LICENSE_FILES:=COPYING
-# autogen fix
PKG_FIXUP:=autoreconf
+PKG_REMOVE_FILES:=autogen.sh
+PKG_BUILD_DEPENDS:=libpcap
+PKG_BUILD_PARALLEL:=1
+include $(INCLUDE_DIR)/uclibc++.mk
include $(INCLUDE_DIR)/package.mk
+ifeq ($(CONFIG_LIBNDPI_GCRYPT),)
+CONFIGURE_ARGS += --disable-gcrypt
+endif
+
define Package/libndpi
- SECTION:=network
- CATEGORY:=Network
- TITLE:=nDPI Deep Packet Inspection Library
- URL:=https://www.ntop.org
+ SECTION:=libs
+ CATEGORY:=Libraries
+ TITLE:=Library for deep-packet inspection
+ URL:=https://github.com/ntop/nDPI
+ DEPENDS:=$(CXX_DEPENDS) +LIBNDPI_GCRYPT:libgcrypt +libpcap +libjson-c
endef
define Package/libndpi/description
- Open and Extensible GPLv3 Deep Packet Inspection Library
+ nDPI is an open source LGPLv3 library for deep-packet inspection.
+ Based on OpenDPI it includes ntop extensions.
endef
-CONFIGURE_ARGS += \
- --with-only-libndpi
+define Package/libndpi/config
+config LIBNDPI_GCRYPT
+ bool "GCrypt support"
+ depends on PACKAGE_libndpi
+ default n
+ help
+ This option enables QUIC client hello decryption.
+ Disabled by default.
+endef
define Build/Prepare
- $(call Build/Prepare/Default)
+ $(PKG_UNPACK)
+ $(Build/Patch)
+ mv $(PKG_BUILD_DIR)/configure.seed $(PKG_BUILD_DIR)/configure.ac
+ $(SED) "s/@NDPI_MAJOR@/3/g" \
+ -e "s/@NDPI_MINOR@/4/g" \
+ -e "s/@NDPI_PATCH@/0/g" \
+ -e "s/@NDPI_VERSION_SHORT@/3.4.0/g" \
+ -e "s/@FUZZY@/dnl> /g" \
+ $(PKG_BUILD_DIR)/configure.ac
endef
-define Build/Configure
- ( cd $(PKG_BUILD_DIR); ./autogen.sh )
- $(call Build/Configure/Default)
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)/usr/include/ndpi
+ $(CP) $(PKG_BUILD_DIR)/src/include/*.h \
+ $(1)/usr/include/ndpi/
+
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_BUILD_DIR)/src/lib/libndpi.so* \
+ $(1)/usr/lib/
+
+ $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+ $(CP) $(PKG_BUILD_DIR)/libndpi.pc \
+ $(1)/usr/lib/pkgconfig/
endef
-define Build/InstallDev
- $(INSTALL_DIR) $(STAGING_DIR)/usr/local/include/libndpi
- $(CP) $(PKG_BUILD_DIR)/src/include/* $(STAGING_DIR)/usr/local/include/libndpi
- $(INSTALL_DIR) $(STAGING_DIR)/usr/local/lib
- $(CP) $(PKG_BUILD_DIR)/src/lib/libndpi.* $(STAGING_DIR)/usr/local/lib
+define Package/libndpi/install
+ $(INSTALL_DIR) $(1)/usr/lib/
+ $(CP) $(PKG_BUILD_DIR)/src/lib/libndpi.so* \
+ $(1)/usr/lib/
+ $(INSTALL_DIR) $(1)/usr/bin/
+ $(CP) $(PKG_BUILD_DIR)/example/ndpiReader \
+ $(1)/usr/bin/
endef
$(eval $(call BuildPackage,libndpi))
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