Torsocks .spec
Posted 07-03-2009 at 05:07 AM by unSpawn
Torsocks: http://code.google.com/p/torsocks/
* To work the compile-time switches just use --define like: 'rpmbuild -bb --define='build_enablesocksdns=1' --define='build_enablehostnames=0' torsocks.spec'.
Code:
# No debuginfo: %define debug_packages %{nil} %define debug_package %{nil} # %define name torsocks %define ver 1.0 %define rel 1 %define buildver %{ver}-gamma # # Configuration switches for rebuilding (1=yes 0=no). # Force dns lookups to use tcp? (config switch --enable-socksdns) %define enablesocksdns 0 %{?build_enablesocksdns:%define enablesocksdns 1} # Don't override name lookup calls to use SOCKS? (config switch --disable-tordns) %define disabletordns 0 %{?build_disabletordns:%define disabletordns 1} # Use the old method to override connect? (config switch --enable-oldmethod) %define enableoldmethod 0 %{?build_enableoldmethod:%define enableoldmethod 1} # Enable hostname lookups for socks servers? (config switch --enable-hostnames) %define enablehostnames 0 %{?build_enablehostnames:%define build_enablehostnames 1} # Do not allow TSOCKS_CONF_FILE to specify configuration file? (config switch --disable-envconf) %define disableenvconf 0 %{?build_disableenvconf:%define 1} # # Be standards compliant, don't break relocation and avoid necessity for configure switches. %define _prefix /usr/local %define _sysconfdir /usr/local/etc %define _libdir /usr/local/lib %define _docdir /usr/local/share/doc %define _mandir /usr/local/share/man %define _bindir /usr/local/bin %define _sbindir /usr/local/sbin # Name: %{name} Summary: %{name}, use applications with Tor. Version: %{ver} Release: %{rel} License: GPL Group: Utilities/System Source: %{name}-%{buildver}.tar.gz Prereq: tor Provides: %{name} Buildarch: noarch Vendor: Robert Hogan and Ruben Garcia URL: http://code.google.com/p/torsocks BuildRoot: %{_tmppath}/%{name}-%{version} Prefix: /usr/local %description %{name} allows you to use most socks-friendly applications in a safe way with Tor. This is a fork of the tsocks project (http://sourceforge.net/project/ showfiles.php?group_id=17338). The purpose of this fork is to maintain a working implementation of tsocks that is primarily useful for Tor. %prep %setup -n %{name}-%{buildver} %build %configure \ %if %{enablesocksdns} --enable-socksdns \ %endif %if %{disabletordns} --disable-tordns \ %endif %if %{enableoldmethod} --enable-oldmethod \ %endif %if %{enablehostnames} --enable-hostnames \ %endif %if %{disableenvconf} --disable-envconf \ %endif make %install if [ "$RPM_BUILD_ROOT" = "%{_tmppath}/%{name}-%{ver}" ]; then rm -rf $RPM_BUILD_ROOT make DESTDIR=$RPM_BUILD_ROOT install else echo "Invalid Build root "${RPM_BUILD_ROOT}"." exit 1 fi find $RPM_BUILD_ROOT -not -type d | sed -e "s|$RPM_BUILD_ROOT||g" > autofillfiles %clean if [ "$RPM_BUILD_ROOT" = "%{_tmppath}/%{name}-%{ver}" ]; then rm -rf $RPM_BUILD_ROOT else echo "Invalid Build root "${RPM_BUILD_ROOT}"." exit 1 fi %files -f autofillfiles %changelog * Thu Jul 03 2009 unSpawn - - Init .spec file. - Build version with "--define='build_enablesocksdns=1'".