diff options
author | Andrei Belov <defan@nginx.com> | 2018-03-01 23:03:03 +0300 |
---|---|---|
committer | Andrei Belov <defan@nginx.com> | 2018-03-01 23:03:03 +0300 |
commit | 5d5117ce3487f5925f4b8e3934b70d140c4f2e0a (patch) | |
tree | 83c027f7cf7f85e1a54d56ad09ef64f3f221ec2a | |
parent | d27e100b445fa7c361ec1fa083388a54484c4651 (diff) | |
download | unit-5d5117ce3487f5925f4b8e3934b70d140c4f2e0a.tar.gz unit-5d5117ce3487f5925f4b8e3934b70d140c4f2e0a.tar.bz2 |
Packages: unified check-build-depends target.
-rw-r--r-- | pkg/deb/Makefile | 34 | ||||
-rw-r--r-- | pkg/rpm/Makefile | 35 |
2 files changed, 22 insertions, 47 deletions
diff --git a/pkg/deb/Makefile b/pkg/deb/Makefile index df2990ba..ad8e642c 100644 --- a/pkg/deb/Makefile +++ b/pkg/deb/Makefile @@ -84,33 +84,19 @@ export CR=\\n default: @echo "valid targets: all modules unit $(addprefix unit-, $(MODULES)) test test-debug clean" -all: check-build-depends unit modules +all: check-build-depends-all unit modules modules: $(addprefix unit-, $(MODULES)) -check-build-depends: - @{ \ - not_installed= ; \ - for pkg in $(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 \ - } - 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 \ dpkg -s $${pkg} >/dev/null 2>&1 ; \ if [ $$? -ne 0 ]; then \ not_installed="$${not_installed} $${pkg}" ; \ @@ -125,6 +111,7 @@ check-build-depends-%: exit 1 ; \ fi \ } + touch $@ debuild/$(SRCDIR)/debian: @{ \ @@ -254,8 +241,9 @@ test-debug: unit modules clean: rm -rf debuild debuild-* debs ../../build + rm -f check-build-depends-* find . -maxdepth 1 -type l -delete -.PHONY: default all modules check-build-depends test test-debug clean +.PHONY: default all modules test test-debug clean -.SECONDARY: +.SECONDARY: $(addprefix check-build-depends-, $(MODULES)) $(addprefix debuild-, $(MODULES)) 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)) |