]> git.pld-linux.org Git - packages/liblinear.git/blob - liblinear.spec
- updated to 2.47
[packages/liblinear.git] / liblinear.spec
1 #
2 # Conditional build:
3 %bcond_without  octave  # Octave (MATLAB) module
4 %bcond_without  python  # Python (any) interface
5 %bcond_without  python2 # Python 2.x interface
6 %bcond_without  python3 # Python 3.x interface
7 #
8 %if %{without python}
9 %undefine       with_python2
10 %undefine       with_python3
11 %endif
12 Summary:        LIBLINEAR - a Library for Large Linear Classification
13 Summary(pl.UTF-8):      LIBLINEAR - biblioteka do liniowej klasyfikacji dużych danych
14 Name:           liblinear
15 Version:        2.47
16 Release:        1
17 License:        BSD
18 Group:          Libraries
19 Source0:        https://www.csie.ntu.edu.tw/~cjlin/liblinear/%{name}-%{version}.tar.gz
20 # Source0-md5:  5f332f5f965d4ccb2c35a594abd6ec1d
21 Patch0:         %{name}-python.patch
22 Patch1:         %{name}-make.patch
23 Patch2:         %{name}-matlab.patch
24 URL:            https://www.csie.ntu.edu.tw/~cjlin/liblinear/
25 BuildRequires:  blas-devel
26 BuildRequires:  libstdc++-devel
27 %{?with_octave:BuildRequires:   octave-devel}
28 %{?with_python2:BuildRequires:  python-devel >= 1:2.7}
29 %{?with_python3:BuildRequires:  python3-devel >= 1:3.5}
30 BuildRequires:  rpm-pythonprov
31 BuildRequires:  rpmbuild(macros) >= 1.714
32 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33
34 %define         octave_oct_dir  %(octave-config --oct-site-dir)
35
36 %description
37 LIBLINEAR is a simple package for solving large-scale regularized
38 linear classification and regression. It currently supports:
39 - L2-regularized logistic regression/L2-loss support vector
40   classification/L1-loss support vector classification
41 - L1-regularized L2-loss support vector classification/L1-regularized
42   logistic regression
43 - L2-regularized L2-loss support vector regression/L1-loss support
44   vector regression. 
45
46 %description -l pl.UTF-8
47 LIBLINEAR to prosty pakiet do rozwiązywania zagadnień regularnej
48 klasyfikacji liniowej i regresji. Obecnie obsługuje:
49 - regresję logistyczną z regularyzacją L2
50 - regresję logistyczną z regularyzacją L1
51 - regresję wektorową z regularyzacją L2
52
53 %package devel
54 Summary:        Header files for LIBLINEAR library
55 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki LIBLINEAR
56 Group:          Development/Libraries
57 Requires:       %{name} = %{version}-%{release}
58
59 %description devel
60 Header files for LIBLINEAR library.
61
62 %description devel -l pl.UTF-8
63 Pliki nagłówkowe biblioteki LIBLINEAR.
64
65 %package -n octave-liblinear
66 Summary:        MATLAB/Octave interface for LIBLINEAR library
67 Summary(pl.UTF-8):      Interfejs MATLAB-a/Octave do biblioteki LIBLINEAR
68 Group:          Libraries
69 Requires:       octave
70
71 %description -n octave-liblinear
72 MATLAB/Octave interface for LIBLINEAR library.
73
74 %description -n octave-liblinear -l pl.UTF-8
75 Interfejs MATLAB-a/Octave do biblioteki LIBLINEAR.
76
77 %package -n python-liblinear
78 Summary:        Python 2 interface for LIBLINEAR library
79 Summary(pl.UTF-8):      Interfejs Pythona 2 do biblioteki LIBLINEAR
80 Group:          Libraries/Python
81 Requires:       %{name} = %{version}-%{release}
82 Requires:       python-libs >= 1:2.7
83 BuildArch:      noarch
84
85 %description -n python-liblinear
86 Python 2 interface for LIBLINEAR library.
87
88 %description -n python-liblinear -l pl.UTF-8
89 Interfejs Pythona 2 do biblioteki LIBLINEAR.
90
91 %package -n python3-liblinear
92 Summary:        Python 3 interface for LIBLINEAR library
93 Summary(pl.UTF-8):      Interfejs Pythona 3 do biblioteki LIBLINEAR
94 Group:          Libraries/Python
95 Requires:       %{name} = %{version}-%{release}
96 Requires:       python3-libs >= 1:3.5
97 BuildArch:      noarch
98
99 %description -n python3-liblinear
100 Python 3 interface for LIBLINEAR library.
101
102 %description -n python3-liblinear -l pl.UTF-8
103 Interfejs Pythona 3 do biblioteki LIBLINEAR.
104
105 %prep
106 %setup -q
107 %patch0 -p1
108 %patch1 -p1
109 %patch2 -p1
110
111 %build
112 %{__make} \
113         CC="%{__cc}" \
114         CXX="%{__cxx}" \
115         CFLAGS="%{rpmcflags} -fPIC -Wall" \
116         LIBS="-lblas"
117
118 %if %{with octave}
119 %{__make} -C matlab \
120         CC="%{__cc}" \
121         CXX="%{__cxx}" \
122         CFLAGS="%{rpmcflags} -fPIC -I.. -I/usr/include/octave -Wall" \
123         MEX=mkoctfile \
124         MEX_OPTION=--mex \
125         MEX_EXT=mex
126 %endif
127
128 %if %{with python2}
129 cd python
130 %py_build
131 cd ..
132 %endif
133
134 %if %{with python3}
135 cd python
136 %py3_build
137 cd ..
138 %endif
139
140 %install
141 rm -rf $RPM_BUILD_ROOT
142 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir},%{_includedir}}
143
144 install liblinear.so.* $RPM_BUILD_ROOT%{_libdir}
145 ln -sf $(basename $RPM_BUILD_ROOT%{_libdir}/liblinear.so.*) $RPM_BUILD_ROOT%{_libdir}/liblinear.so
146 cp -p linear.h newton.h $RPM_BUILD_ROOT%{_includedir}
147 install train $RPM_BUILD_ROOT%{_bindir}/liblinear-train
148 install predict $RPM_BUILD_ROOT%{_bindir}/liblinear-predict
149
150 %if %{with octave}
151 install -d $RPM_BUILD_ROOT%{octave_oct_dir}/liblinear
152 install matlab/*.mex $RPM_BUILD_ROOT%{octave_oct_dir}/liblinear
153 %endif
154
155 %if %{with python2}
156 cd python
157 %py_install
158 cd ..
159 %endif
160
161 %if %{with python3}
162 cd python
163 %py3_install
164 cd ..
165 %endif
166
167 %clean
168 rm -rf $RPM_BUILD_ROOT
169
170 %post   -p /sbin/ldconfig
171 %postun -p /sbin/ldconfig
172
173 %files
174 %defattr(644,root,root,755)
175 %doc COPYRIGHT README
176 %attr(755,root,root) %{_bindir}/liblinear-predict
177 %attr(755,root,root) %{_bindir}/liblinear-train
178 %attr(755,root,root) %{_libdir}/liblinear.so.5
179
180 %files devel
181 %defattr(644,root,root,755)
182 %attr(755,root,root) %{_libdir}/liblinear.so
183 %{_includedir}/linear.h
184 %{_includedir}/newton.h
185
186 %if %{with octave}
187 %files -n octave-liblinear
188 %defattr(644,root,root,755)
189 %dir %{octave_oct_dir}/liblinear
190 %attr(755,root,root) %{octave_oct_dir}/liblinear/libsvmread.mex
191 %attr(755,root,root) %{octave_oct_dir}/liblinear/libsvmwrite.mex
192 %attr(755,root,root) %{octave_oct_dir}/liblinear/predict.mex
193 %attr(755,root,root) %{octave_oct_dir}/liblinear/train.mex
194 %endif
195
196 %if %{with python2}
197 %files -n python-liblinear
198 %defattr(644,root,root,755)
199 %doc python/README
200 %{py_sitescriptdir}/liblinear
201 %{py_sitescriptdir}/liblinear_official-%{version}.0-py*.egg-info
202 %endif
203
204 %if %{with python3}
205 %files -n python3-liblinear
206 %defattr(644,root,root,755)
207 %doc python/README
208 %{py3_sitescriptdir}/liblinear
209 %{py3_sitescriptdir}/liblinear_official-%{version}.0-py*.egg-info
210 %endif
This page took 0.080248 seconds and 3 git commands to generate.