-%define prod_name Formulator
-
-Summary: Zope framework that eases the creation and validation of web forms.
-Name: Zope-%{prod_name}
-Version: 1.0.1
+%define zope_subname Formulator
+Summary: Zope framework that eases the creation and validation of web forms
+Summary(pl.UTF-8): Dodatek do Zope ułatwiający tworzenie i sprawdzanie poprawności formularzy WWW
+Name: Zope-%{zope_subname}
+Version: 1.11.3
Release: 1
-License: BSD-style
-Source0: http://www.zope.org/Members/faassen/%{prod_name}/%{prod_name}-%{version}.tgz
-URL: http://www.zope.org/Members/faassen/%{prod_name}
-Group: Development/Languages/Python
-Group(de): Entwicklung/Sprachen/Python
-Group(pl): Programowanie/Jêzyki/Python
+License: BSD-like
+Group: Development/Tools
+Source0: http://www.infrae.com/download/%{zope_subname}/%{version}/%{zope_subname}-%{version}.tgz
+# Source0-md5: 59206403a29953fa33d5dce829101ab5
+URL: http://www.infrae.com/products/formulator/
+BuildRequires: python
+BuildRequires: rpmbuild(macros) >= 1.268
+%pyrequires_eq python-modules
+Requires(post,postun): /usr/sbin/installzopeproduct
Requires: Zope
-BuildRequires: python >= 2.1
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-%define python_compile_opt python -O -c "import compileall; compileall.compile_dir('.')"
-%define python_compile python -c "import compileall; compileall.compile_dir('.')"
-
-%define zope_dir %{_libdir}/zope
-%define zope_productsdir %{zope_dir}/Products
-
%description
-%{prod_name} is a tool to help with the creation and validation of web
-forms. Form fields are stored as objects in Zope, in a special Form folder.
-
-%prep
-%setup -q -n %{prod_name}
+%{zope_subname} is a tool to help with the creation and validation of
+web forms. Form fields are stored as objects in Zope, in a special
+Form folder.
-%build
-%{python_compile}
-%{python_compile_opt}
+%description -l pl.UTF-8
+%{zope_subname} jest narzędziem pomagającym przy tworzeniu i
+sprawdzaniu poprawności formularzy WWW. Pola formularza są zapisywane
+jako obiekty w Zope, w specjalnym folderze Form.
-find . -name \*.py | xargs -r rm -f
-gzip -9nf *.txt
+%prep
+%setup -q -n %{zope_subname}
+mkdir docs
+mv -f {CREDITS.txt,HISTORY.txt,INSTALL.txt,README.txt,TODO.txt} docs
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{zope_productsdir}/%{prod_name}
+install -d $RPM_BUILD_ROOT%{_datadir}/%{name}
+cp -af {dtml,help,i18n,tests,www,*.py,*.html,refresh.txt,version.txt} $RPM_BUILD_ROOT%{_datadir}/%{name}
+
+%py_comp $RPM_BUILD_ROOT%{_datadir}/%{name}
+%py_ocomp $RPM_BUILD_ROOT%{_datadir}/%{name}
-cp -a . $RPM_BUILD_ROOT%{zope_productsdir}/%{prod_name}
-rm -f $RPM_BUILD_ROOT%{zope_productsdir}/%{prod_name}/*.gz
+# find $RPM_BUILD_ROOT -type f -name "*.py" -exec rm -rf {} \;;
+rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/docs
%clean
rm -rf $RPM_BUILD_ROOT
+%post
+/usr/sbin/installzopeproduct %{_datadir}/%{name} %{zope_subname}
+%service -q zope restart
+
+%postun
+if [ "$1" = "0" ]; then
+ /usr/sbin/installzopeproduct -d %{zope_subname}
+ %service -q zope restart
+fi
+
%files
%defattr(644,root,root,755)
-%doc *.gz
-%{zope_productsdir}/%{prod_name}
+%doc docs/*
+%{_datadir}/%{name}