Author: qboosh                       Date: Sun Sep 18 15:54:46 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- added python patch, package python module (on bcond)

---- Files affected:
packages/pacparser:
   pacparser.spec (1.17 -> 1.18) , pacparser-python.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/pacparser/pacparser.spec
diff -u packages/pacparser/pacparser.spec:1.17 
packages/pacparser/pacparser.spec:1.18
--- packages/pacparser/pacparser.spec:1.17      Sun Sep 18 09:09:46 2011
+++ packages/pacparser/pacparser.spec   Sun Sep 18 17:54:41 2011
@@ -1,6 +1,7 @@
 # $Revision$, $Date$
-# TODO:
-# - python module (make pymod, unset SONAME for python module)
+#
+# Conditional build:
+%bcond_without python  # Python module
 #
 Summary:       A library to make your web software pac (proxy auto-config) 
files intelligent
 Summary(pl.UTF-8):     Biblioteka do obsługi plików pac (automatycznej 
konfiguracji proxy)
@@ -14,8 +15,15 @@
 #Source0Download: http://code.google.com/p/pacparser/downloads/list
 Patch0:                %{name}-make.patch
 Patch1:                %{name}-libdir.patch
+Patch2:                %{name}-python.patch
 URL:           http://code.google.com/p/pacparser/
 BuildRequires: js-devel
+BuildRequires: rpmbuild(macros) >= 1.566
+BuildRequires: sed >= 4.0
+%if %{with python}
+BuildRequires: python-devel
+BuildRequires: rpm-pythonprov
+%endif
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -67,10 +75,25 @@
 %description devel -l pl.UTF-8
 Pliki nagłówkowe biblioteki pacparser.
 
+%package -n python-pacparser
+Summary:       Python interface for pacparser library
+Summary(pl.UTF-8):     Interfejs Pythona do biblioteki pacparser
+Group:         Libraries/Python
+Requires:      %{name} = %{version}-%{release}
+%pyrequires_eq python-libs
+
+%description -n python-pacparser
+Python interface for pacparser library.
+
+%description -n python-pacparser -l pl.UTF-8
+Interfejs Pythona do biblioteki pacparser.
+
 %prep
 %setup -q
 %patch0 -p1
 %patch1 -p1
+%undos src/pymod/setup.py
+%patch2 -p1
 
 %build
 %{__make} -C src \
@@ -79,6 +102,13 @@
        LDFLAGS="%{rpmldflags} -ljs" \
        LIB=%{_lib}
 
+%if %{with python}
+cd src/pymod
+CFLAGS="%{rpmcflags}" \
+LDFLAGS="%{rpmldflags} -L$(pwd)/.." \
+%{__python} setup.py build
+%endif
+
 %install
 rm -rf $RPM_BUILD_ROOT
 
@@ -86,6 +116,15 @@
        DESTDIR=$RPM_BUILD_ROOT \
        LIB=%{_lib}
 
+%if %{with python}
+cd src/pymod
+%{__python} setup.py install \
+       --optimize=2 \
+       --root=$RPM_BUILD_ROOT
+
+%py_postclean
+%endif
+
 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}
 
 %clean
@@ -107,12 +146,24 @@
 %{_includedir}/pacparser.h
 %{_mandir}/man3/pacparser*.3*
 
+%if %{with python}
+%files -n python-pacparser
+%defattr(644,root,root,755)
+%dir %{py_sitedir}/pacparser
+%attr(755,root,root) %{py_sitedir}/pacparser/_pacparser.so
+%{py_sitedir}/pacparser/__init__.py[co]
+%{py_sitedir}/pacparser-1-py*.egg-info
+%endif
+
 %define date   %(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
 * %{date} PLD Team <[email protected]>
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.18  2011/09/18 15:54:41  qboosh
+- added python patch, package python module (on bcond)
+
 Revision 1.17  2011/09/18 07:09:46  qboosh
 - pl
 - License is LGPL (v3+)

================================================================
Index: packages/pacparser/pacparser-python.patch
diff -u /dev/null packages/pacparser/pacparser-python.patch:1.1
--- /dev/null   Sun Sep 18 17:54:46 2011
+++ packages/pacparser/pacparser-python.patch   Sun Sep 18 17:54:41 2011
@@ -0,0 +1,14 @@
+--- pacparser-1.3.0/src/pymod/setup.py.orig    2011-09-10 08:36:51.000000000 
+0200
++++ pacparser-1.3.0/src/pymod/setup.py 2011-09-18 17:26:31.571407941 +0200
+@@ -42,9 +42,9 @@
+     return
+ 
+   pacparser_module = Extension('_pacparser',
+-                               include_dirs = ['../spidermonkey/js/src', 
'..'],
++                               include_dirs = ['..', '/usr/include/js'],
+                                sources = ['pacparser_py.c'],
+-                               extra_objects = ['../pacparser.o', 
'../libjs.a'])
++                               libraries = ['pacparser', 'js'])
+   setup (name = 'pacparser',
+          version = '1',
+          description = 'Pacparser package',
================================================================

---- CVS-web:
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/pacparser/pacparser.spec?r1=1.17&r2=1.18&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to