gup.spec 4.3 KB

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