LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > unSpawn
User Name
Password

Notices


Rate this Entry

Torsocks .spec

Posted 07-03-2009 at 05:07 AM by unSpawn

Torsocks: http://code.google.com/p/torsocks/

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'".
* To work the compile-time switches just use --define like: 'rpmbuild -bb --define='build_enablesocksdns=1' --define='build_enablehostnames=0' torsocks.spec'.
Posted in Uncategorized
Views 2925 Comments 0
« Prev     Main     Next »

  



All times are GMT -5. The time now is 07:09 PM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration