]>
Commit | Line | Data |
---|---|---|
641d9ce6 JB |
1 | # TODO: Cplex, Mosek, Xpress, Gurobi solvers (commercial) |
2 | # | |
3 | # Conditional build: | |
4 | %bcond_without apidocs # do not build and package API docs | |
5 | %bcond_without static_libs # don't build static libraries | |
6 | %bcond_with soplex # Soplex solver support (academic use or commercial) | |
7 | # | |
8 | Summary: COIN-OR Osi - Open Solver Interface library | |
9 | Summary(pl.UTF-8): COIN-OR Osi (Open Solver Interface) - interfejs do rozwiązywania problemów matematycznych | |
10 | Name: CoinOsi | |
11 | Version: 0.106.10 | |
12 | Release: 1 | |
13 | License: Eclipse Public License v1.0 | |
14 | Group: Libraries | |
15 | Source0: http://www.coin-or.org/download/source/Osi/Osi-%{version}.tgz | |
16 | # Source0-md5: 1a3d67fe4c9948286269e92a85c63b79 | |
17 | Patch0: Osi-glpk.patch | |
18 | Patch1: Osi-destdir.patch | |
19 | Patch2: Osi-link.patch | |
20 | URL: https://projects.coin-or.org/Osi | |
21 | BuildRequires: CoinUtils-devel | |
22 | BuildRequires: autoconf >= 2.59 | |
23 | BuildRequires: automake | |
24 | %{?with_apidocs:BuildRequires: doxygen} | |
25 | BuildRequires: glpk-devel | |
26 | BuildRequires: libstdc++-devel | |
27 | BuildRequires: libtool >= 2:1.5 | |
28 | %{?with_soplex:BuildRequires: soplex-devel} | |
29 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
30 | ||
31 | %description | |
32 | The COIN-OR Open Solver Interface library is a collection of solver | |
33 | interfaces (SIs) that provide a common interface - the OSI API - for | |
34 | all the supported solvers. | |
35 | ||
36 | %description -l pl.UTF-8 | |
37 | Biblioteka COIN-OR Open Solver Interface to zbiór interfejsów do | |
38 | bibliotek rozwiązujących problemy matematyczne (Solver Interface) | |
39 | udostępniających wspólny interfejs (API OSI) dla wszystkich | |
40 | obsługiwanych bibliotek. | |
41 | ||
42 | %package devel | |
43 | Summary: Header files for COIN-OR Osi library | |
44 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki COIN-OR Osi | |
45 | Group: Development/Libraries | |
46 | Requires: %{name} = %{version}-%{release} | |
47 | Requires: CoinUtils-devel | |
48 | ||
49 | %description devel | |
50 | Header files for COIN-OR Osi library. | |
51 | ||
52 | %description devel -l pl.UTF-8 | |
53 | Pliki nagłówkowe biblioteki COIN-OR Osi. | |
54 | ||
55 | %package static | |
56 | Summary: Static COIN-OR Osi library | |
57 | Summary(pl.UTF-8): Statyczna biblioteka COIN-OR Osi | |
58 | Group: Development/Libraries | |
59 | Requires: %{name}-devel = %{version}-%{release} | |
60 | ||
61 | %description static | |
62 | Static COIN-OR Osi library. | |
63 | ||
64 | %description static -l pl.UTF-8 | |
65 | Statyczna biblioteka COIN-OR Osi. | |
66 | ||
67 | %package apidocs | |
68 | Summary: COIN-OR Osi API documentation | |
69 | Summary(pl.UTF-8): Dokumentacja API biblioteki COIN-OR Osi | |
70 | Group: Documentation | |
71 | ||
72 | %description apidocs | |
73 | API documentation for COIN-OR Osi library. | |
74 | ||
75 | %description apidocs -l pl.UTF-8 | |
76 | Dokumentacja API biblioteki COIN-OR Osi. | |
77 | ||
78 | %package glpk | |
79 | Summary: COIN-OR Open Solver Interface for GLPK | |
80 | Summary(pl.UTF-8): Biblioteka COIN-OR Open Solver Interface dla GLPK | |
81 | Group: Libraries | |
82 | Requires: %{name} = %{version}-%{release} | |
83 | ||
84 | %description glpk | |
85 | COIN-OR Open Solver Interface for GLPK solver. | |
86 | ||
87 | %description glpk -l pl.UTF-8 | |
88 | Biblioteka COIN-OR Open Solver Interface dla biblioteki rozwiązującej | |
89 | GLPK. | |
90 | ||
91 | %package glpk-devel | |
92 | Summary: Development files for COIN-OR OsiGlpk library | |
93 | Summary(pl.UTF-8): Pliki programistyczne biblioteki COIN-OR OsiGlpk | |
94 | Group: Development/Libraries | |
95 | Requires: %{name}-devel = %{version}-%{release} | |
96 | Requires: %{name}-glpk = %{version}-%{release} | |
97 | Requires: glpk-devel | |
98 | ||
99 | %description glpk-devel | |
100 | Development files for COIN-OR OsiGlpk library. | |
101 | ||
102 | %description glpk-devel -l pl.UTF-8 | |
103 | Pliki programistyczne biblioteki COIN-OR OsiGlpk. | |
104 | ||
105 | %package glpk-static | |
106 | Summary: Static COIN-OR OsiGlpk library | |
107 | Summary(pl.UTF-8): Statyczna biblioteka COIN-OR OsiGlpk | |
108 | Group: Development/Libraries | |
109 | Requires: %{name}-glpk-devel = %{version}-%{release} | |
110 | ||
111 | %description glpk-static | |
112 | Static COIN-OR OsiGlpk library. | |
113 | ||
114 | %description glpk-static -l pl.UTF-8 | |
115 | Statyczna biblioteka COIN-OR OsiGlpk. | |
116 | ||
117 | %package soplex | |
118 | Summary: COIN-OR Open Solver Interface for Soplex | |
119 | Summary(pl.UTF-8): Biblioteka COIN-OR Open Solver Interface dla biblioteki Soplex | |
120 | Group: Libraries | |
121 | Requires: %{name} = %{version}-%{release} | |
122 | ||
123 | %description soplex | |
124 | COIN-OR Open Solver Interface for Soplex solver. | |
125 | ||
126 | %description soplex -l pl.UTF-8 | |
127 | Biblioteka COIN-OR Open Solver Interface dla biblioteki rozwiązującej | |
128 | Soplex. | |
129 | ||
130 | %package soplex-devel | |
131 | Summary: Development files for COIN-OR OsiSpx library | |
132 | Summary(pl.UTF-8): Pliki programistyczne biblioteki COIN-OR OsiSpx | |
133 | Group: Development/Libraries | |
134 | Requires: %{name}-devel = %{version}-%{release} | |
135 | Requires: %{name}-soplex = %{version}-%{release} | |
136 | Requires: soplex-devel | |
137 | ||
138 | %description soplex-devel | |
139 | Development files for COIN-OR OsiSpx library. | |
140 | ||
141 | %description soplex-devel -l pl.UTF-8 | |
142 | Pliki programistyczne biblioteki COIN-OR OsiSpx. | |
143 | ||
144 | %package soplex-static | |
145 | Summary: Static COIN-OR OsiSpx library | |
146 | Summary(pl.UTF-8): Statyczna biblioteka COIN-OR OsiSpx | |
147 | Group: Development/Libraries | |
148 | Requires: %{name}-soplex-devel = %{version}-%{release} | |
149 | ||
150 | %description soplex-static | |
151 | Static COIN-OR OsiGlpk library. | |
152 | ||
153 | %description soplex-static -l pl.UTF-8 | |
154 | Statyczna biblioteka COIN-OR OsiGlpk. | |
155 | ||
156 | %prep | |
157 | %setup -q -n Osi-%{version} | |
158 | %patch0 -p1 | |
159 | %patch1 -p1 | |
160 | %patch2 -p1 | |
161 | ||
162 | ln -s ../BuildTools Osi/BuildTools | |
163 | ||
164 | %build | |
165 | cd Osi | |
166 | %{__libtoolize} | |
167 | %{__aclocal} -I BuildTools | |
168 | %{__autoconf} | |
169 | %{__autoheader} | |
170 | %{__automake} | |
171 | cd .. | |
172 | %configure \ | |
173 | --enable-dependency-linking \ | |
174 | %{?with_static_libs:--enable-static} \ | |
175 | --with-coinutils-lib="-lCoinUtils" \ | |
176 | --with-coinutils-incdir="/usr/include/coin" \ | |
177 | --with-glpk-lib="-lglpk" \ | |
178 | --with-netlib-datadir="/usr/share/coin/Data/Netlib" \ | |
179 | --with-sample-datadir="/usr/share/coin/Data/Sample" \ | |
180 | %{?with_soplex:--with-soplex-lib="-lsoplex" --with-soplex-incdir="/usr/include/soplex"} | |
181 | ||
182 | %{__make} | |
183 | ||
184 | %if %{with apidocs} | |
185 | %{__make} doxydoc | |
186 | %endif | |
187 | ||
188 | %install | |
189 | rm -rf $RPM_BUILD_ROOT | |
190 | ||
191 | %{__make} install \ | |
192 | DESTDIR=$RPM_BUILD_ROOT | |
193 | ||
194 | # obsoleted by pkg-config | |
195 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libOsi*.la | |
196 | # packages as %doc | |
197 | %{__rm} $RPM_BUILD_ROOT%{_datadir}/coin/doc/Osi/{AUTHORS,LICENSE,README} | |
198 | ||
199 | %clean | |
200 | rm -rf $RPM_BUILD_ROOT | |
201 | ||
202 | %post -p /sbin/ldconfig | |
203 | %postun -p /sbin/ldconfig | |
204 | ||
4298b71f JB |
205 | %post glpk -p /sbin/ldconfig |
206 | %postun glpk -p /sbin/ldconfig | |
207 | ||
208 | %post soplex -p /sbin/ldconfig | |
209 | %postun soplex -p /sbin/ldconfig | |
210 | ||
641d9ce6 JB |
211 | %files |
212 | %defattr(644,root,root,755) | |
213 | %doc Osi/{AUTHORS,CHANGELOG,LICENSE,README} | |
214 | %attr(755,root,root) %{_libdir}/libOsi.so.*.*.* | |
215 | %attr(755,root,root) %ghost %{_libdir}/libOsi.so.1 | |
216 | %attr(755,root,root) %{_libdir}/libOsiCommonTests.so.*.*.* | |
217 | %attr(755,root,root) %ghost %{_libdir}/libOsiCommonTests.so.1 | |
218 | ||
219 | %files devel | |
220 | %defattr(644,root,root,755) | |
221 | %attr(755,root,root) %{_libdir}/libOsi.so | |
222 | %attr(755,root,root) %{_libdir}/libOsiCommonTests.so | |
223 | %{_includedir}/coin/OsiConfig.h | |
224 | %{_includedir}/coin/OsiAuxInfo.hpp | |
225 | %{_includedir}/coin/OsiBranchingObject.hpp | |
226 | %{_includedir}/coin/OsiChooseVariable.hpp | |
227 | %{_includedir}/coin/OsiColCut.hpp | |
228 | %{_includedir}/coin/OsiCollections.hpp | |
229 | %{_includedir}/coin/OsiCut.hpp | |
230 | %{_includedir}/coin/OsiCuts.hpp | |
231 | %{_includedir}/coin/OsiPresolve.hpp | |
232 | %{_includedir}/coin/OsiRowCut.hpp | |
233 | %{_includedir}/coin/OsiRowCutDebugger.hpp | |
234 | %{_includedir}/coin/OsiSolverBranch.hpp | |
235 | %{_includedir}/coin/OsiSolverInterface.hpp | |
236 | %{_includedir}/coin/OsiSolverParameters.hpp | |
237 | %{_includedir}/coin/OsiUnitTests.hpp | |
238 | %{_pkgconfigdir}/osi.pc | |
239 | %{_pkgconfigdir}/osi-unittests.pc | |
240 | %dir %{_datadir}/coin/doc/Osi | |
241 | %{_datadir}/coin/doc/Osi/osi_addlibs.txt | |
242 | ||
243 | %if %{with static_libs} | |
244 | %files static | |
245 | %defattr(644,root,root,755) | |
246 | %{_libdir}/libOsi.a | |
247 | %{_libdir}/libOsiCommonTests.a | |
248 | %endif | |
249 | ||
250 | %if %{with apidocs} | |
251 | %files apidocs | |
252 | %defattr(644,root,root,755) | |
253 | %doc doxydoc/html/* | |
254 | %endif | |
255 | ||
256 | %files glpk | |
257 | %defattr(644,root,root,755) | |
258 | %attr(755,root,root) %{_libdir}/libOsiGlpk.so.*.*.* | |
259 | %attr(755,root,root) %ghost %{_libdir}/libOsiGlpk.so.1 | |
260 | ||
261 | %files glpk-devel | |
262 | %defattr(644,root,root,755) | |
263 | %attr(755,root,root) %{_libdir}/libOsiGlpk.so | |
264 | %{_includedir}/coin/OsiGlpkSolverInterface.hpp | |
265 | %{_pkgconfigdir}/osi-glpk.pc | |
266 | ||
267 | %files glpk-static | |
268 | %defattr(644,root,root,755) | |
269 | %{_libdir}/libOsiGlpk.a | |
270 | ||
271 | %if %{with soplex} | |
272 | %files soplex | |
273 | %defattr(644,root,root,755) | |
274 | %attr(755,root,root) %{_libdir}/libOsiSpx.so.*.*.* | |
275 | %attr(755,root,root) %ghost %{_libdir}/libOsiSpx.so.1 | |
276 | ||
277 | %files soplex-devel | |
278 | %defattr(644,root,root,755) | |
279 | %attr(755,root,root) %{_libdir}/libOsiSpx.so | |
280 | %{_includedir}/coin/OsiSpxSolverInterface.hpp | |
281 | %{_pkgconfigdir}/osi-soplex.pc | |
282 | ||
283 | %files soplex-static | |
284 | %defattr(644,root,root,755) | |
285 | %{_libdir}/libOsiSpx.a | |
286 | %endif |