aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <igor.pashev@nexenta.com>2012-10-01 15:17:39 +0400
committerIgor Pashev <igor.pashev@nexenta.com>2012-10-01 15:17:39 +0400
commitd7cd7ae95e86736c315e3d5f8b6e414bf17ff533 (patch)
treefc3d0663a9c5f53f222af6e274db114e0efdd21a
parent246fbe2007da3224dc05f31bd832e087ed2f6d85 (diff)
downloadcibs-d7cd7ae95e86736c315e3d5f8b6e414bf17ff533.tar.gz
Pass all variable from Makefile to pkgmogrify
-rw-r--r--README.md16
-rw-r--r--rules/ips.mk16
2 files changed, 20 insertions, 12 deletions
diff --git a/README.md b/README.md
index a373f56..95e5187 100644
--- a/README.md
+++ b/README.md
@@ -24,3 +24,19 @@ Look into directory "`examples`" for examples.
# CIBS modules
+## ips.mk
+
+This module provides functions to work with IPS manifests and publish packages.
+When "`ips.mk`" modules is included these targets are available from main "`Makefile`":
+
+* `publish` - publish IPS package into IPS repository
+* `pre-publish` - make everything required to publish (including downloading archive,
+patching, compiling, mogrifying manifests etc), but do not publish. Usefull for final
+verifications what is going into IPS repository. All intermediate and final manifests
+are in "`work/manifests`" directory.
+* `build-dep` - install build dependencies
+
+
+Any variable defined in "`Makefile`" will be passed to "`pkgmogrify`", for example:
+
+`pkgmogrify -Darchive="mpfr-3.1.1.tar.xz" -Ddownload="http://ftp.gnu.org/gnu/mpfr/mpfr-3.1.1.tar.xz" -Dhome="http://www.mpfr.org/" -Dlicense="LGPLv3" -Dname="mpfr" -Dsummary="GNU library for multiple-precision floating-point computations with correct rounding" -Dversion="3.1.1" ...`
diff --git a/rules/ips.mk b/rules/ips.mk
index d215af5..4c07710 100644
--- a/rules/ips.mk
+++ b/rules/ips.mk
@@ -35,18 +35,10 @@ ips-version = $(version)
endif
# Substitutions in IPS manifest:
-# XXX What about to grep all variables from component makefile?
-pkg-define = \
--Dsummary="$(summary)" \
--Dlicense="$(license)" \
--Dlicense-file="$(license-file)" \
--Dhome="$(home)" \
--Dname="$(name)" \
--Dversion="$(version)" \
--Dips-version="$(ips-version)" \
--Darchive="$(archive)" \
--Ddownload="$(download)" \
--Dchecksum="$(checksum)" \
+makefile-vars := $(shell sed -n 's/^ *\([0-9a-zA-Z]*\) *[:?]*=.*$$/\1/p' Makefile | sort -u)
+pkg-define = $(foreach _,$(makefile-vars),-D$(_)="$($(_))")
+pkg-define += -Dips-version="$(ips-version)"
+
pkg-define += \
-DMACH="$(mach)" \