Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > by-pkgid > da3aebb89e3158821e2f9494771e5cc3 > files > 2

ezweb-platform-0.1-0.2.svn2768mdv2010.1.src.rpm

%define python_compile_opt python -O -c "import compileall; compileall.compile_dir('.')"
%define python_compile     python -c "import compileall; compileall.compile_dir('.')"

%define ezwebdir %_datadir/%name
%define databasedir %{_localstatedir}/%{_lib}/%name

%define svnrev 2768

Name:		ezweb-platform
Version:	0.1
Release:	%mkrel 0.2.svn%svnrev
# downloaded from svn:
# svn export https://svn.forge.morfeo-project.org/svn/ezwebplatform/ezweb_platform/src/trunk
Source:		ezweb-platform-svn%{svnrev}.tar.bz2
URL:		http://ezweb.morfeo-project.org/
License:	GPLv2+
Group:		System/Servers
Summary:	EzWeb Platform
BuildRequires:	python-devel, python-sqlite, python-django >= 1.0, python-libxml2dom
BuildRequires:	python-psycopg2, python-imaging
Requires:	python-django >= 1.0, apache, apache-mod_python, python-sqlite
Requires:	python-imaging python-libxml2dom
Suggests:	python-psycopg2
%if %mdkversion < 201010
Requires(post):   rpm-helper
Requires(postun):   rpm-helper
%endif
BuildArch:	noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}

%description
The EzWeb project is based on the development of key technologies to be
employed in building the front end layer of a new generation SOA
architecture

%prep
%setup -q -n ezweb-platform-svn%{svnrev}
sed -ie "s/^DATABASE_ENGINE = 'postgresql_psycopg2'/DATABASE_ENGINE = 'sqlite3'/" settings.py
sed -ie "s|^DATABASE_NAME = '.*'|DATABASE_NAME = '%{buildroot}%{databasedir}/database'|" settings.py

%build
%python_compile
%python_compile_opt

%install
rm -Rf %{buildroot}

mkdir -p %buildroot%databasedir
touch %{buildroot}%{databasedir}/database

./manage.py syncdb <<EOF
no

EOF
sed -ie "s|^DATABASE_NAME = '.*'|DATABASE_NAME = '%{databasedir}/database'|" settings.py

mkdir -p %{buildroot}%{ezwebdir}
cp -a * %{buildroot}%{ezwebdir}

mkdir -p %buildroot%_webappconfdir
cat > %buildroot%_webappconfdir/%name.conf << EOF
<Location />
  SetHandler python-program
  PythonHandler django.core.handlers.modpython
  SetEnv DJANGO_SETTINGS_MODULE settings

  PythonPath "['/usr/share/ezweb-platform'] + sys.path"
</Location>

Alias /media /usr/share/python-support/python-django/django/contrib/admin/media
Alias /site-media /usr/share/ezweb-platform/media
Alias /repository /var/www/gadgets

<Location /repository>
  SetHandler None
</Location>

<Directory "/var/www/gadgets">
  Options Indexes FollowSymLinks MultiViews
  AllowOverride None
  Order allow,deny
  Allow from all
</Directory>
EOF

%post
%if %mdkversion < 201010
%_post_webapp
%endif

%postun
%if %mdkversion < 201010
%_postun_webapp
%endif

%files
%defattr(-,root,root)
%config(noreplace) %_webappconfdir/%name.conf
%{ezwebdir}
%attr(0770,root,apache) %databasedir
%config(noreplace) %attr(0660,root,apache) %databasedir/database


%changelog
* Mon Mar 01 2010 Guillaume Rousse <guillomovitch@mandriva.org> 0.1-0.2.svn2768mdv2010.1
+ Revision: 513135
- rely on filetrigger for reloading apache configuration begining with 2010.1, rpm-helper macros otherwise

* Mon Jan 25 2010 Nicolas Vigier <nvigier@mandriva.com> 0.1-0.1.svn2768mdv2010.1
+ Revision: 496278
- new svn snapshot

* Tue Nov 24 2009 Nicolas Vigier <nvigier@mandriva.com> 0.1-0.1.svn2697mdv2010.1
+ Revision: 469703
- update to new svn snapshot

* Wed Apr 08 2009 Nicolas Vigier <nvigier@mandriva.com> 0.1-0.1.svn1825mdv2009.1
+ Revision: 365131
- new svn version

* Wed Dec 10 2008 Nicolas Vigier <nvigier@mandriva.com> 0.1-0.1.svn1580mdv2009.1
+ Revision: 312545
- provide default sqlite database
- add requires on python-libxml2dom
- add requires on python-imaging
- new svn version
- import ezweb-platform