Blob Blame History Raw
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}


Name:		openxcap
Version:	1.1.2
Release:	1%{?dist}
Summary:	Fully featured XCAP server
Group:		System Environment/Daemons
License:	GPLv2
URL:		http://openxcap.org/
Source0:	http://download.ag-projects.com/XCAP/%{name}-%{version}.tar.gz
Source1:	%{name}.init
Source2:	%{name}.sysconfig

Patch0:		%{name}-fix_shebang.diff
BuildArch:      noarch
BuildRoot:	%(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires:	python-devel
BuildRequires:	python-setuptools
Requires:	python >= 2.5
Requires:	MySQL-python
Requires:	PyXML
Requires:	python-application
RequireS:	python-gnutls
Requires:	python-lxml
Requires:	python-sqlobject
Requires:	python-twisted-core
Requires:	python-twisted-web
Requires:	python-twisted-web2
Requires:	python-zope-interface

Requires(post): chkconfig
Requires(preun): chkconfig
# This is for /sbin/service
Requires(preun): initscripts


%description
Fully featured XCAP server. An XCAP server is used by SIP SIMPLE clients and
servers to manage buddy lists and policy for subscriptions to presence or
other type of events published using SIP protocol.

XCAP protocol allows a client to read, write and modify application
configuration data stored in XML format on a server. XCAP maps XML document
sub-trees and element attributes to HTTP URIs, so that these components can
be directly accessed by HTTP. An XCAP server is used by the XCAP clients to
store data like Presence policy in combination with a SIP Presence server
that supports PUBLISH/SUBSCRIBE/NOTIFY methods to provide a complete SIP
SIMPLE server solution.


%prep
%setup -q
%patch0 -p0 -b .fix_shebang


%build
%{__python} -c 'import setuptools; execfile("setup.py")' build


%install
rm -rf $RPM_BUILD_ROOT
%{__python} -c 'import setuptools; execfile("setup.py")' install --skip-build --root $RPM_BUILD_ROOT
install -D -p -m 0644 config.ini.sample $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/config.ini
install -D -p -m 0755 %{SOURCE1} $RPM_BUILD_ROOT%{_initrddir}/%{name}
install -D -p -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name}
install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/tls
install -d $RPM_BUILD_ROOT%{_localstatedir}/run/%{name}
install -D -p -m 0644 scripts/mysql-create.sql $RPM_BUILD_ROOT%{_datadir}/%{name}/mysql-create.sql


%clean
rm -rf $RPM_BUILD_ROOT


%post
/sbin/chkconfig --add openxcap


%preun
if [ $1 = 0 ] ; then
    /sbin/service openxcap stop >/dev/null 2>&1
    /sbin/chkconfig --del openxcap
fi

%files
%defattr(-,root,root,-)
%doc LICENSE PKG-INFO README TODO opensips/opensips.cfg
%dir %{_sysconfdir}/%{name}
%dir %{_sysconfdir}/%{name}/tls
%dir %{_localstatedir}/run/%{name}
%dir %{_datadir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/config.ini
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
%{_initrddir}/%{name}
%{_bindir}/%{name}
%{_datadir}/%{name}/mysql-create.sql
%{python_sitelib}/xcap
%{python_sitelib}/%{name}-%{version}-*.egg-info


%changelog
* Thu Sep 24 2009 Peter Lemenkov <lemenkov@gmail.com> 1.1.2-1
- Initial package