[tor-commits] [tor/master] Cleanup of RPM build process - no more .git in tarball, use automake's dist-gzip to create the tarball.

nickm at torproject.org nickm at torproject.org
Tue Jul 31 15:49:45 UTC 2012


commit 72260cfa680ac1fd77d8859d471f766853ddc063
Author: Ondrej Mikle <ondrej.mikle at gmail.com>
Date:   Fri Jun 15 23:59:35 2012 +0200

    Cleanup of RPM build process - no more .git in tarball, use automake's dist-gzip to create the tarball.
    
    Signed-off-by: Ondrej Mikle <ondrej.mikle at gmail.com>
---
 Makefile.am |   29 ++++++++++++-----------------
 1 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index a80763d..e25e8ff 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -24,23 +24,18 @@ EXTRA_DIST = \
 #install-data-local:
 #	$(INSTALL) -m 755 -d $(LOCALSTATEDIR)/lib/tor
 
-# Assume a tarball is in .. for now.
-dist-rpm:
-	RPM_BUILD_DIR="/tmp/tor-rpm-build-$$$$";                \
-	rm -rf $$RPM_BUILD_DIR;                                 \
-	mkdir $$RPM_BUILD_DIR || exit 1;                        \
-	for subdir in BUILD RPMS SOURCES SPECS SRPMS; do        \
-	    mkdir $$RPM_BUILD_DIR/$$subdir;                     \
-	done;                                                   \
-	mkdir $$RPM_BUILD_DIR/SOURCES/tor-$(VERSION);           \
-	cp -R ./ $$RPM_BUILD_DIR/SOURCES/tor-$(VERSION)/;       \
-	pushd $$RPM_BUILD_DIR/SOURCES/;                         \
-	tar zcf tor-$(VERSION).tar.gz ./;                       \
-	popd;                                                   \
-	LIBS=-lrt rpmbuild -ba --define "_topdir $$RPM_BUILD_DIR" tor.spec; \
-	mv $$RPM_BUILD_DIR/SRPMS/* .;                           \
-	mv $$RPM_BUILD_DIR/RPMS/* .;                            \
-	rm -rf $$RPM_BUILD_DIR
+# Use automake's dist-gzip target to build the tarball
+dist-rpm: dist-gzip
+	TIMESTAMP=$$(date +"%Y-%m-%d_%H.%M.%S"); 				\
+	RPM_BUILD_DIR=$$(mktemp -d "/tmp/tor-rpm-build-$$TIMESTAMP-XXXX");	\
+	mkdir -p "$$RPM_BUILD_DIR"/{BUILD,RPMS,SOURCES/"tor-$(VERSION)",SPECS,SRPMS}; \
+	cp -fa "$(distdir).tar.gz" "$$RPM_BUILD_DIR"/SOURCES/;			\
+	LIBS=-lrt rpmbuild -ba --define "_topdir $$RPM_BUILD_DIR" tor.spec; 	\
+	cp -fa "$$RPM_BUILD_DIR"/SRPMS/* .;                           		\
+	cp -fa "$$RPM_BUILD_DIR"/RPMS/* .;                            		\
+	rm -rf "$$RPM_BUILD_DIR";						\
+	echo "RPM build finished";						\
+	#end of dist-rpm
 
 dist: check
 





More information about the tor-commits mailing list