aboutsummaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am32
1 files changed, 32 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 8f706df..34ab32a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,3 +5,35 @@ EXTRA_DIST = README COPYING AUTHORS INSTALL NEWS ChangeLog \
backupninja.spec backupninja.spec.in autogen.sh
SUBDIRS = etc examples handlers lib man src
+
+rpm_topdir=`cd $(top_srcdir) && pwd`/rpm
+rpm-package: dist
+ if test x$(HAVE_RPM) = xyes ; then \
+ mkdir -p $(rpm_topdir) ; \
+ cd $(rpm_topdir) ; \
+ mkdir -p BUILD RPMS SOURCES SPECS ; \
+ cd SOURCES ; \
+ ln -sf ../../$(distdir).tar.gz ; \
+ cd .. ; \
+ cd SPECS ; \
+ ln -sf ../../backupninja.spec . ; \
+ cd .. ; \
+ rpmbuild --define "_topdir `cd . && pwd`" -bb SPECS/backupninja.spec && \
+ echo "Package successfully built in `pwd`/RPMS." ; \
+ else \
+ echo "Error: RPM executable and/or source directory not found." ; \
+ fi
+srpm-package: dist
+ if test x$(HAVE_RPM) = xyes ; then \
+ cd $(rpm_topdir) ; \
+ mkdir -p BUILD SRPMS SOURCES SPECS ; \
+ cd SOURCES ; \
+ ln -s ../../$(distdir).tar.gz ; \
+ cd .. ; \
+ cd SPECS ; \
+ ln -sf ../../backupninja.spec .
+ rpmbuild --define "_topdir `cd . && pwd`" -bs SPECS/backupninja.spec && \
+ echo "Package successfully built in `pwd`/SRPMS." ; \
+ else \
+ echo "Error: RPM executable and/or source directory not found." ; \
+ fi