diff options
author | Alfredo Cardigliano <alfredo.cardigliano@gmail.com> | 2018-11-19 11:16:28 +0100 |
---|---|---|
committer | Alfredo Cardigliano <alfredo.cardigliano@gmail.com> | 2018-11-19 11:16:28 +0100 |
commit | 219951760f35c3defc2d413af667ad155c5faf68 (patch) | |
tree | e81992d66a7ad417f22dd9ee8bef31f1914cd04f /packages | |
parent | 0ee451040d57610f1965ef2a78dd4a2e8f5b3442 (diff) |
ubuntu ndpi/ndpi-dev package (testing)
Diffstat (limited to 'packages')
l--------- | packages/debian | 1 | ||||
-rw-r--r-- | packages/ubuntu/Makefile | 42 | ||||
-rw-r--r-- | packages/ubuntu/Makefile.in | 24 | ||||
-rwxr-xr-x | packages/ubuntu/configure | 57 | ||||
-rw-r--r-- | packages/ubuntu/configure.in | 41 | ||||
-rw-r--r-- | packages/ubuntu/debian/README | 2 | ||||
-rw-r--r-- | packages/ubuntu/debian/changelog.in | 2 | ||||
-rw-r--r-- | packages/ubuntu/debian/compat | 2 | ||||
-rw-r--r-- | packages/ubuntu/debian/control.in | 10 | ||||
-rw-r--r-- | packages/ubuntu/debian/dirs | 1 | ||||
-rwxr-xr-x | packages/ubuntu/debian/postinst | 11 | ||||
-rw-r--r-- | packages/ubuntu/debian/postrm | 6 | ||||
-rw-r--r-- | packages/ubuntu/debian/preinst | 7 | ||||
-rwxr-xr-x | packages/ubuntu/debian/prerm | 6 | ||||
-rwxr-xr-x | packages/ubuntu/debian/rules | 23 |
15 files changed, 92 insertions, 143 deletions
diff --git a/packages/debian b/packages/debian new file mode 120000 index 000000000..7d13753d7 --- /dev/null +++ b/packages/debian @@ -0,0 +1 @@ +ubuntu
\ No newline at end of file diff --git a/packages/ubuntu/Makefile b/packages/ubuntu/Makefile deleted file mode 100644 index 5f1684155..000000000 --- a/packages/ubuntu/Makefile +++ /dev/null @@ -1,42 +0,0 @@ -# -# Change it according to your setup -# -NDPI_HOME=$(PWD)/../.. -NDPI_BUILD=${NDPI_HOME}/packages/ubuntu - -all: clean ndpi - -ndpi: - \rm -rf ./usr ./debian/tmp ./debian/ndpi-dev - mkdir -p ./usr/local ./debian/ndpi-dev - mkdir -p ./usr/local/ndpi/lib ./usr/local/ndpi/bin ./ndpi-dev/usr/local/include/ndpi/ - cd ${NDPI_HOME}; ./autogen.sh; ./configure; make - cp $(NDPI_HOME)/lib/libndpi.a $(NDPI_HOME)/lib/libndpi.so* ./usr/local/ndpi/lib/ - cp $(NDPI_HOME)/example/ndpiReader ./usr/local/ndpi/bin/ - cp $(NDPI_HOME)/src/include/*.h ndpi-dev/usr/local/include/ndpi/ - -rm -fr ndpi-dev/usr/local/include/nprobe/ndpi/.svn ndpi-dev/usr/local/include/ndpi/Makefile* ndpi-dev/usr/local/include/ndpi/ndpi_win32.h* ndpi-dev/usr/local/include/ndpi/include - -find ./usr/local/lib -name "*.la" -exec /bin/rm {} ';' - @echo - @find . -name "*~" -exec /bin/rm {} ';' - dpkg-buildpackage -rfakeroot -d -us -uc - dpkg-sig --sign builder -k 7921DF34 ../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*amd64.deb - @echo "-------------------------------" - @echo "-------------------------------" - -dpkg --contents ndpi*all.deb - @echo "-------------------------------" - -distclean: - echo "dummy distclean" - -install: - echo "dummy install" - -clean: - -rm -rf *~ *deb debian/tmp ./usr diff --git a/packages/ubuntu/Makefile.in b/packages/ubuntu/Makefile.in index 5f1684155..bff183ebf 100644 --- a/packages/ubuntu/Makefile.in +++ b/packages/ubuntu/Makefile.in @@ -7,17 +7,19 @@ NDPI_BUILD=${NDPI_HOME}/packages/ubuntu all: clean ndpi ndpi: - \rm -rf ./usr ./debian/tmp ./debian/ndpi-dev - mkdir -p ./usr/local ./debian/ndpi-dev - mkdir -p ./usr/local/ndpi/lib ./usr/local/ndpi/bin ./ndpi-dev/usr/local/include/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/local/lib ./debian/ndpi-tmp/usr/local/bin + mkdir -p ./debian/ndpi-dev-tmp/usr/local/lib ./debian/ndpi-dev-tmp/usr/local/include/ndpi cd ${NDPI_HOME}; ./autogen.sh; ./configure; make - cp $(NDPI_HOME)/lib/libndpi.a $(NDPI_HOME)/lib/libndpi.so* ./usr/local/ndpi/lib/ - cp $(NDPI_HOME)/example/ndpiReader ./usr/local/ndpi/bin/ - cp $(NDPI_HOME)/src/include/*.h ndpi-dev/usr/local/include/ndpi/ - -rm -fr ndpi-dev/usr/local/include/nprobe/ndpi/.svn ndpi-dev/usr/local/include/ndpi/Makefile* ndpi-dev/usr/local/include/ndpi/ndpi_win32.h* ndpi-dev/usr/local/include/ndpi/include - -find ./usr/local/lib -name "*.la" -exec /bin/rm {} ';' + cp $(NDPI_HOME)/src/lib/libndpi.so* ./debian/ndpi-tmp/usr/local/lib/ + cp $(NDPI_HOME)/src/lib/libndpi.a ./debian/ndpi-dev-tmp/usr/local/lib/ + cp $(NDPI_HOME)/example/ndpiReader ./debian/ndpi-tmp/usr/local/bin/ + cp $(NDPI_HOME)/src/include/*.h ./debian/ndpi-dev-tmp/usr/local/include/ndpi/ + -rm -fr ./debian/ndpi-dev-tmp/usr/local/include/ndpi/ndpi_win32.h* @echo - @find . -name "*~" -exec /bin/rm {} ';' + @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 7921DF34 ../ndpi*deb @\rm -f ../ndpi*dsc ../ndpi*.gz ../ndpi*changes @@ -26,7 +28,7 @@ ndpi: @echo "Package built." @/bin/ls ndpi*deb @echo "-------------------------------" - -dpkg --contents ndpi*amd64.deb + -dpkg --contents ndpi*@EXTN@.deb @echo "-------------------------------" @echo "-------------------------------" -dpkg --contents ndpi*all.deb @@ -39,4 +41,4 @@ install: echo "dummy install" clean: - -rm -rf *~ *deb debian/tmp ./usr + -rm -rf *~ *deb ./usr ./debian/ndpi ./debian/ndpi-dev ./debian/ndpi-tmp ./debian/ndpi-dev-tmp diff --git a/packages/ubuntu/configure b/packages/ubuntu/configure index 857a095ca..ab2436b40 100755 --- a/packages/ubuntu/configure +++ b/packages/ubuntu/configure @@ -583,13 +583,12 @@ PACKAGE_URL='' ac_subst_vars='LTLIBOBJS LIBOBJS -PFRING_SVN_RELEASE -SVN_RELEASE +GIT_COMMITS +GIT_RELEASE KERNEL DATE EXTN MACHINE -PFRING_VERS NDPI_VERS target_alias host_alias @@ -610,6 +609,7 @@ infodir docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -674,6 +674,7 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -926,6 +927,15 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1063,7 +1073,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1216,6 +1226,7 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1670,37 +1681,43 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -NDPI_VERS=`cat ../../config.h | grep -w VERSION | cut -d \" -f 2` -PFRING_VERS=`cat $HOME/PF_RING/kernel/linux/pf_ring.h | grep RING_VERSION | head -1 | cut -d '"' -f 2` -SVN_RELEASE=`svn info ../.. | grep "^Revision"|cut -d " " -f 2` -PFRING_SVN_RELEASE=`svn info $HOME/PF_RING | grep "^Revision"|cut -d " " -f 2` +DATE=`date -R` +KERNEL=`uname -r` MACHINE=`uname -m` +SHORT_MACHINE=`uname -m | cut -b1-3` +EXTN="" if test $MACHINE = "x86_64"; then - EXTN="amd64" + EXTN="amd64" else - EXTN="i386" + if test $SHORT_MACHINE = "aar"; then + EXTN="arm64" + else + if test $SHORT_MACHINE = "arm"; then + EXTN="armhf" + else + if test $SHORT_MACHINE = "mip"; then + EXTN="mips" + else + EXTN="i386" + fi + fi + fi fi -DATE=`date -R` -KERNEL=`uname -r` - - - - +NDPI_VERS=`cat ../../configure.ac|grep C_INIT|cut -c 21-|rev|cut -c 3-|rev` +GIT_RELEASE=`git rev-parse HEAD` +GIT_COMMITS=`git rev-list --all |wc -l | tr -d '[:space:]'` +ac_config_files="$ac_config_files Makefile debian/changelog debian/files debian/control" -ac_config_files="$ac_config_files Makefile" -ac_config_files="$ac_config_files debian/changelog" -ac_config_files="$ac_config_files debian/files" -ac_config_files="$ac_config_files debian/control" cat >confcache <<\_ACEOF diff --git a/packages/ubuntu/configure.in b/packages/ubuntu/configure.in index bf0608cf5..88a5788be 100644 --- a/packages/ubuntu/configure.in +++ b/packages/ubuntu/configure.in @@ -1,32 +1,41 @@ AC_INIT([Makefile.in], 1.0) -NDPI_VERS=`cat ../../config.h | grep -w VERSION | cut -d \" -f 2` -PFRING_VERS=`cat $HOME/PF_RING/kernel/linux/pf_ring.h | grep RING_VERSION | head -1 | cut -d '"' -f 2` -SVN_RELEASE=`svn info ../.. | grep "^Revision"|cut -d " " -f 2` -PFRING_SVN_RELEASE=`svn info $HOME/PF_RING | grep "^Revision"|cut -d " " -f 2` +DATE=`date -R` +KERNEL=`uname -r` MACHINE=`uname -m` +SHORT_MACHINE=`uname -m | cut -b1-3` +EXTN="" if test $MACHINE = "x86_64"; then - EXTN="amd64" + EXTN="amd64" else - EXTN="i386" + if test $SHORT_MACHINE = "aar"; then + EXTN="arm64" + else + if test $SHORT_MACHINE = "arm"; then + EXTN="armhf" + else + if test $SHORT_MACHINE = "mip"; then + EXTN="mips" + else + EXTN="i386" + fi + fi + fi fi -DATE=`date -R` -KERNEL=`uname -r` +NDPI_VERS=`cat ../../configure.ac|grep C_INIT|cut -c 21-|rev|cut -c 3-|rev` +GIT_RELEASE=`git rev-parse HEAD` +GIT_COMMITS=`git rev-list --all |wc -l | tr -d '[[:space:]]'` + +AC_CONFIG_FILES([Makefile debian/changelog debian/files debian/control]) AC_SUBST(NDPI_VERS) -AC_SUBST(PFRING_VERS) AC_SUBST(MACHINE) AC_SUBST(EXTN) AC_SUBST(DATE) AC_SUBST(KERNEL) -AC_SUBST(SVN_RELEASE) -AC_SUBST(PFRING_SVN_RELEASE) - -AC_CONFIG_FILES(Makefile) -AC_CONFIG_FILES(debian/changelog) -AC_CONFIG_FILES(debian/files) -AC_CONFIG_FILES(debian/control) +AC_SUBST(GIT_RELEASE) +AC_SUBST(GIT_COMMITS) AC_OUTPUT diff --git a/packages/ubuntu/debian/README b/packages/ubuntu/debian/README index 6563a5d36..ccecea75a 100644 --- a/packages/ubuntu/debian/README +++ b/packages/ubuntu/debian/README @@ -1,2 +1,2 @@ This directory contains the files needed to build the package -named 'nprobe' for the Debian GNU/Linux distribution. +named 'ndpi' for the Debian GNU/Linux distribution. diff --git a/packages/ubuntu/debian/changelog.in b/packages/ubuntu/debian/changelog.in index 15d86b02d..a5ed21450 100644 --- a/packages/ubuntu/debian/changelog.in +++ b/packages/ubuntu/debian/changelog.in @@ -1,4 +1,4 @@ -ndpi (@NDPI_VERS@-@SVN_RELEASE@) stable; urgency=high +ndpi (@NDPI_VERS@-@GIT_COMMITS@) stable; urgency=high * Last packaged version -- Luca Deri <deri@ntop.org> @DATE@ diff --git a/packages/ubuntu/debian/compat b/packages/ubuntu/debian/compat index d00491fd7..ec635144f 100644 --- a/packages/ubuntu/debian/compat +++ b/packages/ubuntu/debian/compat @@ -1 +1 @@ -1 +9 diff --git a/packages/ubuntu/debian/control.in b/packages/ubuntu/debian/control.in index 56191e2eb..f55c82979 100644 --- a/packages/ubuntu/debian/control.in +++ b/packages/ubuntu/debian/control.in @@ -2,27 +2,25 @@ Source: ndpi Section: free Priority: optional Maintainer: Luca Deri <deri@ntop.org> -Standards-Version: @NDPI_VERSION@ +Standards-Version: @NDPI_VERS@ Build-Depends: Build-Conflicts: Package: ndpi Architecture: @EXTN@ -Depends: pfring (=@PFRING_VERS@-@PFRING_SVN_RELEASE@), libnuma +Depends: libnuma Recommends: Suggests: Pre-Depends: Conflicts: Provides: Replaces: -Description: A network probe. +Description: A L7 DPI library. Package: ndpi-dev Section: libdevel Architecture: all Depends: ndpi (= ${binary:Version}), ${misc:Depends} Conflicts: -Description: development library and header files for ndpi - Headers, static libraries, and documentation for the ndpi library - +Description: Development library and header files for ndpi diff --git a/packages/ubuntu/debian/dirs b/packages/ubuntu/debian/dirs index c648ad7d0..e69de29bb 100644 --- a/packages/ubuntu/debian/dirs +++ b/packages/ubuntu/debian/dirs @@ -1 +0,0 @@ -usr/local/ndpi diff --git a/packages/ubuntu/debian/postinst b/packages/ubuntu/debian/postinst index 65bf04230..202f79aa8 100755 --- a/packages/ubuntu/debian/postinst +++ b/packages/ubuntu/debian/postinst @@ -17,18 +17,7 @@ esac umask 022 -# Update shared libs -echo "/usr/local/lib\n" > /etc/ld.so.conf.d/nprobe.conf echo "Rebuilding ld cache..." /sbin/ldconfig -echo "Adding the nprobe startup script" -update-rc.d nprobe defaults 93 >/dev/null - -echo "Making the /etc/nprobe directory..." -mkdir -p /etc/nprobe/ - -echo "Making the /var/log/nprobe directory..." -mkdir -p /var/log/nprobe - exit 0 diff --git a/packages/ubuntu/debian/postrm b/packages/ubuntu/debian/postrm index 8ea16af2d..3347514a1 100644 --- a/packages/ubuntu/debian/postrm +++ b/packages/ubuntu/debian/postrm @@ -2,12 +2,6 @@ set -e -#\/bin/rm /etc/ld.so.conf.d/nprobe.conf /sbin/ldconfig -# Not needed: upstart does it -if [ "$1" = "purge" ] ; then - update-rc.d nprobe remove >/dev/null -fi - exit 0 diff --git a/packages/ubuntu/debian/preinst b/packages/ubuntu/debian/preinst index cf9323e94..89699e385 100644 --- a/packages/ubuntu/debian/preinst +++ b/packages/ubuntu/debian/preinst @@ -1,5 +1,5 @@ #! /bin/sh -# preinst script for nbox +# preinst script # # see: dh_installdeb(1) @@ -13,9 +13,6 @@ set -e case "$1" in install|upgrade) - if test -f /usr/local/sbin/nprobe; then - rm /usr/local/sbin/nprobe - fi ;; abort-upgrade) @@ -30,6 +27,4 @@ esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. - - exit 0 diff --git a/packages/ubuntu/debian/prerm b/packages/ubuntu/debian/prerm index 58af3b74c..8f91692e0 100755 --- a/packages/ubuntu/debian/prerm +++ b/packages/ubuntu/debian/prerm @@ -1,14 +1,10 @@ #!/bin/sh -e -# Only shut the daemon down if we're really removing the package. If this is -# an upgrade, we will instead do a restart in the postinst... this keeps nprobe -# from being left shut down for a long time, which could pose problems. case "$1" in upgrade) ;; *) - /etc/init.d/nprobe stop ;; esac -exit 0
\ No newline at end of file +exit 0 diff --git a/packages/ubuntu/debian/rules b/packages/ubuntu/debian/rules index a5fbcda09..a72ae122f 100755 --- a/packages/ubuntu/debian/rules +++ b/packages/ubuntu/debian/rules @@ -1,16 +1,7 @@ #!/usr/bin/make -f # Uncomment this to turn on verbose mode. -# export DH_VERBOSE=1 - -# -# debian/compat -# We should use at least compatibility version 5 -# but this requires the whole building process -# to be remade and this is something we leave -# to when we will have more time -# http://www.tin.org/bin/man.cgi?section=7&topic=debhelper -# +export DH_VERBOSE=1 package=ndpi @@ -37,20 +28,20 @@ binary-indep: build install binary-arch: build install dh_testdir dh_testroot - dh_clean -k + dh_prep + #dh_clean -k dh_installdirs dh_installinit dh_installman -# install the files into debian/tmp. - cp -r ./usr/ ./debian/tmp - cp -r ./ndpi-dev/* ./debian/ndpi-dev/ - -find ./debian/tmp -name .svn -exec /bin/rm -rf {} ';' - -find ./debian/tmp -executable -type f |xargs strip 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 |