]>
Commit | Line | Data |
---|---|---|
ef4c7c3f | 1 | # |
2 | # TODO | |
6eaa1535 | 3 | # - maybe separate other prolog packages to rpm subpackages |
c9a2b49a | 4 | # |
16e9cab1 | 5 | # Conditional build: |
7955951b JB |
6 | %bcond_without java # Java bindings (so far, JPL only works with Sun Java and IBM Java) |
7 | %bcond_without tests # make check | |
16e9cab1 JR |
8 | # |
9 | ||
6eaa1535 | 10 | %ifnarch %{x8664} i586 i686 pentium3 pentium4 athlon |
16e9cab1 JR |
11 | %undefine with_java |
12 | %endif | |
13 | ||
6eaa1535 JR |
14 | # packages use SWI-Prolog own linker which doesn't understand -gdwarf* and |
15 | # some -march= options passed to it by gcc | |
16 | # No poin in building debug packages without debug info | |
17 | %define _enable_debug_packages 0 | |
18 | ||
de83a41c JP |
19 | %define use_jdk openjdk8 |
20 | ||
88202d50 | 21 | Summary: SWI Prolog Language |
1f5e051c | 22 | Summary(pl.UTF-8): Język SWI Prolog |
88202d50 | 23 | Name: pl |
c5f63c5d | 24 | Version: 7.2.3 |
c69bb25b | 25 | Release: 5 |
d6ebf125 | 26 | License: LGPL v2.1+ |
88202d50 | 27 | Group: Development/Languages |
d6ebf125 | 28 | #Source0Download: http://www.swi-prolog.org/download/stable |
c5f63c5d JB |
29 | Source0: http://www.swi-prolog.org/download/stable/src/swi%{name}-%{version}.tar.gz |
30 | # Source0-md5: 67c182f18310f115b49f1e2195499e0c | |
c9a2b49a | 31 | Patch0: %{name}-clib-configure.patch |
d6ebf125 | 32 | Patch1: %{name}-xpce-install.patch |
6e26775e | 33 | Patch2: %{name}-format.patch |
6008b4b3 | 34 | Patch3: %{name}-jni.patch |
312f2978 | 35 | Patch4: build.patch |
a600d3a9 | 36 | URL: http://www.swi-prolog.org/ |
ba6112db | 37 | BuildRequires: autoconf >= 2.50 |
e1caf73c | 38 | BuildRequires: automake |
c9a2b49a | 39 | BuildRequires: db-devel |
ef4c7c3f | 40 | BuildRequires: fontconfig-devel |
41 | BuildRequires: freetype-devel | |
ba6112db | 42 | BuildRequires: gmp-devel >= 4.2.0 |
de83a41c | 43 | %{?with_java:%buildrequires_jdk} |
d8d6b4c2 | 44 | BuildRequires: libjpeg-devel |
7910415f | 45 | BuildRequires: ncurses-devel |
c70c09d5 JR |
46 | BuildRequires: openssl-devel |
47 | BuildRequires: pkgconfig | |
c9a2b49a JR |
48 | BuildRequires: readline-devel >= 4.2 |
49 | BuildRequires: unixODBC-devel | |
50 | BuildRequires: uriparser-devel | |
c70c09d5 JR |
51 | BuildRequires: xorg-lib-libICE-devel |
52 | BuildRequires: xorg-lib-libSM-devel | |
53 | BuildRequires: xorg-lib-libX11-devel | |
54 | BuildRequires: xorg-lib-libXaw-devel | |
55 | BuildRequires: xorg-lib-libXext-devel | |
56 | BuildRequires: xorg-lib-libXft-devel | |
57 | BuildRequires: xorg-lib-libXinerama-devel | |
58 | BuildRequires: xorg-lib-libXmu-devel | |
59 | BuildRequires: xorg-lib-libXpm-devel | |
60 | BuildRequires: xorg-lib-libXrender-devel | |
61 | BuildRequires: xorg-lib-libXt-devel | |
c9a2b49a | 62 | BuildRequires: zlib-devel |
ba6112db | 63 | Requires: gmp >= 4.2.0 |
f0077b5e | 64 | Obsoletes: swi-pl |
ef4c7c3f | 65 | Obsoletes: swi-prolog |
b3f13a2b | 66 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
b47bab49 | 67 | |
ea44b468 JR |
68 | %define no_install_post_chrpath 1 |
69 | ||
b47bab49 | 70 | %description |
5c2adf18 | 71 | ISO/Edinburgh-style Prolog compiler including modules, autoload, |
72 | libraries, Garbage-collector, stack-expandor, C/C++-interface, | |
73 | GNU-readline interface, very fast compiler. Including packages clib | |
74 | (Unix process control and sockets), cpp (C++ interface), sgml (reading | |
75 | XML/SGML), sgml/RDF (reading RDF into triples) and XPCE (Graphics UI | |
76 | toolkit, integrated editor (Emacs-clone) and source-level debugger). | |
b47bab49 | 77 | |
8aecb77a JR |
78 | %description -l pl.UTF-8 |
79 | Kompilator języka PROLOG w stylu Edinburgh wraz z modułami, | |
77a1a4ef | 80 | bibliotekami, garbage collectorrem, interfejsem C, interfejsami do GNU |
8aecb77a | 81 | readline, GNU Emacsa i X11 przy użyciu XPCE. |
b47bab49 | 82 | |
17ca8a5c JR |
83 | %package jpl |
84 | Summary: Dynamic, bidirectional interface between SWI-Prolog and Java | |
09a95fb3 | 85 | Summary(pl.UTF-8): Dynamiczny, dwukierunkowy interfejs pomiędzy SWI-Prologiem a Javą |
17ca8a5c JR |
86 | Group: Development/Languages |
87 | Requires: %{name} = %{version}-%{release} | |
de83a41c | 88 | Requires: jdk >= 8 |
17ca8a5c JR |
89 | |
90 | %description jpl | |
d6ebf125 JB |
91 | JPL 3.x is a dynamic, bidirectional interface between SWI-Prolog 5.2.0 |
92 | or later and Java 2 runtimes (see JPL 3.x Objectives). It offers two | |
93 | APIs: | |
94 | * Java API (Java-calls-Prolog): this interface comprises public Java | |
95 | classes which support: | |
96 | + constructing Java representations of Prolog terms and queries | |
97 | + calling queries within SWI-Prolog engines | |
98 | + retrieving (as Java representations of Prolog terms) any | |
99 | bindings created by a call | |
100 | * Prolog API (Prolog-calls-Java): this interface comprises Prolog | |
101 | library predicates which support: | |
102 | + creating instances (objects) of Java classes (built-in and | |
103 | user-defined) | |
104 | + calling methods of Java objects (and static methods of classes), | |
105 | perhaps returning values or object references | |
106 | + getting and setting the values of fields of Java objects and | |
107 | classes | |
09a95fb3 | 108 | |
17ca8a5c JR |
109 | Calls to the two APIs can be nested, e.g. Java code can call Prolog |
110 | predicates which call Java methods which call Prolog predicates etc. | |
111 | ||
09a95fb3 JB |
112 | %description jpl -l pl.UTF-8 |
113 | JPL 3.x to dynamiczny, dwukierunkowy interfejs pomiędzy SWI-Prologiem | |
114 | 5.2.0 i późniejszymi a środowiskami uruchomieniowymi Javy 2 (więcej w | |
115 | dokumencie JPL 3.x Objectives). Oferuje dwa API: | |
d6ebf125 JB |
116 | - API Javy (wywołania Prologu z Javy) - ten interfejs obejmuje klasy |
117 | publiczne Javy obsługujące: | |
118 | - tworzenie reprezentacji wyrażeń i zapytań Prologu w Javie | |
119 | - wywoływanie zapytań wewnątrz silników SWI-Prologu | |
120 | - odtwarzanie (jako reprezentacji wyrażeń Prologu w Javie) | |
121 | wszelkich dowiązań utworzonych przez wywołanie | |
122 | - API Prologu (wywołania Javy z Prologu) - ten interfejs obejmuje | |
123 | predykaty biblioteki Prologu obsługującą: | |
124 | - tworzenie instancji (obiektów) klas Javy (wbudowanych i | |
125 | zdefiniowanych przez użytkownika) | |
126 | - wywołania metod obiektów (i statycznych metod klas) Javy, także | |
127 | zwracających wartości lub referencje do obiektów | |
128 | - pobieranie i ustawianie wartości pól obiektów i klas Javy | |
09a95fb3 JB |
129 | |
130 | Wywołania obu API mogą być zagnieżdżane, np. kod w Javie może wywołać | |
131 | predykaty Prologu wywołujące metody Javy, które wywołują predykaty | |
132 | Prologu itd. | |
133 | ||
17ca8a5c | 134 | %package xpce |
d8d6b4c2 | 135 | Summary: XPCE - GUI Toolkit for (SWI-)Prolog |
09a95fb3 | 136 | Summary(pl.UTF-8): XPCE - toolkit graficzny dla (SWI-)Prologu |
d8d6b4c2 | 137 | Group: Development/Languages |
9091e58d | 138 | Requires: %{name} = %{version}-%{release} |
17ca8a5c | 139 | Obsoletes: xpce |
d8d6b4c2 | 140 | |
17ca8a5c | 141 | %description xpce |
5c2adf18 | 142 | Graphical User Interface (GUI) toolkit for Prolog and other |
143 | dynamically typed languages. Provides Object Oriented programming to | |
144 | Prolog as well as a high-level portable GUI toolkit for (SWI-)Prolog. | |
145 | Also available for Quintus and SICStus Prolog. | |
d8d6b4c2 | 146 | |
17ca8a5c | 147 | %description xpce -l pl.UTF-8 |
09a95fb3 | 148 | Zestaw Graficzny Interfejsu Użytkownika (GUI) dla Prologu i innych |
8aecb77a | 149 | dynamicznie wpisywanych języków. Udostępnia obiektowo zorientowane |
09a95fb3 JB |
150 | programowanie dla Prologu jak także jako wysoko dostępny przenośny |
151 | zestaw GUI dla (SWI-)Prologu. Dostępne także dla Quintus i SICStus | |
5c2adf18 | 152 | Prolog. |
d8d6b4c2 | 153 | |
b47bab49 | 154 | %prep |
c5f63c5d | 155 | %setup -q -n swi%{name}-%{version} |
c9a2b49a | 156 | %patch0 -p1 |
d6ebf125 | 157 | %patch1 -p1 |
6e26775e | 158 | %patch2 -p1 |
6008b4b3 | 159 | %patch3 -p1 |
312f2978 | 160 | %patch4 -p1 |
b47bab49 | 161 | |
1075bfab JR |
162 | %{__mv} src/Tests/core/test_d_break.pl{,disabled} |
163 | ||
b47bab49 | 164 | %build |
6eaa1535 JR |
165 | # packages use SWI-Prolog own linker which doesn't understand -gdwarf* and |
166 | # some -march= options passed to it by gcc | |
167 | CFLAGS=$(echo %{rpmcflags} | sed 's|-march=[^ ]*||') | |
168 | export CFLAGS | |
169 | ||
c41fab66 JP |
170 | %if %{with java} |
171 | export JAVA_HOME="%{java_home}" | |
172 | export JAVAPREFIX="%{java_home}/bin" | |
173 | %endif | |
de83a41c | 174 | |
b47bab49 | 175 | cd src |
c9a2b49a JR |
176 | cp -f /usr/share/automake/config.sub . |
177 | %{__aclocal} | |
178 | %{__autoconf} | |
2b6114fc JR |
179 | %configure \ |
180 | PLARCH=%{_target_platform} | |
c9a2b49a | 181 | %{__make} |
7910415f | 182 | cd .. |
183 | ||
1ef76211 | 184 | # the packages are written in Prolog itself |
185 | PATH="$(pwd)/src:$PATH"; export PATH | |
2b6114fc | 186 | LD_LIBRARY_PATH="$(pwd)/lib/%{_target_platform}"; export LD_LIBRARY_PATH |
6e26775e | 187 | export CLASSPATH=. |
1ef76211 | 188 | |
ab4596f4 | 189 | cd packages |
795b760b | 190 | wd=`pwd` |
d6ebf125 | 191 | # see packages/configure for default packages list and their order |
baa60e51 JR |
192 | for i in clib cpp odbc table xpce/src sgml RDF semweb http chr \ |
193 | clpqr nlp ssl tipc pldoc plunit %{?with_java:jpl} \ | |
c5f63c5d | 194 | zlib protobufs PDT utf8proc archive pengines cql \ |
baa60e51 | 195 | inclpr ; do |
d983696f | 196 | cd $i |
9ed3ef8d | 197 | cp -f /usr/share/automake/config.sub . |
1b374694 PG |
198 | %{__aclocal} |
199 | %{__autoconf} | |
d6ebf125 | 200 | grep -q AC_CONFIG_HEADER configure.in && %{__autoheader} |
6e26775e JB |
201 | # ac_cv_prog_uudecode_base64=no is a hack to compile Test.class instead of |
202 | # using included one which fails with Sun/Oracle JDK 1.6 [needed for jpl] | |
203 | %configure \ | |
204 | ac_cv_prog_uudecode_base64=no | |
1b374694 | 205 | %{__make} |
795b760b | 206 | cd $wd |
d983696f | 207 | done |
7910415f | 208 | cd .. |
b47bab49 | 209 | |
7955951b JB |
210 | %{?with_tests:%{__make} -C src check} |
211 | ||
b47bab49 | 212 | %install |
88202d50 | 213 | rm -rf $RPM_BUILD_ROOT |
a600d3a9 | 214 | |
4d684186 | 215 | %{__make} -j1 install -C src \ |
c70c09d5 | 216 | DESTDIR=$RPM_BUILD_ROOT |
b47bab49 | 217 | |
2b6114fc | 218 | LD_LIBRARY_PATH="$RPM_BUILD_ROOT%{_libdir}/swipl-%{version}/lib/%{_target_platform}"; export LD_LIBRARY_PATH |
a600d3a9 | 219 | |
baa60e51 JR |
220 | for i in clib cpp odbc table xpce/src sgml RDF semweb http chr \ |
221 | clpqr nlp ssl tipc pldoc plunit %{?with_java:jpl} \ | |
c5f63c5d | 222 | zlib protobufs PDT utf8proc archive pengines cql \ |
baa60e51 | 223 | inclpr ; do |
d983696f | 224 | PATH=$RPM_BUILD_ROOT%{_bindir}:$PATH \ |
c9a2b49a | 225 | %{__make} -j1 install -C packages/$i \ |
baa60e51 | 226 | PLBASE=$RPM_BUILD_ROOT%{_libdir}/swipl-%{version} \ |
66ce5bea TP |
227 | prefix=$RPM_BUILD_ROOT%{_prefix} \ |
228 | bindir=$RPM_BUILD_ROOT%{_bindir} \ | |
229 | mandir=$RPM_BUILD_ROOT%{_mandir}/man1 | |
d983696f | 230 | done |
b47bab49 | 231 | |
d6ebf125 JB |
232 | # packaged as doc |
233 | %{__rm} -r $RPM_BUILD_ROOT%{_libdir}/swipl-%{version}/{customize,xpce/{COPYING,README}} | |
234 | # no need to package | |
235 | %{__rm} -r $RPM_BUILD_ROOT%{_libdir}/swipl-%{version}/demo | |
236 | ||
b47bab49 | 237 | %clean |
238 | rm -rf $RPM_BUILD_ROOT | |
16e9cab1 | 239 | |
b47bab49 | 240 | %files |
88202d50 | 241 | %defattr(644,root,root,755) |
d6ebf125 | 242 | %doc README ReleaseNotes/relnotes-* customize |
baa60e51 JR |
243 | %attr(755,root,root) %{_bindir}/swipl* |
244 | %dir %{_libdir}/swipl-%{version} | |
d6ebf125 | 245 | %{_libdir}/swipl-%{version}/Makefile |
baa60e51 JR |
246 | %attr(755,root,root) %{_libdir}/swipl-%{version}/bin |
247 | %{_libdir}/swipl-%{version}/boot* | |
248 | %dir %{_libdir}/swipl-%{version}/lib | |
2b6114fc JR |
249 | %dir %{_libdir}/swipl-%{version}/lib/%{_target_platform} |
250 | %attr(755,root,root) %{_libdir}/swipl-%{version}/lib/%{_target_platform}/*.so* | |
251 | %{_libdir}/swipl-%{version}/lib/%{_target_platform}/*.a | |
baa60e51 | 252 | %{_libdir}/swipl-%{version}/library |
fc61d546 | 253 | %if %{with java} |
2b6114fc | 254 | %exclude %{_libdir}/swipl-%{version}/lib/%{_target_platform}/libjpl.so |
baa60e51 | 255 | %exclude %{_libdir}/swipl-%{version}/library/jpl.pl |
fc61d546 | 256 | %endif |
baa60e51 JR |
257 | %{_libdir}/swipl-%{version}/include |
258 | %{_libdir}/swipl-%{version}/do* | |
259 | %{_libdir}/swipl-%{version}/*.rc | |
260 | %{_libdir}/swipl-%{version}/swipl.home | |
261 | %{_pkgconfigdir}/swipl.pc | |
d6ebf125 | 262 | %{_mandir}/man1/swipl*.1* |
d8d6b4c2 | 263 | |
17ca8a5c | 264 | %files xpce |
5c2adf18 | 265 | %defattr(644,root,root,755) |
c5f63c5d | 266 | %doc packages/xpce/{EXTENDING,INFO,README,README.CXX,README.customise} |
d6ebf125 JB |
267 | %attr(755,root,root) %{_bindir}/xpce-client |
268 | %dir %{_libdir}/swipl-%{version}/xpce | |
269 | %{_libdir}/swipl-%{version}/xpce/Defaults* | |
270 | %attr(755,root,root) %{_libdir}/swipl-%{version}/xpce/bin | |
271 | %{_libdir}/swipl-%{version}/xpce/appl-help | |
272 | %{_libdir}/swipl-%{version}/xpce/bitmaps | |
273 | %{_libdir}/swipl-%{version}/xpce/man | |
274 | %{_libdir}/swipl-%{version}/xpce/pl | |
275 | %{_libdir}/swipl-%{version}/xpce/prolog | |
17ca8a5c JR |
276 | |
277 | %if %{with java} | |
278 | %files jpl | |
279 | %defattr(644,root,root,755) | |
2b6114fc | 280 | %attr(755,root,root) %{_libdir}/swipl-%{version}/lib/%{_target_platform}/libjpl.so |
d6ebf125 | 281 | %{_libdir}/swipl-%{version}/lib/jpl.jar |
baa60e51 | 282 | %{_libdir}/swipl-%{version}/library/jpl.pl |
17ca8a5c | 283 | %endif |