From 3927b4f73fe40a34bdc9dca9d3e66a14a7c10913 Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Fri, 12 Apr 2019 08:37:29 +0200 Subject: [PATCH] 1.25.12 packaging touchups --- packaging/debian/buildppa.sh | 13 ++-- packaging/debian/debian/rules-xenial | 60 ++++++++++++++++++ .../patches/kio_recoll-1.12-adapt.patch | 63 +++++++++++++++++++ packaging/debian/debiankio/patches/series | 1 + 4 files changed, 133 insertions(+), 4 deletions(-) create mode 100755 packaging/debian/debian/rules-xenial create mode 100644 packaging/debian/debiankio/patches/kio_recoll-1.12-adapt.patch diff --git a/packaging/debian/buildppa.sh b/packaging/debian/buildppa.sh index 2e99da9b..9fe98110 100644 --- a/packaging/debian/buildppa.sh +++ b/packaging/debian/buildppa.sh @@ -6,10 +6,10 @@ PPA_KEYID=D38B9201 -RCLVERS=1.25.11 +RCLVERS=1.25.12 SCOPEVERS=1.20.2.4 GSSPVERS=1.0.0 -PPAVERS=2 +PPAVERS=5 # RCLSRC=/y/home/dockes/projets/fulltext/recoll/src @@ -49,7 +49,7 @@ debdir=debian # No new releases for trusty either because of risk of kio compat (kio # wont build) series="xenial bionic cosmic disco" -#series= +series=xenial if test "X$series" != X ; then check_recoll_orig @@ -66,6 +66,11 @@ for series in $series ; do else cp -f -p $debdir/control recoll-${RCLVERS}/debian/control fi + if test -f $debdir/rules-$series ; then + cp -f -p $debdir/rules-$series recoll-${RCLVERS}/debian/rules + else + cp -f -p $debdir/rules recoll-${RCLVERS}/debian/rules + fi sed -e s/SERIES/${series}/g \ -e s/PPAVERS/${PPAVERS}/g \ @@ -81,7 +86,7 @@ done ### KIO. Does not build on trusty from recoll 1.23 because of the need ### for c++11 series="xenial bionic cosmic disco" -#series= +series= debdir=debiankio topdir=kio-recoll-${RCLVERS} diff --git a/packaging/debian/debian/rules-xenial b/packaging/debian/debian/rules-xenial new file mode 100755 index 00000000..cf9d22d3 --- /dev/null +++ b/packaging/debian/debian/rules-xenial @@ -0,0 +1,60 @@ +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# On XENIAL turning this on set -pie on the python module build (dh +# bug?), which fails +### export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/buildflags.mk + +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + +build3vers := $(shell py3versions -sv) + +#build qt5 UI +export QT_SELECT := qt5 + +ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) + NJOBS := -j $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) +endif + +# main packaging script based on dh7 syntax +%: + dh $@ --parallel --with python2 --with python3 --with autotools-dev + +override_dh_auto_configure: + dh_auto_configure -- --enable-recollq --enable-xadump + +build3vers := $(shell py3versions -sv) + +override_dh_auto_install: + dh_auto_install + (cd python/recoll; libdir=/usr/lib/$${DEB_BUILD_MULTIARCH} python \ + ./setup.py install \ + --install-layout=deb \ + --prefix=/usr \ + --root=$(CURDIR)/debian/tmp/usr ) + set -e && for i in $(build3vers); do \ + (cd python/recoll; libdir=/usr/lib/$${DEB_BUILD_MULTIARCH} python$$i \ + ./setup.py install \ + --install-layout=deb \ + --prefix=/usr \ + --root=$(CURDIR)/debian/tmp/ ) ; \ + done + (cd python/pychm; python ./setup.py install \ + --install-layout=deb \ + --prefix=/usr \ + --root=$(CURDIR)/debian/tmp/ ) + set -e && for i in $(build3vers); do \ + (cd python/pychm; python$$i ./setup.py install \ + --install-layout=deb \ + --prefix=/usr \ + --root=$(CURDIR)/debian/tmp/ ) ; \ + done + find $(CURDIR) -type f -name '*.la' -exec rm -f '{}' \; + find $(CURDIR) -type f -name '*.pyc' -exec rm -f '{}' \; + rm -rf $(CURDIR)/debian/tmp/usr/lib/python*/*/*/__pycache__ diff --git a/packaging/debian/debiankio/patches/kio_recoll-1.12-adapt.patch b/packaging/debian/debiankio/patches/kio_recoll-1.12-adapt.patch new file mode 100644 index 00000000..155707a0 --- /dev/null +++ b/packaging/debian/debiankio/patches/kio_recoll-1.12-adapt.patch @@ -0,0 +1,63 @@ +diff --git a/src/kde/kioslave/kio_recoll/kio_recoll.cpp b/src/kde/kioslave/kio_recoll/kio_recoll.cpp +index 51284c23..afc74ac2 100644 +--- a/kde/kioslave/kio_recoll/kio_recoll.cpp ++++ b/kde/kioslave/kio_recoll/kio_recoll.cpp +@@ -48,8 +48,7 @@ using namespace std; + RclConfig *RecollProtocol::o_rclconfig; + + RecollProtocol::RecollProtocol(const QByteArray& pool, const QByteArray& app) +- : SlaveBase("recoll", pool, app), m_initok(false), m_rcldb(0), +- m_alwaysdir(false) ++ : SlaveBase("recoll", pool, app), m_initok(false), m_alwaysdir(false) + { + qDebug() << "RecollProtocol::RecollProtocol()"; + if (o_rclconfig == 0) { +@@ -68,7 +67,7 @@ RecollProtocol::RecollProtocol(const QByteArray& pool, const QByteArray& app) + } + rwSettings(false); + +- m_rcldb = new Rcl::Db(o_rclconfig); ++ m_rcldb = std::shared_ptr(new Rcl::Db(o_rclconfig)); + if (!m_rcldb) { + m_reason = "Could not build database object. (out of memory ?)"; + return; +@@ -100,7 +99,6 @@ RecollProtocol::RecollProtocol(const QByteArray& pool, const QByteArray& app) + RecollProtocol::~RecollProtocol() + { + qDebug() << "RecollProtocol::~RecollProtocol()"; +- delete m_rcldb; + } + + bool RecollProtocol::maybeOpenDb(string& reason) +@@ -337,7 +335,7 @@ bool RecollProtocol::doSearch(const QueryDesc& qd) + } + + std::shared_ptr sdata(sd); +- std::shared_ptrquery(new Rcl::Query(m_rcldb)); ++ std::shared_ptrquery(new Rcl::Query(m_rcldb.get())); + query->setCollapseDuplicates(prefs.collapseDuplicates); + if (!query->setQuery(sdata)) { + m_reason = "Query execute failed. Invalid query or syntax error?"; +@@ -346,7 +344,8 @@ bool RecollProtocol::doSearch(const QueryDesc& qd) + } + + DocSequenceDb *src = +- new DocSequenceDb(std::shared_ptr(query), "Query results", sdata); ++ new DocSequenceDb(m_rcldb, std::shared_ptr(query), ++ "Query results", sdata); + if (src == 0) { + error(KIO::ERR_SLAVE_DEFINED, u8s2qs("Can't build result sequence")); + return false; +diff --git a/src/kde/kioslave/kio_recoll/kio_recoll.h b/src/kde/kioslave/kio_recoll/kio_recoll.h +index 628bbe71..441def11 100644 +--- a/kde/kioslave/kio_recoll/kio_recoll.h ++++ b/kde/kioslave/kio_recoll/kio_recoll.h +@@ -177,7 +177,7 @@ private: + bool isRecollResult(const QUrl& url, int *num, QString* q); + + bool m_initok; +- Rcl::Db *m_rcldb; ++ std::shared_ptr m_rcldb; + std::string m_reason; + bool m_alwaysdir; + // english by default else env[RECOLL_KIO_STEMLANG] diff --git a/packaging/debian/debiankio/patches/series b/packaging/debian/debiankio/patches/series index e69de29b..978cb7ce 100644 --- a/packaging/debian/debiankio/patches/series +++ b/packaging/debian/debiankio/patches/series @@ -0,0 +1 @@ +kio_recoll-1.12-adapt.patch