From: Eric Sandeen Date: Tue, 16 Jul 2002 04:44:19 +0000 (+0000) Subject: Use rpmbuild for building rpms X-Git-Tag: v2.2.0~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=41a1923dfe4a212f0625a547434b98ae951a6b7b;p=thirdparty%2Fxfsprogs-dev.git Use rpmbuild for building rpms --- diff --git a/build/Makefile b/build/Makefile index 48ebcf58c..8ca704777 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 2dffcebc3..57bc4f0dd 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 c614aa59e..937946a6d 100644 --- a/configure.in +++ b/configure.in @@ -77,17 +77,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 5bb90ab9c..1c6263ce2 100644 --- a/include/builddefs.in +++ b/include/builddefs.in @@ -70,6 +70,7 @@ LN_S = @LN_S@ ZIP = @zip@ TAR = @tar@ RPM = @rpm@ +RPMBUILD= @rpmbuild@ MSGFMT = @msgfmt@ RPM_VERSION = @rpm_version@