From: David Levine Date: Sat, 24 Dec 2011 15:59:45 +0000 (-0600) Subject: Added --with-rpmdir configure option so that user can set location of RPM build root. X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=96bc1e4a303b5e1a43323a1f9186138cb921f0a3;p=mmh Added --with-rpmdir configure option so that user can set location of RPM build root. --- diff --git a/Makefile.in b/Makefile.in index 38a9c1d..598173f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -9,6 +9,7 @@ SHELL = /bin/sh @SET_MAKE@ srcdir = @srcdir@ +abs_srcdir = @abs_srcdir@ VPATH = @srcdir@ # ========== USER CONFIGURATION SECTION ========== @@ -32,6 +33,9 @@ etcdir = @sysconfdir@ # location of man pages mandir = @mandir@ +# RPM build root +rpmdir = @rpmdir@ + # location of incoming mail mailspool = @mailspool@ @@ -198,15 +202,15 @@ nmhrelease: # Create binary and source RPMs. Assumes that configure had already # been run. Otherwise, there wouldn't be a Makefile. -# _topdir puts build area in the RPM/ directory below the current one. -# _tmppath uses the specified local TMP. -# srcdir is this current, top level nmh directory. +# _topdir is the specified RPM build root. +# _tmppath is TMP below _topdir. +# srcdir is the top level nmh source directory. # tarfile and version are as specified in this file. rpmbuild does # not allow Version to contain any dashes. rpm: all nmhdist - @rpmbuild --define '_topdir '`pwd`'/RPM' \ + @rpmbuild --define '_topdir $(rpmdir)' \ --define '_tmppath %{_topdir}/TMP' \ - --define 'srcdir '`pwd` \ + --define 'srcdir $(abs_srcdir)' \ --define 'tarfile $(tarfile)' \ --define 'version '`echo $(VERSION) | sed "s/-/_/g"` \ -ba nmh.spec diff --git a/configure.in b/configure.in index e93e173..3bba22c 100644 --- a/configure.in +++ b/configure.in @@ -659,6 +659,18 @@ else AC_SUBST(NDBM_LIBS) fi +dnl ------------------ +dnl Set RPM build root +dnl ------------------ +dnl nmhrpm is used in the final summary, see below. The default value is +dnl reported there as ./RPM, consistent with the reporting of the default +dnl source code location as ., but its absolute path is used in the Makefile. +AC_ARG_WITH(rpmdir, + AS_HELP_STRING([--with-rpmdir=RPMDIR], [RPM build directory @<:@RPM@:>@])) + AS_IF([test x"$with_rpmdir" = x], [rpmdir='$(abs_srcdir)/RPM'; nmhrpm=./RPM], + [rpmdir="$with_rpmdir"; eval "nmhrpm=${rpmdir}"]) +AC_SUBST(rpmdir) + dnl -------------------- dnl CHECK FOR CYRUS-SASL @@ -978,6 +990,7 @@ eval "nmhbin=${bindir}"; eval "nmhbin=${nmhbin}" eval "nmhsysconf=${sysconfdir}"; eval "nmhsysconf=${nmhsysconf}" eval "nmhlib=${libdir}"; eval "nmhlib=${nmhlib}" eval "nmhman=${mandir}"; eval "nmhman=${nmhman}" +eval "nmhrpm=${nmhrpm}"; pop_kinds=no if test x"$enable_pop" = x"yes"; then @@ -1004,6 +1017,7 @@ binary install path : ${nmhbin} library install path : ${nmhlib} config files install path : ${nmhsysconf} man page install path : ${nmhman} +RPM build root : ${nmhrpm} backup prefix : ${backup_prefix} transport system : ${MTS} file locking type : ${LOCKTYPE} diff --git a/nmh.spec b/nmh.spec index 57c6d2f..35de0c8 100644 --- a/nmh.spec +++ b/nmh.spec @@ -1,6 +1,5 @@ # Assumes that rpmbuild was invoked in main nmh directory using "make -# rpm". Therefore, configure must already have been run. "make rpm" -# uses an RPM directory below the current directory. +# rpm". Therefore, configure must already have been run. # # This file is intended to be zero maintenance, that's why it relies # on the Makefile (and specifically on the nmhdist target). If you @@ -53,7 +52,7 @@ find $RPM_BUILD_ROOT ! -type d -print | sed "s#^$RPM_BUILD_ROOT##" > nmh_files %clean -rm -rf $RPM_BUILD_ROOT $RPM_SOURCE_DIR/%tarfile nmh_files doc +rm -rf $RPM_BUILD_ROOT doc $RPM_SOURCE_DIR/%tarfile nmh_files %files -f nmh_files