summaryrefslogtreecommitdiffhomepage
path: root/pkg/rpm/Makefile
diff options
context:
space:
mode:
authorAndrei Belov <defan@nginx.com>2018-03-01 23:03:03 +0300
committerAndrei Belov <defan@nginx.com>2018-03-01 23:03:03 +0300
commit5d5117ce3487f5925f4b8e3934b70d140c4f2e0a (patch)
tree83c027f7cf7f85e1a54d56ad09ef64f3f221ec2a /pkg/rpm/Makefile
parentd27e100b445fa7c361ec1fa083388a54484c4651 (diff)
downloadunit-5d5117ce3487f5925f4b8e3934b70d140c4f2e0a.tar.gz
unit-5d5117ce3487f5925f4b8e3934b70d140c4f2e0a.tar.bz2
Packages: unified check-build-depends target.
Diffstat (limited to '')
-rw-r--r--pkg/rpm/Makefile35
1 files changed, 11 insertions, 24 deletions
diff --git a/pkg/rpm/Makefile b/pkg/rpm/Makefile
index 881f0a76..05628243 100644
--- a/pkg/rpm/Makefile
+++ b/pkg/rpm/Makefile
@@ -55,35 +55,21 @@ export CR=\\n
default:
@echo "valid targets: all modules unit $(addprefix unit-, $(MODULES)) rpmlint specs test test-debug clean"
-all: check-build-depends unit modules
+all: check-build-depends-all unit modules
modules: $(addprefix unit-, $(MODULES))
specs: $(addsuffix .spec, $(addprefix rpmbuild/SPECS/unit-, $(MODULES)))
-check-build-depends:
- @{ \
- not_installed= ; \
- for pkg in $(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 \
- }
-
check-build-depends-%:
@{ \
+ case "$*" in \
+ all) pkgs="$(BUILD_DEPENDS)" ;; \
+ unit) pkgs="$(BUILD_DEPENDS_unit)" ;; \
+ *) pkgs="$(BUILD_DEPENDS_unit) $(BUILD_DEPENDS_$*)" ;; \
+ esac ; \
not_installed= ; \
- for pkg in $(BUILD_DEPENDS_unit) $(BUILD_DEPENDS_$*); do \
+ for pkg in $${pkgs}; do \
rpm -qi $${pkg} >/dev/null 2>&1 ; \
if [ $$? -ne 0 ]; then \
not_installed="$${not_installed} $${pkg}" ; \
@@ -98,6 +84,7 @@ check-build-depends-%:
exit 1 ; \
fi \
}
+ touch $@
rpmbuild/SPECS:
mkdir -p rpmbuild/SPECS
@@ -197,9 +184,9 @@ test-debug: unit modules
clean:
rm -rf rpmbuild/SPECS rpmbuild/BUILD rpmbuild/BUILDROOT rpmbuild/RPMS rpmbuild/SRPMS ../../build
- rm -f rpmbuild/SOURCES/unit-*.tar.gz unit
+ rm -f rpmbuild/SOURCES/unit-*.tar.gz check-build-depends-*
find . -maxdepth 1 -type l -delete
-.PHONY: default all modules specs check-build-depends rpmlint test test-debug clean
+.PHONY: default all modules specs rpmlint test test-debug clean
-.SECONDARY:
+.SECONDARY: $(addprefix check-build-depends-, $(MODULES))