bittorrent.spec 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. ##
  2. ## bittorrent.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2006 Ralf S. Engelschall <http://engelschall.com/>
  5. ##
  6. ## Permission to use, copy, modify, and distribute this software for
  7. ## any purpose with or without fee is hereby granted, provided that
  8. ## the above copyright notice and this permission notice appear in all
  9. ## copies.
  10. ##
  11. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. ## SUCH DAMAGE.
  23. ##
  24. # package information
  25. Name: bittorrent
  26. Summary: BitTorrent Peer-To-Peer Networking
  27. URL: http://www.bittorrent.com/
  28. Vendor: Bram Cohen
  29. Packager: OpenPKG
  30. Distribution: OpenPKG
  31. Class: PLUS
  32. Group: Network
  33. License: MIT-style
  34. Version: 4.20.1
  35. Release: 20060627
  36. # list of sources
  37. Source0: http://download.bittorrent.com/dl/BitTorrent-%{version}.tar.gz
  38. Source1: rc.bittorrent
  39. Source2: apache.conf
  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://download.bittorrent.com/dl/
  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. HOME=`pwd` %{l_prefix}/bin/python \
  64. setup.py install \
  65. --root=$RPM_BUILD_ROOT \
  66. --prefix=%{l_prefix}
  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 bin in *; do
  71. mv $bin $RPM_BUILD_ROOT%{l_prefix}/libexec/bittorrent/$bin
  72. ( echo "#!/bin/sh"
  73. echo "PYTHONPATH=\"%{l_prefix}/libexec/bittorrent\"; export PYTHONPATH"
  74. echo "exec %{l_prefix}/libexec/bittorrent/$bin \${1+\"\$@\"}"
  75. ) >$RPM_BUILD_ROOT%{l_prefix}/bin/$bin
  76. chmod a+x $RPM_BUILD_ROOT%{l_prefix}/bin/$bin
  77. done
  78. ) || exit $?
  79. %{l_shtool} mkdir -f -p -m 755 \
  80. $RPM_BUILD_ROOT%{l_prefix}/etc/bittorrent
  81. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  82. %{SOURCE apache.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/bittorrent/
  83. %{l_shtool} mkdir -f -p -m 755 \
  84. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  85. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  86. %{SOURCE rc.bittorrent} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  87. %{l_shtool} mkdir -f -p -m 755 \
  88. $RPM_BUILD_ROOT%{l_prefix}/var/bittorrent
  89. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc
  90. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/locale
  91. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  92. %{l_files_std} \
  93. '%attr(755,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/bittorrent' \
  94. '%config %{l_prefix}/etc/bittorrent/*'
  95. %files -f files
  96. %clean
  97. rm -rf $RPM_BUILD_ROOT