summaryrefslogtreecommitdiffhomepage
path: root/pkg/rpm
diff options
context:
space:
mode:
authorAndrei Belov <defan@nginx.com>2018-01-22 16:39:31 +0300
committerAndrei Belov <defan@nginx.com>2018-01-22 16:39:31 +0300
commitbe8df0631a6fa4e5afa8c03ed5b84cec72da20d4 (patch)
tree756001955deac1252d1890cae951d397a502103d /pkg/rpm
parentd1f29ed77edd5833d1e84f20ed7032377d5de960 (diff)
downloadunit-be8df0631a6fa4e5afa8c03ed5b84cec72da20d4.tar.gz
unit-be8df0631a6fa4e5afa8c03ed5b84cec72da20d4.tar.bz2
Packages: improved per-module dependency tracking.
Diffstat (limited to 'pkg/rpm')
-rw-r--r--pkg/rpm/Makefile26
-rw-r--r--pkg/rpm/Makefile.go3
-rw-r--r--pkg/rpm/Makefile.php3
-rw-r--r--pkg/rpm/Makefile.python3
4 files changed, 29 insertions, 6 deletions
diff --git a/pkg/rpm/Makefile b/pkg/rpm/Makefile
index 2a839444..aad26a5a 100644
--- a/pkg/rpm/Makefile
+++ b/pkg/rpm/Makefile
@@ -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 $@
diff --git a/pkg/rpm/Makefile.go b/pkg/rpm/Makefile.go
index 37cf53cb..7f2f5438 100644
--- a/pkg/rpm/Makefile.go
+++ b/pkg/rpm/Makefile.go
@@ -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
diff --git a/pkg/rpm/Makefile.php b/pkg/rpm/Makefile.php
index dcaee2a8..a3cbcb8c 100644
--- a/pkg/rpm/Makefile.php
+++ b/pkg/rpm/Makefile.php
@@ -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
diff --git a/pkg/rpm/Makefile.python b/pkg/rpm/Makefile.python
index b954744e..21ba8a5d 100644
--- a/pkg/rpm/Makefile.python
+++ b/pkg/rpm/Makefile.python
@@ -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