@SET_MAKE@
srcdir = @srcdir@
+abs_srcdir = @abs_srcdir@
VPATH = @srcdir@
# ========== USER CONFIGURATION SECTION ==========
# location of man pages
mandir = @mandir@
+# RPM build root
+rpmdir = @rpmdir@
+
# location of incoming mail
mailspool = @mailspool@
# 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
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
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
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}
# 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
%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