Sun, 24 Aug 2014 13:49:27 +0200
Accommodate architecture segregated lib(32|64|...) library paths.
michael@793 | 1 | ## |
michael@793 | 2 | ## tsocks.spec -- OpenPKG RPM Package Specification |
michael@793 | 3 | ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/> |
michael@793 | 4 | ## |
michael@793 | 5 | ## Permission to use, copy, modify, and distribute this software for |
michael@793 | 6 | ## any purpose with or without fee is hereby granted, provided that |
michael@793 | 7 | ## the above copyright notice and this permission notice appear in all |
michael@793 | 8 | ## copies. |
michael@793 | 9 | ## |
michael@793 | 10 | ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
michael@793 | 11 | ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
michael@793 | 12 | ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
michael@793 | 13 | ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR |
michael@793 | 14 | ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
michael@793 | 15 | ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
michael@793 | 16 | ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
michael@793 | 17 | ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
michael@793 | 18 | ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
michael@793 | 19 | ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
michael@793 | 20 | ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
michael@793 | 21 | ## SUCH DAMAGE. |
michael@793 | 22 | ## |
michael@793 | 23 | |
michael@793 | 24 | # package versions |
michael@793 | 25 | %define V_base 1.8 |
michael@793 | 26 | %define V_opkg 1.8b5 |
michael@793 | 27 | %define V_dist 1.8beta5 |
michael@793 | 28 | |
michael@793 | 29 | # package information |
michael@793 | 30 | Name: tsocks |
michael@793 | 31 | Summary: Transparent SOCKS Client Library |
michael@793 | 32 | URL: http://tsocks.sourceforge.net/ |
michael@793 | 33 | Vendor: Shaun Clowes |
michael@793 | 34 | Packager: OpenPKG Foundation e.V. |
michael@793 | 35 | Distribution: OpenPKG Community |
michael@793 | 36 | Class: PLUS |
michael@793 | 37 | Group: Network |
michael@793 | 38 | License: LGPL |
michael@793 | 39 | Version: %{V_opkg} |
michael@794 | 40 | Release: 20140800 |
michael@793 | 41 | |
michael@793 | 42 | # list of sources |
michael@793 | 43 | Source0: http://switch.dl.sourceforge.net/tsocks/tsocks-%{V_dist}.tar.gz |
michael@793 | 44 | Source1: tsocks.conf |
michael@793 | 45 | Patch0: tsocks.patch |
michael@793 | 46 | |
michael@793 | 47 | # build information |
michael@793 | 48 | Prefix: %{l_prefix} |
michael@793 | 49 | BuildRoot: %{l_buildroot} |
michael@793 | 50 | BuildPreReq: OpenPKG, openpkg >= 20040130, gcc, make |
michael@793 | 51 | PreReq: OpenPKG, openpkg >= 20040130 |
michael@793 | 52 | AutoReq: no |
michael@793 | 53 | AutoReqProv: no |
michael@793 | 54 | |
michael@793 | 55 | %description |
michael@793 | 56 | TSOCKS' role is to allow non-SOCKS aware applications (e.g telnet, |
michael@793 | 57 | ssh, ftp etc) to use SOCKS without any modification. It does this by |
michael@793 | 58 | intercepting the calls that applications make to establish network |
michael@793 | 59 | connections and negotating them through a SOCKS server as necessary. |
michael@793 | 60 | |
michael@793 | 61 | %track |
michael@793 | 62 | prog tsocks = { |
michael@793 | 63 | version = %{V_dist} |
michael@793 | 64 | url = http://prdownloads.sourceforge.net/tsocks/ |
michael@793 | 65 | regex = tsocks-(__VER__)\.tar\.gz |
michael@793 | 66 | } |
michael@793 | 67 | |
michael@793 | 68 | %prep |
michael@793 | 69 | %setup -q -n tsocks-%{V_base} |
michael@793 | 70 | %patch -p0 |
michael@793 | 71 | %{l_shtool} subst \ |
michael@793 | 72 | -e 's;/usr/lib/libtsocks;%{l_prefix}/lib/tsocks/libtsocks;g' \ |
michael@793 | 73 | tsocks |
michael@793 | 74 | |
michael@793 | 75 | %build |
michael@794 | 76 | if [ ! -f /lib*/libdl.so ] && [ ! -f /usr/lib*/libdl.so ]; then |
michael@793 | 77 | %{l_shtool} subst -e 's;-ldl;-lc;' configure |
michael@793 | 78 | fi |
michael@793 | 79 | CC="%{l_cc}" \ |
michael@793 | 80 | CFLAGS="%{l_cflags -O}" \ |
michael@793 | 81 | CPPFLAGS="%{l_cppflags}" \ |
michael@793 | 82 | LDFLAGS="%{l_ldflags}" \ |
michael@793 | 83 | ./configure \ |
michael@793 | 84 | --prefix=%{l_prefix} \ |
michael@793 | 85 | --libdir=%{l_prefix}/lib/tsocks \ |
michael@793 | 86 | --with-conf=%{l_prefix}/etc/tsocks/tsocks.conf |
michael@793 | 87 | %{l_make} %{l_mflags -O} |
michael@793 | 88 | |
michael@793 | 89 | %install |
michael@793 | 90 | rm -rf $RPM_BUILD_ROOT |
michael@793 | 91 | %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT |
michael@793 | 92 | %{l_shtool} mkdir -f -p -m 755 \ |
michael@793 | 93 | $RPM_BUILD_ROOT%{l_prefix}/etc/tsocks |
michael@793 | 94 | %{l_shtool} install -c -m 755 \ |
michael@793 | 95 | %{SOURCE tsocks.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/tsocks/ |
michael@793 | 96 | %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
michael@793 | 97 | %{l_files_std} \ |
michael@793 | 98 | '%config %{l_prefix}/etc/tsocks/tsocks.conf' |
michael@793 | 99 | |
michael@793 | 100 | %files -f files |
michael@793 | 101 | |
michael@793 | 102 | %clean |
michael@793 | 103 | rm -rf $RPM_BUILD_ROOT |
michael@793 | 104 |