inn.spec 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. ##
  2. ## inn.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: inn
  27. Summary: InterNetNews Usenet Server
  28. URL: http://www.isc.org/products/INN/
  29. Vendor: Internet Software Consortium
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [BASE]
  32. Group: News
  33. License: ISC
  34. Version: 2.4.0
  35. Release: 20030527
  36. # list of sources
  37. Source0: ftp://ftp.isc.org/isc/inn/inn-%{version}.tar.gz
  38. Source1: rc.inn
  39. Source2: fsl.inn
  40. Patch0: inn.patch
  41. # build information
  42. Prefix: %{l_prefix}
  43. BuildRoot: %{l_buildroot}
  44. BuildPreReq: OpenPKG, openpkg >= 20020206, fsl, gzip, make, perl, db, openssl, bison, flex
  45. PreReq: OpenPKG, openpkg >= 20020206, fsl, gzip, perl, MTA
  46. AutoReq: no
  47. AutoReqProv: no
  48. %description
  49. InterNetNews (INN) is a complete Usenet system. It includes innd, an
  50. NNTP server, and nnrpd, a newsreading server. INN separates hosts
  51. that feed you news from those that have users reading news.
  52. %prep
  53. %setup -q
  54. %patch -p0
  55. %build
  56. # adjust some too strange INN paths
  57. %{l_shtool} subst \
  58. -e "s;^\\(PATHBIN.*=\\).*;\\1 \$(PATHNEWS)/libexec/inn;" \
  59. Makefile.global.in
  60. %{l_shtool} subst \
  61. -e "s;^\\(pathbin:.*\\)@prefix@.*;\\1@prefix@/libexec/inn;" \
  62. samples/inn.conf.in
  63. %{l_shtool} subst \
  64. -e 's;\(ExtUtils::Embed.*ldopts.*tail -1\);\1 | sed -e "s/ -lc/ /";' \
  65. configure
  66. # configure the source tree
  67. CC="%{l_cc}" \
  68. CFLAGS="%{l_cflags -O} %{l_cppflags}" \
  69. LDFLAGS="%{l_ldflags} `%{l_prefix}/bin/fsl-config --ldflags --all`" \
  70. LIBS="`%{l_prefix}/bin/fsl-config --libs --all`" \
  71. ./configure \
  72. --prefix=%{l_prefix} \
  73. --bindir=%{l_prefix}/libexec/inn \
  74. --with-etc-dir=%{l_prefix}/etc/inn \
  75. --with-db-dir=%{l_prefix}/var/inn/db \
  76. --with-control-dir=%{l_prefix}/libexec/inn/control \
  77. --with-filter-dir=%{l_prefix}/libexec/inn/filter \
  78. --with-lib-dir=%{l_prefix}/lib/inn \
  79. --with-log-dir=%{l_prefix}/var/inn/log \
  80. --with-run-dir=%{l_prefix}/var/inn/run \
  81. --with-spool-dir=%{l_prefix}/var/inn/spool \
  82. --with-tmp-dir=%{l_prefix}/var/inn/tmp \
  83. --with-openssl=%{l_prefix} \
  84. --with-berkeleydb=%{l_prefix} \
  85. --with-news-user=%{l_musr} \
  86. --with-news-group=%{l_musr} \
  87. --with-news-master=%{l_musr} \
  88. --with-sendmail=%{l_prefix}/sbin/sendmail \
  89. --enable-uucp-rnews \
  90. --with-perl
  91. # build the INN system
  92. %{l_make} %{l_mflags}
  93. %install
  94. rm -rf $RPM_BUILD_ROOT
  95. # determine current user and group
  96. thisuser=`%{l_shtool} echo -e '%u'`
  97. thisgroup=`%{l_shtool} echo -e '%g'`
  98. if [ ".$thisgroup" = . ]; then
  99. thisgroup="$thisuser"
  100. fi
  101. # adjust INN installation procedure
  102. %{l_shtool} subst \
  103. -e "s;^\\(prefix.*=\\).*;\\1 $RPM_BUILD_ROOT%{l_prefix};" \
  104. -e "s;^\\(PATH.*=[ ]*\\)\\(%{l_prefix}\\);\\1 $RPM_BUILD_ROOT\\2;" \
  105. -e "s;^\\(NEWSUSER.*=\\).*;\\1 $thisuser;" \
  106. -e "s;^\\(NEWSGROUP.*=\\).*;\\1 $thisgroup;" \
  107. -e "s;^\\(OWNER.*=\\).*;\\1;" \
  108. -e "s;^\\(ROWNER.*=\\).*;\\1;" \
  109. Makefile.global
  110. # perform installation procedure
  111. %{l_make} %{l_mflags} install
  112. # make some programs manually accessible
  113. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/bin
  114. for bin in controlbatch controlchan news2mail startinnfeed overchan \
  115. archive innmail innconfval ctlinnd inews rnews nntpsend; do
  116. ln $RPM_BUILD_ROOT%{l_prefix}/libexec/inn/$bin \
  117. $RPM_BUILD_ROOT%{l_prefix}/bin/$bin
  118. done
  119. # strip installation
  120. rm -f $RPM_BUILD_ROOT%{l_prefix}/libexec/inn/filter/*.py
  121. rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/inn/*.tcl
  122. rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/inn/lib*.a
  123. rm -rf $RPM_BUILD_ROOT%{l_prefix}/doc
  124. rm -rf $RPM_BUILD_ROOT%{l_prefix}/include
  125. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  126. # adjust configuration
  127. ( echo ''
  128. echo '# dummy entry to make INN happy as long as'
  129. echo '# this server has no real newsfeeds configured.'
  130. echo 'dummy-feed:!*::'
  131. echo ''
  132. ) >>$RPM_BUILD_ROOT%{l_prefix}/etc/inn/newsfeeds
  133. ( echo ''
  134. echo '# use the traditional spool area for storage'
  135. echo 'method tradspool {'
  136. echo ' newsgroups: *'
  137. echo ' class: 1'
  138. echo '}'
  139. ) >>$RPM_BUILD_ROOT%{l_prefix}/etc/inn/storage.conf
  140. # create initial history database
  141. ( cd $RPM_BUILD_ROOT%{l_prefix}/var/inn/db
  142. touch history
  143. INNCONF=$RPM_BUILD_ROOT%{l_prefix}/etc/inn/inn.conf \
  144. $RPM_BUILD_ROOT%{l_prefix}/libexec/inn/makedbz -i -f ./history
  145. chmod 644 history*
  146. )
  147. # adjust permissions
  148. chmod 664 $RPM_BUILD_ROOT%{l_prefix}/var/inn/db/active
  149. # create empty logfiles
  150. touch $RPM_BUILD_ROOT%{l_prefix}/var/inn/log/news.log
  151. # install run-command script
  152. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  153. %{l_shtool} install -c -m 755 \
  154. -e 's;@l_prefix@;%{l_prefix};g' \
  155. -e 's;@l_musr@;%{l_musr};g' \
  156. -e 's;@l_mgrp@;%{l_mgrp};g' \
  157. %{SOURCE rc.inn} \
  158. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  159. # OSSP fsl support
  160. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  161. %{l_shtool} install -c -m 644 \
  162. -e 's;@l_prefix@;%{l_prefix};g' \
  163. %{SOURCE fsl.inn} \
  164. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  165. # strip binaries
  166. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true
  167. strip $RPM_BUILD_ROOT%{l_prefix}/libexec/inn/* 2>/dev/null || true
  168. # create temporary directory
  169. %{l_shtool} mkdir -f -p -m 770 \
  170. $RPM_BUILD_ROOT%{l_prefix}/var/inn/tmp
  171. # determine file list
  172. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  173. %{l_files_std} \
  174. '%config %{l_prefix}/etc/inn/*' \
  175. '%config %{l_prefix}/etc/fsl/fsl.inn' \
  176. '%not %dir %{l_prefix}/etc/fsl' \
  177. '%attr(4550,root,%{l_mgrp}) %{l_prefix}/bin/rnews' \
  178. '%attr(4755,root,%{l_mgrp}) %{l_prefix}/libexec/inn/inndstart' \
  179. '%attr(4755,root,%{l_mgrp}) %{l_prefix}/libexec/inn/startinnfeed' \
  180. '%config %{l_prefix}/var/inn/db/*'
  181. %files -f files
  182. %clean
  183. rm -rf $RPM_BUILD_ROOT