]> git.pld-linux.org Git - packages/python-psycopg2.git/commitdiff
- install ZPsycopgDA in %{_datadir}/Zope-ZPsycopgDA
authorJacek Konieczny <jajcus@pld-linux.org>
Sun, 16 Nov 2003 16:52:08 +0000 (16:52 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- installzopeproduct in %post/%postun of ZPsycopgDA

Changed files:
    python-psycopg2.spec -> 1.28

python-psycopg2.spec

index 95468eb0589a20284b8d7e0623b6c0560aa03d1b..220c12d51cfedb4099b617a08700516e4025ca7e 100644 (file)
@@ -22,11 +22,7 @@ Requires:    postgresql-libs
 Requires:      python-mx-DateTime
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define prod_name ZPsycopgDA
-%define zope_dir          %{_libdir}/zope
-%define zope_productsdir   %{zope_dir}/Products
-%define python_compile_opt python -O -c "import compileall; compileall.compile_dir('.')"
-%define python_compile     python -c "import compileall; compileall.compile_dir('.')"
+%define zope_subname ZPsycopgDA
 
 %description
 psycopg is a PostgreSQL database adapter for the Python programming
@@ -42,7 +38,7 @@ z za
 psycopg jest, ¿e w jest pe³ni zgodny z standardem DBAPI-2.0 i jest
 'thread safe' na poziomie 2.
 
-%package -n Zope-%{prod_name}
+%package -n Zope-%{zope_subname}
 Summary:       Zope PostgreSQL database adapter
 Summary(pl):   Interfejs bazy danych PostgreSQL do Zope
 Group:         Development/Languages/Python
@@ -50,10 +46,10 @@ Requires:   Zope
 Requires:      %{name} = %{version}
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%description -n Zope-%{prod_name}
+%description -n Zope-%{zope_subname}
 Zope PostgreSQL database adapter.
 
-%description -n Zope-%{prod_name} -l pl
+%description -n Zope-%{zope_subname} -l pl
 Interfejs bazy danych PostgreSQL do Zope.
 
 %prep
@@ -69,27 +65,39 @@ Interfejs bazy danych PostgreSQL do Zope.
        --with-postgres-includes=%{_includedir}/postgresql/server
 %{__make}
 
-cd %{prod_name}
-%{python_compile}
-%{python_compile_opt}
-
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{py_sitedir},%{zope_productsdir}/%{prod_name}}
+install -d $RPM_BUILD_ROOT{%{py_sitedir},%{_datadir}/Zope-%{zope_subname}}
 
 install psycopgmodule.so $RPM_BUILD_ROOT%{py_sitedir}
 
-cp -ar %{prod_name}/* $RPM_BUILD_ROOT%{zope_productsdir}/%{prod_name}
-rm -f $RPM_BUILD_ROOT%{zope_productsdir}/%{prod_name}/*.py
+cp -ar %{zope_subname}/* $RPM_BUILD_ROOT%{_datadir}/Zope-%{zope_subname}
+%py_comp $RPM_BUILD_ROOT%{_datadir}/Zope-%{zope_subname}
+%py_ocomp $RPM_BUILD_ROOT%{_datadir}/Zope-%{zope_subname}
+rm -f $RPM_BUILD_ROOT%{_datadir}/Zope-%{zope_subname}/*.py
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%post -n Zope-%{zope_subname}
+/usr/sbin/installzopeproduct %{_datadir}/Zope-%{zope_subname} %{zope_subname}
+if [ -f /var/lock/subsys/zope ]; then
+       /etc/rc.d/init.d/zope restart >&2
+fi
+
+%postun -n Zope-%{zope_subname}
+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 AUTHORS CREDITS FAQ NEWS README RELEASE-1.0 SUCCESS TODO doc
 %attr(755,root,root) %{py_sitedir}/*.so
 
-%files -n Zope-%{prod_name}
+%files -n Zope-%{zope_subname}
 %defattr(644,root,root,755)
-%{zope_productsdir}/%{prod_name}
+%{_datadir}/Zope-%{zope_subname}
This page took 0.12765 seconds and 4 git commands to generate.