]> git.pld-linux.org Git - packages/z3.git/blame - z3.spec
- updated to 4.8.13
[packages/z3.git] / z3.spec
CommitLineData
79443d4c
JB
1#
2# Conditional build:
3%bcond_without apidocs # Doxygen documentation
4%bcond_with dotnet # .NET API (requires MS .NET SDK + mono)
5%bcond_without ocaml # OCaml API
6%bcond_without ocaml_opt # skip building native optimized binaries (bytecode is always built)
7
8# not yet available on x32 (ocaml 4.02.1), update when upstream will support it
9%ifnarch %{ix86} %{x8664} %{arm} aarch64 ppc sparc sparcv9
10%undefine with_ocaml_opt
11%endif
12
13Summary: High-performance theorem prover developed at Microsoft Research
14Summary(pl.UTF-8): Wydajne narzędzie do dowodzenia twierdzeń tworzone przez Microsoft Research
3cec6e31 15Name: z3
804ec7be
JB
16Version: 4.8.13
17Release: 1
79443d4c 18License: MIT
3cec6e31 19Group: Applications/Engineering
79443d4c 20#Source0Download: https://github.com/Z3Prover/z3/releases
01b2836f 21Source0: https://github.com/Z3Prover/z3/archive/z3-%{version}.tar.gz
804ec7be 22# Source0-md5: 723a8859cc9b38b90d127aeca8144dc2
79443d4c
JB
23Patch0: %{name}-pld.patch
24URL: https://github.com/Z3Prover/z3
25BuildRequires: cmake >= 3.4
26%{?with_apidocs:BuildRequires: doxygen}
27BuildRequires: gmp-devel
28BuildRequires: libgomp-devel
29BuildRequires: libstdc++-devel >= 6:4.7
30%{?with_dotnet:BuildRequires: mono-devel}
31%if %{with ocaml}
32BuildRequires: ocaml
33BuildRequires: ocaml-findlib
01b2836f 34BuildRequires: ocaml-zarith-devel
79443d4c 35%endif
3cec6e31
JR
36BuildRequires: python
37BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38
39%description
40Z3 is a high-performance theorem prover being developed at Microsoft
41Research.
42
79443d4c
JB
43%description -l pl
44Z3 to wydajne narzędzie do dowodzenia twierdzeń tworzone przez
45Microsoft Research.
46
3cec6e31
JR
47%package devel
48Summary: Development files for Z3
79443d4c 49Summary(pl.UTF-8): Pliki programistyczne Z3
3cec6e31 50Group: Development/Libraries
79443d4c 51Requires: %{name} = %{version}-%{release}
3cec6e31
JR
52
53%description devel
54Development files for Z3.
55
79443d4c
JB
56%description devel -l pl.UTF-8
57Pliki programistyczne Z3.
58
59%package apidocs
60Summary: API documentation for Z3 library
61Summary(pl.UTF-8): Dokumentacja API Biblioteki Z3
62Group: Documentation
79443d4c 63BuildArch: noarch
79443d4c
JB
64
65%description apidocs
66API documentation for Z3 library.
67
68%description apidocs -l pl.UTF-8
69Dokumentacja API Biblioteki Z3.
70
71%package -n java-z3
72Summary: Java API for Z3 library
73Summary(pl.UTF-8): API języka Java do biblioteki Z3
74Group: Libraries/Java
75Requires: %{name} = %{version}-%{release}
76
77%description -n java-z3
78Java API for Z3 theorem prover library.
79
80%description -n java-z3 -l pl.UTF-8
81API języka Java do biblioteki dowodzenia twierdzeń Z3.
82
83%package -n ocaml-z3
84Summary: Z3 binding for OCaml
85Summary(pl.UTF-8): Wiązania Z3 dla OCamla
86Group: Libraries
87Requires: %{name} = %{version}-%{release}
01b2836f 88Requires: ocaml-zarith
79443d4c
JB
89%requires_eq ocaml-runtime
90
91%description -n ocaml-z3
92This package contains files needed to run bytecode executables using
93Z3 library.
94
95%description -n ocaml-z3 -l pl.UTF-8
96Pakiet ten zawiera binaria potrzebne do uruchamiania programów
97używających biblioteki Z3.
98
99%package -n ocaml-z3-devel
100Summary: Z3 binding for OCaml - development part
101Summary(pl.UTF-8): Wiązania Z3 dla OCamla - cześć programistyczna
102Group: Development/Libraries
103Requires: ocaml-z3 = %{version}-%{release}
01b2836f 104Requires: ocaml-zarith-devel
79443d4c
JB
105%requires_eq ocaml
106
107%description -n ocaml-z3-devel
108This package contains files needed to develop OCaml programs using Z3
109library.
110
111%description -n ocaml-z3-devel -l pl.UTF-8
112Pakiet ten zawiera pliki niezbędne do tworzenia programów używających
113biblioteki Z3.
114
115%package -n python-z3
116Summary: Python API for Z3 library
117Summary(pl.UTF-8): API języka Python do biblioteki Z3
118Group: Libraries/Python
119Requires: %{name} = %{version}-%{release}
120
121%description -n python-z3
122Python API for Z3 theorem prover library.
123
124%description -n python-z3 -l pl.UTF-8
125API języka Python do biblioteki dowodzenia twierdzeń Z3.
126
3cec6e31 127%prep
01b2836f 128%setup -q -n z3-z3-%{version}
79443d4c 129%patch0 -p1
3cec6e31
JR
130
131%build
79443d4c
JB
132%if %{with ocaml}
133# ml not supported by CMakeLists.txt, need to generate some files
5cc33889
JB
134%if %{without ocaml_opt}
135# hack to avoid configuration failure
136OCAMLOPT=ocamlc \
137%endif
79443d4c
JB
138%{__python} scripts/mk_make.py \
139 --ml
140# --dotnet --java --python
141
142# clean up so that cmake can be run
143%{__rm} src/ast/pattern/database.h \
144 src/util/z3_version.h \
145 $(find src -name '*.hpp') \
146 src/api/api_commands.cpp \
147 src/api/api_log_macros.cpp \
148 src/api/api_log_macros.h \
149 src/api/dll/gparams_register_modules.cpp \
150 src/api/dll/install_tactic.cpp \
151 src/api/dll/mem_initializer.cpp \
152 src/shell/gparams_register_modules.cpp \
153 src/shell/install_tactic.cpp \
154 src/shell/mem_initializer.cpp \
155 src/test/gparams_register_modules.cpp \
156 src/test/install_tactic.cpp \
157 src/test/mem_initializer.cpp
158%endif
159
160# use (unofficial) cmake suite for regular build, because mk_make would
161# require too much patching to comply with PLD standards (%{_lib}-awareness,
162# optflags, verbose make...)
163
164install -d build-cmake
165cd build-cmake
166%cmake .. \
79443d4c
JB
167 -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir}/z3 \
168 -DCMAKE_INSTALL_PYTHON_PKG_DIR=%{py_sitescriptdir} \
01b2836f
JB
169 %{?with_apidocs:-DZ3_BUILD_DOCUMENTATION=ON} \
170 %{?with_dotnet:-DZ3_BUILD_DOTNET_BINDINGS=ON} \
171 -DZ3_BUILD_JAVA_BINDINGS=ON \
172 -DZ3_BUILD_LIBZ3_SHARED=ON \
0bc82cec
JB
173 -DZ3_BUILD_PYTHON_BINDINGS=ON \
174 %{?with_dotnet:-DZ3_INSTALL_DOTNET_BINDINGS=ON} \
175 -DZ3_INSTALL_JAVA_BINDINGS=ON \
176 -DZ3_INSTALL_PYTHON_BINDINGS=ON \
177 -DZ3_USE_LIB_GMP=ON
3cec6e31 178
3cec6e31
JR
179%{__make}
180
79443d4c 181%if %{with ocaml}
804ec7be 182# no cmake suite for ocaml; do it manually (basing on Makefile generated by mk_make.py from `configure --ml`)
79443d4c
JB
183install -d src/api/ml
184cp -p ../build/api/ml/META src/api/ml
01b2836f
JB
185ocamlfind ocamlc -package zarith -ccopt "%{rpmcxxflags} -I../src/api -I../src/api/ml -o src/api/ml/z3native_stubs.o" -c ../src/api/ml/z3native_stubs.c
186ocamlfind ocamlc -package zarith -i -I src/api/ml -c ../src/api/ml/z3enums.ml > src/api/ml/z3enums.mli
187ocamlfind ocamlc -package zarith -I src/api/ml -o src/api/ml/z3enums.cmi -c src/api/ml/z3enums.mli
188ocamlfind ocamlc -package zarith -I src/api/ml -o src/api/ml/z3enums.cmo -c ../src/api/ml/z3enums.ml
189ocamlfind ocamlc -package zarith -i -I src/api/ml -o ../src/api/ml/z3native.ml > src/api/ml/z3native.mli
190ocamlfind ocamlc -package zarith -I src/api/ml -o src/api/ml/z3native.cmi -c src/api/ml/z3native.mli
191ocamlfind ocamlc -package zarith -I src/api/ml -o src/api/ml/z3native.cmo -c ../src/api/ml/z3native.ml
79443d4c 192cp -p ../src/api/ml/z3.mli src/api/ml/z3.mli
01b2836f
JB
193ocamlfind ocamlc -package zarith -I src/api/ml -o src/api/ml/z3.cmi -c src/api/ml/z3.mli
194ocamlfind ocamlc -package zarith -I src/api/ml -o src/api/ml/z3.cmo -c ../src/api/ml/z3.ml
804ec7be 195ocamlmklib -o src/api/ml/z3ml -I src/api/ml src/api/ml/z3native_stubs.o src/api/ml/z3enums.cmo src/api/ml/z3native.cmo src/api/ml/z3.cmo -L. -lz3 -cclib -fopenmp
79443d4c 196%if %{with ocaml_opt}
01b2836f
JB
197ocamlfind ocamlopt -package zarith -I src/api/ml -o src/api/ml/z3enums.cmx -c ../src/api/ml/z3enums.ml
198ocamlfind ocamlopt -package zarith -I src/api/ml -o src/api/ml/z3native.cmx -c ../src/api/ml/z3native.ml
199ocamlfind ocamlopt -package zarith -I src/api/ml -o src/api/ml/z3.cmx -c ../src/api/ml/z3.ml
804ec7be 200ocamlmklib -o src/api/ml/z3ml -I src/api/ml src/api/ml/z3native_stubs.o src/api/ml/z3enums.cmx src/api/ml/z3native.cmx src/api/ml/z3.cmx -L. -lz3 -cclib -fopenmp
01b2836f 201ocamlfind ocamlopt -package zarith -linkall -shared -o src/api/ml/z3ml.cmxs -I . -I src/api/ml src/api/ml/z3ml.cmxa
79443d4c
JB
202%endif
203%endif
204
3cec6e31
JR
205%install
206rm -rf $RPM_BUILD_ROOT
3cec6e31 207
79443d4c
JB
208%{__make} -C build-cmake install \
209 DESTDIR=$RPM_BUILD_ROOT
210
211%py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
212%py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
213%py_postclean
3cec6e31 214
79443d4c
JB
215%if %{with ocaml}
216cd build-cmake
68d8dbb4 217install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs
79443d4c 218ocamlfind install -destdir $RPM_BUILD_ROOT%{_libdir}/ocaml Z3 src/api/ml/META \
5cc33889
JB
219 src/api/ml/z3*.mli src/api/ml/z3*.cmi \
220 src/api/ml/dllz3ml.so src/api/ml/libz3ml.a src/api/ml/z3ml.cma \
221%if %{with ocaml_opt}
222 src/api/ml/z3*.cmx \
223 src/api/ml/z3ml.a src/api/ml/z3ml.cmxa src/api/ml/z3ml.cmxs
224%endif
79443d4c
JB
225
226%{__rm} $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs/dllz3ml.so.owner
5cc33889 227%if %{without ocaml_opt}
68d8dbb4 228%{__sed} -i -e '/archive.*native/d' $RPM_BUILD_ROOT%{_libdir}/ocaml/Z3/META
5cc33889 229%endif
79443d4c
JB
230cd ..
231%endif
232
233install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
3cec6e31
JR
234cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
235
79443d4c
JB
236# packaged as %doc in -apidocs
237%{__rm} -r $RPM_BUILD_ROOT%{_docdir}/api
238
3cec6e31
JR
239%clean
240rm -rf $RPM_BUILD_ROOT
241
242%post -p /sbin/ldconfig
243%postun -p /sbin/ldconfig
244
245%files
246%defattr(644,root,root,755)
79443d4c
JB
247%doc LICENSE.txt README.md RELEASE_NOTES
248%attr(755,root,root) %{_libdir}/libz3.so.*.*.*.*
249%ghost %attr(755,root,root) %{_libdir}/libz3.so.4.8
250%attr(755,root,root) %{_bindir}/z3
3cec6e31
JR
251
252%files devel
253%defattr(644,root,root,755)
3cec6e31 254%attr(755,root,root) %{_libdir}/libz3.so
804ec7be
JB
255%{_includedir}/z3
256%{_pkgconfigdir}/z3.pc
79443d4c 257%{_libdir}/cmake/z3
3cec6e31 258%{_examplesdir}/%{name}-%{version}
79443d4c
JB
259
260%if %{with apidocs}
261%files apidocs
262%defattr(644,root,root,755)
263%doc build-cmake/doc/api/html/{search,*.{css,html,js,png}}
264%endif
265
266%files -n java-z3
267%defattr(644,root,root,755)
268%attr(755,root,root) %{_libdir}/libz3java.so
269%{_javadir}/com.microsoft.z3-*.*.*.*.jar
270%{_javadir}/com.microsoft.z3.jar
271
272%if %{with ocaml}
273%files -n ocaml-z3
274%defattr(644,root,root,755)
275%attr(755,root,root) %{_libdir}/ocaml/stublibs/dllz3ml.so
276%dir %{_libdir}/ocaml/Z3
277%{_libdir}/ocaml/Z3/z3ml.cma
278%if %{with ocaml_opt}
279%attr(755,root,root) %{_libdir}/ocaml/Z3/z3ml.cmxs
280%endif
281
282%files -n ocaml-z3-devel
283%defattr(644,root,root,755)
68d8dbb4 284%{_libdir}/ocaml/Z3/META
5cc33889 285%{_libdir}/ocaml/Z3/libz3ml.a
79443d4c
JB
286%{_libdir}/ocaml/Z3/z3*.cmi
287%{_libdir}/ocaml/Z3/z3*.mli
288%if %{with ocaml_opt}
79443d4c
JB
289%{_libdir}/ocaml/Z3/z3ml.a
290%{_libdir}/ocaml/Z3/z3*.cmx
291%{_libdir}/ocaml/Z3/z3ml.cmxa
292%endif
79443d4c
JB
293%endif
294
295%files -n python-z3
296%defattr(644,root,root,755)
297%{py_sitescriptdir}/z3
This page took 0.112969 seconds and 4 git commands to generate.