Examples using Bib-1 use attributes
[idzebra-moved-to-github.git] / idzebra.spec
index 343baea..dcc7c56 100644 (file)
@@ -2,14 +2,14 @@
 Name: idzebra
 %define namev idzebra-2.0
 Version: %{idmetaversion}
-Release: 1indexdata
+Release: 2indexdata
 License: GPL
 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/
-BuildRequires: libyaz4-devel >= 4.2.0
+URL: http://www.indexdata.com/zebra
+BuildRequires: libyaz5-devel >= 5.0.0
 BuildRequires: expat-devel, bzip2-devel, tcl, zlib-devel
 Summary: High-performance, structured text indexing and retrival engine.
 Group: Applications/Databases
@@ -33,11 +33,9 @@ boolean search expressions and relevance-ranked free-text queries.
 %package -n lib%{namev}
 Summary: Zebra libraries
 Group: Libraries
-Requires: libyaz4 bzip2-libs
+Requires: libyaz5 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
@@ -49,7 +47,7 @@ Modules for the Zebra search engine.
 %package -n lib%{namev}-devel
 Summary: Zebra development libraries
 Group: Development/Libraries
-Requires: lib%{namev} = %{version} libyaz4-devel bzip2-devel 
+Requires: lib%{namev} = %{version} libyaz5-devel bzip2-devel 
 %description -n lib%{namev}-devel
 Development libraries for the Zebra search engine.
 
@@ -65,14 +63,18 @@ make CFLAGS="$RPM_OPT_FLAGS"
 
 %install
 rm -fr ${RPM_BUILD_ROOT}
-make prefix=${RPM_BUILD_ROOT}/usr mandir=${RPM_BUILD_ROOT}/%{_mandir} \
-        libdir=${RPM_BUILD_ROOT}/%{_libdir} install
+make install DESTDIR=${RPM_BUILD_ROOT}
 rm ${RPM_BUILD_ROOT}/%{_libdir}/*.la
 rm ${RPM_BUILD_ROOT}/%{_bindir}/zebraidx
 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}
@@ -89,6 +91,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.*
@@ -104,3 +109,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
+