f7a023c
# NOTE: upstream does not make releases and has no version numbering scheme.
f7a023c
# We check the code out of git and use the date of the last commit as the
96d1407
# version number.
f7a023c
%global owner    CVC4
faaaccf
%global gittag   15f53d6feb84e4ddb41deaf2b5630f5c1303b06d
f7a023c
%global shorttag %(cut -b -7 <<< %{gittag})
96d1407
96d1407
Name:           lfsc
faaaccf
Version:        0.20210305
2e66715
Release:        4%{?dist}
96d1407
Summary:        SMT proof checker
96d1407
96d1407
License:        BSD
f7a023c
URL:            https://github.com/%{owner}/LFSC
f7a023c
Source0:        https://github.com/%{owner}/LFSC/archive/%{gittag}/%{name}-%{shorttag}.tar.gz
96d1407
# The next few sources contain commonly used proof definitions
dd65b92
Source1:        http://clc.cs.uiowa.edu/lfsc/euf_interpolation.plf
f7a023c
Source2:        http://clc.cs.uiowa.edu/lfsc/sat.plf
f7a023c
Source3:        http://clc.cs.uiowa.edu/lfsc/smt.plf
f7a023c
Source4:        http://clc.cs.uiowa.edu/lfsc/th_base.plf
f7a023c
Source5:        http://clc.cs.uiowa.edu/lfsc/th_real.plf
f7a023c
Source6:        http://clc.cs.uiowa.edu/lfsc/th_lra.plf
f7a023c
Source7:        http://clc.cs.uiowa.edu/lfsc/th_lra-cvc3.plf
f7a023c
Source8:        http://clc.cs.uiowa.edu/lfsc/color_base.plf
f7a023c
Source9:        http://clc.cs.uiowa.edu/lfsc/color_euf.plf
14d870d
# Use std::unordered_map instead of the deprecated __gnu_cxx::hash_map
14d870d
Patch0:         %{name}-map.patch
f7a023c
f7a023c
BuildRequires:  cmake
0303727
BuildRequires:  flex
f7a023c
BuildRequires:  gcc-c++
96d1407
BuildRequires:  gmp-devel
430af6b
BuildRequires:  help2man
7cf9996
BuildRequires:  make
df78c43
BuildRequires:  python3
96d1407
96d1407
%description
96d1407
This package contains an SMT proof checker.
96d1407
96d1407
%package devel
96d1407
Summary:        Files needed to compile side conditions
96d1407
Requires:       %{name}%{?_isa} = %{version}-%{release}
96d1407
96d1407
%description devel
96d1407
This package contains the files needed to compile a version of %{name} that
96d1407
can execute a side condition.
96d1407
96d1407
%prep
14d870d
%autosetup -p0 -n LFSC-%{gittag}
96d1407
da3efcc
# We want to know about use of deprecated interfaces
da3efcc
sed -i '/Wno-deprecated/d' CMakeLists.txt
96d1407
f7a023c
# Build a shared library instead of a static library, and give it an soname
f7a023c
sed -e 's/STATIC/SHARED/' \
430af6b
    -e '/^[[:blank:]]*OUTPUT_NAME lfscc/i\  VERSION 0.0.0\n  SOVERSION 0' \
f7a023c
    -e 's/ARCHIVE DESTINATION/LIBRARY DESTINATION/' \
430af6b
    -e '/^set_target_properties/iTARGET_LINK_LIBRARIES(liblfscc gmp)' \
f7a023c
    -i src/CMakeLists.txt
96d1407
f7a023c
# Fix the library install path
f7a023c
if [ "%{_lib}" = "lib64" ]; then
f7a023c
  sed -i 's,/lib,/lib64,' src/CMakeLists.txt
f7a023c
fi
96d1407
dd65b92
# Fix the test script
0303727
sed -i 's,%{_bindir}/env python,%{python3},' tests/run_test.py
dd65b92
f7a023c
%build
07966a5
%cmake
07966a5
%cmake_build
96d1407
f7a023c
%install
07966a5
%cmake_install
96d1407
96d1407
# Install the proof files
96d1407
mkdir -p %{buildroot}%{_datadir}/%{name}
dd65b92
cp -p %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} \
dd65b92
   %{SOURCE7} %{SOURCE8} %{SOURCE9} %{buildroot}%{_datadir}/%{name}
96d1407
430af6b
# Generate a man page
0303727
cd %{_vpath_builddir}/src
430af6b
mkdir -p %{buildroot}%{_mandir}/man1
430af6b
export LD_LIBRARY_PATH=$PWD
430af6b
help2man -N --version-string=%{version} ./lfscc > \
430af6b
  %{buildroot}%{_mandir}/man1/lfscc.1
430af6b
# Fix line breaks in the man page
430af6b
sed -i 's/\\fB/.TP\n&/;s/\\fR: /\\fR\n/' %{buildroot}%{_mandir}/man1/lfscc.1
0303727
0303727
# Help the debuginfo generator
0303727
cp -p ../../src/lexer.flex .
430af6b
cd -
430af6b
96d1407
%check
07966a5
%ctest
96d1407
96d1407
%files
f7a023c
%license COPYING
f7a023c
%doc AUTHORS README.md
f7a023c
%{_bindir}/lfscc
96d1407
%{_datadir}/%{name}/
f7a023c
%{_libdir}/liblfscc.so.*
430af6b
%{_mandir}/man1/lfscc.1*
96d1407
96d1407
%files devel
f7a023c
%{_includedir}/lfscc.h
f7a023c
%{_libdir}/liblfscc.so
96d1407
96d1407
%changelog
2e66715
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.20210305-4
2e66715
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
2e66715
9df4ba1
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.20210305-3
9df4ba1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
9df4ba1
e1febea
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.20210305-2
e1febea
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
e1febea
faaaccf
* Sat Jul 17 2021 Jerry James <loganjerry@gmail.com> - 0.20210305-1
faaaccf
- Update to 20210305 git snapshot
faaaccf
83a4436
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.20201110-2
83a4436
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
83a4436
da3efcc
* Tue Jan 19 2021 Jerry James <loganjerry@gmail.com> - 0.20201110-1
da3efcc
- Update to 20201110 snapshot
da3efcc
0303727
* Mon Aug 24 2020 Jerry James <loganjerry@gmail.com> - 0.20200815-1
0303727
- Update to 20200815 git snapshot
0303727
5921362
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.20200719-2
5921362
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
5921362
07966a5
* Sat Jul 25 2020 Jerry James <loganjerry@gmail.com> - 0.20200719-1
07966a5
- Update to 20200719 git snapshot
07966a5
- Adapt to cmake changes in Rawhide
07966a5
430af6b
* Thu Mar  5 2020 Jerry James <loganjerry@gmail.com> - 0.20200115-1
430af6b
- Update to latest git snapshot
430af6b
- Link the library with gmp
430af6b
- Generate a man page for the binary with help2man
430af6b
24e785c
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.20190808-2
24e785c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
24e785c
df78c43
* Mon Sep  9 2019 Jerry James <loganjerry@gmail.com> - 0.20190808-1
df78c43
- Update to latest git snapshot
df78c43
2343581
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.20190226-2
2343581
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
2343581
0a96d94
* Wed Jun 12 2019 Jerry James <loganjerry@gmail.com> - 0.20190226-1
0a96d94
- Update to latest git snapshot
0a96d94
14d870d
* Thu Feb  7 2019 Jerry James <loganjerry@gmail.com> - 0.20190113-1
14d870d
- Update to latest git snapshot for identifier bug fix
14d870d
- Add -map patch to fix use of deprecated interface
14d870d
214150e
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.20181122-2
214150e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
214150e
dd65b92
* Mon Nov 26 2018 Jerry James <loganjerry@gmail.com> - 0.20181122-1
dd65b92
- Update to latest git snapshot for 2 bug fixes
dd65b92
- Use upstream's new test suite
dd65b92
a384adc
* Wed Nov  7 2018 Jerry James <loganjerry@gmail.com> - 0.20181029-1
a384adc
- Update to latest git snapshot
a384adc
7da6977
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.20180322-2
7da6977
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
7da6977
f7a023c
* Thu Jul  5 2018 Jerry James <loganjerry@gmail.com> - 0.20180322-1
f7a023c
- Initial RPM (unretired)