From 72d0d5fcdd9c2dab9893169b0a8b8303f5ce3bea Mon Sep 17 00:00:00 2001 From: Jose Date: Thu, 7 Sep 2017 19:46:07 +0000 Subject: [PATCH] Fix package depencies to handle php5 conditional packages Build profiles do not work with Depends, instead to handle conditional dependencies we generate a custom variable in rules that is used in the control file --- ice/dpkg/control | 16 ++-------------- ice/dpkg/rules | 28 ++++++++++++++++++++-------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/ice/dpkg/control b/ice/dpkg/control index c04a1db..cab6ec0 100644 --- a/ice/dpkg/control +++ b/ice/dpkg/control @@ -20,17 +20,7 @@ Homepage: https://zeroc.com Package: zeroc-ice-all-runtime Architecture: all Section: web -Depends: zeroc-ice-slice (=${binary:Version}), - libzeroc-ice3.6 (=${binary:Version}), - libzeroc-freeze3.6 (=${binary:Version}), - php5-zeroc-ice (=${binary:Version}) , - zeroc-glacier2 (=${binary:Version}), - zeroc-icebox (=${binary:Version}), - zeroc-icegrid (=${binary:Version}), - libzeroc-icestorm3.6 (=${binary:Version}), - zeroc-icepatch2 (=${binary:Version}), - zeroc-ice-utils (=${binary:Version}), - zeroc-ice-utils-java (=${binary:Version}) +Depends: ${dist:AllRuntimeDepends} Description: Ice (Internet Communications Engine) Ice is a comprehensive RPC framework that helps you build distributed applications with minimal effort using familiar object-oriented idioms. @@ -44,9 +34,7 @@ Description: Ice (Internet Communications Engine) Package: zeroc-ice-all-dev Architecture: all Section: devel -Depends: libzeroc-ice-dev (=${binary:Version}), - libzeroc-ice-java (=${binary:Version}), - php5-zeroc-ice-dev (=${binary:Version}) +Depends: ${dist:AllDevDepends} Replaces: libzeroc-ice-java (<=3.5.1) Description: Ice development packages Ice development packages. diff --git a/ice/dpkg/rules b/ice/dpkg/rules index 28006e1..eb7e3ac 100755 --- a/ice/dpkg/rules +++ b/ice/dpkg/rules @@ -12,9 +12,7 @@ export CLASSPATH=/usr/share/java/proguard.jar export GRADLE_HOME=$(HOME)/.gradle export GRADLE = ./gradlew -g $(GRADLE_HOME) -PACKAGE_NAMES = zeroc-ice-all-runtime \ - zeroc-ice-all-dev \ - zeroc-ice-slice \ +RUNTIME_PACKAGE_NAMES = zeroc-ice-slice \ libzeroc-ice3.6 \ libzeroc-freeze3.6 \ zeroc-glacier2 \ @@ -23,8 +21,9 @@ PACKAGE_NAMES = zeroc-ice-all-runtime \ libzeroc-icestorm3.6 \ zeroc-icepatch2 \ zeroc-ice-utils \ - zeroc-ice-utils-java \ - libzeroc-ice-dev \ + zeroc-ice-utils-java + +DEV_PACKAGE_NAMES = libzeroc-ice-dev \ libzeroc-ice-java CPP11_DESTDIR = $(CURDIR)/debian/tmp-cpp11 @@ -41,7 +40,8 @@ CPP11_LIB_NAMES = libFreeze \ libIceStormService \ libIceUtil -VERSION = 3.6.4 +DEB_VERSION := $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ') +VERSION := $(shell echo $(DEB_VERSION) | sed 's/-.*//g') ARTIFACT_NAMES = freeze \ glacier2 \ @@ -75,16 +75,28 @@ endif DHARGS = --parallel --with javahelper --with systemd - # # Check if nophp5 build profile is active # ifeq (,$(filter nophp5,$(DEB_BUILD_PROFILES))) PHP5=yes DHARGS += --with php5 - PACKAGE_NAMES += php5-zeroc-ice php5-zeroc-ice-dev + RUNTIME_PACKAGE_NAMES += php5-zeroc-ice + DEV_PACKAGE_NAMES += php5-zeroc-ice-dev endif +PACKAGE_NAMES = zeroc-ice-all-runtime \ + zeroc-ice-all-dev \ + $(RUNTIME_PACKAGE_NAMES) \ + $(DEV_PACKAGE_NAMES) + +space := $(null) # +comma := , +dep-dependencies = $(subst $(space), (=$(DEB_VERSION))$(comma) ,$(strip $1)) (=$(DEB_VERSION)) + +override_dh_gencontrol: + dh_gencontrol -- -Vdist:AllRuntimeDepends="$(call dep-dependencies,$(RUNTIME_PACKAGE_NAMES))" \ + -Vdist:AllDevDepends="$(call dep-dependencies,$(DEV_PACKAGE_NAMES))" prefix = /usr MAKEOPTS = prefix=$(prefix) OPTIMIZE=$(OPTIMIZE)