[or-cvs] Implement first version of the ability to target arch and O...

phobos at seul.org phobos at seul.org
Thu Feb 16 21:53:20 UTC 2006


Update of /home/or/cvsroot/tor
In directory moria:/tmp/cvs-serv1804

Modified Files:
	Makefile.am tor.spec.in 
Log Message:
Implement first version of the ability to target arch and OS in rpm
builds.  This also implements the resulting dist-rpm filename to match the
target arch.


Index: Makefile.am
===================================================================
RCS file: /home/or/cvsroot/tor/Makefile.am,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -p -d -r1.20 -r1.21
--- Makefile.am	9 Feb 2006 05:46:46 -0000	1.20
+++ Makefile.am	16 Feb 2006 21:53:18 -0000	1.21
@@ -23,8 +23,8 @@ dist-rpm: dist
 	    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; 			\
+	rpmbuild -ba --define "_topdir $$RPM_BUILD_DIR"	tor.spec;
+#	   $$RPMBUILD_OPTIONS tor.spec; 			\
 	mv $$RPM_BUILD_DIR/SRPMS/* .;                           \
 	mv $$RPM_BUILD_DIR/RPMS/*/* .;                          \
 	rm -rf $$RPM_BUILD_DIR

Index: tor.spec.in
===================================================================
RCS file: /home/or/cvsroot/tor/tor.spec.in,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -p -d -r1.28 -r1.29
--- tor.spec.in	14 Feb 2006 21:21:17 -0000	1.28
+++ tor.spec.in	16 Feb 2006 21:53:18 -0000	1.29
@@ -15,6 +15,13 @@
 %define toruser @TORUSER@
 %define torgroup @TORGROUP@
 
+## Target a specific arch and OS
+#
+# default is i386 linux
+%define target gnu
+%define target_cpu i386
+%define target_os linux
+
 ## Version song and dance
 #
 # This should be the Tor version number, as it appears on the tarball,
@@ -25,6 +32,11 @@
 
 %define version %(echo %{native_version} | sed -e 's/-/./g')
 
+## Define output filename 
+# 
+# This creates filenames based upon the value of target_cpu defined above
+%define _build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%{target_cpu}.rpm
+
 ## Release and OS identification song and dance
 #
 # This identifies the lineage of the spec file. This file is the
@@ -144,7 +156,10 @@ for high-stakes anonymity.
 %setup -q -n %{name}-%{native_version}
 
 %build
-%configure --with-tor-user=%{toruser} --with-tor-group=%{torgroup}
+%configure --with-tor-user=%{toruser} --with-tor-group=%{torgroup} \
+	--build=%{target_cpu}-pc-%{target_os}-%{target} \
+	--host=%{target_cpu}-pc-%{target_os}-%{target}  \
+	--target=%{target_cpu}-pc-%{target_os}-%{target}
 %make
 
 %install



More information about the tor-commits mailing list