inn.spec 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. ##
  2. ## inn.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: inn
  26. Summary: InterNetNews Usenet Server
  27. URL: http://www.isc.org/products/INN/
  28. Vendor: Internet Software Consortium
  29. Packager: The OpenPKG Project
  30. Distribution: OpenPKG [EXP]
  31. Group: News
  32. License: ISC
  33. Version: 2.3.2
  34. Release: 8
  35. # list of sources
  36. Source0: ftp://ftp.isc.org/isc/inn/inn-%{version}.tar.gz
  37. Source1: ftp://ftp.openpkg.org/DST/inn/fakesyslog.tar.gz
  38. Source2: rc.inn
  39. # build information
  40. Prefix: %{l_prefix}
  41. BuildRoot: %{l_buildroot}
  42. BuildPreReq: OpenPKG, openpkg >= 0.9-33, make, perl, db, openssl
  43. PreReq: OpenPKG, openpkg >= 0.9-33, perl, MTA
  44. AutoReq: no
  45. AutoReqProv: no
  46. %description
  47. InterNetNews (INN) is a complete Usenet system. It includes innd, an
  48. NNTP server, and nnrpd, a newsreading server. INN separates hosts
  49. that feed you news from those that have users reading news.
  50. %prep
  51. %setup0 -q -c
  52. %setup1 -q -T -D -a 1
  53. %build
  54. # make sure INN finds our own files
  55. PATH="%{l_prefix}/bin:$PATH"
  56. export PATH
  57. # build faked syslog(3) library
  58. fakesyslogdir="`pwd`/fakesyslog"
  59. ( cd fakesyslog
  60. CC="%{l_cc}" \
  61. CFLAGS="%{l_cflags -O}" \
  62. ./configure \
  63. --with-logfile=%{l_prefix}/var/inn/log/news.log
  64. %{l_make} %{l_mflags}
  65. )
  66. # adjust some too strange INN paths
  67. cd inn-%{version}
  68. %{l_rpmtool} subst \
  69. "s;^\\(PATHBIN.*=\\).*;\\1 \$(PATHNEWS)/libexec/inn;" \
  70. -- Makefile.global.in
  71. %{l_rpmtool} subst \
  72. "s;^\\(pathbin:.*\\)@prefix@.*;\\1@prefix@/libexec/inn;" \
  73. -- samples/inn.conf.in
  74. # configure the source tree
  75. CC="%{l_cc}" \
  76. CFLAGS="%{l_cflags -O}" \
  77. LDFLAGS="-L$fakesyslogdir" \
  78. LIBS="-lfakesyslog" \
  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-path=%{l_prefix}/var/inn/tmp \
  91. --with-openssl=%{l_prefix} \
  92. --with-berkeleydb=%{l_prefix} \
  93. --with-news-user=%{l_fsusr} \
  94. --with-news-group=%{l_fsusr} \
  95. --with-news-master=%{l_fsusr} \
  96. --with-sendmail=%{l_prefix}/sbin/sendmail
  97. # build the INN system
  98. %{l_make} %{l_mflags}
  99. %install
  100. rm -rf $RPM_BUILD_ROOT
  101. cd inn-%{version}
  102. # determine current user and group
  103. thisuser=`(id -un) 2>/dev/null ||\
  104. (whoami) 2>/dev/null ||\
  105. (who am i | cut "-d " -f1) 2>/dev/null ||\
  106. echo $LOGNAME`
  107. thisgroup=`(cat /etc/passwd; ypcat passwd) 2>/dev/null |\
  108. grep "^${thisuser}:" | awk -F: '{ print $4; }' | head -1`
  109. thisgroup=`(cat /etc/group; ypcat group) 2>/dev/null |\
  110. grep ":${thisgroup}:" | awk -F: '{ print $1; }' | head -1`
  111. if [ ".$thisgroup" = . ]; then
  112. thisgroup="$thisuser"
  113. fi
  114. # adjust INN installation procedure
  115. %{l_rpmtool} subst \
  116. "s;^\\(prefix.*=\\).*;\\1 $RPM_BUILD_ROOT%{l_prefix};" \
  117. "s;^\\(PATH.*=[ ]*\\)\\(%{l_prefix}\\);\\1 $RPM_BUILD_ROOT\\2;" \
  118. "s;^\\(NEWSUSER.*=\\).*;\\1 $thisuser;" \
  119. "s;^\\(NEWSGROUP.*=\\).*;\\1 $thisgroup;" \
  120. "s;^\\(OWNER.*=\\).*;\\1;" \
  121. "s;^\\(ROWNER.*=\\).*;\\1;" \
  122. -- Makefile.global
  123. # perform installation procedure
  124. %{l_make} %{l_mflags} install
  125. # make some programs manually accessible
  126. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/bin/
  127. for bin in controlbatch controlchan news2mail startinnfeed overchan \
  128. archive innmail innconfval ctlinnd inews rnews nntpsend; do
  129. ln $RPM_BUILD_ROOT%{l_prefix}/libexec/inn/$bin \
  130. $RPM_BUILD_ROOT%{l_prefix}/bin/$bin
  131. done
  132. # strip installation
  133. rm -f $RPM_BUILD_ROOT%{l_prefix}/libexec/inn/filter/*.py
  134. rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/inn/*.tcl
  135. rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/inn/lib*.a
  136. rm -f $RPM_BUILD_ROOT%{l_prefix}/libexec/inn/ovdb_upgrade
  137. ln $RPM_BUILD_ROOT%{l_prefix}/libexec/inn/ovdb_recover \
  138. $RPM_BUILD_ROOT%{l_prefix}/libexec/inn/ovdb_upgrade
  139. # adjust configuration
  140. ( echo ''
  141. echo '# dummy entry to make INN happy as long as'
  142. echo '# this server has no real newsfeeds configured.'
  143. echo 'echo "dummy-feed:!*::'
  144. echo ''
  145. ) >>$RPM_BUILD_ROOT%{l_prefix}/etc/inn/newsfeeds
  146. ( echo ''
  147. echo '# use the traditional spool area for storage'
  148. echo 'method tradspool {'
  149. echo ' newsgroups: *'
  150. echo ' class: 1'
  151. echo '}'
  152. ) >>$RPM_BUILD_ROOT%{l_prefix}/etc/inn/storage.conf
  153. # create initial history database
  154. ( cd $RPM_BUILD_ROOT%{l_prefix}/var/inn/db
  155. touch history
  156. INNCONF=$RPM_BUILD_ROOT%{l_prefix}/etc/inn/inn.conf \
  157. $RPM_BUILD_ROOT%{l_prefix}/libexec/inn/makedbz -i -f ./history
  158. chmod 644 history*
  159. )
  160. # create empty logfiles
  161. touch $RPM_BUILD_ROOT%{l_prefix}/var/inn/log/news.log
  162. # install run-command script
  163. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  164. %{l_shtool} install -c -m 755 \
  165. -e 's;@l_prefix@;%{l_prefix};g' \
  166. -e 's;@l_fsusr@;%{l_fsusr};g' \
  167. -e 's;@l_fsgrp@;%{l_fsgrp};g' \
  168. %{SOURCE rc.inn} \
  169. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  170. # determine file list
  171. %{l_rpmtool} files -v -o../files -r$RPM_BUILD_ROOT \
  172. %{l_files_std} \
  173. '%config %{l_prefix}/etc/inn/*' \
  174. '%attr(4755,root,%{l_fsgrp}) %{l_prefix}/libexec/inn/inndstart' \
  175. '%attr(4755,root,%{l_fsgrp}) %{l_prefix}/libexec/inn/startinnfeed'
  176. %files -f files
  177. %clean
  178. rm -rf $RPM_BUILD_ROOT