URL: http://hathaway.freezope.org/Software/BTreeFolder2/
%pyrequires_eq python-modules
Requires: Zope
+Requires(post,postun): /usr/sbin/installzopeproduct
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-%define product_dir /usr/lib/zope/Products
-
%description
BTreeFolder2 is a Zope product that acts like a Zope folder but can
store many more items.
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{product_dir}/%{zope_subname}
+install -d $RPM_BUILD_ROOT%{_datadir}/%{name}
# should tests be included or not?
-cp -af {tests,*.py,*.dtml} $RPM_BUILD_ROOT%{product_dir}/%{zope_subname}
+cp -af tests *.py *.dtml *.gif $RPM_BUILD_ROOT%{_datadir}/%{name}
-%py_comp $RPM_BUILD_ROOT%{product_dir}/%{zope_subname}
-%py_ocomp $RPM_BUILD_ROOT%{product_dir}/%{zope_subname}
+%py_comp $RPM_BUILD_ROOT%{_datadir}/%{name}
+%py_ocomp $RPM_BUILD_ROOT%{_datadir}/%{name}
# find $RPM_BUILD_ROOT -type f -name "*.py" -exec rm -rf {} \;;
rm -rf $RPM_BUILD_ROOT
%post
+/usr/sbin/installzopeproduct %{_datadir}/%{name}/$p BTreeFolder2
if [ -f /var/lock/subsys/zope ]; then
/etc/rc.d/init.d/zope restart >&2
fi
%postun
-if [ -f /var/lock/subsys/zope ]; then
- /etc/rc.d/init.d/zope restart >&2
+if [ "$1" = "0" ]; then
+ /usr/sbin/installzopeproduct -d $p BTreeFolder2
+ if [ -f /var/lock/subsys/zope ]; then
+ /etc/rc.d/init.d/zope restart >&2
+ fi
fi
%files
%defattr(644,root,root,755)
-%doc README.txt
-%{product_dir}/%{zope_subname}
+%doc README.txt CHANGES.txt
+%{_datadir}/%{name}