From: Jacek Konieczny Date: Sun, 16 Nov 2003 16:42:09 +0000 (+0000) Subject: - install in %{_datadir}/%{name} X-Git-Tag: auto/ac/Zope-ZMySQLDA-2_0_8-1 X-Git-Url: http://git.pld-linux.org/?p=packages%2FZope-ZMySQLDA.git;a=commitdiff_plain;h=6bde8100e3296948591859ddf7cda4a95e924e55 - install in %{_datadir}/%{name} - installzopeproduct in %post/%postun - use python rpm macros - BuildRequires removed Changed files: Zope-ZMySQLDA.spec -> 1.11 --- diff --git a/Zope-ZMySQLDA.spec b/Zope-ZMySQLDA.spec index 695f2c1..b2d12c4 100644 --- a/Zope-ZMySQLDA.spec +++ b/Zope-ZMySQLDA.spec @@ -1,26 +1,21 @@ -%define prod_name ZMySQLDA +%include /usr/lib/rpm/macros.python +%define zope_subname ZMySQLDA Summary: Zope MySQL database adapter Summary(pl): Interfejs bazy danych MySQL do Zope -Name: Zope-%{prod_name} +Name: Zope-%{zope_subname} Version: 2.0.8 Release: 1 License: ZPL Group: Development/Languages/Python -Source0: http://www.zope.org/Members/adustman/Products/ZMySQLDA/%{prod_name}-%{version}.tar.gz +Source0: http://www.zope.org/Members/adustman/Products/ZMySQLDA/%{zope_subname}-%{version}.tar.gz # Source0-md5: 74332272e53b13c6b19d3185d575699c URL: http://www.zope.org/Members/adustman/Products/ZMySQLDA/ -BuildRequires: python-MySQLdb +%pyrequires_eq python-modules Requires: Zope Requires: python-MySQLdb 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 Zope MySQL database adapter. @@ -29,26 +24,38 @@ Interfejs bazy danych MySQL do Zope. %prep %setup -q -c -mv -f lib/python/Products/%{prod_name}/* . +mv -f lib/python/Products/%{zope_subname}/* . rm -rf lib %build -%{python_compile} -%{python_compile_opt} - -find . -name \*.py | xargs -r rm -f %install rm -rf $RPM_BUILD_ROOT -install -d $RPM_BUILD_ROOT%{zope_productsdir}/%{prod_name} +install -d $RPM_BUILD_ROOT%{_datadir}/%{name} -cp -a . $RPM_BUILD_ROOT%{zope_productsdir}/%{prod_name} -rm -f $RPM_BUILD_ROOT%{zope_productsdir}/%{prod_name}/*.gz +cp -af *.py *.dtml help icons $RPM_BUILD_ROOT%{_datadir}/%{name} + +%py_comp $RPM_BUILD_ROOT%{_datadir}/%{name} +%py_ocomp $RPM_BUILD_ROOT%{_datadir}/%{name} %clean rm -rf $RPM_BUILD_ROOT +%post +/usr/sbin/installzopeproduct %{_datadir}/%{name} %{zope_subname} +if [ -f /var/lock/subsys/zope ]; then + /etc/rc.d/init.d/zope restart >&2 +fi + +%postun +if [ "$1" = "0" ]; then + /usr/sbin/installzopeproduct -d %{zope_subname} + if [ -f /var/lock/subsys/zope ]; then + /etc/rc.d/init.d/zope restart >&2 + fi +fi + %files %defattr(644,root,root,755) %doc *.txt -%{zope_productsdir}/%{prod_name} +%{_datadir}/%{name}