summaryrefslogtreecommitdiff
path: root/packaging/rpm/Makefile.am
diff options
context:
space:
mode:
Diffstat (limited to 'packaging/rpm/Makefile.am')
-rw-r--r--packaging/rpm/Makefile.am39
1 files changed, 39 insertions, 0 deletions
diff --git a/packaging/rpm/Makefile.am b/packaging/rpm/Makefile.am
new file mode 100644
index 000000000..bbeb1c932
--- /dev/null
+++ b/packaging/rpm/Makefile.am
@@ -0,0 +1,39 @@
+# $Id$
+#
+# create an RPM package out of an automake based source distribution
+# © 2001 Hans Ulrich Niedermann <gp@n-dimensional.de>
+#
+
+EXTRA_DIST = package.spec.in @PACKAGE@.spec
+
+DISTCLEANFILES = @PACKAGE@.spec
+
+clean-local:
+ rm -rf BUILD RPMS SPECS SOURCES SRPMS
+
+@PACKAGE@.spec: package.spec
+ cp $< $@
+
+rpm: Makefile package.spec
+if RPM_LIBUSB_DEVEL
+ @echo "Building libgphoto2 RPM with USB support and dependency on the libusb RPM package."
+else
+ @echo "#############################################################################"
+ @echo "# Building libgphoto2 RPM packages ***WITHOUT*** USB support. #"
+ @echo "# Install both the libusb and the libusb-devel RPM package for USB support. #"
+ @echo "#############################################################################"
+ @sleep 3
+endif
+ $(MAKE) clean
+ mkdir -p BUILD SPECS SOURCES SRPMS
+ for arch in i386 i486 i586 i686 alpha noarch; do \
+ mkdir -p "RPMS/$${arch}"; \
+ done
+ $(MAKE) SOURCES/@PACKAGE@-@VERSION@.tar.gz SPECS/@PACKAGE@-@VERSION@.spec
+ @RPMBUILD@ --define "_topdir $$(pwd)" -ba SPECS/@PACKAGE@-@VERSION@.spec
+
+SOURCES/@PACKAGE@-@VERSION@.tar.gz: $(top_srcdir)/@PACKAGE@-@VERSION@.tar.gz
+ ln -f $< $@
+
+SPECS/@PACKAGE@-@VERSION@.spec: package.spec
+ ln -f $< $@