tor/tor.spec

Wed, 22 Jan 2014 21:02:10 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 22 Jan 2014 21:02:10 +0100
changeset 789
cbbc8daa8174
child 790
ab976cd2e548
permissions
-rw-r--r--

Import package vendor original specs for necessary manipulations.

     1 ##
     2 ##  tor.spec -- OpenPKG RPM Package Specification
     3 ##  Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/>
     4 ##
     5 ##  Permission to use, copy, modify, and distribute this software for
     6 ##  any purpose with or without fee is hereby granted, provided that
     7 ##  the above copyright notice and this permission notice appear in all
     8 ##  copies.
     9 ##
    10 ##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    11 ##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    12 ##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    13 ##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    14 ##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    15 ##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    16 ##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    17 ##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    18 ##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    19 ##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    20 ##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    21 ##  SUCH DAMAGE.
    22 ##
    24 #   package version
    25 %define       V_dist  0.2.3.14-alpha
    26 %define       V_opkg  0.2.3.14
    28 #   package information
    29 Name:         tor
    30 Summary:      Anonymous Internet Communication System
    31 URL:          http://www.torproject.org/
    32 Vendor:       R. Dingledine & N. Mathewson
    33 Packager:     OpenPKG Foundation e.V.
    34 Distribution: OpenPKG Community
    35 Class:        PLUS
    36 Group:        Network
    37 License:      LGPL
    38 Version:      %{V_opkg}
    39 Release:      20120427
    41 #   list of sources
    42 Source0:      http://www.torproject.org/dist/tor-%{V_dist}.tar.gz
    43 Source1:      rc.tor
    44 Source2:      torrc
    46 #   build information
    47 BuildPreReq:  OpenPKG, openpkg >= 20100101, gcc
    48 PreReq:       OpenPKG, openpkg >= 20100101, tsocks
    49 BuildPreReq:  openssl, libevent, zlib
    50 PreReq:       openssl, libevent, zlib
    52 %description
    53    Tor is a toolset for a wide range of organizations and people
    54    that want to improve their safety and security on the Internet.
    55    Using Tor can help you anonymize web browsing and publishing,
    56    instant messaging, IRC, SSH, and other applications that use the TCP
    57    protocol. Tor also provides a platform on which software developers
    58    can build new applications with built-in anonymity, safety, and
    59    privacy features. Your traffic is safer when you use Tor, because
    60    communications are bounced around a distributed network of servers,
    61    called onion routers. Instead of taking a direct route from source to
    62    destination, data packets on the Tor network take a random pathway
    63    through several servers that cover your tracks so no observer at any
    64    single point can tell where the data came from or where it's going.
    66 %track
    67     prog tor = {
    68         version   = %{V_dist}
    69         url       = http://www.torproject.org/dist/
    70         regex     = tor-(\d+\.\d+(\.\d+)*(-(alpha|beta|rc))?)\.tar\.gz
    71     }
    73 %prep
    74     %setup -q -n tor-%{V_dist}
    76 %build
    77     libs=""
    78     case "%{l_platform -t}" in
    79         *-linux* ) libs="$libs -lrt" ;;
    80     esac
    81     CC="%{l_cc}" \
    82     CFLAGS="%{l_cflags -O}" \
    83     CPPFLAGS="%{l_cppflags}" \
    84     LDFLAGS="%{l_ldflags}" \
    85     LIBS="$libs" \
    86     ./configure \
    87         --prefix=%{l_prefix} \
    88         --mandir=%{l_prefix}/man \
    89         --with-ssl-dir=%{l_prefix} \
    90         --with-libevent-dir=%{l_prefix} \
    91         --disable-asciidoc
    92     %{l_make} %{l_mflags -O}
    94 %install
    95     %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
    96     strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
    97     mv $RPM_BUILD_ROOT%{l_prefix}/etc/tor/torrc.sample \
    98        $RPM_BUILD_ROOT%{l_prefix}/etc/tor/torrc
    99     %{l_shtool} subst \
   100         -e 's;exec tsocks;exec %{l_prefix}/bin/tsocks;' \
   101         $RPM_BUILD_ROOT%{l_prefix}/bin/torify
   102     %{l_shtool} mkdir -f -p -m 755 \
   103         $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
   104     %{l_shtool} install -c -m 755 %{l_value -s -a} \
   105         %{SOURCE rc.tor} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
   106     %{l_shtool} install -c -m 755 %{l_value -s -a} \
   107         %{SOURCE torrc} $RPM_BUILD_ROOT%{l_prefix}/etc/tor/
   108     %{l_shtool} mkdir -f -p -m 755 \
   109         $RPM_BUILD_ROOT%{l_prefix}/var/tor/db
   110     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   111         %{l_files_std} \
   112         '%config %{l_prefix}/etc/tor/*' \
   113         '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/tor' \
   114         '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/tor/db'
   116 %files -f files
   118 %clean
   120 %post
   121     #   after upgrade, restart service
   122     [ $1 -eq 2 ] || exit 0
   123     eval `%{l_rc} tor status 2>/dev/null`
   124     [ ".$tor_active" = .yes ] && %{l_rc} tor restart
   125     exit 0
   127 %preun
   128     #   before erase, stop service and remove log files
   129     [ $1 -eq 0 ] || exit 0
   130     %{l_rc} tor stop 2>/dev/null
   131     rm -f $RPM_INSTALL_PREFIX/var/tor/tor.* >/dev/null 2>&1 || true
   132     rm -f $RPM_INSTALL_PREFIX/var/tor/db/*  >/dev/null 2>&1 || true
   133     exit 0

mercurial