Browse Source

marisa-trie 0.2.1-2

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@7452 ec354946-7b23-47d6-9f5a-488ba84defc7
iwaim 12 years ago
parent
commit
6d63d93b9b
1 changed files with 47 additions and 1 deletions
  1. 47 1
      m/marisa-trie/marisa-trie-vl.spec

+ 47 - 1
m/marisa-trie/marisa-trie-vl.spec

@@ -1,8 +1,10 @@
 %define ver 0.2.1
-%define rel 1
+%define rel 2
 
 %define srcname marisa
 
+%define enable_python 1
+
 Summary: Matching Algorithm with Recursively Implemented StorAge
 Name: marisa-trie
 Version: %{ver}
@@ -12,6 +14,11 @@ Group: System Environment/Libraries
 URL: http://code.google.com/p/marisa-trie/
 Source0: http://marisa-trie.googlecode.com/files/%{srcname}-%{version}.tar.gz
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
+%if %{enable_python}
+BuildRequires: swig
+BuildRequires: python-devel
+BuildRequires: marisa-trie-devel
+%endif
 
 Vendor: Project Vine
 Distribution: Vine Linux
@@ -45,6 +52,17 @@ Requires: %{name} = %{version}-%{release}
 %description devel
 The marisa-trie-devel package contains the header files and libraries.
 
+%if %{enable_python}
+%package python
+Summary: marisa-trie Python binding
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description python
+marisa-trie Python binding
+
+%endif
+
 %prep
 %setup -q -n %{srcname}-%{version}
 
@@ -52,10 +70,25 @@ The marisa-trie-devel package contains the header files and libraries.
 %configure --enable-shared
 %__make
 
+%if %{enable_python}
+pushd bindings
+make swig-python
+pushd python
+python setup.py build
+popd
+popd
+%endif
+
 %install
 %__rm -rf $RPM_BUILD_ROOT
 %makeinstall
 
+%if %{enable_python}
+pushd bindings/python
+python setup.py install --root $RPM_BUILD_ROOT
+popd
+%endif
+
 # remove files
 %__rm -f $RPM_BUILD_ROOT%{_libdir}/*.{la,a}
 
@@ -83,7 +116,20 @@ The marisa-trie-devel package contains the header files and libraries.
 %{_includedir}/marisa/*.h
 %{_libdir}/libmarisa.so
 
+%if %{enable_python}
+%files python
+%defattr(-,root,root,-)
+%doc COPYING AUTHORS
+%{python_sitearch}/_marisa.so
+%{python_sitearch}/marisa-*.egg-info
+%{python_sitearch}/marisa.py
+%{python_sitearch}/marisa.pyc
+%endif
+
 %changelog
+* Fri Feb  8 2013 IWAI, Masaharu <iwai@alib.jp> 0.2.1-2
+- create python sub package
+
 * Mon Jan 28 2013 IWAI, Masaharu <iwai@alib.jp> 0.2.1-1
 - initial build for Vine Linux