bittorrent.spec 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. ##
  2. ## bittorrent.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2004 Cable & Wireless <http://www.cw.com/>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # package information
  26. Name: bittorrent
  27. Summary: BitTorrent Peer-To-Peer Networking
  28. URL: http://bitconjurer.org/BitTorrent/
  29. Vendor: Bram Cohen
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG
  32. Class: PLUS
  33. Group: Network
  34. License: MIT-style
  35. Version: 3.4.2
  36. Release: 20040702
  37. # list of sources
  38. Source0: http://osdn.dl.sourceforge.net/bittorrent/BitTorrent-%{version}.tar.gz
  39. Source1: rc.bittorrent
  40. Source2: apache.conf
  41. # build information
  42. Prefix: %{l_prefix}
  43. BuildRoot: %{l_buildroot}
  44. BuildPreReq: OpenPKG, openpkg >= 20040130, python
  45. PreReq: OpenPKG, openpkg >= 20040130, python
  46. AutoReq: no
  47. AutoReqProv: no
  48. %description
  49. BitTorrent is a Peer-to-Peer networking server and client.
  50. %track
  51. prog bittorrent = {
  52. version = %{version}
  53. url = http://prdownloads.sourceforge.net/bittorrent/
  54. regex = BitTorrent-(__VER__)\.tar\.gz
  55. }
  56. %prep
  57. %setup -q -n BitTorrent-%{version}
  58. %build
  59. %{l_shtool} subst \
  60. -e 's;#!/usr/bin/env python;#!%{l_prefix}/bin/python;g' \
  61. *.py
  62. %install
  63. rm -rf $RPM_BUILD_ROOT
  64. %{l_prefix}/bin/python \
  65. setup.py install \
  66. --root=$RPM_BUILD_ROOT
  67. %{l_shtool} mkdir -f -p -m 755 \
  68. $RPM_BUILD_ROOT%{l_prefix}/libexec/bittorrent
  69. ( cd $RPM_BUILD_ROOT%{l_prefix}/bin
  70. for src in *.py; do
  71. dst=`echo $src | sed -e 's;\.py$;;'`
  72. mv $src $RPM_BUILD_ROOT%{l_prefix}/libexec/bittorrent/$src
  73. ( echo "#!/bin/sh"
  74. echo "PYTHONPATH=\"%{l_prefix}/libexec/bittorrent\"; export PYTHONPATH"
  75. echo "exec %{l_prefix}/libexec/bittorrent/$src \${1+\"\$@\"}"
  76. ) >$RPM_BUILD_ROOT%{l_prefix}/bin/$dst
  77. chmod a+x $RPM_BUILD_ROOT%{l_prefix}/bin/$dst
  78. done
  79. ) || exit $?
  80. %{l_shtool} mkdir -f -p -m 755 \
  81. $RPM_BUILD_ROOT%{l_prefix}/etc/bittorrent
  82. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  83. %{SOURCE apache.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/bittorrent/
  84. %{l_shtool} mkdir -f -p -m 755 \
  85. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  86. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  87. %{SOURCE rc.bittorrent} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  88. %{l_shtool} mkdir -f -p -m 755 \
  89. $RPM_BUILD_ROOT%{l_prefix}/var/bittorrent
  90. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  91. %{l_files_std} \
  92. '%attr(755,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/bittorrent'
  93. %files -f files
  94. %clean
  95. rm -rf $RPM_BUILD_ROOT