2015-04-23 15:09:07 +00:00
|
|
|
# Python 3 NOTE: Although there are references to python 3 support in the
|
|
|
|
# source tree, building with python 3 currently fails. I fixed several
|
|
|
|
# problems before giving up. If someone would like to fix all of the problems
|
|
|
|
# and submit the results upstream, I'm sure many people would be grateful.
|
|
|
|
|
|
|
|
%global opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0)
|
2016-11-10 23:07:47 +00:00
|
|
|
%global medtag d57a2a6dce92
|
2015-04-23 15:09:07 +00:00
|
|
|
|
|
|
|
Name: z3
|
2016-11-10 23:07:47 +00:00
|
|
|
Version: 4.5.0
|
|
|
|
Release: 1%{?dist}
|
2015-04-23 15:09:07 +00:00
|
|
|
Summary: Satisfiability Modulo Theories (SMT) solver
|
|
|
|
|
|
|
|
License: MIT
|
|
|
|
URL: https://github.com/Z3Prover/z3
|
2015-05-28 16:05:25 +00:00
|
|
|
Source0: https://github.com/Z3Prover/z3/archive/%{name}-%{version}.tar.gz
|
2015-04-23 15:09:07 +00:00
|
|
|
# Do not try to build with SSE2 on non-x86_64 arches
|
|
|
|
Patch0: %{name}-sse2.patch
|
|
|
|
|
|
|
|
BuildRequires: doxygen
|
2016-07-01 01:54:14 +00:00
|
|
|
BuildRequires: gcc-c++
|
2015-04-23 15:09:07 +00:00
|
|
|
BuildRequires: gmp-devel
|
|
|
|
BuildRequires: graphviz
|
|
|
|
BuildRequires: java-devel
|
|
|
|
BuildRequires: jpackage-utils
|
|
|
|
BuildRequires: ocaml
|
2015-05-28 16:05:25 +00:00
|
|
|
BuildRequires: ocaml-findlib
|
|
|
|
BuildRequires: ocaml-ocamldoc
|
2015-04-23 15:09:07 +00:00
|
|
|
BuildRequires: python2-devel
|
2016-11-10 23:07:47 +00:00
|
|
|
BuildRequires: python2-setuptools
|
2015-04-23 15:09:07 +00:00
|
|
|
|
|
|
|
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
|
|
|
|
|
|
|
|
%description
|
|
|
|
Z3 is a satisfiability modulo theories (SMT) solver; given a set of
|
|
|
|
constraints with variables, it reports a set of values for those
|
|
|
|
variables that would meet the constraints. The Z3 input format is an
|
|
|
|
extension of the one defined by the SMT-LIB 2.0 standard. Z3 supports
|
|
|
|
arithmetic, fixed-size bit-vectors, extensional arrays, datatypes,
|
|
|
|
uninterpreted functions, and quantifiers.
|
|
|
|
|
|
|
|
%package libs
|
|
|
|
Summary: Library for applications that use z3 functionality
|
|
|
|
|
|
|
|
%description libs
|
|
|
|
Library for applications that use z3 functionality.
|
|
|
|
|
|
|
|
%package devel
|
|
|
|
Summary: Header files for build applications that use z3
|
|
|
|
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
|
|
|
|
|
|
|
|
%description devel
|
|
|
|
Header files for build applications that use z3.
|
|
|
|
|
|
|
|
%package doc
|
|
|
|
Summary: API documentation for Z3
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
%description doc
|
|
|
|
API documentation for Z3.
|
|
|
|
|
|
|
|
%package -n java-%{name}
|
|
|
|
Summary: Java interface to z3
|
|
|
|
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
|
|
|
|
Requires: java
|
|
|
|
Requires: jpackage-utils
|
|
|
|
|
|
|
|
%description -n java-%{name}
|
|
|
|
Java interface to z3.
|
|
|
|
|
|
|
|
%package -n ocaml-%{name}
|
|
|
|
Summary: Ocaml interface to z3
|
|
|
|
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
|
|
|
|
|
|
|
|
%description -n ocaml-%{name}
|
|
|
|
Ocaml interface to z3.
|
|
|
|
|
|
|
|
%package -n ocaml-%{name}-devel
|
|
|
|
Summary: Files for building ocaml applications that use z3
|
|
|
|
Requires: ocaml-%{name}%{?_isa} = %{version}-%{release}
|
|
|
|
|
|
|
|
%description -n ocaml-%{name}-devel
|
|
|
|
Files for building ocaml applications that use z3.
|
|
|
|
|
|
|
|
%package -n python-%{name}
|
|
|
|
Summary: Python 2 interface to z3
|
|
|
|
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
|
|
|
|
|
|
|
|
%description -n python-%{name}
|
|
|
|
Python 2 interface to z3.
|
|
|
|
|
|
|
|
%prep
|
2015-05-28 16:05:25 +00:00
|
|
|
%setup -q -n %{name}-%{name}-%{version}
|
|
|
|
%patch0
|
2015-04-23 15:09:07 +00:00
|
|
|
|
|
|
|
# Install python objects into the right place, enable verbose builds, use
|
|
|
|
# Fedora CFLAGS, preserve timestamps when installing, include the entire
|
|
|
|
# contents of the archives in the library, link the library with the correct
|
2016-11-10 23:07:47 +00:00
|
|
|
# flags, don't hide library symbols needed by the executable, use an soname,
|
|
|
|
# and build the ocaml files with debug info.
|
2015-04-23 15:09:07 +00:00
|
|
|
sed -e "s|^\(PYTHON_PACKAGE_DIR=\).*|\1'%{python2_sitearch}/z3'|" \
|
|
|
|
-e 's/@$(CXX)/$(CXX)/' \
|
|
|
|
-e 's/ -O3//;s/ -fomit-frame-pointer//' \
|
2016-11-10 23:07:47 +00:00
|
|
|
-e "s/\(['\"]\)cp\([^[:alnum:]]\)/\1cp -p\2/" \
|
2015-04-23 15:09:07 +00:00
|
|
|
-e "s/\(SLIBEXTRAFLAGS = '\)'/\1-Wl,--no-whole-archive -Wl,--as-needed'/" \
|
2016-11-10 23:07:47 +00:00
|
|
|
-e "/SLIBFLAGS/s|-shared|& $RPM_LD_FLAGS -Wl,--whole-archive|" \
|
2015-04-23 15:09:07 +00:00
|
|
|
-e 's/\(libz3$(SO_EXT)\)\(\\n\)/\1 -Wl,--no-whole-archive\2/' \
|
|
|
|
-e "s/'tstomp\.cpp',/& '-fPIC',/" \
|
2015-10-09 03:08:13 +00:00
|
|
|
-e 's/ -fvisibility=hidden//' \
|
2016-11-10 23:07:47 +00:00
|
|
|
-e '/dll_file/s/\$(SLINK_FLAGS)/& -Wl,-h,lib%{name}.so.0/' \
|
|
|
|
-e "s/OCAML_FLAGS = ''/OCAML_FLAGS = '-g'/" \
|
2015-04-23 15:09:07 +00:00
|
|
|
-i scripts/mk_util.py
|
|
|
|
|
|
|
|
# Do not try to build with SSE2 support on non-x86_64 arches.
|
|
|
|
%ifnarch x86_64
|
2015-10-09 03:40:18 +00:00
|
|
|
sed -i 's/exec_compiler_cmd.*-msse.*:/None:/' scripts/mk_util.py
|
2015-04-23 15:09:07 +00:00
|
|
|
%endif
|
|
|
|
|
|
|
|
# Comply with the Java packaging guidelines
|
2016-11-10 23:07:47 +00:00
|
|
|
sed -e 's,\(System\.load\)Library("\(.*\)"),\1("%{_libdir}/z3/\2.so"),' \
|
2016-07-13 21:07:47 +00:00
|
|
|
-i scripts/update_api.py
|
2015-04-23 15:09:07 +00:00
|
|
|
|
|
|
|
# Fix character encoding
|
|
|
|
iconv -f iso8859-1 -t utf-8 RELEASE_NOTES > RELEASE_NOTES.utf8
|
|
|
|
touch -r RELEASE_NOTES RELEASE_NOTES.utf8
|
|
|
|
mv -f RELEASE_NOTES.utf8 RELEASE_NOTES
|
|
|
|
|
|
|
|
# Fix permissions
|
2016-07-13 21:07:47 +00:00
|
|
|
find -O3 src -type f -perm /0111 \( -name \*.cpp -o -name \*.h \) \
|
|
|
|
-exec chmod 0644 {} +
|
2015-05-28 16:05:25 +00:00
|
|
|
|
2016-11-10 23:07:47 +00:00
|
|
|
# Fix ocaml documentation generation (broken in 4.4.0, broken more in 4.5.0)
|
|
|
|
sed -e 's,api\\html\\ml,api/html/ml,' \
|
|
|
|
-e 's,python/z3.py,python/z3/z3.py,' \
|
|
|
|
-e 's,z3enums\.mli,z3enums.ml,' \
|
|
|
|
-i doc/mk_api_doc.py
|
2015-04-23 15:09:07 +00:00
|
|
|
|
|
|
|
%build
|
|
|
|
export CXXFLAGS="$RPM_OPT_FLAGS -fPIC"
|
2015-10-09 03:08:13 +00:00
|
|
|
export LDFLAGS="$RPM_LD_FLAGS -Wl,--as-needed -lgmp"
|
2016-11-10 23:07:47 +00:00
|
|
|
export LANG="C.UTF-8"
|
2015-04-23 15:09:07 +00:00
|
|
|
export PYTHON="%{__python2}"
|
|
|
|
|
|
|
|
# This is NOT an autoconf-generated configure script.
|
2016-11-10 23:07:47 +00:00
|
|
|
./configure -p %{_prefix} --githash=%{medtag} --gmp --java --ml
|
|
|
|
# FIXME: intermittent build failures with %%{?_smp_mflags}
|
|
|
|
make -C build
|
2015-04-23 15:09:07 +00:00
|
|
|
|
|
|
|
# The z3 binary is NOT linked with libz3, but instead has duplicate copies of a
|
|
|
|
# lot of object files, so rebuild it. But first, add library links.
|
|
|
|
pushd build
|
|
|
|
mv libz3.so libz3.so.0.0.0
|
|
|
|
ln -s libz3.so.0.0.0 libz3.so.0
|
|
|
|
ln -s libz3.so.0 libz3.so
|
2015-05-28 16:05:25 +00:00
|
|
|
g++ $RPM_OPT_FLAGS -fopenmp -o z3 shell/*.o $LDFLAGS -L. -lz3
|
2015-04-23 15:09:07 +00:00
|
|
|
popd
|
|
|
|
|
|
|
|
# Build the documentation
|
|
|
|
pushd doc
|
2015-05-28 16:05:25 +00:00
|
|
|
%{__python2} mk_api_doc.py --ml
|
2015-04-23 15:09:07 +00:00
|
|
|
popd
|
|
|
|
|
|
|
|
%install
|
2016-11-10 23:07:47 +00:00
|
|
|
export LANG="C.UTF-8"
|
2015-05-28 16:05:25 +00:00
|
|
|
|
|
|
|
# Install
|
2016-11-10 23:07:47 +00:00
|
|
|
make -C build install DESTDIR=%{buildroot}
|
2015-04-23 15:09:07 +00:00
|
|
|
|
|
|
|
# On 64-bit systems, move the library to the right directory
|
|
|
|
if [ "%{_libdir}" != "%{_prefix}/lib" ]; then
|
|
|
|
mkdir -p %{buildroot}%{_libdir}
|
|
|
|
mv %{buildroot}%{_prefix}/lib/libz3.so* %{buildroot}%{_libdir}
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Make library links
|
|
|
|
mv %{buildroot}%{_libdir}/libz3.so %{buildroot}%{_libdir}/libz3.so.0.0.0
|
|
|
|
ln -s libz3.so.0.0.0 %{buildroot}%{_libdir}/libz3.so.0
|
|
|
|
ln -s libz3.so.0 %{buildroot}%{_libdir}/libz3.so
|
|
|
|
|
|
|
|
# Move the header files into their own directory
|
|
|
|
mkdir -p %{buildroot}%{_includedir}/%{name}
|
|
|
|
mv %{buildroot}%{_includedir}/*.h %{buildroot}%{_includedir}/%{name}
|
|
|
|
|
2016-11-10 23:07:47 +00:00
|
|
|
# Install the python interface
|
|
|
|
mkdir -p %{buildroot}%{python2_sitearch}
|
|
|
|
cp -a build/python/%{name} %{buildroot}%{python2_sitearch}
|
2015-04-23 15:09:07 +00:00
|
|
|
ln -s %{_libdir}/lib%{name}.so.0 \
|
|
|
|
%{buildroot}%{python2_sitearch}/%{name}/lib%{name}.so
|
2016-01-21 03:26:48 +00:00
|
|
|
|
2015-05-28 16:05:25 +00:00
|
|
|
# Move the Java interface to its correct location
|
2015-04-23 15:09:07 +00:00
|
|
|
mkdir -p %{buildroot}%{_libdir}/%{name}
|
|
|
|
mkdir -p %{buildroot}%{_jnidir}
|
2015-05-28 16:05:25 +00:00
|
|
|
mv %{buildroot}%{_prefix}/lib/*.jar %{buildroot}%{_jnidir}
|
2015-04-23 15:09:07 +00:00
|
|
|
ln -s %{_jnidir}/com.microsoft.z3.jar %{buildroot}%{_libdir}/%{name}
|
2015-05-28 16:05:25 +00:00
|
|
|
mv %{buildroot}%{_prefix}/lib/lib%{name}java.so %{buildroot}%{_libdir}/%{name}
|
2015-04-23 15:09:07 +00:00
|
|
|
|
2015-05-28 16:05:25 +00:00
|
|
|
#%%check
|
2015-04-25 15:45:50 +00:00
|
|
|
# Some of the tests require more memory than the koji builders have available.
|
|
|
|
# However, valgrind also shows a large number of memory leaks. I will work
|
|
|
|
# with upstream to fix the leaks, then try again to see if the tests can be
|
|
|
|
# run on the koji builders successfully. If not, the tests will have to be run
|
|
|
|
# manually on machines with more available memory.
|
|
|
|
#
|
2016-11-10 23:07:47 +00:00
|
|
|
#export LANG="C.UTF-8"
|
2015-04-25 15:45:50 +00:00
|
|
|
#pushd build
|
|
|
|
#make test
|
|
|
|
#./test-z3 /a
|
|
|
|
#popd
|
2015-04-23 15:09:07 +00:00
|
|
|
|
|
|
|
%post libs -p /sbin/ldconfig
|
|
|
|
|
|
|
|
%postun libs -p /sbin/ldconfig
|
|
|
|
|
|
|
|
%files
|
2016-11-10 23:07:47 +00:00
|
|
|
%doc README.md RELEASE_NOTES
|
2015-04-23 15:09:07 +00:00
|
|
|
%{_bindir}/%{name}
|
|
|
|
|
|
|
|
%files libs
|
|
|
|
%license LICENSE.txt
|
|
|
|
%{_libdir}/lib%{name}.so.*
|
|
|
|
|
|
|
|
%files devel
|
|
|
|
%{_includedir}/%{name}/
|
|
|
|
%{_libdir}/lib%{name}.so
|
|
|
|
|
|
|
|
%files doc
|
|
|
|
%doc doc/api/html examples
|
|
|
|
%license LICENSE.txt
|
|
|
|
|
|
|
|
%files -n java-%{name}
|
|
|
|
%{_libdir}/%{name}/
|
|
|
|
%{_jnidir}/com.microsoft.z3.jar
|
|
|
|
|
|
|
|
%files -n ocaml-%{name}
|
2015-05-28 16:05:25 +00:00
|
|
|
%dir %{_libdir}/ocaml/Z3/
|
|
|
|
%{_libdir}/ocaml/Z3/META
|
|
|
|
%{_libdir}/ocaml/Z3/*.cma
|
|
|
|
%{_libdir}/ocaml/Z3/*.cmi
|
2016-11-10 23:07:47 +00:00
|
|
|
%{_libdir}/ocaml/Z3/*.cmxs
|
2015-05-28 16:05:25 +00:00
|
|
|
%{_libdir}/ocaml/Z3/*.so
|
2015-04-23 15:09:07 +00:00
|
|
|
|
|
|
|
%files -n ocaml-%{name}-devel
|
2016-11-10 23:07:47 +00:00
|
|
|
%{_libdir}/ocaml/Z3/*.a
|
2015-05-28 16:05:25 +00:00
|
|
|
%{_libdir}/ocaml/Z3/*.cmx
|
|
|
|
%{_libdir}/ocaml/Z3/*.cmxa
|
|
|
|
%{_libdir}/ocaml/Z3/*.mli
|
2015-04-23 15:09:07 +00:00
|
|
|
|
|
|
|
%files -n python-%{name}
|
|
|
|
%{python2_sitearch}/%{name}/
|
|
|
|
|
|
|
|
%changelog
|
2016-11-10 23:07:47 +00:00
|
|
|
* Tue Nov 8 2016 Jerry James <loganjerry@gmail.com> - 4.5.0-1
|
|
|
|
- New upstream version
|
|
|
|
- All patches except -sse2 have been upstreamed; drop them
|
|
|
|
- Upstream now ships __init__.py; drop our version
|
|
|
|
- Drop all the buildroot tricks; Makefile supports DESTDIR now
|
|
|
|
- Use C.UTF-8 instead of en_US.UTF-8
|
|
|
|
|
2016-11-05 10:21:15 +00:00
|
|
|
* Sat Nov 05 2016 Richard W.M. Jones <rjones@redhat.com> - 4.4.1-8
|
|
|
|
- Rebuild for OCaml 4.04.0.
|
|
|
|
|
2016-07-19 13:15:01 +00:00
|
|
|
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.4.1-7
|
|
|
|
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
|
|
|
|
|
2016-07-13 21:07:47 +00:00
|
|
|
* Wed Jul 13 2016 Jerry James <loganjerry@gmail.com> - 4.4.1-6
|
|
|
|
- Fix Java interface (bz 1353773)
|
|
|
|
|
2016-07-01 01:54:14 +00:00
|
|
|
* Thu Jun 30 2016 Jerry James <loganjerry@gmail.com> - 4.4.1-5
|
|
|
|
- Fix __init__.py (bz 1351580)
|
|
|
|
|
2016-02-05 04:01:44 +00:00
|
|
|
* Fri Feb 05 2016 Fedora Release Engineering <releng@fedoraproject.org> - 4.4.1-4
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
|
|
|
|
|
2016-02-02 23:38:53 +00:00
|
|
|
* Tue Feb 02 2016 Jonathan Wakely <jwakely@redhat.com> - 4.4.1-3
|
|
|
|
- Patched for C++11 compatibility.
|
|
|
|
|
2016-01-21 03:26:48 +00:00
|
|
|
* Wed Jan 20 2016 Jerry James <loganjerry@gmail.com> - 4.4.1-2
|
|
|
|
- Add __init__.py to the python interface (bz 1298429)
|
|
|
|
|
2015-10-09 03:08:13 +00:00
|
|
|
* Thu Oct 8 2015 Jerry James <loganjerry@gmail.com> - 4.4.1-1
|
|
|
|
- New upstream version
|
|
|
|
|
2015-07-28 23:42:05 +00:00
|
|
|
* Tue Jul 28 2015 Richard W.M. Jones <rjones@redhat.com> - 4.4.0-4
|
|
|
|
- OCaml 4.02.3 rebuild.
|
|
|
|
|
2015-06-25 07:30:00 +00:00
|
|
|
* Thu Jun 25 2015 Richard W.M. Jones <rjones@redhat.com> - 4.4.0-3
|
|
|
|
- ocaml-4.02.2 final rebuild.
|
|
|
|
|
2015-06-18 15:17:39 +00:00
|
|
|
* Thu Jun 18 2015 Richard W.M. Jones <rjones@redhat.com> - 4.4.0-2
|
|
|
|
- ocaml-4.02.2 rebuild.
|
|
|
|
|
2015-05-28 16:05:25 +00:00
|
|
|
* Wed May 27 2015 Jerry James <loganjerry@gmail.com> - 4.4.0-1
|
|
|
|
- New upstream version
|
|
|
|
|
2015-04-23 15:09:07 +00:00
|
|
|
* Wed Apr 22 2015 Jerry James <loganjerry@gmail.com> - 4.3.2-3.20150329git.29606b5
|
|
|
|
- Fix issues found on review (bz 1206826)
|
|
|
|
|
|
|
|
* Mon Mar 30 2015 Jerry James <loganjerry@gmail.com> - 4.3.2-2.20150329git.29606b5
|
|
|
|
- Update to latest git HEAD
|
|
|
|
- Include examples in -doc
|
|
|
|
|
|
|
|
* Sat Mar 28 2015 Jerry James <loganjerry@gmail.com> - 4.3.2-1.20150327git.ac21ffe
|
|
|
|
- Initial RPM
|