inn.spec 7.9 KB

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