htdig.spec 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. ##
  2. ## htdig.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2006 Ralf S. Engelschall <http://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: htdig
  26. Summary: Web Crawler
  27. URL: http://www.htdig.org/
  28. Vendor: The ht://Dig Group
  29. Packager: OpenPKG
  30. Distribution: OpenPKG
  31. Class: PLUS
  32. Group: Searching
  33. License: GPL
  34. Version: 3.2.0b6
  35. Release: 20060924
  36. # list of sources
  37. Source0: http://www.htdig.org/files/htdig-%{version}.tar.gz
  38. Source1: rc.htdig
  39. Patch0: htdig.patch
  40. # build information
  41. Prefix: %{l_prefix}
  42. BuildRoot: %{l_buildroot}
  43. BuildPreReq: OpenPKG, openpkg >= 20060823, gcc, make, flex, perl
  44. PreReq: OpenPKG, openpkg >= 20060823
  45. BuildPreReq: zlib, openssl
  46. PreReq: zlib, openssl
  47. AutoReq: no
  48. AutoReqProv: no
  49. %description
  50. The ht://Dig system is a complete world wide web indexing and
  51. searching system for a domain or intranet. This system is not meant
  52. to replace the need for powerful internet-wide search systems
  53. like Lycos, Infoseek, Google and AltaVista. Instead it is meant
  54. to cover the search needs for a single company, campus, or even a
  55. particular sub section of a web site. As opposed to some WAIS-based
  56. or web-server based search engines, ht://Dig can easily span several
  57. web servers. The type of these different web servers doesn't matter
  58. as long as they understand common protocols like HTTP.
  59. %track
  60. prog htdig = {
  61. version = %{version}
  62. url = http://www.htdig.org/files/
  63. regex = htdig-(__VER__)\.tar\.gz
  64. }
  65. %prep
  66. %setup -q
  67. %patch -p0
  68. %build
  69. # configure program
  70. %{l_shtool} subst \
  71. -e 's;/cgi-bin/htsearch;/openpkg-cgi/htsearch;g' \
  72. -e 's;$(VERSION);;' \
  73. installdir/search.html
  74. CC="%{l_cc}" \
  75. CXX="%{l_cxx} -Wno-deprecated" \
  76. CPPFLAGS="%{l_cppflags}" \
  77. CFLAGS="%{l_cflags -O}" \
  78. CXXFLAGS="%{l_cxxflags -O}" \
  79. ./configure \
  80. --prefix=%{l_prefix} \
  81. --with-config-dir=%{l_prefix}/etc/htdig \
  82. --with-common-dir=%{l_prefix}/etc/htdig \
  83. --with-database-dir=%{l_prefix}/var/htdig/db \
  84. --with-default-config-file=%{l_prefix}/etc/htdig/htdig.conf \
  85. --with-cgi-bin-dir=%{l_prefix}/cgi \
  86. --with-image-dir=%{l_prefix}/share/htdig/image \
  87. --with-image-url-prefix=/openpkg-htdig/image \
  88. --with-search-dir=%{l_prefix}/share/htdig \
  89. --with-search-form=index.html \
  90. --with-zlib=%{l_prefix} \
  91. --with-ssl=%{l_prefix} \
  92. --with-apache=%{l_prefix}/bin/apache \
  93. --disable-bigfile \
  94. --disable-shared
  95. # build program
  96. %{l_make} %{l_mflags}
  97. %install
  98. # install program
  99. rm -rf $RPM_BUILD_ROOT
  100. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  101. # strip down installation
  102. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  103. rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib
  104. rm -rf $RPM_BUILD_ROOT%{l_prefix}/include
  105. # install run-command script
  106. %{l_shtool} mkdir -f -p -m 755 \
  107. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  108. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  109. %{SOURCE rc.htdig} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  110. # create additional directories
  111. %{l_shtool} mkdir -f -p -m 755 \
  112. $RPM_BUILD_ROOT%{l_prefix}/var/htdig/run
  113. # determine installation files
  114. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  115. %{l_files_std} \
  116. '%config %{l_prefix}/etc/htdig/*' \
  117. '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/htdig/*'
  118. %files -f files
  119. %clean
  120. rm -rf $RPM_BUILD_ROOT
  121. %post
  122. if [ $1 -eq 1 ]; then
  123. # add hook to Apache configuration
  124. apacheconf="$RPM_INSTALL_PREFIX/etc/apache/apache.conf"
  125. if [ -f $apacheconf ]; then
  126. ( echo "Alias /openpkg-htdig $RPM_INSTALL_PREFIX/share/htdig"
  127. ) | $RPM_INSTALL_PREFIX/lib/openpkg/rpmtool config \
  128. -a -i "$RPM_INSTALL_PREFIX:htdig" $apacheconf
  129. fi
  130. # display final hints on initial installation
  131. ( echo "To complete this installation of ht://Dig please edit"
  132. echo "the configuration file and run ht://Dig once to initially"
  133. echo "create the database:"
  134. echo " \$ vi $RPM_INSTALL_PREFIX/etc/htdig/htdig.conf"
  135. echo " \$ $RPM_INSTALL_PREFIX/etc/rc htdig daily"
  136. echo " \$ $RPM_INSTALL_PREFIX/etc/rc apache stop start"
  137. echo "Now you should be able to access the search form and"
  138. echo "perform your first search:"
  139. echo " http://localhost/openpkg-htdig/"
  140. ) | %{l_rpmtool} msg -b -t notice
  141. fi
  142. exit 0
  143. %preun
  144. if [ $1 -eq 0 ]; then
  145. # remove hook from Apache configuration
  146. apacheconf="$RPM_INSTALL_PREFIX/etc/apache/apache.conf"
  147. if [ -f $apacheconf ]; then
  148. $RPM_INSTALL_PREFIX/lib/openpkg/rpmtool config \
  149. -r -i "$RPM_INSTALL_PREFIX:htdig" $apacheconf
  150. fi
  151. # before erase, remove data
  152. rm -f $RPM_INSTALL_PREFIX/var/htdig/run/* >/dev/null 2>&1 || true
  153. rm -f $RPM_INSTALL_PREFIX/var/htdig/db/* >/dev/null 2>&1 || true
  154. fi
  155. exit 0