From 83e198260b41a7234ff79425c09020824a4a2ff4 Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 16 May 2018 21:24:19 +0200 Subject: [PATCH] switch to dh for debian packaging --- build_scripts/Debian/debian/rules | 66 ++---------------- build_scripts/Debian/makeSourcePackage.sh | 85 +++++++++++++---------- 2 files changed, 53 insertions(+), 98 deletions(-) diff --git a/build_scripts/Debian/debian/rules b/build_scripts/Debian/debian/rules index 67b3e334e..1068923eb 100755 --- a/build_scripts/Debian/debian/rules +++ b/build_scripts/Debian/debian/rules @@ -2,22 +2,22 @@ export DH_VERBOSE = 1 -GPKG_EXPORT_BUILDFLAGS = 1 +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/default.mk + export DEB_BUILD_MAINT_PTIONS = hardening=+all export QT_SELECT = qt5 -include /usr/share/dpkg/default.mk - -MY_BUILD_DIR = _build +MY_BUILDDIR = _build %: - dh $@ --buildsystem=qmake --builddirectory=$(MY_BUILD_DIR) + dh $@ --buildsystem=qmake --builddirectory=$(MY_BUILDDIR) # Override dh_auto_configure in order to call qmake on the parent dir. # We call mkdir here because of #800738. override_dh_auto_configure: @mkdir -p $(MY_BUILDDIR) - dh_auto_configure -- .. + dh_auto_configure -- ../src # Upstream ships with a 'history' directory containing ancient code. # We are not interested in installing this. @@ -25,57 +25,3 @@ override_dh_installchangelogs: dh_installchangelogs --exclude=history -# configure: configure-stamp -# configure-stamp: -# dh_testdir -# cd src && qmake "CONFIG-=debug" "CONFIG+=release" "CONFIG+=rs_autologin" "CONFIG+=retroshare_plugins" PREFIX=/usr LIB_DIR=/usr/lib RetroShare.pro -# touch $@ -# -# -# build: build-arch build-indep -# -# build-stamp: configure-stamp -# dh_testdir -# cd src && $(MAKE) -# touch $@ -# -# build-indep: build-stamp -# -# build-arch: build-stamp -# -# clean: -# dh_testdir -# dh_testroot -# rm -f configure-stamp build-stamp -# # Add here commands to clean up after the build process. -# [ ! -f src/Makefile ] || (cd src && $(MAKE) distclean) -# dh_prep -# dh_clean -# -# install: build -# dh_testdir -# dh_testroot -# dh_prep -# dh_clean -# cd src && $(MAKE) INSTALL_ROOT=$(CURDIR)/debian/tmp install -# -# # Build architecture-independent files here. -# binary-indep: build install -# -# # Build architecture-dependent files here. -# binary-arch: build install -# dh_testdir -# dh_testroot -# dh_install --list-missing -# dh_link -# dh_strip -# dh_compress -# dh_fixperms -# dh_installdeb -# dh_shlibdeps -# dh_gencontrol -# dh_md5sums -# dh_builddeb -# -# binary: binary-indep binary-arch -# .PHONY: build clean binary-indep binary-arch binary install configure diff --git a/build_scripts/Debian/makeSourcePackage.sh b/build_scripts/Debian/makeSourcePackage.sh index 2817cef07..c62914cf5 100755 --- a/build_scripts/Debian/makeSourcePackage.sh +++ b/build_scripts/Debian/makeSourcePackage.sh @@ -48,6 +48,10 @@ while [ ${#} -gt 0 ]; do gpgkey=${1} shift ;; + "-nodl") + nodl=yes + shift + ;; "-makeorig") makeorig=yes shift @@ -93,58 +97,63 @@ read tmp echo Extracting base archive... if ! test "${makeorig}" = "yes" ; then - if ! test -f retroshare_${version}.orig.tar.gz; then + if ! test -f retroshare_${version_number}.orig.tar.gz; then echo Error: no orig file found. Please call with -makeorig option first exit fi fi +if ! test "${nodl}" = "yes"; then + mkdir -p ${workdir}/src + echo Checking out latest snapshot... + cd ${workdir}/src + git clone --depth 1 ${gitpath} --single-branch --branch $branch . + + cd - -mkdir -p ${workdir}/src -echo Checking out latest snapshot... -cd ${workdir}/src -git clone --depth 1 ${gitpath} --single-branch --branch $branch . + if ! test -d ${workdir}/src/libretroshare/; then + echo Git clone failed. + exit + fi -cd - + cp -r debian ${workdir}/debian -if ! test -d ${workdir}/src/libretroshare/; then - echo Git clone failed. - exit + # VOIP tweak + cp ${workdir}/src/retroshare-gui/src/gui/chat/PopupChatDialog.ui ${workdir}/src/plugins/VOIP/gui/PopupChatDialog.ui + + # remove unised qml code, only needed on Android + rm -rf ${workdir}/src/retroshare-qml-app/ + rm -rf ${workdir}/src/build_scripts/ + rm ${workdir}/debian/*~ + + cd ${workdir} + echo Setting version numbers... + + # setup version numbers + sed -e "s%RS_REVISION_NUMBER.*%RS_REVISION_NUMBER 0x${hhsh}%" src/libretroshare/src/retroshare/rsversion.in > src/libretroshare/src/retroshare/rsversion.h + + # Various cleaning + echo Cleaning... + + \rm -rf src/.git + + if test "${makeorig}" = "yes" ; then + echo making orig archive + cd - + tar zcvf retroshare_${version_number}.orig.tar.gz ${workdir} + exit + fi + + cd - +else + tar zxvf retroshare_${version_number}.orig.tar.gz fi -cp -r debian ${workdir}/debian - -# VOIP tweak -cp ${workdir}/src/retroshare-gui/src/gui/chat/PopupChatDialog.ui ${workdir}/src/plugins/VOIP/gui/PopupChatDialog.ui - -# remove unised qml code, only needed on Android - -rm -rf ${workdir}/src/retroshare-qml-app/ -rm -rf ${workdir}/src/build_scripts/ -rm ${workdir}/debian/*~ - # Cloning sqlcipher # git clone https://github.com/sqlcipher/sqlcipher.git -cd ${workdir} -echo Setting version numbers... - -# setup version numbers -sed -e "s%RS_REVISION_NUMBER.*%RS_REVISION_NUMBER 0x${hhsh}%" src/libretroshare/src/retroshare/rsversion.in > src/libretroshare/src/retroshare/rsversion.h - -# Various cleaning -echo Cleaning... - -\rm -rf src/.git - -if test "${makeorig}" = "yes" ; then - echo making orig archive - cd - - tar zcvf retroshare_${version_number}.orig.tar.gz ${workdir} - exit -fi - echo Calling debuild... +cd ${workdir} debuild -S -k${gpgkey} --lintian-opts +pedantic -EviIL cd -