Beginnings on CentOS 5 RPM
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 8 Sep 2010 11:58:52 +0000 (07:58 -0400)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 8 Sep 2010 11:58:52 +0000 (07:58 -0400)
Makefile.am
metaproxy.spec [new file with mode: 0644]
rpm/metaproxy.init [new file with mode: 0755]
rpm/metaproxy.xml [new file with mode: 0644]

index f9ab81a..04ba163 100644 (file)
@@ -9,7 +9,7 @@ AUTOMAKE_OPTIONS = foreign
 
 EXTRA_DIST = Doxyfile.in NEWS README LICENSE \
              m4/yazpp.m4 m4/yaz.m4 m4/ax_boost.m4 \
-             buildconf.sh
+             buildconf.sh metaproxy.spec
 
 MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure 
 
@@ -17,6 +17,8 @@ dist-hook:
        if test -x /usr/bin/git -a -d .git; then git log >ChangeLog ; cp ChangeLog $(distdir); fi
        mkdir $(distdir)/win
        -cp $(srcdir)/win/* $(distdir)/win
+       mkdir $(distdir)/rpm
+       -cp $(srcdir)/rpm/* $(distdir)/rpm
 
 .PHONY:dox
 dox:
diff --git a/metaproxy.spec b/metaproxy.spec
new file mode 100644 (file)
index 0000000..5a088e5
--- /dev/null
@@ -0,0 +1,91 @@
+Summary: Z39.50/SRU router
+Name: metaproxy
+Version: 1.1.4
+Release: 1
+License: GPL
+Group: Applications/Internet
+Vendor: Index Data ApS <info@indexdata.dk>
+Source: metaproxy-%{version}.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}-root
+BuildRequires: pkgconfig, libyazpp4, libxslt-devel, boost-devel
+Packager: Adam Dickmeiss <adam@indexdata.dk>
+URL: http://www.indexdata.com/metaproxy
+Group:  Applications/Internet
+Requires: libmetaproxy3
+
+%description
+Metaproxy daemon.
+
+%package doc
+Summary: Metaproxy documentation
+Group: Documentation
+
+%description doc
+Metaproxy documentation.
+
+%package -n libmetaproxy3
+Summary: Metaproxy library
+Group: Libraries
+Requires: libyazpp4
+
+%description -n libmetaproxy3
+The Metaproxy libraries.
+
+%package -n libmetaproxy3-devel
+Summary: Metaproxy development package
+Group: Development/Libraries
+Requires: libmetaproxy3 = %{version} libyazpp4-devel
+
+%description -n libmetaproxy3-devel
+Development libraries and include files for the Metaproxy package.
+
+%prep
+%setup
+
+%build
+
+CFLAGS="$RPM_OPT_FLAGS" \
+ ./configure --prefix=%{_prefix} --libdir=%{_libdir} --mandir=%{_mandir} \
+       --enable-shared --with-yazpp=/usr/bin
+make CFLAGS="$RPM_OPT_FLAGS"
+
+%install
+rm -fr ${RPM_BUILD_ROOT}
+make prefix=${RPM_BUILD_ROOT}/%{_prefix} mandir=${RPM_BUILD_ROOT}/%{_mandir} \
+       libdir=${RPM_BUILD_ROOT}/%{_libdir} install
+rm ${RPM_BUILD_ROOT}/%{_libdir}/*.la
+rm -fr ${RPM_BUILD_ROOT}/%{_prefix}/share/metaproxy
+rm -fr ${RPM_BUILD_ROOT}/%{_libdir}/metaproxy
+mkdir -p ${RPM_BUILD_ROOT}/etc/metaproxy/filters-enabled
+mkdir -p ${RPM_BUILD_ROOT}/etc/metaproxy/filters-available
+mkdir -p ${RPM_BUILD_ROOT}/etc/logrotate.d
+install -m 644 rpm/metaproxy.xml ${RPM_BUILD_ROOT}/etc/metaproxy/metaproxy.xml
+install -m 755 rpm/metaproxy.init ${RPM_BUILD_ROOT}/etc/rc.2/init.d/metaproxy
+
+%clean
+rm -fr ${RPM_BUILD_ROOT}
+
+%files -n libmetaproxy3
+%doc README LICENSE NEWS
+%defattr(-,root,root)
+%{_libdir}/*.so.*
+%dir %{_libdir}/metaproxy/modules
+
+%files -n libmetaproxy3-devel
+%defattr(-,root,root)
+%{_includedir}/metaproxy
+%{_libdir}/*.so
+%{_libdir}/*.a
+
+%files
+%defattr(-,root,root)
+%{_bindir}/metaproxy
+%{_mandir}/man?/*
+
+%files doc
+%defattr(-,root,root)
+%{_prefix}/share/doc/metaproxy
+%config /etc/rc.d/init.d/metaproxy
+%config(noreplace) /etc/metaproxy/metaproxy.xml
+%dir /etc/metaproxy/filters-available
+%dir /etc/metaproxy/filters-enabled
diff --git a/rpm/metaproxy.init b/rpm/metaproxy.init
new file mode 100755 (executable)
index 0000000..76efd8a
--- /dev/null
@@ -0,0 +1,82 @@
+#!/bin/bash
+#
+# metaproxy    Startup script for Metaproxy
+#
+# chkconfig: 2345 85 15
+# description: Metaproxy SRU/Z39.50 router
+# processname: metaproxy
+# config: /etc/metaproxy/metaproxy.xml
+# config: /etc/sysconfig/metaproxy
+# pidfile: /var/run/metaproxy.pid
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+OPTIONS="-u nobody -l /var/log/metaproxy.log -c /etc/metaproxy/metaproxy.xml"
+
+if [ -f /etc/sysconfig/metaproxy ]; then
+        . /etc/sysconfig/metaproxy
+fi
+
+DAEMON=${DAEMON-/usr/bin/metaproxy}
+prog=metaproxy
+pidfile=${PIDFILE-/var/run/metaproxy.pid}
+lockfile=${LOCKFILE-/var/lock/subsys/metaproxy}
+RETVAL=0
+
+start() {
+        echo -n $"Starting $prog: "
+        daemon --pidfile=${pidfile} $DAEMON $OPTIONS -D -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
+       ;;
+  configtest)
+       $DAEMON $OPTIONS -t
+       RETVAL=$?
+       ;;
+  *)
+       echo $"Usage: $prog {start|stop|restart|help|configtest}"
+       exit 1
+esac
+
+exit $RETVAL
diff --git a/rpm/metaproxy.xml b/rpm/metaproxy.xml
new file mode 100644 (file)
index 0000000..d84a917
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<metaproxy xmlns="http://indexdata.com/metaproxy" version="1.0">
+  <dlpath>/usr/lib/metaproxy/modules</dlpath>
+  <start route="start"/>
+  <filters>
+    <filter id="frontend" type="frontend_net">
+      <threads>50</threads>
+      <port>@:9000</port>
+    </filter>
+  </filters>
+  <routes>  
+    <route id="start">
+      <filter refid="frontend"/>
+      <filter type="log">
+        <message>log</message>
+      </filter>
+      <include src="filters-enabled/*.xml"/>
+      <filter type="bounce"/>
+    </route>
+  </routes>
+</metaproxy>
+