File htdig.spec of Package htdig

#
# spec file for package htdig
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:           htdig
BuildRequires:  apache2-devel gcc-c++ libapr-util1-devel libopenssl-devel pcre-devel postfix zlib-devel
BuildRequires:  libtool
%define apache_serverroot %(/usr/sbin/apxs2 -q datadir 2>/dev/null || /usr/sbin/apxs2 -q PREFIX)
Url:            http://www.htdig.org
License:        GPL v2 or later
Group:          Productivity/Networking/Web/Utilities
AutoReqProv:    on
Version:        3.2.0b6
Release:        217
Summary:        WWW Index and Search System
Source:         http://switch.dl.sourceforge.net/sourceforge/htdig/htdig-%{version}.tar.bz2
Source1:        %{name}-README.SuSE
Patch1:         %{name}-google-style.patch
Patch2:         %{name}-rundig.patch
Patch3:         %{name}-ExternalParser-typo.patch
Patch4:         %{name}-SSLConnection.patch
Patch5:         %{name}-simpleUTF8.patch
Patch8:         %{name}-cleanup-db.diff
Patch9:         %{name}-cross-site-CAN-2005-0085.patch
Patch10:        %{name}-3.2.0b6-strictaliasing.diff
Patch11:        htsearch-gcc41.patch
Patch14:        %{name}-quoting.patch
# PATCH-FIX-UPSTREAM gmtime-lastday.patch use INT32_MAX to define last day (bnc##231196), related to (bnc#343913)
Patch15:        %{name}-gmtime-lastday.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
The ht://Dig system is a complete World Wide Web index and search
system for a small domain or intranet. This system is not meant to
replace the need for powerful Internet-wide search systems like Lycos,
Infoseek, Webcrawler, or AltaVista. Instead it is meant to cover the
search needs of a single company, campus, or even a particular
subsection of a Web site.

Unlike some WAIS-based or Web server-based search engines, ht://Dig can
span several Web servers at a site. The type of these Web servers does
not matter as long as they understand the HTTP 1.0 protocol.



Authors:
--------
    Andrew Scherpbier <andrew@contigo.com>
    Gabriele Bartolini <bartolini@infomedia.it>
    Lachlan Andrew <lha@users.sourceforge.net>

%package devel
License:        GPL v2 or later
Summary:        Development files for htdig
Group:          Productivity/Networking/Web/Utilities
Requires:       %{name} = %{version}

%description devel
The ht://Dig system is a complete World Wide Web index and search
system for a small domain or intranet. This system is not meant to
replace the need for powerful Internet-wide search systems like Lycos,
Infoseek, Webcrawler, or AltaVista. Instead it is meant to cover the
search needs of a single company, campus, or even a particular
subsection of a Web site.

This package is needed if you want to develop other applications on
htdig.



Authors:
--------
    Andrew Scherpbier <andrew@contigo.com>
    Gabriele Bartolini <bartolini@infomedia.it>
    Lachlan Andrew <lha@users.sourceforge.net>

%package doc
License:        GPL v2 or later
Summary:        WWW Index and Search System Documentation
Group:          Productivity/Networking/Web/Utilities
Requires:       %{name} = %{version}

%description doc
The ht://Dig system is a complete World Wide Web index and search
system for a small domain or intranet. This system is not meant to
replace the need for powerful Internet-wide search systems like Lycos,
Infoseek, Webcrawler, or AltaVista. Instead it is meant to cover the
search needs of a single company, campus, or even a particular
subsection of a Web site.

This package provides additional documentation for htdig in
/usr/share/doc/packages/htdig/



Authors:
--------
    Andrew Scherpbier <andrew@contigo.com>
    Gabriele Bartolini <bartolini@infomedia.it>
    Lachlan Andrew <lha@users.sourceforge.net>

%prep
%setup -q
cp %{S:1} README.SuSE
%patch1 
%patch2 
%patch3 
%patch4 
%patch5 
%patch8 -p 1
%patch9 -p1
%patch10 -p1
%patch11
%patch14 -p1
%patch15

%build
%{?suse_update_config:%{suse_update_config -f db/dist}}
pushd contrib 1>/dev/null
find . -type f | xargs -n 1 sed -i "s@/usr/local/bin/perl@/usr/bin/perl@"
popd 1>/dev/null
%__rm -f acconfig.h db/dist/acconfig.h aclocal.m4 configure db/dist/configure
autoreconf --force --install
%configure \
   --with-config-dir=%{_sysconfdir}/htdig \
   --with-common-dir=%{apache_serverroot}/htdig/common \
   --with-database-dir=/var/lib/htdig/db \
   --with-cgi-bin-dir=%{apache_serverroot}/cgi-bin \
   --with-image-dir=%{apache_serverroot}/htdig/images \
   --with-image-url-prefix=images \
   --with-search-dir=%{apache_serverroot}/htdig \
   --with-ssl \
   --with-zlib \
   --enable-bigfile \
   --disable-static
%{__make} %{?_smp_mflags}

%install
find . -name \*.orig -o -name .cvsignore | xargs rm  -f
%makeinstall
# remove static libs as nobody uses them
find %buildroot/%_libdir/ -name *.*a | xargs rm  -f
pushd %buildroot/%{_sysconfdir}/htdig 1>/dev/null
# try to use only one mime.types file (from aaa_base) for the distri
%__rm mime.types
%__ln_s ../mime.types mime.types
# adapt the htdig.conf file 
sed -e "s@start_url:.*http://www.htdig.org/@start_url:      http://localhost/@g" htdig.conf > htdig.conf.new
mv htdig.conf.new htdig.conf
popd 1>/dev/null
# install the documentation files in the right directory
%__mkdir_p %buildroot/%_defaultdocdir/%{name}/
pushd %{_builddir}/%{name}-%{version} 1>/dev/null
cp -a contrib %buildroot/%_defaultdocdir/%{name}/
cp -a htdoc %buildroot/%_defaultdocdir/%{name}/
cp COPYING ChangeLog README* STATUS %buildroot/%_defaultdocdir/%{name}/

%clean
rm -rf %buildroot

%files devel
%defattr(-,root,root)
%dir %_includedir/htdig
%dir %_includedir/htdig_db
%_includedir/htdig/*
%_includedir/htdig_db/*

%files doc
%defattr(-,root,root)
%doc %_defaultdocdir/%{name}/contrib 
%doc %_defaultdocdir/%{name}/htdoc
#disable execute permission
%attr(644, root, root) %_defaultdocdir/%{name}/htdoc/cf_generate.pl
#delete Makefile waste from doc
%exclude %_defaultdocdir/%{name}/htdoc/Makefile*

%files
%defattr(-,root,root)
%dir %_defaultdocdir/%{name}
%doc %_defaultdocdir/%{name}/*
%exclude %_defaultdocdir/%{name}/contrib
%exclude %_defaultdocdir/%{name}/htdoc
%config(noreplace) %{_sysconfdir}/htdig
%dir %{apache_serverroot}/htdig
%{apache_serverroot}/htdig/search.html
%{apache_serverroot}/htdig/common
%{apache_serverroot}/htdig/images
%dir /var/lib/htdig
/var/lib/htdig/db
%{apache_serverroot}/cgi-bin/htsearch
%{apache_serverroot}/cgi-bin/qtest
%{_mandir}/*/*
%_libdir/h*
%_bindir/*

%changelog
openSUSE Build Service is sponsored by