%define ver x.x.x
%define rel x
%define nam xxxxxxx
%define prefix /xxx
%define PYTHON_VERSION x.x
Summary: This package provides the basic framework and web interfaces.
Name: %{nam} 
Version: %ver 
Release: %rel 
Copyright: GPL
Group: Applications/Réseau
Source: %{nam}-%ver.tar.gz 
URL: http://glasnost.entrouvert.org/ 
Packager: Benjamin POUSSIN <poussin@codelutin.com>
Requires: sed python%{PYTHON_VERSION}-imaging python%{PYTHON_VERSION}-tal httpd mod_python libxslt PyXML python%{PYTHON_VERSION}-docutils
BuildRoot: /var/tmp/%{name}-buildroot
BuildArchitectures: noarch

%description 
Glasnost is the voting system originally developed by Easter-eggs for
in-house decision making and now also used in other places.
It evolved from a simple voting system to a complex content management system
with many features (collaborative redaction, calendar...)

%package gtk
Summary: This package provides the GTK+ GUI interface to Glasnost.
Group: Applications/Réseau
%description gtk
This package provides the GTK+ GUI interface to Glasnost.

%prep

%setup -n %{nam}-%{ver}

%build  
make DESTDIR=$RPM_BUILD_ROOT PREFIX=%{prefix} mo

%install  
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT
make WEB_USER=root WEB_GROUP=root DESTDIR=$RPM_BUILD_ROOT DONT_USE_DESTDIR_FOR_LINK=true install
mkdir -p $RPM_BUILD_ROOT/etc/init.d
cp redhat/glasnost-redhat-init.d $RPM_BUILD_ROOT/etc/init.d/glasnost
mkdir -p $RPM_BUILD_ROOT/etc/cron.hourly
mkdir -p $RPM_BUILD_ROOT%{prefix}/share/doc/%{nam}
cp redhat/README.redhat $RPM_BUILD_ROOT%{prefix}/share/doc/%{nam}/README
cp README.config $RPM_BUILD_ROOT%{prefix}/share/doc/%{nam}
cp COPYING $RPM_BUILD_ROOT%{prefix}/share/doc/%{nam}


%clean 
rm -rf $RPM_BUILD_ROOT

%files
%config(noreplace) /etc/%{nam}/config
/etc/init.d/%{nam}
%{prefix}/lib/%{nam}/servers
%{prefix}/lib/%{nam}/web
%{prefix}/lib/%{nam}/glasnost/__init__.py
%{prefix}/lib/%{nam}/glasnost/common
%{prefix}/lib/%{nam}/glasnost/proxy
%{prefix}/lib/%{nam}/glasnost/server
%{prefix}/lib/%{nam}/glasnost/web
%{prefix}/sbin/%{nam}
%{prefix}/sbin/glasnost-variables-filename
%{prefix}/sbin/%{nam}-variables
%{prefix}/sbin/%{nam}-import
%{prefix}/sbin/%{nam}-export
%{prefix}/sbin/%{nam}-make-system
%{prefix}/sbin/%{nam}-convert-ids
/var/lib/%{nam}
%{prefix}/share/%{nam}
/var/log/%{nam}
%{prefix}/share/locale/de/LC_MESSAGES/%{nam}-web.mo
%{prefix}/share/locale/fi/LC_MESSAGES/%{nam}-web.mo
%{prefix}/share/locale/fr/LC_MESSAGES/%{nam}-web.mo
%{prefix}/share/locale/sv/LC_MESSAGES/%{nam}-web.mo
%{prefix}/share/doc/%{nam}

%files gtk
%{prefix}/bin/%{name}-gtk
%{prefix}/lib/%{name}/glasnost/gtk

%changelog
* Mon Jun 30 2003 Benjamin POUSSIN <poussin@codelutin.com> 0.6.3
- split in two package: glasnost, glasnost-gtk
- added dependancy: python-docutils, PyXML
- construct noarch rpm
