nntpcache.spec 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. ##
  2. ## nntpcache.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: nntpcache
  27. Summary: NNTP Caching Proxy
  28. URL: http://www.nntpcache.org/
  29. Vendor: Julian Assange, Luke Bowker
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [BASE]
  32. Group: News
  33. License: BSD
  34. Version: 3.0.1
  35. Release: 20030714
  36. # package options
  37. %option with_fsl yes
  38. # list of sources
  39. Source0: ftp://ftp.nntpcache.org/pub/nntpcache/nntpcache-%{version}.tar.gz
  40. Source1: rc.nntpcache
  41. Source2: fsl.nntpcache
  42. # build information
  43. Prefix: %{l_prefix}
  44. BuildRoot: %{l_buildroot}
  45. BuildPreReq: OpenPKG, openpkg >= 20030710, make
  46. PreReq: OpenPKG, openpkg >= 20030710
  47. %if "%{with_fsl}" == "yes"
  48. BuildPreReq: fsl >= 1.2.0
  49. PreReq: fsl >= 1.2.0
  50. %endif
  51. AutoReq: no
  52. AutoReqProv: no
  53. %description
  54. NNTPCache (efficiently) executes on the localhost pretending to
  55. be an NNRP news reading server. In fact, what it does is pass
  56. certain NNTP commands through to real (remote and possibly local)
  57. news-servers based on various pattern matching rules. NNTPCache
  58. then takes the output from those servers and caches & indexes it in
  59. funky ways (much case specific magic goes into this). The next time
  60. such information is asked for, or other information which can be
  61. logically inferred from the previously collated information, it is
  62. sent directly from the cache, without consulting the remote servers.
  63. %prep
  64. %setup -q
  65. %build
  66. # configure package
  67. %{l_shtool} subst \
  68. -e 's;test -e;test -f;g' \
  69. Makefile* */Makefile*
  70. %{l_shtool} subst \
  71. -e 's;/etc/nntpcache/\(newshound\.conf\);%{l_prefix}/etc/nntpcache/\1;' \
  72. contrib/newshound/getconf.c
  73. CC="%{l_cc}" \
  74. CFLAGS="%{l_cflags -O}" \
  75. LDFLAGS="%{l_fsl_ldflags}" \
  76. LIBS="%{l_fsl_libs}" \
  77. ./configure \
  78. --prefix=%{l_prefix} \
  79. --sysconfdir=%{l_prefix}/etc/nntpcache \
  80. --libexecdir=%{l_prefix}/libexec/nntpcache \
  81. --localstatedir=%{l_prefix}/var/nntpcache
  82. # build package
  83. %{l_make} %{l_mflags}
  84. %install
  85. rm -rf $RPM_BUILD_ROOT
  86. # install package
  87. %{l_shtool} mkdir -f -p -m 755 \
  88. $RPM_BUILD_ROOT%{l_prefix}/var
  89. %{l_shtool} subst \
  90. -e "s;chown;true;g" -e "s;chgrp;true;g" \
  91. `find . -type f -name Makefile -print`
  92. %{l_make} %{l_mflags} install \
  93. prefix=$RPM_BUILD_ROOT%{l_prefix} \
  94. exec_prefix=$RPM_BUILD_ROOT%{l_prefix} \
  95. sysconfdir=$RPM_BUILD_ROOT%{l_prefix}/etc/nntpcache \
  96. libexecdir=$RPM_BUILD_ROOT%{l_prefix}/libexecdir/nntpcache \
  97. configDir=$RPM_BUILD_ROOT%{l_prefix}/etc/nntpcache \
  98. localstatedir=$RPM_BUILD_ROOT%{l_prefix}/var/nntpcache \
  99. cacheDir=$RPM_BUILD_ROOT%{l_prefix}/var/nntpcache
  100. # strip down and post-adjust installation hierarchy
  101. rm -rf $RPM_BUILD_ROOT%{l_prefix}/include
  102. rm -rf $RPM_BUILD_ROOT%{l_prefix}/etc/nntpcache/http
  103. rm -rf $RPM_BUILD_ROOT%{l_prefix}/bin
  104. rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/innreport.sh
  105. rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/newshound.pl
  106. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/nntpcache/pubring*
  107. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/nntpcache/innreport*
  108. strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
  109. find $RPM_BUILD_ROOT%{l_prefix} -type d -print | xargs chmod 755
  110. find $RPM_BUILD_ROOT%{l_prefix} -type f -print | grep -v /sbin | xargs chmod 644
  111. find $RPM_BUILD_ROOT%{l_prefix} -type f -name VERSION -print | xargs rm -f
  112. ( cd $RPM_BUILD_ROOT%{l_prefix}/etc/nntpcache
  113. for file in *-dist; do
  114. mv $file `echo $file | sed -e 's;-dist$;;'`
  115. done )
  116. # install run-command script
  117. %{l_shtool} mkdir -f -p -m 755 \
  118. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  119. %{l_shtool} install -c -m 755 \
  120. -e 's;@l_prefix@;%{l_prefix};g' \
  121. -e 's;@l_susr@;%{l_susr};g' \
  122. -e 's;@l_rusr@;%{l_rusr};g' \
  123. -e 's;@l_rgrp@;%{l_rgrp};g' \
  124. %{SOURCE rc.nntpcache} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  125. # install OSSP fsl configuration
  126. %{l_shtool} mkdir -f -p -m 755 \
  127. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  128. %{l_shtool} install -c -m 644 \
  129. -e 's;@l_prefix@;%{l_prefix};g' \
  130. %{SOURCE fsl.nntpcache} \
  131. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  132. # determine installation files
  133. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  134. %{l_files_std} \
  135. '%not %dir %{l_prefix}/etc/fsl' \
  136. '%config %{l_prefix}/etc/fsl/fsl.nntpcache'
  137. %files -f files
  138. %clean
  139. rm -rf $RPM_BUILD_ROOT