diff options
author | Luca Deri <deri@ntop.org> | 2020-11-03 16:08:57 +0100 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2020-11-03 16:08:57 +0100 |
commit | fc58e564f0ff31049fcfa39b68657f3f91d637be (patch) | |
tree | e705b7cb10789b8a30af79842ead0e8b2fda970c | |
parent | 8e84abfa0e9beedaeebaa34e4b84eb7acb03bd68 (diff) |
Restored Ubuntu/Debian packaging
-rw-r--r-- | packages/ubuntu/Makefile.in | 31 | ||||
-rw-r--r-- | packages/ubuntu/README | 12 | ||||
-rwxr-xr-x | packages/ubuntu/debian/rules | 77 | ||||
-rw-r--r-- | src/lib/Makefile.in | 2 |
4 files changed, 75 insertions, 47 deletions
diff --git a/packages/ubuntu/Makefile.in b/packages/ubuntu/Makefile.in index 919f3827c..9878273b4 100644 --- a/packages/ubuntu/Makefile.in +++ b/packages/ubuntu/Makefile.in @@ -1,10 +1,35 @@ NDPI_HOME=$(PWD)/../.. NDPI_BUILD="$(realpath ${NDPI_HOME}/packages/ubuntu)" -all: clean ndpi - ndpi: - cd ${NDPI_HOME}; ./autogen.sh --prefix="/usr"; make + \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)/src/lib/libndpi.so.@NDPI_VERS@ ./debian/ndpi-tmp/usr/local/lib/ + cd ./debian/ndpi-tmp/usr/local/lib/; ln -s libndpi.so.@NDPI_VERS@ libndpi.so; cd - + cd ./debian/ndpi-tmp/usr/local/lib/; ln -s libndpi.so.@NDPI_VERS@ libndpi.so.@MAJOR_RELEASE@; cd - + 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 ./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 "-------------------------------" distclean: -cd ${NDPI_HOME} && make distclean diff --git a/packages/ubuntu/README b/packages/ubuntu/README deleted file mode 100644 index 9d08aca27..000000000 --- a/packages/ubuntu/README +++ /dev/null @@ -1,12 +0,0 @@ -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/debian/rules b/packages/ubuntu/debian/rules index 7d4e02758..a72ae122f 100755 --- a/packages/ubuntu/debian/rules +++ b/packages/ubuntu/debian/rules @@ -1,35 +1,50 @@ #!/usr/bin/make -f -export DEB_BUILD_MAINT_OPTIONS = hardening=+all +# Uncomment this to turn on verbose mode. export DH_VERBOSE=1 -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 +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 diff --git a/src/lib/Makefile.in b/src/lib/Makefile.in index 6c69485b3..e8e60ba90 100644 --- a/src/lib/Makefile.in +++ b/src/lib/Makefile.in @@ -15,7 +15,7 @@ libdir = ${prefix}/lib includedir = ${prefix}/include/ndpi CC = @CC@ CFLAGS += -fPIC -DPIC -I../include -Ithird_party/include -DNDPI_LIB_COMPILATION -Wall @CFLAGS@ @CUSTOM_NDPI@ -LDFLAGS = @LDFLAGS@ @ADDITIONAL_LIBS@ @LIBS@ +LDFLAGS = @LDFLAGS@ @ADDITIONAL_LIBS@ @LIBS@ -lm RANLIB = ranlib OBJECTS = $(patsubst protocols/%.c, protocols/%.o, $(wildcard protocols/*.c)) $(patsubst third_party/src/%.c, third_party/src/%.o, $(wildcard third_party/src/*.c)) $(patsubst ./%.c, ./%.o, $(wildcard ./*.c)) |