]> git.pld-linux.org Git - packages/liblinear.git/commitdiff
- new auto/th/liblinear-2.1-1
authorJakub Bogusz <qboosh@pld-linux.org>
Sun, 29 Jan 2017 10:14:58 +0000 (11:14 +0100)
committerJakub Bogusz <qboosh@pld-linux.org>
Sun, 29 Jan 2017 10:14:58 +0000 (11:14 +0100)
liblinear-make.patch [new file with mode: 0644]
liblinear-python.patch [new file with mode: 0644]
liblinear.spec [new file with mode: 0644]

diff --git a/liblinear-make.patch b/liblinear-make.patch
new file mode 100644 (file)
index 0000000..b91ee14
--- /dev/null
@@ -0,0 +1,29 @@
+--- liblinear-2.1/Makefile.orig        2015-09-27 00:03:26.000000000 +0200
++++ liblinear-2.1/Makefile     2017-01-29 09:07:42.640874155 +0100
+@@ -8,19 +8,20 @@
+ all: train predict
+-lib: linear.o tron.o blas/blas.a
++lib: linear.o tron.o
+       if [ "$(OS)" = "Darwin" ]; then \
+               SHARED_LIB_FLAG="-dynamiclib -Wl,-install_name,liblinear.so.$(SHVER)"; \
+       else \
+               SHARED_LIB_FLAG="-shared -Wl,-soname,liblinear.so.$(SHVER)"; \
+       fi; \
+-      $(CXX) $${SHARED_LIB_FLAG} linear.o tron.o blas/blas.a -o liblinear.so.$(SHVER)
++      $(CXX) $${SHARED_LIB_FLAG} linear.o tron.o -o liblinear.so.$(SHVER) $(LIBS) ; \
++      ln -s liblinear.so.$(SHVER) liblinear.so
+-train: tron.o linear.o train.c blas/blas.a
+-      $(CXX) $(CFLAGS) -o train train.c tron.o linear.o $(LIBS)
++train: lib train.c
++      $(CXX) $(CFLAGS) -o train train.c -L. -llinear $(LIBS)
+-predict: tron.o linear.o predict.c blas/blas.a
+-      $(CXX) $(CFLAGS) -o predict predict.c tron.o linear.o $(LIBS)
++predict: lib predict.c
++      $(CXX) $(CFLAGS) -o predict predict.c -L. -llinear $(LIBS)
+ tron.o: tron.cpp tron.h
+       $(CXX) $(CFLAGS) -c -o tron.o tron.cpp
diff --git a/liblinear-python.patch b/liblinear-python.patch
new file mode 100644 (file)
index 0000000..a4725af
--- /dev/null
@@ -0,0 +1,16 @@
+--- liblinear-2.1/python/liblinear.py.orig     2015-09-27 00:03:39.000000000 +0200
++++ liblinear-2.1/python/liblinear.py  2017-01-28 23:38:33.691264075 +0100
+@@ -1,5 +1,3 @@
+-#!/usr/bin/env python
+-
+ from ctypes import *
+ from ctypes.util import find_library
+ from os import path
+--- liblinear-2.1/python/liblinearutil.py.orig 2015-09-27 00:03:40.000000000 +0200
++++ liblinear-2.1/python/liblinearutil.py      2017-01-28 23:38:44.447930619 +0100
+@@ -1,5 +1,3 @@
+-#!/usr/bin/env python
+-
+ import os, sys
+ sys.path = [os.path.dirname(os.path.abspath(__file__))] + sys.path 
+ from liblinear import *
diff --git a/liblinear.spec b/liblinear.spec
new file mode 100644 (file)
index 0000000..e5c7a43
--- /dev/null
@@ -0,0 +1,103 @@
+Summary:       LIBLINEAR - a Library for Large Linear Classification
+Summary(pl.UTF-8):     LIBLINEAR - biblioteka do liniowej klasyfikacji dużych danych
+Name:          liblinear
+Version:       2.1
+Release:       1
+License:       BSD
+Group:         Libraries
+Source0:       http://www.csie.ntu.edu.tw/~cjlin/liblinear/%{name}-%{version}.tar.gz
+# Source0-md5: 0d87a71d054ed17c5ee7656efba06e89
+Patch0:                %{name}-python.patch
+Patch1:                %{name}-make.patch
+URL:           http://www.csie.ntu.edu.tw/~cjlin/liblinear/
+BuildRequires: blas-devel
+BuildRequires: libstdc++-devel
+BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+LIBLINEAR is a simple package for solving large-scale regularized
+linear classification and regression. It currently supports:
+- L2-regularized logistic regression/L2-loss support vector
+  classification/L1-loss support vector classification
+- L1-regularized L2-loss support vector classification/L1-regularized
+  logistic regression
+- L2-regularized L2-loss support vector regression/L1-loss support
+  vector regression. 
+
+%description -l pl.UTF-8
+LIBLINEAR to prosty pakiet do rozwiązywania zagadnień regularnej
+klasyfikacji liniowej i regresji. Obecnie obsługuje:
+- regresję logistyczną z regularyzacją L2
+- regresję logistyczną z regularyzacją L1
+- regresję wektorową z regularyzacją L2
+
+%package devel
+Summary:       Header files for LIBLINEAR library
+Summary(pl.UTF-8):     Pliki nagłówkowe biblioteki LIBLINEAR
+Group:         Development/Libraries
+Requires:      %{name} = %{version}-%{release}
+
+%description devel
+Header files for LIBLINEAR library.
+
+%description devel -l pl.UTF-8
+Pliki nagłówkowe biblioteki LIBLINEAR.
+
+%package -n python-liblinear
+Summary:       Python interface for LIBLINEAR library
+Summary(pl.UTF-8):     Interfejs Pythona do biblioteki LIBLINEAR
+Group:         Libraries/Python
+Requires:      %{name} = %{version}-%{release}
+
+%description -n python-liblinear
+Python interface for LIBLINEAR library.
+
+%description -n python-liblinear -l pl.UTF-8
+Interfejs Pythona do biblioteki LIBLINEAR.
+
+%prep
+%setup -q
+%patch0 -p1
+%patch1 -p1
+
+%build
+%{__make} \
+       CC="%{__cc}" \
+       CXX="%{__cxx}" \
+       CFLAGS="%{rpmcflags} -fPIC -Wall" \
+       LIBS="-lblas"
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir},%{_includedir},%{py_sitescriptdir}}
+
+install liblinear.so.* $RPM_BUILD_ROOT%{_libdir}
+ln -sf $(basename $RPM_BUILD_ROOT%{_libdir}/liblinear.so.*) $RPM_BUILD_ROOT%{_libdir}/liblinear.so
+cp -p linear.h tron.h $RPM_BUILD_ROOT%{_includedir}
+install train $RPM_BUILD_ROOT%{_bindir}/liblinear-train
+install predict $RPM_BUILD_ROOT%{_bindir}/liblinear-predict
+cp -p python/*.py $RPM_BUILD_ROOT%{py_sitescriptdir}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post  -p /sbin/ldconfig
+%postun        -p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc COPYRIGHT README
+%attr(755,root,root) %{_bindir}/liblinear-predict
+%attr(755,root,root) %{_bindir}/liblinear-train
+%attr(755,root,root) %{_libdir}/liblinear.so.3
+
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/liblinear.so
+%{_includedir}/linear.h
+%{_includedir}/tron.h
+
+%files -n python-liblinear
+%defattr(644,root,root,755)
+%{py_sitescriptdir}/liblinear.py
+%{py_sitescriptdir}/liblinearutil.py
This page took 0.119012 seconds and 4 git commands to generate.