cp $$i $(distdir)/win; \
fi; \
done
+ mkdir $(distdir)/rpm
+ -cp $(srcdir)/rpm/* $(distdir)/rpm
dox:
doxygen
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
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
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}
%{_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.*
%{_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
+
--- /dev/null
+#!/bin/bash
+#
+# zebrasrv Startup script for zebrasrv
+#
+# chkconfig: 2345 85 15
+# description: Index Data Zebra server
+# processname: zebrasrv-2.0
+# config: /etc/idzebra/zebra.cfg
+# config: /etc/sysconfig/zebrasrv
+# pidfile: /var/run/zebrasrv.pid
+
+. /etc/rc.d/init.d/functions
+
+OPTIONS="-l /var/log/zebrasrv.log -u nobody tcp:@6:2100 tcp:@:2100"
+
+if [ -f /etc/sysconfig/zebrasrv ]; then
+ . /etc/sysconfig/zebrasrv
+fi
+CONFIG=${CONFIG-/etc/idzebra/zebra.cfg}
+DAEMON=${DAEMON-/usr/bin/zebrasrv-2.0}
+prog=zebrasrv
+pidfile=${PIDFILE-/var/run/zebrasrv.pid}
+lockfile=${LOCKFILE-/var/lock/subsys/zebrasrv}
+RETVAL=0
+
+if [ ! -f $CONFIG ]; then
+ echo "$prog: No $CONFIG"
+ exit 0
+fi
+
+start() {
+ echo -n $"Starting $prog: "
+ daemon --pidfile=${pidfile} $DAEMON $OPTIONS -D -c $CONFIG -p ${pidfile}
+ RETVAL=$?
+ echo
+ [ $RETVAL = 0 ] && touch ${lockfile}
+ return $RETVAL
+}
+
+stop() {
+ echo -n $"Stopping $prog: "
+ killproc -p ${pidfile} -d 10 $DAEMON
+ RETVAL=$?
+ echo
+ [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
+}
+reload() {
+ stop
+ start
+}
+
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ status)
+ status -p ${pidfile} $DAEMON
+ RETVAL=$?
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ condrestart)
+ if [ -f ${pidfile} ] ; then
+ stop
+ start
+ fi
+ ;;
+ reload)
+ reload
+ ;;
+ *)
+ echo $"Usage: $prog {start|stop|restart|help}"
+ exit 1
+esac
+
+exit $RETVAL
--- /dev/null
+/var/log/zebrasrv.log {
+ weekly
+ missingok
+ rotate 4
+ compress
+ delaycompress
+ notifempty
+ postrotate
+ if [ -f /var/run/zebrasrv.pid ]; then
+ /sbin/service zebrasrv restart > /dev/null
+ fi
+ endscript
+}