heise.spec 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. ##
  2. ## heise.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.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. # version variables
  26. %define V_vl 2.1.9
  27. %define V_vs 219
  28. # package information
  29. Name: heise
  30. Summary: Heise Register
  31. URL: http://www.heise.de/ct/ftp/register.shtml
  32. Vendor: Heise Verlag, Andy Spiegl, Jan Starzynski
  33. Packager: The OpenPKG Project
  34. Distribution: OpenPKG [EVAL]
  35. Group: Misc
  36. License: GPL
  37. Version: %{V_vl}
  38. Release: 20021211
  39. # list of sources
  40. Source0: ftp://ftp.heise.de/pub/ct/register/regpl%{V_vs}.zip
  41. Source1: rc.heise
  42. Source2: heise.conf
  43. # build information
  44. Prefix: %{l_prefix}
  45. BuildRoot: %{l_buildroot}
  46. BuildPreReq: OpenPKG, openpkg >= 20020206, infozip
  47. PreReq: OpenPKG, openpkg >= 20020206, infozip, perl, curl, shtool
  48. AutoReq: no
  49. AutoReqProv: no
  50. %description
  51. Utility to seach in the index of the german magazine publisher Heise.
  52. %prep
  53. %setup -T -c
  54. %{l_prefix}/bin/unzip -x %{SOURCE regpl%{V_vs}.zip}
  55. %build
  56. ( echo "#!%{l_prefix}/bin/perl"
  57. sed \
  58. -e '1,15d' \
  59. -e "s;~/heise/inhalt.frm;%{l_prefix}/var/heise/inhalt.frm;" \
  60. -e "s;^\(\$frmfilefmt = \).*$;\1\"%{l_prefix}/etc/heise/heise.conf\"\;;" \
  61. <reg.pl
  62. ) >heise
  63. %install
  64. rm -rf $RPM_BUILD_ROOT
  65. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/bin
  66. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/heise
  67. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  68. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/var/heise
  69. %{l_shtool} install -c -m 755 \
  70. heise \
  71. $RPM_BUILD_ROOT%{l_prefix}/bin/
  72. %{l_shtool} install -c -m 644 \
  73. %{SOURCE heise.conf} \
  74. $RPM_BUILD_ROOT%{l_prefix}/etc/heise/
  75. %{l_shtool} install -c -m 755 \
  76. -e 's;@l_prefix@;%{l_prefix};g' \
  77. -e 's;@l_musr@;%{l_musr};g' \
  78. -e 's;@l_mgrp@;%{l_mgrp};g' \
  79. %{SOURCE rc.heise} \
  80. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  81. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  82. %files -f files
  83. %clean
  84. rm -rf $RPM_BUILD_ROOT
  85. %post
  86. if [ "$1" -eq 1 ]; then
  87. $RPM_INSTALL_PREFIX/etc/rc.d/rc.heise weekly || true
  88. fi
  89. %preun
  90. if [ "$1" -eq 0 ]; then
  91. rm -rf $RPM_INSTALL_PREFIX/var/heise/* 2>/dev/null || true
  92. fi