diff --git a/Z3_cmake_files.tar.gz b/Z3_cmake_files.tar.gz new file mode 100644 index 0000000..4774990 Binary files /dev/null and b/Z3_cmake_files.tar.gz differ diff --git a/z3.spec b/z3.spec index 99d6d68..f64fc48 100644 --- a/z3.spec +++ b/z3.spec @@ -2,12 +2,16 @@ Name: z3 Version: 4.8.8 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Satisfiability Modulo Theories (SMT) solver License: MIT URL: https://github.com/Z3Prover/z3 Source0: https://github.com/Z3Prover/z3/archive/%{name}-%{version}.tar.gz +# Z3 has a build system using CMake. However, it does not support building OCaml bindings yet. +# Therefore, stay with the classical configure and make build and provide the required +# cmake files manually, which allow Z3 to be found by find_package(Z3) +Source1: Z3_cmake_files.tar.gz BuildRequires: doxygen BuildRequires: gcc-c++ @@ -85,7 +89,8 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release} Python 3 interface to z3. %prep -%autosetup -p1 -n %{name}-%{name}-%{version} +# Unpack Source1 too, using -a 1 +%autosetup -p1 -n %{name}-%{name}-%{version} -a 1 # Install python objects into the right place, enable verbose builds, use # Fedora CFLAGS, preserve timestamps when installing, include the entire @@ -113,6 +118,18 @@ 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 +# Prepare the cmake files +sed -i -e 's/@CMAKE_INSTALL_LIBDIR@/%{_lib}/g' \ + -e 's/@VERSION@/%{version}/g' \ + -e 's/@Z3_VERSION_MAJOR@/%(echo %{version} | cut -d. -f1)/g' \ + -e 's/@Z3_VERSION_MINOR@/%(echo %{version} | cut -d. -f2)/g' \ + -e 's/@Z3_VERSION_PATCH@/%(echo %{version} | cut -d. -f3)/g' \ + ./Z3_cmake_files/* +%if 0%{__isa_bits} == 32 +# Adjust Z3ConfigVersion.cmake in case of 32-bit builds +sed -i 's/\"8/\"4/g' ./Z3_cmake_files/Z3ConfigVersion.cmake +%endif + %build export CXXFLAGS="$RPM_OPT_FLAGS" export LANG="C.UTF-8" @@ -167,6 +184,10 @@ mv %{buildroot}%{_prefix}/lib/*.jar %{buildroot}%{_jnidir} ln -s %{_jnidir}/com.microsoft.z3.jar %{buildroot}%{_libdir}/%{name} mv %{buildroot}%{_prefix}/lib/lib%{name}java.so %{buildroot}%{_libdir}/%{name} +# Install the provided cmake files +mkdir -p %{buildroot}%{_libdir}/cmake/%{name}/ +install -D -m 644 Z3_cmake_files/Z3*.cmake %{buildroot}%{_libdir}/cmake/%{name}/ + #%%check # Some of the tests require more memory than the koji builders have available. # @@ -187,6 +208,7 @@ mv %{buildroot}%{_prefix}/lib/lib%{name}java.so %{buildroot}%{_libdir}/%{name} %files devel %{_includedir}/%{name}/ %{_libdir}/lib%{name}.so +%{_libdir}/cmake/%{name}/ %files doc %doc doc/api/html examples @@ -214,6 +236,9 @@ mv %{buildroot}%{_prefix}/lib/lib%{name}java.so %{buildroot}%{_libdir}/%{name} %{python3_sitearch}/%{name}/ %changelog +* Thu May 14 2020 Wolfgang Stöggl - 4.8.8-2 +- Add Z3 cmake files required by find_package(Z3) + * Sat May 9 2020 Jerry James - 4.8.8-1 - Version 4.8.8 - Drop all patches; all have been upstreamed