gup.spec 4.5 KB

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