File roundcubemail-plugin-dblog.spec of Package roundcubemail-plugin-dblog

%global roundcube %{_datadir}/roundcubemail
%global roundcube_plugins %{roundcube}/plugins
%global roundcube_conf %{_sysconfdir}/roundcubemail
%global roundcube_log %{_var}/log/roundcubemail
%global roundcube_lib %{_var}/lib/roundcubemail

Name:       roundcubemail-plugin-dblog
Version:    2.0
Release:    1%{?dist}
Summary:    Log to DB plugin for Roundcube Webmail

Group:      Applications/Internet
License:    AGPLv3+ and GPLv3+

Source0:    %{name}-%{version}.tar.gz

BuildRoot:  %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildArch:  noarch

Requires:   roundcubemail >= 0.9

Allows log entries to be created in a database table.

%setup -q


rm -rf %{buildroot}
mkdir -p \
    %{buildroot}%{roundcube_conf} \

cp -a dblog %{buildroot}%{roundcube_plugins}
pushd %{buildroot}%{roundcube_plugins}/dblog
mv %{buildroot}%{roundcube_conf}/
ln -s ../../../../..%{roundcube_conf}/

if [ -f "%{php_inidir}/apc.ini" -o -f "%{php_inidir}/apcu.ini" ]; then
    if [ ! -z "`grep apc.enabled=1 %{php_inidir}/apc{,u}.ini`" ]; then
%if 0%{?fedora} > 15
        /bin/systemctl condrestart httpd.service
    /sbin/service httpd condrestart

rm -rf %{buildroot}

%dir %{roundcube_conf}
%config(noreplace) %attr(0640,root,apache) %{roundcube_conf}/
%dir %{roundcube}
%dir %{roundcube_plugins}

* Fri Jun 14 2013 Jeroen van Meeuwen <> - 2.0-1
- Initial package version