#
# Makefile for top level of nmh distribution
#
-# $Id$
-#
# nmh version
VERSION = @VERSION@
distclean-local: clean-local
rm -f Makefile config.h config.status config.log config.cache stamp-h distname
+ $(RM) -r RPM
realclean-local: distclean-local
cd $(ftpdir) && ln -s $(tarfile) nmh.tar.gz
cd $(ftpdir) && md5sum *.gz > MD5SUM
+# 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.
+# tarfile and version are as specified in this file. rpmbuild does
+# not allow Version to contain any dashes.
+rpm: all nmhdist
+ @rpmbuild --define '_topdir $(shell pwd)/RPM' \
+ --define '_tmppath %{_topdir}/TMP' \
+ --define 'srcdir $(shell pwd)' \
+ --define 'tarfile $(tarfile)' \
+ --define 'version $(shell echo $(VERSION) | sed "s/-/_/g")' \
+ -ba nmh.spec
+ @$(RM) $(tarfile)