File msn-proxy.spec of Package MSN-Proxy

#
# Spec file for package MSN-Proxy (Version 0.8)
#
# Copyright (c) 2009 Exata T.I., Maringa, PR, Brasil.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org
#

# norootforbuild

Name:           msn-proxy
Version:        0.8
Release:        0
License:        GPL
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  mysql-devel
BuildRequires:  libevent-devel
BuildRequires:  mysql
BuildRequires:  postgresql-devel
BuildRequires:  postgresql-libs
Requires:       mysql
Requires:       logrotate
Requires:       cron
Requires:       php5-mysql
Requires:       php5-sockets
Group:          Productivity/Networking/Diagnostic
Summary:        GUI frontend for control MSN Messenger connections
URL:            http://sourceforge.net/projects/msn-proxy
Source0:        %{name}-%{version}.tar.bz2
Source1:        %{name}.init
Source2:        %{name}.logrotate


%description
The msn-proxy is a lightweight transparent proxy for MSN Messenger clients.
Supports all active protocols (all clients). Control who and how the  MSN Messenger is used on your network.
Lots of features.

Author:
--------
    Luiz Otavio Oliveira Souza aka 'loos-br' <loos.br@gmail.org, loos-br@users.sourceforge.net>


%package backend-mysql
License:        GPL
Group:          Productivity/Networking/Diagnostic
Requires:       %{name} = %{version}, mysql
Provides:       %{name}_mysql_backend = %{version}-%{release}
Summary:        MySQL support fot %{name}


%description backend-mysql
The msn-proxy is a lightweight transparent proxy for MSN Messenger clients.
Supports all active protocols (all clients). Control who and how the  MSN Messenger is used on your network.
Lots of features.

This package holds the files needed for MySQL support.


%package backend-pgsql
License:        GPL
Group:          Productivity/Networking/Diagnostic
Requires:       %{name} = %{version}, mysql
Provides:       %{name}_pgsql_backend = %{version}-%{release}
Summary:        PostgreSQL support fot %{name}


%description backend-pgsql
The msn-proxy is a lightweight transparent proxy for MSN Messenger clients.
Supports all active protocols (all clients). Control who and how the  MSN Messenger is used on your network.
Lots of features.

This package holds the files needed for PgSQL support.


%prep
%setup -q


%build
%configure --with-mysql --with-pgsql
%{__make}


%install
%makeinstall
%{__install} -d %{buildroot}/srv/www/htdocs/msn-proxy
find %{buildroot}%{_libdir}/%{name} -name \*.la -delete


# Install the init script.
#------------------------------------------------------------------------------------
%{__install} -D -m 755 %{SOURCE1} %{buildroot}%{_sysconfdir}/init.d/%{name}
%{__install} -d %{buildroot}%{_sbindir}
%{__ln_s} -f %{_sysconfdir}/init.d/%{name} %{buildroot}%{_sbindir}/rc%{name}
%{__install} -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}


%post
# Enable MSN-Proxy at starup.
#------------------------------------------------------------------------------------
%{fillup_and_insserv -fy %{name}}


%preun
%{stop_on_removal %{name}}


%postun
%{restart_on_update %{name}}
%{insserv_cleanup}


%clean
%{__rm} -rf %{buildroot}


%files
%defattr(-,root,root)
%doc ChangeLog INSTALL
%{_bindir}/msn_proxy
%{_sbindir}/rc%{name}
%{_sysconfdir}/init.d/%{name}
%{_sysconfdir}/logrotate.d/%{name}
%dir %{_sysconfdir}/%{name}
%dir %{_libdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/msn-proxy.conf


%files backend-mysql
%defattr(-,root,root)
%{_libdir}/%{name}/mysql.so
%{_sysconfdir}/%{name}/mysql


%files backend-pgsql
%defattr(-,root,root)
%{_libdir}/%{name}/pgsql.so
%{_sysconfdir}/%{name}/pgsql


#%{__cp} -R src/db-modules/mysql/php/* %{buildroot}/srv/www/htdocs/msn-proxy/
#%config(noreplace) %attr(0640,root,root) %{_sysconfdir}/%{name}/mysql/conf
#%config(noreplace) /srv/www/htdocs/msn-proxy/mysql.inc.php
#/srv/www/htdocs/*