Skip to content

Commit

Permalink
Fix package depencies to handle php5 conditional packages
Browse files Browse the repository at this point in the history
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
  • Loading branch information
pepone committed Sep 7, 2017
1 parent 9b983dd commit 72d0d5f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
16 changes: 2 additions & 14 deletions ice/dpkg/control
Original file line number Diff line number Diff line change
Expand Up @@ -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}) <!nophp5>,
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.
Expand All @@ -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}) <!nophp5>
Depends: ${dist:AllDevDepends}
Replaces: libzeroc-ice-java (<=3.5.1)
Description: Ice development packages
Ice development packages.
Expand Down
28 changes: 20 additions & 8 deletions ice/dpkg/rules
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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
Expand All @@ -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 \
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 72d0d5f

Please sign in to comment.