Skip to content

Commit 72d0d5f

Browse files
committed
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
1 parent 9b983dd commit 72d0d5f

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

ice/dpkg/control

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,7 @@ Homepage: https://zeroc.com
2020
Package: zeroc-ice-all-runtime
2121
Architecture: all
2222
Section: web
23-
Depends: zeroc-ice-slice (=${binary:Version}),
24-
libzeroc-ice3.6 (=${binary:Version}),
25-
libzeroc-freeze3.6 (=${binary:Version}),
26-
php5-zeroc-ice (=${binary:Version}) <!nophp5>,
27-
zeroc-glacier2 (=${binary:Version}),
28-
zeroc-icebox (=${binary:Version}),
29-
zeroc-icegrid (=${binary:Version}),
30-
libzeroc-icestorm3.6 (=${binary:Version}),
31-
zeroc-icepatch2 (=${binary:Version}),
32-
zeroc-ice-utils (=${binary:Version}),
33-
zeroc-ice-utils-java (=${binary:Version})
23+
Depends: ${dist:AllRuntimeDepends}
3424
Description: Ice (Internet Communications Engine)
3525
Ice is a comprehensive RPC framework that helps you build distributed
3626
applications with minimal effort using familiar object-oriented idioms.
@@ -44,9 +34,7 @@ Description: Ice (Internet Communications Engine)
4434
Package: zeroc-ice-all-dev
4535
Architecture: all
4636
Section: devel
47-
Depends: libzeroc-ice-dev (=${binary:Version}),
48-
libzeroc-ice-java (=${binary:Version}),
49-
php5-zeroc-ice-dev (=${binary:Version}) <!nophp5>
37+
Depends: ${dist:AllDevDepends}
5038
Replaces: libzeroc-ice-java (<=3.5.1)
5139
Description: Ice development packages
5240
Ice development packages.

ice/dpkg/rules

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ export CLASSPATH=/usr/share/java/proguard.jar
1212
export GRADLE_HOME=$(HOME)/.gradle
1313
export GRADLE = ./gradlew -g $(GRADLE_HOME)
1414

15-
PACKAGE_NAMES = zeroc-ice-all-runtime \
16-
zeroc-ice-all-dev \
17-
zeroc-ice-slice \
15+
RUNTIME_PACKAGE_NAMES = zeroc-ice-slice \
1816
libzeroc-ice3.6 \
1917
libzeroc-freeze3.6 \
2018
zeroc-glacier2 \
@@ -23,8 +21,9 @@ PACKAGE_NAMES = zeroc-ice-all-runtime \
2321
libzeroc-icestorm3.6 \
2422
zeroc-icepatch2 \
2523
zeroc-ice-utils \
26-
zeroc-ice-utils-java \
27-
libzeroc-ice-dev \
24+
zeroc-ice-utils-java
25+
26+
DEV_PACKAGE_NAMES = libzeroc-ice-dev \
2827
libzeroc-ice-java
2928

3029
CPP11_DESTDIR = $(CURDIR)/debian/tmp-cpp11
@@ -41,7 +40,8 @@ CPP11_LIB_NAMES = libFreeze \
4140
libIceStormService \
4241
libIceUtil
4342

44-
VERSION = 3.6.4
43+
DEB_VERSION := $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ')
44+
VERSION := $(shell echo $(DEB_VERSION) | sed 's/-.*//g')
4545

4646
ARTIFACT_NAMES = freeze \
4747
glacier2 \
@@ -75,16 +75,28 @@ endif
7575

7676

7777
DHARGS = --parallel --with javahelper --with systemd
78-
7978
#
8079
# Check if nophp5 build profile is active
8180
#
8281
ifeq (,$(filter nophp5,$(DEB_BUILD_PROFILES)))
8382
PHP5=yes
8483
DHARGS += --with php5
85-
PACKAGE_NAMES += php5-zeroc-ice php5-zeroc-ice-dev
84+
RUNTIME_PACKAGE_NAMES += php5-zeroc-ice
85+
DEV_PACKAGE_NAMES += php5-zeroc-ice-dev
8686
endif
8787

88+
PACKAGE_NAMES = zeroc-ice-all-runtime \
89+
zeroc-ice-all-dev \
90+
$(RUNTIME_PACKAGE_NAMES) \
91+
$(DEV_PACKAGE_NAMES)
92+
93+
space := $(null) #
94+
comma := ,
95+
dep-dependencies = $(subst $(space), (=$(DEB_VERSION))$(comma) ,$(strip $1)) (=$(DEB_VERSION))
96+
97+
override_dh_gencontrol:
98+
dh_gencontrol -- -Vdist:AllRuntimeDepends="$(call dep-dependencies,$(RUNTIME_PACKAGE_NAMES))" \
99+
-Vdist:AllDevDepends="$(call dep-dependencies,$(DEV_PACKAGE_NAMES))"
88100

89101
prefix = /usr
90102
MAKEOPTS = prefix=$(prefix) OPTIMIZE=$(OPTIMIZE)

0 commit comments

Comments
 (0)