%define PACKAGE_NAME osaas-server %define PACKAGE_VERSION 1.0.1 %define release 5+gp %define _prefix /opt/gispatcher %define osaasdir %{_prefix}/osaas-server %define TARGET_DIR $RPM_BUILD_ROOT%{osaasdir} Summary: OSAAS is an OGC Statistics And Accounting System Name: %{PACKAGE_NAME} Version: %{PACKAGE_VERSION} Release: %{release} Source: %{PACKAGE_NAME}-%{PACKAGE_VERSION}.tar.gz #Patch0: osaas-server-path-correction.patch License: See GPL.txt Group: Application/Development BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Prefix: %{_prefix} Requires: postgresql Requires: postgresql-server Requires: python >= 2.3 Requires: python-psycopg2 Requires: python-lxml Url: http://osaas.wald.intevation.org %description OSAAS is an OGC Statistics And Accounting System. It gathers data about requests made to WMS/WFS servers to support billing and statistic. %package contrib Summary: OSAAS is an OGC Statistics And Accounting System Group: Application/Development License: See GPL.txt Requires: postgresql Requires: postgresql-server Requires: python >= 2.3 Requires: python-psycopg2 Requires: python-lxml Url: http://osaas.wald.intevation.org %description contrib OSAAS is an OGC Statistics And Accounting System. This contrib package gathers data about requests made to WFS servers to support billing and statistic. %prep %setup -q #%patch0 %build %install install -d %{TARGET_DIR} # copy whole lotta stuff to install cp -r server %{TARGET_DIR} cp ChangeLog %{TARGET_DIR} cp README.txt %{TARGET_DIR} # copy contrib/billing stuff to install cp --parents -r contrib/billing %{TARGET_DIR} # do some linking install -d $RPM_BUILD_ROOT/etc/osaas ln -s %{osaasdir}/server/demo-config.xml $RPM_BUILD_ROOT/etc/osaas/osaas-config.xml # create osaas-users file touch $RPM_BUILD_ROOT/etc/osaas/osaas-users # install startup-script install -d $RPM_BUILD_ROOT/etc/init.d install -d $RPM_BUILD_ROOT/sbin cp contrib/osaas $RPM_BUILD_ROOT/etc/init.d/osaas ln -s /etc/init.d/osaas $RPM_BUILD_ROOT/sbin/rcosaas # test the stuff python server/test/runtests.py %clean rm -rf $RPM_BUILD_ROOT # build the user, if not exists %pre groupadd -o -r osaas >/dev/null 2>&1 || : useradd -M -g osaas -o -r -d %{osaasdir} -s /bin/bash \ -c "OSAAS-Server " osaas >/dev/null 2>&1 || : install -d /var/log/osaas install -d %{osaasdir} chown osaas:osaas /var/log/osaas chown -R osaas:osaas %{osaasdir} chmod 0700 /var/log/osaas %post if [ $1 = 1 ] ; then # initial intall chkconfig --add osaas mail -s 'Configuring your OSAAS-Server' root << EOF Dear administrators, in order to run your OSAAS-Server, you need to configure your database and create an OSAAS-user. The needed steps are described in the following document: %{osaasdir}/server/README.txt Please follow the steps using 'initosaasdb.py' and 'adduser.py'. Best regards The GISpatcher-team EOF fi %preun if [ $1 = 0 ] ; then # removal /sbin/service osaas condstop >/dev/null 2>&1 chkconfig --del osaas # also remove the *.pyc-files find %{osaasdir} -name *.pyc |xargs rm -rf fi %files %defattr(-,root,root) %doc %{osaasdir}/README.txt %doc %{osaasdir}/ChangeLog %config(noreplace) /etc/osaas/osaas-config.xml %config(noreplace) /etc/osaas/osaas-users /etc/init.d/osaas /sbin/rcosaas %{osaasdir}/server %exclude %{osaasdir}/server/test %files contrib %{osaasdir}/contrib %changelog * Thu Oct 25 2010 Bjoern Schilberg - 1.0.1 - Added an sql script that creates a table for storing wfs requests (#Issue176). - Added a python script that looks for WFS-GetFeature requests stored in the osaas database table requests and updates the number of features returned by the specific request of the entries. - Added an additional script for the wfs_requests.sql script - it adds a new column 'billtime' that saves the time when the billing.py script has been executed. * Mon Mar 22 2010 Stephan Holl - Implemented logging of request-durations (#Issue94). This requires updating the database-schema of current releases depending on used schema. The columns startime and endtime will be added, the column responsetime will no longer be used. Make sure that you also have installed a decent OSAAS-client compiled into owsproxy. This is done within RPM-package >= deegree-owsproxy-2.3pre-2gp * Mon Feb 10 2010 Stephan Holl - fixes geospatial/issue30: Reconnecting to postgreSQL when postgreSQL-Server dies. - deactivated the patch since this is already done upstream. * Wed Dec 03 2008 Stephan Holl + set the config-files as noreplace * Fri Nov 21 2008 Stephan Holl - added dependency to python-psycopg2 (this is included in our repository, since it is not found in the base-repo for OpenSuSE 10.3 - tweacking some %post, %preun, %postun blocks. - added a mail to the administrator, that he needs to read the README.txt - removed user-deletion after uninstall * Tue Oct 21 2008 Stephan Holl - initial creation of this spec-file