Name: cmsappdb
Version: 0.1.0
Release: 0
Summary: Database Server for my CMS
Group: Database

Requires: cleanpython26
BuildRequires: cleanpython26
%define python /opt/cleanpython26/bin/python

##########################################################################
# Lines below this point normally shouldn't change

%define source %{name}-%{version}

Vendor: Zope Corporation
Packager: Zope Corporation <sales@zope.com>
License: ZVSL
AutoReqProv: no
Source: %{source}.tgz
Prefix: /opt
BuildRoot: /tmp/%{name}

%description
%{summary}

%prep
%setup -n %{source}

%build
rm -rf %{buildroot}
mkdir %{buildroot} %{buildroot}/opt
cp -r $RPM_BUILD_DIR/%{source} %{buildroot}/opt/%{name}
cd %{buildroot}/opt/%{name}
%{python} install.py bootstrap
%{python} install.py buildout:extensions=

%{python} -m compileall -q -f -d /opt/%{name}/eggs eggs \
   > /dev/null 2>&1 || true

rm -rf release-distributions

for egglink in develop-eggs/*.egg-link
do
    sed -i "s;%{buildroot};;" ${egglink}
done

cd /tmp

%clean
rm -rf %{buildroot}
rm -rf $RPM_BUILD_DIR/%{source}

%files
%defattr(-, root, root)
/opt/%{name}