bittorrent.spec 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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: EVAL
  33. Group: Network
  34. License: MIT-style
  35. Version: 3.4.2
  36. Release: 20040518
  37. # list of sources
  38. Source0: http://osdn.dl.sourceforge.net/bittorrent/BitTorrent-%{version}.tar.gz
  39. Source1: rc.bittorrent
  40. # build information
  41. Prefix: %{l_prefix}
  42. BuildRoot: %{l_buildroot}
  43. BuildPreReq: OpenPKG, openpkg >= 20040130, python
  44. PreReq: OpenPKG, openpkg >= 20040130, python
  45. AutoReq: no
  46. AutoReqProv: no
  47. %description
  48. BitTorrent is a Peer-to-Peer networking server and client.
  49. %track
  50. prog bittorrent = {
  51. version = %{version}
  52. url = http://prdownloads.sourceforge.net/bittorrent/
  53. regex = BitTorrent-(__VER__)\.tar\.gz
  54. }
  55. %prep
  56. %setup -q -n BitTorrent-%{version}
  57. %build
  58. %{l_shtool} subst \
  59. -e 's;#!/usr/bin/env python;#!%{l_prefix}/bin/python;g' \
  60. *.py
  61. %install
  62. rm -rf $RPM_BUILD_ROOT
  63. %{l_prefix}/bin/python \
  64. setup.py install \
  65. --root=$RPM_BUILD_ROOT
  66. %{l_shtool} mkdir -f -p -m 755 \
  67. $RPM_BUILD_ROOT%{l_prefix}/libexec/bittorrent
  68. ( cd $RPM_BUILD_ROOT%{l_prefix}/bin
  69. for src in *.py; do
  70. dst=`echo $src | sed -e 's;\.py$;;'`
  71. mv $src $RPM_BUILD_ROOT%{l_prefix}/libexec/bittorrent/$src
  72. ( echo "#!/bin/sh"
  73. echo "PYTHONPATH=\"%{l_prefix}/libexec/bittorrent\"; export PYTHONPATH"
  74. echo "exec %{l_prefix}/libexec/bittorrent/$src \${1+\"\$@\"}"
  75. ) >$RPM_BUILD_ROOT%{l_prefix}/bin/$dst
  76. chmod a+x $RPM_BUILD_ROOT%{l_prefix}/bin/$dst
  77. done
  78. ) || exit $?
  79. %{l_shtool} mkdir -f -p -m 755 \
  80. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  81. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  82. %{SOURCE rc.bittorrent} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  83. %{l_shtool} mkdir -f -p -m 755 \
  84. $RPM_BUILD_ROOT%{l_prefix}/var/bittorrent
  85. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  86. %{l_files_std} \
  87. '%attr(755,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/bittorrent'
  88. %files -f files
  89. %clean
  90. rm -rf $RPM_BUILD_ROOT