summaryrefslogtreecommitdiff
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
commit6b956682b51c4108b0bb2c2a1cf54bddf344fbfa (patch)
treeb21c8deb5c2a7bdbe34e294df29720624d56617d
parent3ae6203b6fa3c8e42ad05211afd1ab34326d9056 (diff)
downloadattr-6b956682b51c4108b0bb2c2a1cf54bddf344fbfa.tar.gz
Use rpmbuild for building rpms
-rw-r--r--build/Makefile2
-rw-r--r--build/rpm/Makefile2
-rw-r--r--configure.in23
-rw-r--r--include/builddefs.in1
4 files changed, 21 insertions, 7 deletions
diff --git a/build/Makefile b/build/Makefile
index 97b86f9..f20beea 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 dee180c..17eceb5 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 643092d..07bea11 100644
--- a/configure.in
+++ b/configure.in
@@ -73,17 +73,30 @@ test -z "$RPM" && AC_PATH_PROG(RPM, rpm, /bin/rpm)
rpm=$RPM
AC_SUBST(rpm)
-dnl check if the msgfmt program is available
-test -z "$MSGFMT" && AC_CHECK_PROG(MSGFMT, msgfmt, /usr/bin/msgfmt)
-msgfmt=$MSGFMT
-AC_SUBST(msgfmt)
-
dnl .. and what version is rpm
rpm_version=0
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 msgfmt program is available
+test -z "$MSGFMT" && AC_CHECK_PROG(MSGFMT, msgfmt, /usr/bin/msgfmt)
+msgfmt=$MSGFMT
+AC_SUBST(msgfmt)
+
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 412798c..df2f1aa 100644
--- a/include/builddefs.in
+++ b/include/builddefs.in
@@ -67,6 +67,7 @@ LN_S = @LN_S@
ZIP = @zip@
TAR = @tar@
RPM = @rpm@
+RPMBUILD= @rpmbuild@
MSGFMT = @msgfmt@
RPM_VERSION = @rpm_version@