gup.spec 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. ##
  2. ## gup.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. # package information
  26. Name: gup
  27. Summary: Group Update (Newsgroups Subscription Manager)
  28. URL: http://packages.debian.org/stable/news/gup.html
  29. Vendor: Mark Delany
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [JUNK]
  32. Group: Converter
  33. License: Public Domain
  34. Version: 0.5.9
  35. Release: 20021230
  36. # list of sources
  37. Source0: ftp://ftp.debian.org/debian/pool/main/g/gup/gup_%{version}.tar.gz
  38. Patch0: gup.patch
  39. # build information
  40. Prefix: %{l_prefix}
  41. BuildRoot: %{l_buildroot}
  42. BuildPreReq: OpenPKG, openpkg >= 20020206
  43. PreReq: OpenPKG, openpkg >= 20020206, MTA, inn
  44. AutoReq: no
  45. AutoReqProv: no
  46. %description
  47. GUP is a small mail robot for managing the USENET newsgroup
  48. subscriptions of feeds in INN.
  49. %prep
  50. %setup -q -n gup-%{version}
  51. %patch -p0
  52. %build
  53. %{l_shtool} subst \
  54. -e 's;/usr/sbin/sendmail;%{l_prefix}/sbin/sendmail;' \
  55. -e 's;/var/lib/news;%{l_prefix}/var/gup;' \
  56. -e 's;"news";"postmaster";' \
  57. -e 's;USE_FLOCK;USE_DOTLOCK;' \
  58. config.h
  59. %{l_make} %{l_mflags -O} \
  60. CC="%{l_cc}" \
  61. P_CFLAGS="%{l_cflags -O}"
  62. %install
  63. rm -rf $RPM_BUILD_ROOT
  64. %{l_shtool} mkdir -f -p -m 755 \
  65. $RPM_BUILD_ROOT%{l_prefix}/sbin \
  66. $RPM_BUILD_ROOT%{l_prefix}/man/man8 \
  67. $RPM_BUILD_ROOT%{l_prefix}/etc/gup \
  68. $RPM_BUILD_ROOT%{l_prefix}/var/gup/sites
  69. %{l_shtool} install -c -s -m 4755 \
  70. gup $RPM_BUILD_ROOT%{l_prefix}/sbin/
  71. %{l_shtool} install -c -m 644 \
  72. gup.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/
  73. echo "test test postmaster@localhost" >config
  74. %{l_shtool} install -c -m 600 \
  75. config $RPM_BUILD_ROOT%{l_prefix}/etc/gup/config
  76. ( echo "From: \"Group Update\" <gup@localhost>"
  77. echo "User-Agent: gup/%{version}"
  78. echo ""
  79. echo "This is the Group Update (gup/%{version}) service on"
  80. echo "localhost managing your Usenet newsgroup subscription."
  81. ) >header
  82. %{l_shtool} install -c -m 644 \
  83. header $RPM_BUILD_ROOT%{l_prefix}/etc/gup/header
  84. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  85. %files -f files
  86. %clean
  87. rm -rf $RPM_BUILD_ROOT
  88. %post
  89. aliases_file=`$RPM_INSTALL_PREFIX/etc/rc --query mta_aliases_file`
  90. update_command=`$RPM_INSTALL_PREFIX/etc/rc --query mta_aliases_update`
  91. if [ ".$aliases_file" != . ]; then
  92. gup="$RPM_INSTALL_PREFIX/sbin/gup"
  93. gup="$gup -d $RPM_INSTALL_PREFIX/etc/gup"
  94. gup="$gup -m $RPM_INSTALL_PREFIX/etc/gup/header"
  95. gup="$gup -s $RPM_INSTALL_PREFIX/var/gup/sites"
  96. gup="$gup -l $RPM_INSTALL_PREFIX/var/gup/logfile"
  97. gup="$gup -a $RPM_INSTALL_PREFIX/var/inn/db/active"
  98. gup="$gup -n $RPM_INSTALL_PREFIX/var/inn/db/newsgroups"
  99. echo "gup: \"|$gup\"" |\
  100. $RPM_INSTALL_PREFIX/lib/openpkg/rpmtool config \
  101. -a -i "$RPM_INSTALL_PREFIX:gup" $aliases_file
  102. fi
  103. if [ ".$update_command" != . ]; then
  104. eval $update_command
  105. fi
  106. %preun
  107. aliases_file=`$RPM_INSTALL_PREFIX/etc/rc --query mta_aliases_file`
  108. update_command=`$RPM_INSTALL_PREFIX/etc/rc --query mta_aliases_update`
  109. if [ ".$aliases_file" != . ]; then
  110. $RPM_INSTALL_PREFIX/lib/openpkg/rpmtool config \
  111. -r -i "$RPM_INSTALL_PREFIX:gup" $aliases_file
  112. fi
  113. if [ ".$update_command" != . ]; then
  114. eval $update_command
  115. fi