Packages: improved per-module dependency tracking.
This commit is contained in:
@@ -12,7 +12,8 @@ SRCDIR= unit-$(VERSION)
|
||||
|
||||
CODENAME = $(shell lsb_release -cs)
|
||||
|
||||
BUILD_DEPENDS = debhelper devscripts libxml2-utils lintian lsb-release xsltproc
|
||||
BUILD_DEPENDS_unit = debhelper devscripts libxml2-utils lintian lsb-release xsltproc
|
||||
BUILD_DEPENDS = $(BUILD_DEPENDS_unit)
|
||||
|
||||
MODULES=
|
||||
|
||||
@@ -100,6 +101,25 @@ check-build-depends:
|
||||
fi \
|
||||
}
|
||||
|
||||
check-build-depends-%:
|
||||
@{ \
|
||||
not_installed= ; \
|
||||
for pkg in $(BUILD_DEPENDS_unit) $(BUILD_DEPENDS_$*); do \
|
||||
dpkg -s $${pkg} >/dev/null 2>&1 ; \
|
||||
if [ $$? -ne 0 ]; then \
|
||||
not_installed="$${not_installed} $${pkg}" ; \
|
||||
fi ; \
|
||||
done ; \
|
||||
if test -n "$${not_installed}" ; then \
|
||||
echo "" >&2 ; \
|
||||
echo "The following packages are required in order to proceed:" >&2 ; \
|
||||
echo "" >&2 ; \
|
||||
echo $${not_installed} >&2 ; \
|
||||
echo "" >&2 ; \
|
||||
exit 1 ; \
|
||||
fi \
|
||||
}
|
||||
|
||||
debuild/$(SRCDIR)/debian:
|
||||
@{ \
|
||||
set -e ; \
|
||||
@@ -133,7 +153,7 @@ debuild/unit_$(VERSION).orig.tar.gz: | debuild/$(SRCDIR)/debian
|
||||
mv debuild/$(SRCDIR).tar.gz debuild/unit_$(VERSION).orig.tar.gz
|
||||
cd debuild && tar zxf unit_$(VERSION).orig.tar.gz
|
||||
|
||||
unit: debuild/unit_$(VERSION).orig.tar.gz debuild/$(SRCDIR)/debian/changelog
|
||||
unit: check-build-depends-unit debuild/unit_$(VERSION).orig.tar.gz debuild/$(SRCDIR)/debian/changelog
|
||||
@echo "===> Building $@ package"
|
||||
cd debuild/$(SRCDIR) && debuild -us -uc
|
||||
mkdir -p debs
|
||||
@@ -192,7 +212,7 @@ debuild-%: debuild/unit_$(VERSION).orig.tar.gz ../../docs/changes.xml
|
||||
chmod +x $@/$(SRCDIR)/debian/rules ; \
|
||||
}
|
||||
|
||||
unit-%: | debuild-%
|
||||
unit-%: check-build-depends-% | debuild-%
|
||||
@echo "===> Building $@ package"
|
||||
cd debuild-$*/$(SRCDIR) && debuild -us -uc
|
||||
mkdir -p debs
|
||||
|
||||
@@ -13,7 +13,8 @@ MODULE_INSTARGS_go= go-install
|
||||
MODULE_SOURCES_go= unit.example-go-app \
|
||||
unit.example-go-config
|
||||
|
||||
BUILD_DEPENDS+= golang
|
||||
BUILD_DEPENDS_go= golang
|
||||
BUILD_DEPENDS+= $(BUILD_DEPENDS_go)
|
||||
|
||||
MODULE_BUILD_DEPENDS_go=,golang
|
||||
MODULE_DEPENDS_go=,golang
|
||||
|
||||
@@ -13,7 +13,8 @@ MODULE_INSTARGS_go17= /usr/lib/go-1.7/bin/go-install
|
||||
MODULE_SOURCES_go17= unit.example-go-app \
|
||||
unit.example-go1.7-config
|
||||
|
||||
BUILD_DEPENDS+= golang-1.7
|
||||
BUILD_DEPENDS_go17= golang-1.7
|
||||
BUILD_DEPENDS+= $(BUILD_DEPENDS_go17)
|
||||
|
||||
MODULE_BUILD_DEPENDS_go17=,golang-1.7
|
||||
MODULE_DEPENDS_go17=,golang-1.7
|
||||
|
||||
@@ -13,7 +13,8 @@ MODULE_INSTARGS_go18= /usr/lib/go-1.8/bin/go-install
|
||||
MODULE_SOURCES_go18= unit.example-go-app \
|
||||
unit.example-go1.8-config
|
||||
|
||||
BUILD_DEPENDS+= golang-1.8
|
||||
BUILD_DEPENDS_go18= golang-1.8
|
||||
BUILD_DEPENDS+= $(BUILD_DEPENDS_go18)
|
||||
|
||||
MODULE_BUILD_DEPENDS_go18=,golang-1.8
|
||||
MODULE_DEPENDS_go18=,golang-1.8
|
||||
|
||||
@@ -13,7 +13,8 @@ MODULE_INSTARGS_go19= /usr/lib/go-1.9/bin/go-install
|
||||
MODULE_SOURCES_go19= unit.example-go-app \
|
||||
unit.example-go1.9-config
|
||||
|
||||
BUILD_DEPENDS+= golang-1.9
|
||||
BUILD_DEPENDS_go19= golang-1.9
|
||||
BUILD_DEPENDS+= $(BUILD_DEPENDS_go19)
|
||||
|
||||
MODULE_BUILD_DEPENDS_go19=,golang-1.9
|
||||
MODULE_DEPENDS_go19=,golang-1.9
|
||||
|
||||
@@ -14,15 +14,17 @@ MODULE_SOURCES_php= unit.example-php-app \
|
||||
unit.example-php-config
|
||||
|
||||
ifneq (,$(findstring $(CODENAME),trusty jessie))
|
||||
BUILD_DEPENDS+= php5-dev libphp5-embed
|
||||
BUILD_DEPENDS_php= php5-dev libphp5-embed
|
||||
MODULE_BUILD_DEPENDS_php=,php5-dev,libphp5-embed
|
||||
MODULE_DEPENDS_php=,libphp5-embed
|
||||
else
|
||||
BUILD_DEPENDS+= php-dev libphp-embed
|
||||
BUILD_DEPENDS_php= php-dev libphp-embed
|
||||
MODULE_BUILD_DEPENDS_php=,php-dev,libphp-embed
|
||||
MODULE_DEPENDS_php=,libphp-embed
|
||||
endif
|
||||
|
||||
BUILD_DEPENDS+= $(BUILD_DEPENDS_php)
|
||||
|
||||
define MODULE_PREINSTALL_php
|
||||
mkdir -p debian/unit-php/usr/share/doc/unit-php/examples/phpinfo-app
|
||||
install -m 644 -p debian/unit.example-php-app debian/unit-php/usr/share/doc/unit-php/examples/phpinfo-app/index.php
|
||||
|
||||
@@ -13,7 +13,8 @@ MODULE_INSTARGS_python= python-install
|
||||
MODULE_SOURCES_python= unit.example-python-app \
|
||||
unit.example-python-config
|
||||
|
||||
BUILD_DEPENDS+= python-dev
|
||||
BUILD_DEPENDS_python= python-dev
|
||||
BUILD_DEPENDS+= $(BUILD_DEPENDS_python)
|
||||
|
||||
MODULE_BUILD_DEPENDS_python=,python-dev
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ MODULE_INSTARGS_python27= python2.7-install
|
||||
MODULE_SOURCES_python27= unit.example-python-app \
|
||||
unit.example-python2.7-config
|
||||
|
||||
BUILD_DEPENDS+= python2.7-dev
|
||||
BUILD_DEPENDS_python27= python2.7-dev
|
||||
BUILD_DEPENDS+= $(BUILD_DEPENDS_python27)
|
||||
|
||||
MODULE_BUILD_DEPENDS_python27=,python2.7-dev
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ MODULE_INSTARGS_python34= python3.4-install
|
||||
MODULE_SOURCES_python34= unit.example-python-app \
|
||||
unit.example-python3.4-config
|
||||
|
||||
BUILD_DEPENDS+= python3.4-dev
|
||||
BUILD_DEPENDS_python34= python3.4-dev
|
||||
BUILD_DEPENDS+= $(BUILD_DEPENDS_python34)
|
||||
|
||||
MODULE_BUILD_DEPENDS_python34=,python3.4-dev
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ MODULE_INSTARGS_python35= python3.5-install
|
||||
MODULE_SOURCES_python35= unit.example-python-app \
|
||||
unit.example-python3.5-config
|
||||
|
||||
BUILD_DEPENDS+= python3.5-dev
|
||||
BUILD_DEPENDS_python35= python3.5-dev
|
||||
BUILD_DEPENDS+= $(BUILD_DEPENDS_python35)
|
||||
|
||||
MODULE_BUILD_DEPENDS_python35=,python3.5-dev
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ MODULE_INSTARGS_python36= python3.6-install
|
||||
MODULE_SOURCES_python36= unit.example-python-app \
|
||||
unit.example-python3.6-config
|
||||
|
||||
BUILD_DEPENDS+= python3.6-dev
|
||||
BUILD_DEPENDS_python36= python3.6-dev
|
||||
BUILD_DEPENDS+= $(BUILD_DEPENDS_python36)
|
||||
|
||||
MODULE_BUILD_DEPENDS_python36=,python3.6-dev
|
||||
|
||||
|
||||
@@ -8,7 +8,8 @@ DEFAULT_RELEASE := 1
|
||||
VERSION ?= $(DEFAULT_VERSION)
|
||||
RELEASE ?= $(DEFAULT_RELEASE)
|
||||
|
||||
BUILD_DEPENDS = libxml2 libxslt rpm-build rpmlint
|
||||
BUILD_DEPENDS_unit = libxml2 libxslt rpm-build rpmlint
|
||||
BUILD_DEPENDS = $(BUILD_DEPENDS_unit)
|
||||
|
||||
MODULES=
|
||||
-include Makefile.*
|
||||
@@ -51,6 +52,25 @@ check-build-depends:
|
||||
fi \
|
||||
}
|
||||
|
||||
check-build-depends-%:
|
||||
@{ \
|
||||
not_installed= ; \
|
||||
for pkg in $(BUILD_DEPENDS_unit) $(BUILD_DEPENDS_$*); do \
|
||||
rpm -qi $${pkg} >/dev/null 2>&1 ; \
|
||||
if [ $$? -ne 0 ]; then \
|
||||
not_installed="$${not_installed} $${pkg}" ; \
|
||||
fi ; \
|
||||
done ; \
|
||||
if test -n "$${not_installed}" ; then \
|
||||
echo "" >&2 ; \
|
||||
echo "The following packages are required in order to proceed:" >&2 ; \
|
||||
echo "" >&2 ; \
|
||||
echo $${not_installed} >&2 ; \
|
||||
echo "" >&2 ; \
|
||||
exit 1 ; \
|
||||
fi \
|
||||
}
|
||||
|
||||
rpmbuild/SPECS:
|
||||
mkdir -p rpmbuild/SPECS
|
||||
|
||||
@@ -74,7 +94,7 @@ rpmbuild/SOURCES/unit-$(VERSION).tar.gz:
|
||||
--transform "s#^#unit-$(VERSION)/#" \
|
||||
LICENSE NOTICE CHANGES README configure auto src test
|
||||
|
||||
unit: rpmbuild/SPECS/unit.spec rpmbuild/SOURCES/unit-$(VERSION).tar.gz
|
||||
unit: check-build-depends-unit rpmbuild/SPECS/unit.spec rpmbuild/SOURCES/unit-$(VERSION).tar.gz
|
||||
@echo "===> Building $@ package" ; \
|
||||
rpmbuild -D "_topdir `pwd`/rpmbuild" -ba rpmbuild/SPECS/unit.spec && \
|
||||
ln -s rpmbuild/BUILD/$@-$(VERSION)/build $@
|
||||
@@ -122,7 +142,7 @@ rpmbuild/SPECS/unit-%.spec: unit.module.spec.in ../../docs/changes.xml | rpmbuil
|
||||
>> $@.tmp
|
||||
mv $@.tmp $@
|
||||
|
||||
unit-%: rpmbuild/SPECS/unit-%.spec rpmbuild/SOURCES/unit-$(VERSION).tar.gz
|
||||
unit-%: check-build-depends-% rpmbuild/SPECS/unit-%.spec rpmbuild/SOURCES/unit-$(VERSION).tar.gz
|
||||
@echo "===> Building $@ package" ; \
|
||||
rpmbuild -D "_topdir `pwd`/rpmbuild" -ba rpmbuild/SPECS/$@.spec && \
|
||||
ln -s rpmbuild/BUILD/$@-$(VERSION)/build $@
|
||||
|
||||
@@ -12,7 +12,8 @@ MODULE_INSTARGS_go= go-install
|
||||
MODULE_SOURCES_go= unit.example-go-app \
|
||||
unit.example-go-config
|
||||
|
||||
BUILD_DEPENDS+= golang
|
||||
BUILD_DEPENDS_go= golang
|
||||
BUILD_DEPENDS+= $(BUILD_DEPENDS_go)
|
||||
|
||||
define MODULE_DEFINITIONS_go
|
||||
|
||||
|
||||
@@ -12,7 +12,8 @@ MODULE_INSTARGS_php= php-install
|
||||
MODULE_SOURCES_php= unit.example-php-app \
|
||||
unit.example-php-config
|
||||
|
||||
BUILD_DEPENDS+= php-devel php-embedded
|
||||
BUILD_DEPENDS_php= php-devel php-embedded
|
||||
BUILD_DEPENDS+= $(BUILD_DEPENDS_php)
|
||||
|
||||
define MODULE_PREINSTALL_php
|
||||
%{__mkdir} -p %{buildroot}%{_datadir}/doc/unit-php/examples/phpinfo-app
|
||||
|
||||
@@ -12,7 +12,8 @@ MODULE_INSTARGS_python= python-install
|
||||
MODULE_SOURCES_python= unit.example-python-app \
|
||||
unit.example-python-config
|
||||
|
||||
BUILD_DEPENDS+= python-devel
|
||||
BUILD_DEPENDS_python= python-devel
|
||||
BUILD_DEPENDS+= $(BUILD_DEPENDS_python)
|
||||
|
||||
define MODULE_PREINSTALL_python
|
||||
%{__mkdir} -p %{buildroot}%{_datadir}/doc/unit-python/examples/python-app
|
||||
|
||||
Reference in New Issue
Block a user