aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@sgi.com>2002-07-16 04:44:19 +0000
committerEric Sandeen <sandeen@sgi.com>2002-07-16 04:44:19 +0000
commite822c79849f61a915d3f2188ce8914dffc546a7b (patch)
tree63f1871acea656617fa32e59a41cb35a8667a372
parent0d98e8a9d1921a4d9cd9de3b9d17660090629b34 (diff)
downloaddmapi-dev-e822c79849f61a915d3f2188ce8914dffc546a7b.tar.gz
Use rpmbuild for building rpms
-rw-r--r--build/Makefile2
-rw-r--r--build/rpm/Makefile2
-rw-r--r--configure.in13
-rw-r--r--include/builddefs.in1
4 files changed, 16 insertions, 2 deletions
diff --git a/build/Makefile b/build/Makefile
index 48ebcf5..8ca7047 100644
--- a/build/Makefile
+++ b/build/Makefile
@@ -71,7 +71,7 @@ dist : default $(MANIFEST)
if [ -x $(TAR) ]; then \
( echo "=== tar ===" && $(MAKEF) -C tar $@ || exit $$? ); \
fi; \
- if [ -x $(RPM) ]; then \
+ if [ -x $(RPMBUILD) ]; then \
( echo "=== rpm ===" && $(MAKEF) -C rpm $@ || exit $$? ); \
fi; \
test -z "$$KEEP_DIST_ROOT" || rm -rf $$DIST_ROOT; echo Done
diff --git a/build/rpm/Makefile b/build/rpm/Makefile
index 2dffceb..57bc4f0 100644
--- a/build/rpm/Makefile
+++ b/build/rpm/Makefile
@@ -45,7 +45,7 @@ include $(BUILDRULES)
# generate a binary rpm file
dist : default $(SPECF) rpm-$(RPM_VERSION).rc
- $(RPM) -ba --rcfile ./rpm-$(RPM_VERSION).rc $(SPECF)
+ $(RPMBUILD) -ba --rcfile ./rpm-$(RPM_VERSION).rc $(SPECF)
# Because rpm prior to v.2.90 does not support macros and old style config
# is not supported by rpm v.3, we have to resort to such ugly hacks
diff --git a/configure.in b/configure.in
index 4f73bf5..310c6e1 100644
--- a/configure.in
+++ b/configure.in
@@ -79,6 +79,19 @@ test -x $RPM && \
rpm_version=`$RPM --version | awk '{print $NF}' | awk -F. '{print $1}'`
AC_SUBST(rpm_version)
+dnl At some point in rpm 4.0, rpm can no longer build rpms, and
+dnl rpmbuild is needed (rpmbuild may go way back; not sure)
+dnl So, if rpm version >= 4.0, look for rpmbuild. Otherwise build w/ rpm
+
+if test $rpm_version -ge 4; then
+ AC_PATH_PROG(RPMBUILD, rpmbuild)
+ rpmbuild=$RPMBUILD
+else
+ rpmbuild=$RPM
+fi
+
+AC_SUBST(rpmbuild)
+
dnl check if the makedepend program is available
test -z "$MAKEDEPEND" && AC_PATH_PROG(MAKEDEPEND, makedepend, /bin/true)
makedepend=$MAKEDEPEND
diff --git a/include/builddefs.in b/include/builddefs.in
index bc04317..ac7fc59 100644
--- a/include/builddefs.in
+++ b/include/builddefs.in
@@ -65,6 +65,7 @@ LN_S = @LN_S@
ZIP = @zip@
TAR = @tar@
RPM = @rpm@
+RPMBUILD= @rpmbuild@
MSGFMT = @msgfmt@
RPM_VERSION = @rpm_version@