Update Zebra URL
[idzebra-moved-to-github.git] / idzebra.spec
index 8fd0e6f..e99268e 100644 (file)
@@ -2,33 +2,40 @@
 Name: idzebra
 %define namev idzebra-2.0
 Version: %{idmetaversion}
-Release: 1indexdata
-Requires: lib%{namev}-modules = %{version}
+Release: 2indexdata
 License: GPL
-Group: Applications/Databases
 Vendor: Index Data ApS <info@indexdata.dk>
 Source: idzebra-%{version}.tar.gz
 BuildRoot: %{_tmppath}/idzebra-%{version}-root
 Packager: Adam Dickmeiss <adam@indexdata.dk>
-URL: http://www.indexdata.dk/zebra/
+URL: http://www.indexdata.com/zebra
 BuildRequires: libyaz4-devel >= 4.2.0
 BuildRequires: expat-devel, bzip2-devel, tcl, zlib-devel
 Summary: High-performance, structured text indexing and retrival engine.
-
+Group: Applications/Databases
 %description
 Zebra is a high-performance, general-purpose structured text indexing
 and retrieval engine. It reads structured records in a variety of input
 formats (eg. email, XML, MARC) and allows access to them through exact
 boolean search expressions and relevance-ranked free-text queries. 
 
+%package -n %{namev}
+Summary: High-performance, structured text indexing and retrival engine.
+Group: Applications/Databases
+Requires: lib%{namev}-modules = %{version}
+%description -n %{namev}
+Zebra is a high-performance, general-purpose structured text indexing
+and retrieval engine. It reads structured records in a variety of input
+formats (eg. email, XML, MARC) and allows access to them through exact
+boolean search expressions and relevance-ranked free-text queries. 
+
+
 %package -n lib%{namev}
 Summary: Zebra libraries
 Group: Libraries
 Requires: libyaz4 bzip2-libs
 %description -n lib%{namev}
 Libraries for the Zebra search engine.
-%post -p /sbin/ldconfig 
-%postun -p /sbin/ldconfig 
 
 %package -n lib%{namev}-modules
 Summary: Zebra modules
@@ -45,7 +52,7 @@ Requires: lib%{namev} = %{version} libyaz4-devel bzip2-devel
 Development libraries for the Zebra search engine.
 
 %prep
-%setup -n idzebra-%{version}
+%setup
 
 %build
 
@@ -64,11 +71,16 @@ rm ${RPM_BUILD_ROOT}/%{_mandir}/man1/zebraidx.*
 rm ${RPM_BUILD_ROOT}/%{_bindir}/zebrasrv
 rm ${RPM_BUILD_ROOT}/%{_mandir}/man8/zebrasrv.*
 rm ${RPM_BUILD_ROOT}/%{_mandir}/man1/idzebra-config.*
+mkdir -p ${RPM_BUILD_ROOT}/etc/idzebra
+mkdir -p ${RPM_BUILD_ROOT}/etc/rc.d/init.d
+install -m755 rpm/zebrasrv.init ${RPM_BUILD_ROOT}/etc/rc.d/init.d/zebrasrv
+mkdir -p ${RPM_BUILD_ROOT}/etc/logrotate.d
+install -m644 rpm/zebrasrv.logrotate ${RPM_BUILD_ROOT}/etc/logrotate.d/zebrasrv
 
 %clean
 rm -fr ${RPM_BUILD_ROOT}
 
-%files
+%files -n %{namev}
 %defattr(-,root,root)
 %doc README LICENSE.zebra NEWS
 %config /usr/share/idzebra-2.0/tab
@@ -80,6 +92,9 @@ rm -fr ${RPM_BUILD_ROOT}
 %{_mandir}/*/zebrasrv-*
 %{_mandir}/*/idzebra-abs2dom*
 /usr/share/idzebra-2.0-examples
+%dir %{_sysconfdir}/idzebra
+%config %{_sysconfdir}/rc.d/init.d/zebrasrv
+%config(noreplace) /etc/logrotate.d/zebrasrv
 
 %files -n lib%{namev}
 %{_libdir}/*.so.*
@@ -95,3 +110,20 @@ rm -fr ${RPM_BUILD_ROOT}
 %{_mandir}/*/idzebra-config-*
 /usr/share/aclocal/*.m4
 
+%post -n lib%{namev}
+/sbin/ldconfig 
+%postun -n lib%{namev}
+/sbin/ldconfig 
+%post -n %{namev}
+if [ $1 = 1 ]; then
+       /sbin/chkconfig --add zebrasrv
+       /sbin/service zebrasrv start > /dev/null 2>&1
+else
+       /sbin/service zebrasrv restart > /dev/null 2>&1
+fi
+%preun -n %{namev}
+if [ $1 = 0 ]; then
+       /sbin/service zebrasrv stop > /dev/null 2>&1
+       /sbin/chkconfig --del zebrasrv
+fi
+