[or-cvs] Make dist-rpm makefile target secure; make RPM versions les...

Nick Mathewson nickm at seul.org
Sat Dec 18 23:01:51 UTC 2004


Update of /home/or/cvsroot/tor
In directory moria.mit.edu:/tmp/cvs-serv16798

Modified Files:
      Tag: tor-0_0_9-patches
	Makefile.am tor.spec.in 
Log Message:
Make dist-rpm makefile target secure; make RPM versions less verbose for release versions.

Index: Makefile.am
===================================================================
RCS file: /home/or/cvsroot/tor/Makefile.am,v
retrieving revision 1.15
retrieving revision 1.15.2.1
diff -u -d -r1.15 -r1.15.2.1
--- Makefile.am	9 Nov 2004 20:03:59 -0000	1.15
+++ Makefile.am	18 Dec 2004 23:01:49 -0000	1.15.2.1
@@ -11,16 +11,18 @@
 #	$(INSTALL) -m 755 -d $(LOCALSTATEDIR)/lib/tor
 
 dist-rpm: dist
-	rm -rf /tmp/tor-rpm-build
-	mkdir /tmp/tor-rpm-build
-	for subdir in BUILD RPMS SOURCES SPECS SRPMS; do \
-	    mkdir /tmp/tor-rpm-build/$$subdir;		 \
-	done
-	cp tor-$(VERSION).tar.gz /tmp/tor-rpm-build/SOURCES
-	rpmbuild -ba --define '_topdir /tmp/tor-rpm-build' tor.spec
-	mv /tmp/tor-rpm-build/SRPMS/* .
-	mv /tmp/tor-rpm-build/RPMS/*/* .
-	rm -rf /tmp/tor-rpm-build
+	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;                                                   \
+	cp tor-$(VERSION).tar.gz $$RPM_BUILD_DIR/SOURCES;       \
+	rpmbuild -ba --define "_topdir $$RPM_BUILD_DIR"		\
+	   $$RPMBUILD_OPTIONS tor.spec; 			\
+	mv $$RPM_BUILD_DIR/SRPMS/* .;                           \
+	mv $$RPM_BUILD_DIR/RPMS/*/* .;                          \
+	rm -rf $$RPM_BUILD_DIR
 
 doxygen:
 	doxygen && cd doc/doxygen/latex && make

Index: tor.spec.in
===================================================================
RCS file: /home/or/cvsroot/tor/tor.spec.in,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -u -d -r1.6 -r1.6.2.1
--- tor.spec.in	16 Nov 2004 03:29:05 -0000	1.6
+++ tor.spec.in	18 Dec 2004 23:01:49 -0000	1.6.2.1
@@ -6,7 +6,7 @@
 # This should be incremented whenever the spec file changes, but
 # can drop back to zero at a new Tor version
 
-%define  specver 0
+%define specver 1
 
 ## Things users may want to change
 #
@@ -93,11 +93,16 @@
 %endif
 
 # Using the build date ensures that every build really does get
-# a different release number.
-%define  blddate %(date -u +"%Y%m%d%H%M")
+# a different release number.  We use this trick for CVS versions.
+# For release versions, we don't want or need it.
+%define is_cvs_version %(echo %{native_version} | grep 'cvs' > /dev/null && echo 1 || echo 0)
 
-# ... and here it is.
+%if %{is_cvs_version}
+%define blddate %(date -u +"%Y%m%d%H%M")
 %define release %{pkgspec}.%{specver}.%{ostag}.%{blddate}
+%else
+%define release %{pkgspec}.%{specver}.%{ostag}
+%endif
 
 ## General-purpose macros
 #



More information about the tor-commits mailing list