%define product ERP5
%define version 0.9.20060116
# If we get the code from the CVS, the release will be always the first
%define release 1

%define zope_home %{_prefix}/lib/zope
%define software_home %{zope_home}/lib/python

Summary:   A Zope framework to implement ERP software
Name:      zope-%{product}
Version:   %{version}
Release:   %mkrel %{release}
License:   GPL
Group:     System/Servers
URL:       http://www.erp5.org
Source0:   %{product}-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-rootdir
BuildArch: noarch
Requires:  erp5-zope, MySQL-Max >= 5, erp5-CMFPhoto, erp5-Formulator, zope-CMFReportTool, zope-Localizer, zope-Photo, zope-ZMySQLDA, zope-BTreeFolder2, zope-CMFMailIn, zope-ERP5Catalog, zope-ERP5Form, zope-ERP5SyncML, zope-CMFCategory, zope-ERP5Type, zope-TranslationService, python-numeric, python-psyco, python-glpk, zope-CMFActivity, zope-ERP5Security, zope-ERP5OOo

#----------------------------------------------------------------------
%description
ERP5 is a Zope framework which allows to implement ERP software.
It includes a Rapid Application Development system and a Universal
Business Model which together allow to model any business process in
very short time.

#----------------------------------------------------------------------
%prep
%setup -c

%build


%install
%{__rm} -rf %{buildroot}
%{__mkdir_p} %{buildroot}/%{software_home}/Products
%{__cp} -a * %{buildroot}%{software_home}/Products/


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

%post
mkdir /var/lib/zope/Extensions
mkdir /var/lib/zope/PropertySheet
mkdir /var/lib/zope/Constraint
ln -s %{software_home}/Products/%{name}/Extensions/zsqlbrain.py /var/lib/zope/Extensions/
if [ "`%{_prefix}/bin/zopectl status`" != "daemon manager not running" ] ; then
  service zope restart
fi

%postun
if [ -f "%{_prefix}/bin/zopectl" ] && [ "`%{_prefix}/bin/zopectl status`" != "daemon manager not running" ] ; then
  service zope restart
fi

%files
%defattr(0644, root, root, 0755)
%doc %{product}/VERSION.txt %{product}/README.txt %{product}/INSTALL.txt %{product}/CREDITS.txt %{product}/GPL.txt %{product}/ZPL.txt
%{software_home}/Products/*

#----------------------------------------------------------------------
%changelog
* Mon Jan 16 2006 Kevin Deldycke <kevin@nexedi.com> 0.9.20060116-1mdk
- New build from the CVS

* Tue Jan 10 2006 Kevin Deldycke <kevin@nexedi.com> 0.9.20060110-1mdk
- New release for Mandriva 2006
- Spec file updated

* Tue Sep 01 2004 Sebastien Robin <seb@nexedi.com> 0.8-1mdk
- New release for Mandrake 10.1

* Tue Jun 15 2004 Sebastien Robin <seb@nexedi.com> 0.1-26mdk
- Fix some sql queries

* Thu Jun 10 2004 Sebastien Robin <seb@nexedi.com> 0.1-25mdk
- New release for Mandrake 10.1

* Mon Nov 03 2003 Sebastien Robin <seb@nexedi.com> 0.1-24mdk
- Added dependencies to python-numeric and gplk

* Mon Sep 08 2003 Sebastien Robin <seb@nexedi.com> 0.1-23mdk
- Changed permissions on files

* Wed Sep 05 2003 Sebastien Robin <seb@nexedi.com> 0.1-22mdk
- Update spec in order to follows Mandrake Rules

* Wed May 21 2003 S�bastien Robin <seb@nexedi.com> 0.1-21nxd
- Added dependencies : python-imaging TranslationService

* Tue May 13 2003 S�bastien Robin <seb@nexedi.com> 0.1-20nxd
- Added dependencies : ERP5Catalog, ERP5Form, CMFCategory, ERP5SyncML...
- We need theses dependencies because ERP5 was splitted in several products

* Wed May 02 2003 S�bastien Robin <seb@nexedi.com> 0.1-19nxd
- Added dependencies : PyXML, python-reportlab
- Remove dependencies : python2.1-xml

* Mon Apr 28 2003 S�bastien Robin <seb@nexedi.com> 0.1-17nxd
- Added a dependency (ZMySQLDA), since ERP5 is only tested
  with mysql actually. May be it should be removed afterwards.

* Wed Apr 25 2003 S�bastien Robin <seb@nexedi.com> 0.1-16nxd
- Clean this spec file in order to not copy local files
- Remove dependencies (zope-zserver)
- Add the directory Constraint

* Wed Mar 5 2003 Jean-Paul Smets <jp@nexedi.com> 0.1-15nxd
- Added missing dependencies (zope-zserver)

* Wed Mar 5 2003 Jean-Paul Smets <jp@nexedi.com> 0.1-14nxd
- Added missing dependencies (CMFReport CMFMailIn)

* Wed Mar 5 2003 Jean-Paul Smets <jp@nexedi.com> 0.1-13nxd
- Added missing dependencies (Base18)

* Tue Feb 25 2003 Jean-Paul Smets <jp@nexedi.com> 0.1-12nxd
- Added props

* Tue Feb 25 2003 Jean-Paul Smets <jp@nexedi.com> 0.1-11nxd
- Added images

* Tue Feb 25 2003 Jean-Paul Smets <jp@nexedi.com> 0.1-10nxd
- Code update

* Thu Feb 13 2003 Jean-Paul Smets <jp@nexedi.com> 0.1-9nxd
- Code update

* Mon Feb 2 2003 Jean-Paul Smets <jp@nexedi.com> 0.1-8nxd
- Added portal.gif

* Mon Feb 2 2003 Jean-Paul Smets <jp@nexedi.com> 0.1-7nxd
- Added Core

* Mon Feb 2 2003 Jean-Paul Smets <jp@nexedi.com> 0.1-6nxd
- Code update + do it again

* Thu Dec 12 2002 Jean-Paul Smets <jp@nexedi.com> 0.1-2nxd
- CVS Updates

* Mon Nov 4 2002 Jean-Paul Smets <jp@nexedi.com> 0.1-1nxd
- Initial release