Skip to content

Commit ff0adc8

Browse files
committed
Allow skipping maven and packages via build profiles
1 parent 91cba55 commit ff0adc8

3 files changed

Lines changed: 39 additions & 9 deletions

File tree

debian/control

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,22 @@ Homepage: http://www.cloudstack.org/
1111

1212
Package: cloudstack-common
1313
Architecture: all
14+
Build-Profiles: <!nocommon>
1415
Depends: ${misc:Depends}, ${python3:Depends}, genisoimage, nfs-common, python3-pip, python3-distutils | python3-distutils-extra, python3-netaddr, uuid-runtime
1516
Conflicts: cloud-scripts, cloud-utils, cloud-system-iso, cloud-console-proxy, cloud-daemonize, cloud-deps, cloud-python, cloud-setup
1617
Description: A common package which contains files which are shared by several CloudStack packages
1718

1819
Package: cloudstack-management
1920
Architecture: all
21+
Build-Profiles: <!nomanagement>
2022
Depends: ${python3:Depends}, openjdk-17-jre-headless | java17-runtime-headless | java17-runtime | zulu-17, cloudstack-common (= ${source:Version}), net-tools, sudo, python3-mysql.connector | mysql-connector-python-py3, augeas-tools, mysql-client | mariadb-client, adduser, bzip2, ipmitool, file, gawk, iproute2, qemu-utils, rng-tools, python3-dnspython, lsb-release, init-system-helpers (>= 1.14~), python3-setuptools
2123
Conflicts: cloud-server, cloud-client, cloud-client-ui
2224
Description: CloudStack server library
2325
The CloudStack management server
2426

2527
Package: cloudstack-agent
2628
Architecture: all
29+
Build-Profiles: <!noagent>
2730
Depends: ${python:Depends}, ${python3:Depends}, openjdk-17-jre-headless | java17-runtime-headless | java17-runtime | zulu-17, cloudstack-common (= ${source:Version}), lsb-base (>= 9), openssh-client, qemu-kvm (>= 2.5) | qemu-system-x86 (>= 5.2), libvirt-bin (>= 1.3) | libvirt-daemon-system (>= 3.0), iproute2, ebtables, vlan, ipset, python3-libvirt, ethtool, iptables, cryptsetup, rng-tools, rsync, lsb-release, ufw, apparmor, cpu-checker, libvirt-daemon-driver-storage-rbd, sysstat
2831
Recommends: init-system-helpers
2932
Conflicts: cloud-agent, cloud-agent-libs, cloud-agent-deps, cloud-agent-scripts
@@ -34,27 +37,32 @@ Description: CloudStack agent
3437

3538
Package: cloudstack-usage
3639
Architecture: all
40+
Build-Profiles: <!nousage>
3741
Depends: openjdk-17-jre-headless | java17-runtime-headless | java17-runtime | zulu-17, cloudstack-common (= ${source:Version}), init-system-helpers
3842
Description: CloudStack usage monitor
3943
The CloudStack usage monitor provides usage accounting across the entire cloud for
4044
cloud operators to charge based on usage parameters.
4145

4246
Package: cloudstack-ui
47+
Build-Profiles: <!noui>
4348
Architecture: all
4449
Depends: ${misc:Depends}
4550
Description: The CloudStack UI
4651

4752
Package: cloudstack-docs
53+
Build-Profiles: <!nodocs>
4854
Architecture: all
4955
Depends: ${misc:Depends}
5056
Description: The CloudStack documentation
5157

5258
Package: cloudstack-marvin
59+
Build-Profiles: <!nomarvin>
5360
Architecture: all
5461
Depends: ${misc:Depends}, python3-pip, python3-dev, libffi-dev
5562
Description: The CloudStack Marvin library
5663

5764
Package: cloudstack-integration-tests
65+
Build-Profiles: <!notests>
5866
Architecture: all
5967
Depends: ${misc:Depends}, cloudstack-marvin (= ${source:Version})
6068
Description: The CloudStack Marvin integration tests

debian/rules

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,14 @@ override_dh_auto_configure:
133133
cp packaging/debian/replace.properties replace.properties.tmp
134134
echo VERSION=${VERSION} >> replace.properties.tmp
135135

136+
override_dh_auto_build:
137+
ifneq ($(SKIP_MVN),1)
138+
mvn clean package -Psystemvm,developer -Dsystemvm \
139+
-Dcs.replace.properties=replace.properties.tmp \
140+
-Dmaven.repo.local=$(HOME)/.m2/repository \
141+
${ACS_BUILD_OPTS}
142+
endif
143+
136144
override_dh_auto_clean:
137145
dh_auto_clean
138146
rm -f replace.properties.tmp
@@ -148,7 +156,7 @@ override_dh_auto_install:
148156
mkdir -p $(DESTDIR)/usr/bin
149157
mkdir -p $(DESTDIR)/usr/share
150158

151-
mkdir -p $(DESTDIR)/usr/share/$(PACKAGE)-common
159+
mkdir -p $(DESTDIR)/usr/share/$(PACKAGE)-common
152160
mkdir $(DESTDIR)/usr/share/$(PACKAGE)-common/scripts
153161
mkdir $(DESTDIR)/usr/share/$(PACKAGE)-common/setup
154162
mkdir $(DESTDIR)/usr/share/$(PACKAGE)-common/lib
@@ -176,25 +184,39 @@ override_dh_auto_install:
176184
cp -r python/lib/cloud* $(DESTDIR)/usr/share/pyshared
177185

178186
# cloudstack-agent
179-
$(call build_agent)
187+
if [ -z "$(filter noagent,$(DEB_BUILD_PROFILES))" ]; then \
188+
$(call build_agent)
189+
fi
180190

181191
# cloudstack-management
182-
$(call build_management)
192+
if [ -z "$(filter nomanagement,$(DEB_BUILD_PROFILES))" ]; then \
193+
$(call build_management)
194+
fi
183195

184196
# cloudmonkey
185-
$(call build_cmk)
197+
if [ -z "$(filter nocmk,$(DEB_BUILD_PROFILES))" ]; then \
198+
$(call build_cmk)
199+
fi
186200

187201
# cloudstack-ui
188-
$(call build_ui)
202+
if [ -z "$(filter noui,$(DEB_BUILD_PROFILES))" ]; then \
203+
$(call build_ui)
204+
fi
189205

190206
# cloudstack-usage
191-
$(call build_usage)
207+
if [ -z "$(filter nousage,$(DEB_BUILD_PROFILES))" ]; then \
208+
$(call build_usage)
209+
fi
192210

193211
# cloudstack-marvin
194-
$(call build_marvin)
212+
if [ -z "$(filter nomarvin,$(DEB_BUILD_PROFILES))" ]; then \
213+
$(call build_marvin)
214+
fi
195215

196216
# tests
197-
$(call build_tests)
217+
if [ -z "$(filter notests,$(DEB_BUILD_PROFILES))" ]; then \
218+
$(call build_tests)
219+
fi
198220

199221
override_dh_systemd_enable:
200222
dh_systemd_enable -pcloudstack-management -pcloudstack-agent -pcloudstack-usage

packaging/build-deb.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ dch -b -v "${VERSION}~${DISTCODE}" -u low -m "Apache CloudStack Release ${VERSIO
156156
sed -i '0,/ UNRELEASED;/s// unstable;/g' debian/changelog
157157

158158
dpkg-checkbuilddeps
159-
dpkg-buildpackage -uc -us -b
159+
SKIP_MVN=1 DEB_BUILD_PROFILES="nocommon nomanagement nousage noui nodocs nomarvin notests" dpkg-buildpackage -uc -us -b
160160

161161
/bin/mv debian/changelog.$NOW debian/changelog
162162

0 commit comments

Comments
 (0)