2 # - build ocaml binding as shared module
3 # - verify ocaml,gprolog,swipl,Yap,Ciao files locations
4 # - help naming the subpackages properly
5 # - fix mess with docs packaging
7 # - proprietary: sicstus prolog
10 %bcond_without java # Java bindings
11 %bcond_with ocaml # OCaml bindings
12 %bcond_without ocaml_opt # OCaml bindings native/opt
13 %bcond_with ciao # Ciao Prolog interface
14 %bcond_without gprolog # GNU Pprolog interface
15 %bcond_without swipl # SWI-Prolog interface
16 %bcond_with yap # Yap prolog interface
17 %bcond_with xsb # XSB prolog interface
19 %ifnarch %{ix86} %{x8664} alpha ppc64
20 # GNU Prolog not available
21 %undefine with_gprolog
25 %undefine with_ocaml_opt
28 Summary: The Parma Polyhedra Library: a library of numerical abstractions
29 Summary(pl.UTF-8): Parma Polyhedra Library - biblioteka abstrakcji matematycznych
35 Source0: ftp://ftp.cs.unipr.it/pub/ppl/releases/%{version}/%{name}-%{version}.tar.xz
36 # Source0-md5: e7bd12043d1064214f7a0107b6da3f17
37 Patch0: %{name}-ciao.patch
38 URL: http://www.cs.unipr.it/ppl/
43 BuildRequires: CiaoDE >= 1.14
46 BuildRequires: Yap >= 5.1.1
47 BuildRequires: Yap-static >= 5.1.1
49 BuildRequires: autoconf >= 2.61
50 BuildRequires: automake >= 1:1.11
51 BuildRequires: glpk-devel >= 4.38
52 BuildRequires: gmp-c++-devel >= 4.1.3
53 BuildRequires: gmp-devel >= 4.1.3
54 BuildRequires: libstdc++-devel
55 BuildRequires: libtool >= 2:2.0
56 BuildRequires: m4 >= 1.4.8
57 BuildRequires: perl-base
58 BuildRequires: tar >= 1:1.22
61 BuildRequires: pl >= 5.10.2-3
64 BuildRequires: gprolog >= 1.2.19
67 BuildRequires: ocaml >= 3.09
68 BuildRequires: ocaml-gmp-devel
72 BuildRequires: jpackage-utils
75 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
78 The Parma Polyhedra Library (PPL) is a library for the manipulation of
79 (not necessarily closed) convex polyhedra and other numerical
80 abstractions. The applications of convex polyhedra include program
81 analysis, optimized compilation, integer and combinatorial
82 optimization and statistical data-editing. The Parma Polyhedra Library
83 comes with several user friendly interfaces, is fully dynamic
84 (available virtual memory is the only limitation to the dimension of
85 anything), written in accordance to all the applicable standards,
86 exception-safe, rather efficient, thoroughly documented, and free
87 software. This package provides all what is necessary to run
88 applications using the PPL through its C and C++ interfaces.
90 %description -l pl.UTF-8
91 Parma Polyhedra Library (PPL) to biblioteka do operacji na
92 (niekoniecznie domkniętych) wielościanach wypukłych i innych
93 abstrakcjach matematycznych. Zastosowania wielościanów wypukłych
94 obejmują analizę programów, kompilację z optymalizacją, optymalizację
95 całkowitoliczbową i kombinatoryczną oraz obróbkę danych
96 statystycznych. Biblioteka PPL jest dostarczana z kilkoma przyjaznymi
97 interfejsami, jest w pełni dynamiczna (jedynym ograniczeniem wymiarów
98 jest dostępna pamięć wirtualna), napisana zgodnie ze wszystkimi
99 mającymi zastosowanie standardami, jest bezpieczna pod kątem wyjątków,
100 w miarę wydajna, dobrze udokumentowana i wolnodostępna. Ten pakiet
101 zawiera wszystko, co jest potrzebne aplikacjom korzystającym z PPL
102 poprzez interfejsy dla C i C++.
105 Summary: Development files for the Parma Polyhedra Library C and C++ interfaces
106 Summary(pl.UTF-8): Pliki programistyczne intefejsów C i C++ biblioteki PPL
107 Group: Development/Libraries
108 Requires: %{name} = %{version}-%{release}
109 Requires: gmp-devel >= 4.1.3
110 Obsoletes: ppl-pwl-devel
113 The header files, Autoconf macro and minimal documentation for
114 developing applications using the Parma Polyhedra Library through its
115 C and C++ interfaces.
117 %description devel -l pl.UTF-8
118 Pliki nagłówkowe, makra Autoconfa oraz minimalna dokumentacja do
119 tworzenia aplikacji wykorzystujących bibliotekę Parma Polyhedra
120 Library poprzez interfejsy C i C++.
123 Summary: Static archives for the Parma Polyhedra Library C and C++ interfaces
124 Summary(pl.UTF-8): Biblioteki statyczne interfejsów C i C++ biblioteki PPL
125 Group: Development/Libraries
126 Requires: %{name}-devel = %{version}-%{release}
127 Obsoletes: ppl-pwl-static
130 The static archives for the Parma Polyhedra Library C and C++
133 %description static -l pl.UTF-8
134 Biblioteki statyczne interfejsów C i C++ biblioteki Parma Polyhedra
138 Summary: Documentation for the Parma Polyhedra Library
139 Summary(pl.UTF-8): Dokumentacja biblioteki Parma Polyhedra Library
141 Requires: %{name} = %{version}-%{release}
142 Obsoletes: ppl-pwl-docs
145 This package contains all the documentations required by programmers
146 using the Parma Polyhedra Library (PPL). Install this package if you
147 want to program with the PPL.
149 %description docs -l pl.UTF-8
150 Ten pakiet zawiera całą dokumentację potrzebną programistom
151 korzystającym z biblioteki Parma Polyhedra Library (PPL). Warto
152 zainstalować ten pakiet, aby programować z użyciem PPL.
155 Summary: Utilities using the Parma Polyhedra Library
156 Summary(pl.UTF-8): Narzędzia wykorzystujące bibliotekę PPL
157 Group: Development/Libraries
158 Requires: %{name} = %{version}-%{release}
161 This package contains the mixed integer linear programming solver
162 ppl_lpsol, the program ppl_lcdd for vertex/facet enumeration of convex
163 polyhedra, and the parametric integer programming solver ppl_pips.
165 %description utils -l pl.UTF-8
166 Tan pakiet zawiera program do rozwiązywania mieszanych
167 całkowitoliczbowych problemów programowania liniowego ppl_lpsol,
168 program ppl_lcdd do numerowania wierzchołków i ścian wielościanów
169 wypukłych oraz program do rozwiązywania parametrycznych
170 całkowitoliczbowych problemów programowania liniowego ppl_pips.
173 Summary: The Ciao Prolog interface of the Parma Polyhedra Library
174 Summary(pl.UTF-8): Interfejs Ciao Prologa do biblioteki Parma Polyhedra Library
176 Requires: %{name} = %{version}-%{release}
177 Requires: CiaoDE >= 1.14
178 Obsoletes: ppl-gprolog
180 %description -n Ciao-ppl
181 This package adds Ciao Prolog support to the Parma Polyhedra Library
182 (PPL). Install this package if you want to use the library in Ciao
185 %description -n Ciao-ppl -l pl.UTF-8
186 Ten pakiet dodaje obsługę Ciao Prologa do biblioteki Parma Polyhedra
187 Library (PPL). Należy go zainstalować, aby móc korzystać z biblioteki
190 %package -n Ciao-ppl-static
191 Summary: The static archive for the Ciao Prolog interface of the Parma Polyhedra Library
192 Summary(pl.UTF-8): Statyczna biblioteka interfejsu Ciao Prologa do biblioteki PPL
193 Group: Development/Libraries
194 Requires: Ciao-ppl = %{version}-%{release}
196 %description -n Ciao-ppl-static
197 This package contains the static archive for the Ciao Prolog interface
198 of the Parma Polyhedra Library.
200 %description -n Ciao-ppl-static -l pl.UTF-8
201 Statyczna biblioteka interfejsu Ciao Prologa do biblioteki Parma
205 Summary: The XSB Prolog interface of the Parma Polyhedra Library
206 Summary(pl.UTF-8): Interfejs XSB Prologa do biblioteki Parma Polyhedra Library
208 Requires: %{name} = %{version}-%{release}
209 Requires: XSBDE >= 1.14
210 Obsoletes: ppl-gprolog
212 %description -n XSB-ppl
213 This package adds XSB Prolog support to the Parma Polyhedra Library
214 (PPL). Install this package if you want to use the library in XSB
217 %description -n XSB-ppl -l pl.UTF-8
218 Ten pakiet dodaje obsługę XSB Prologa do biblioteki Parma Polyhedra
219 Library (PPL). Należy go zainstalować, aby móc korzystać z biblioteki
222 %package -n XSB-ppl-static
223 Summary: The static archive for the XSB Prolog interface of the Parma Polyhedra Library
224 Summary(pl.UTF-8): Statyczna biblioteka interfejsu XSB Prologa do biblioteki PPL
225 Group: Development/Libraries
226 Requires: XSB-ppl = %{version}-%{release}
228 %description -n XSB-ppl-static
229 This package contains the static archive for the XSB Prolog interface
230 of the Parma Polyhedra Library.
232 %description -n XSB-ppl-static -l pl.UTF-8
233 Statyczna biblioteka interfejsu XSB Prologa do biblioteki Parma
236 %package -n gprolog-ppl
237 Summary: The GNU Prolog interface of the Parma Polyhedra Library
238 Summary(pl.UTF-8): Interfejs GNU Prologa do biblioteki Parma Polyhedra Library
240 Requires: %{name} = %{version}-%{release}
241 Requires: gprolog >= 1.2.19
242 Obsoletes: ppl-gprolog
244 %description -n gprolog-ppl
245 This package adds GNU Prolog support to the Parma Polyhedra Library
246 (PPL). Install this package if you want to use the library in GNU
249 %description -n gprolog-ppl -l pl.UTF-8
250 Ten pakiet dodaje obsługę GNU Prologa do biblioteki Parma Polyhedra
251 Library (PPL). Należy go zainstalować, aby móc korzystać z biblioteki
254 %package -n gprolog-ppl-static
255 Summary: The static archive for the GNU Prolog interface of the Parma Polyhedra Library
256 Summary(pl.UTF-8): Statyczna biblioteka interfejsu GNU Prologa do biblioteki PPL
257 Group: Development/Libraries
258 Requires: gprolog-ppl = %{version}-%{release}
259 Obsoletes: ppl-gprolog-static
261 %description -n gprolog-ppl-static
262 This package contains the static archive for the GNU Prolog interface
263 of the Parma Polyhedra Library.
265 %description -n gprolog-ppl-static -l pl.UTF-8
266 Statyczna biblioteka interfejsu GNU Prologa do biblioteki Parma
269 %package -n swipl-ppl
270 Summary: The SWI-Prolog interface of the Parma Polyhedra Library
271 Summary(pl.UTF-8): Interfejs SWI-Prologa do biblioteki Parma Polyhedra Library
273 Requires: %{name} = %{version}-%{release}
274 Requires: pl >= 5.10.2-3
275 Obsoletes: ppl-swiprolog
277 %description -n swipl-ppl
278 This package adds SWI-Prolog support to the Parma Polyhedra Library.
279 Install this package if you want to use the library in SWI-Prolog
282 %description -n swipl-ppl -l pl.UTF-8
283 Ten pakiet dodaje obsługę SWI-Prologa do biblioteki Parma Polyhedra
284 Library (PPL). Należy go zainstalować, aby móc korzystać z biblioteki
287 %package -n swipl-ppl-static
288 Summary: The static archive for the SWI-Prolog interface of the Parma Polyhedra Library
289 Summary(pl.UTF-8): Statyczna biblioteka interfejsu SWI-Prologa do biblioteki PPL
290 Group: Development/Libraries
291 Requires: swipl-ppl = %{version}-%{release}
292 Obsoletes: ppl-swiprolog-static
294 %description -n swipl-ppl-static
295 This package contains the static archive for the SWI-Prolog interface
296 of the Parma Polyhedra Library.
298 %description -n swipl-ppl-static -l pl.UTF-8
299 Statyczna biblioteka interfejsu SWI-Prologa do biblioteki Parma
303 Summary: The YAP Prolog interface of the Parma Polyhedra Library
304 Summary(pl.UTF-8): Interfejs YAP Prologa do biblioteki Parma Polyhedra Library
306 Requires: %{name} = %{version}-%{release}
307 Requires: Yap >= 5.1.1
309 Obsoletes: ppl-yap-static
311 %description -n Yap-ppl
312 This package adds YAP Prolog support to the Parma Polyhedra Library
313 (PPL). Install this package if you want to use the library in YAP
316 %description -n Yap-ppl -l pl.UTF-8
317 Ten pakiet dodaje obsługę YAP Prologa do biblioteki Parma Polyhedra
318 Library (PPL). Należy go zainstalować, aby móc korzystać z biblioteki
321 %package -n ocaml-ppl
322 Summary: The OCaml interface of the Parma Polyhedra Library
323 Summary(pl.UTF-8): Interfejs OCamla do biblioteki Parma Polyhedra Library
325 Requires: %{name} = %{version}-%{release}
328 %description -n ocaml-ppl
329 This package adds Objective Caml (OCaml) support to the Parma
330 Polyhedra Library. Install this package if you want to use the library
333 %description -n ocaml-ppl -l pl.UTF-8
334 Ten pakiet dodaje obsługę Objective Camla (OCamla) do biblioteki Parma
335 Polyhedra Library (PPL). Należy go zainstalować, aby móc korzystać z
338 %package -n ocaml-ppl-devel
339 Summary: Development files for OCaml interface of the Parma Polyhedra Library
340 Summary(pl.UTF-8): Pliki programistyczne interfejsu OCamla biblioteki PPL
341 Group: Development/Libraries
342 Requires: ocaml-ppl = %{version}-%{release}
344 %description -n ocaml-ppl-devel
345 This package contains libraries and signature files for developing
346 applications using the OCaml interface of the Parma Polyhedra Library.
348 %description -n ocaml-ppl-devel -l pl.UTF-8
349 Ten pakiet zawiera pliki bibliotek i sygnatur do tworzenia aplikacji
350 wykorzystujących interfejs OCamla biblioteki Parma Polyhedra Library.
353 Summary: The Java interface of the Parma Polyhedra Library
354 Summary(pl.UTF-8): Interfejs Javy do biblioteki Parma Polyhedra Library
356 Requires: %{name} = %{version}-%{release}
357 Requires: jpackage-utils
359 %description -n java-ppl
360 This package adds Java support to the Parma Polyhedra Library. Install
361 this package if you want to use the library in Java programs.
363 %description -n java-ppl -l pl.UTF-8
364 Ten pakiet dodaje obsługę Javy do biblioteki Parma Polyhedra Library.
365 Należy go zainstalować, aby móc korzystać z biblioteki w Javie.
367 %package -n java-ppl-javadoc
368 Summary: Javadocs for java-ppl
369 Summary(pl.UTF-8): Dokumentacja Javadoc do pakietu java-ppl
371 Requires: java-ppl = %{version}-%{release}
372 Requires: jpackage-utils
374 %description -n java-ppl-javadoc
375 This package contains the API documentation for Java interface of the
376 Parma Polyhedra Library.
378 %description -n java-ppl-javadoc -l pl.UTF-8
379 Ten pakiet zawiera dokumentację API do interfejsu Javy biblioteki
380 Parma Polyhedra Library.
392 CPPFLAGS="-I%{_includedir}/glpk"
394 CPPFLAGS="$CPPFLAGS -I%{_libdir}/gprolog-`gprolog --version 2>&1 | head -1 | sed -e "s/.* \([^ ]*\)$/\1/g"`/include"
397 CPPFLAGS="$CPPFLAGS -I`swipl -dump-runtime-variables | grep PLBASE= | sed 's/PLBASE="\(.*\)";/\1/'`/include"
400 CPPFLAGS="$CPPFLAGS -I%{_includedir}/Yap"
404 --docdir=%{_docdir}/%{name}-%{version} \
405 %{?with_java:--with-java=%{java_home}} \
406 --enable-interfaces="c++ c %{?with_ocaml:ocaml} %{?with_java:java} %{?with_ciao:ciao_prolog} %{?with_gprolog:gnu_prolog} %{?with_swipl:swi_prolog} %{?with_xsb:xsb_prolog} %{?with_yap:yap_prolog}"
411 rm -rf $RPM_BUILD_ROOT
412 # let these dirs exist even if no bindings are build
413 install -d $RPM_BUILD_ROOT{%{_libdir}/%{name},%{_datadir}/%{name}}
416 INSTALL="%{__install} -p" \
417 DESTDIR=$RPM_BUILD_ROOT
420 # Install the Javadocs for ppl-java.
421 install -d $RPM_BUILD_ROOT%{_javadocdir}
423 $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/ppl-user-java-interface-%{version}-html \
424 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-java
427 %if %{with java} || %{with ciao} || %{with gprolog} || %{with swipl} || %{with xsb} || %{with yap}
428 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/*.la
432 %{__rm} $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/{COPYING,fdl.*,gpl.*}
433 # packaged in .pdf format
434 %{__rm} $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/ppl-user*-%{version}.ps.gz
437 rm -rf $RPM_BUILD_ROOT
439 %post -p /sbin/ldconfig
440 %postun -p /sbin/ldconfig
443 %defattr(644,root,root,755)
444 %dir %{_docdir}/%{name}-%{version}
445 %doc %{_docdir}/%{name}-%{version}/BUGS
446 %doc %{_docdir}/%{name}-%{version}/CREDITS
447 %doc %{_docdir}/%{name}-%{version}/NEWS
448 %doc %{_docdir}/%{name}-%{version}/README
449 %doc %{_docdir}/%{name}-%{version}/README.configure
450 %doc %{_docdir}/%{name}-%{version}/TODO
451 %attr(755,root,root) %{_libdir}/libppl.so.*.*.*
452 %attr(755,root,root) %ghost %{_libdir}/libppl.so.14
453 %attr(755,root,root) %{_libdir}/libppl_c.so.*.*.*
454 %attr(755,root,root) %ghost %{_libdir}/libppl_c.so.4
455 %dir %{_libdir}/%{name}
456 %dir %{_datadir}/%{name}
459 %defattr(644,root,root,755)
460 %attr(755,root,root) %{_bindir}/ppl-config
461 %attr(755,root,root) %{_libdir}/libppl.so
462 %attr(755,root,root) %{_libdir}/libppl_c.so
464 %{_libdir}/libppl_c.la
465 %{_includedir}/ppl*.hh
466 %{_includedir}/ppl_c*.h
467 %{_mandir}/man1/ppl-config.1*
468 %{_mandir}/man3/libppl.3*
469 %{_mandir}/man3/libppl_c.3*
470 %{_aclocaldir}/ppl.m4
471 %{_aclocaldir}/ppl_c.m4
474 %defattr(644,root,root,755)
476 %{_libdir}/libppl_c.a
479 %defattr(644,root,root,755)
480 %attr(755,root,root) %{_bindir}/ppl_lcdd
481 %attr(755,root,root) %{_bindir}/ppl_lpsol
482 %attr(755,root,root) %{_bindir}/ppl_pips
483 %{_mandir}/man1/ppl_lcdd.1*
484 %{_mandir}/man1/ppl_lpsol.1*
485 %{_mandir}/man1/ppl_pips.1*
488 %defattr(644,root,root,755)
489 %doc %{_docdir}/%{name}-%{version}/ChangeLog*
490 %doc %{_docdir}/%{name}-%{version}/README.doc
491 %doc %{_docdir}/%{name}-%{version}/ppl-user-%{version}-html/
492 %doc %{_docdir}/%{name}-%{version}/ppl-user-c-interface-%{version}-html/
493 %doc %{_docdir}/%{name}-%{version}/ppl-user-c-interface-%{version}.pdf
494 %doc %{_docdir}/%{name}-%{version}/ppl-user-%{version}.pdf
496 %if %{with ciao} || %{with gprolog} || %{with swipl} || %{with xsb} || %{with yap}
497 %doc %{_docdir}/%{name}-%{version}/ppl-user-prolog-interface-%{version}-html/
498 %doc %{_docdir}/%{name}-%{version}/ppl-user-prolog-interface-%{version}.pdf
503 %defattr(644,root,root,755)
504 %attr(755,root,root) %{_libdir}/%{name}/libppl_xsb.so
505 %{_datadir}/%{name}/ppl_xsb.xwam
507 %files -n XSB-ppl-static
508 %defattr(644,root,root,755)
509 %{_libdir}/%{name}/libppl_xsb.a
514 %defattr(644,root,root,755)
515 %doc interfaces/Prolog/Ciao/README.ciao
516 %attr(755,root,root) %{_libdir}/%{name}/libppl_ciao.so
517 %{_datadir}/%{name}/ppl_ciao.po
519 %files -n Ciao-ppl-static
520 %defattr(644,root,root,755)
521 %{_libdir}/%{name}/libppl_ciao.a
525 %files -n gprolog-ppl
526 %defattr(644,root,root,755)
527 %doc interfaces/Prolog/GNU/README.gprolog
528 %attr(755,root,root) %{_bindir}/ppl_gprolog
529 %attr(755,root,root) %{_libdir}/%{name}/libppl_gprolog.so
530 %{_datadir}/%{name}/ppl_gprolog.pl
532 %files -n gprolog-ppl-static
533 %defattr(644,root,root,755)
534 %{_libdir}/%{name}/libppl_gprolog.a
539 %defattr(644,root,root,755)
540 %doc interfaces/Prolog/SWI/README.swiprolog
541 %attr(755,root,root) %{_libdir}/%{name}/libppl_swiprolog.so
542 %{_datadir}/%{name}/ppl_swiprolog.pl
544 %files -n swipl-ppl-static
545 %defattr(644,root,root,755)
546 %{_libdir}/%{name}/libppl_swiprolog.a
551 %defattr(644,root,root,755)
552 %doc interfaces/Prolog/YAP/README.yap
553 %attr(755,root,root) %{_libdir}/%{name}/ppl_yap.so
554 %{_datadir}/%{name}/ppl_yap.pl
559 %defattr(644,root,root,755)
560 %doc interfaces/OCaml/README.ocaml
561 %{?with_ocaml_opt:%{_libdir}/%{name}/ppl_ocaml.a}
562 %{_libdir}/%{name}/ppl_ocaml.cma
563 %{?with_ocaml_opt:%{_libdir}/%{name}/ppl_ocaml.cmxa}
564 %{_libdir}/%{name}/ppl_ocaml.cmi
565 %{_libdir}/%{name}/ppl_ocaml_globals.cmi
567 %files -n ocaml-ppl-devel
568 %defattr(644,root,root,755)
569 %doc %{_docdir}/%{name}-%{version}/ppl-user-ocaml-interface-%{version}.pdf
570 %doc %{_docdir}/%{name}-%{version}/ppl-user-ocaml-interface-%{version}-html/
571 %{_libdir}/%{name}/libppl_ocaml.a
572 %{_libdir}/%{name}/ppl_ocaml.mli
577 %defattr(644,root,root,755)
578 %doc interfaces/Java/README.java
579 %attr(755,root,root) %{_libdir}/%{name}/libppl_java.so
580 %{_libdir}/%{name}/ppl_java.jar
582 %files -n java-ppl-javadoc
583 %defattr(644,root,root,755)
584 %doc %{_docdir}/%{name}-%{version}/ppl-user-java-interface-%{version}.pdf
585 %{_javadocdir}/%{name}-java