From 231844b6e59f5551694c82704d3fdc09ff235979 Mon Sep 17 00:00:00 2001 From: Till Hofmann Date: Jul 29 2019 08:40:11 +0000 Subject: Import spec file from COPR timn/clingo --- diff --git a/clingo.spec b/clingo.spec new file mode 100644 index 0000000..8611056 --- /dev/null +++ b/clingo.spec @@ -0,0 +1,159 @@ +Name: clingo +Version: 5.3.0 +Release: 3%{?dist} +Summary: A grounder and solver for logic programs + +License: MIT +URL: https://potassco.org/clingo/ +%global commit a82743f7cc38e62e942be3f83cc4c2d1cc786021 +%global shortcommit %(c=%{commit}; echo ${c:0:7}) +Source0: https://github.com/potassco/clingo/archive/v%{version}/%{name}-%{version}.tar.gz +Patch0: %{name}-5.3.0-fix-exception-by-value.patch +Patch1: %{name}-5.3.0-clasp-disable-class-memaccess-warning.patch + +BuildRequires: gcc-c++, cmake +BuildRequires: bison, re2c + +%description +Clingo is part of the Potassco project for Answer Set Programming +(ASP). ASP offers a simple and powerful modeling language to describe +combinatorial problems as logic programs. The clingo system then takes +such a logic program and computes answer sets representing solutions +to the given problem. + + +%package devel +Summary: Development files for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + +%package -n lua-%{name} +Summary: Lua bindings for Clingo +Requires: %{name}%{?_isa} = %{version}-%{release} +BuildRequires: lua-devel + +%description -n lua-%{name} +Lua bindings for Clingo, a grounder and solver for logic programs. + +Detailed information (including a User's manual), source code, and pre-compiled +binaries are available at: http://potassco.org/ + +%package -n python2-%{name} +Summary: Python 2 bindings for Clingo +Requires: %{name}%{?_isa} = %{version}-%{release} +BuildRequires: python2, python2-devel +%{?python_provide:%python_provide python2-%{name}} + +%description -n python2-%{name} +This module provides functions and classes to work with ground terms and to +control the instantiation process. In clingo builts, additional functions to +control and inspect the solving process are available. + +Functions defined in a python script block are callable during the +instantiation process using @-syntax. The default grounding/solving process can +be customized if a main function is provided. + +Detailed information (including a User's manual), source code, and pre-compiled +binaries are available at: http://potassco.org/ + +%package -n python3-%{name} +Summary: Python 3 bindings for Clingo +Requires: %{name}%{?_isa} = %{version}-%{release} +BuildRequires: python3, python3-devel +%{?python_provide:%python_provide python3-%{name}} + +%description -n python3-%{name} +This module provides functions and classes to work with ground terms and to +control the instantiation process. In clingo builts, additional functions to +control and inspect the solving process are available. + +Functions defined in a python script block are callable during the +instantiation process using @-syntax. The default grounding/solving process can +be customized if a main function is provided. + +Detailed information (including a User's manual), source code, and pre-compiled +binaries are available at: http://potassco.org/ + + +%prep +%setup -q +%patch0 -p1 -b .fix-exception-by-value +cd clasp +%patch1 -p1 -b .disable-class-memaccess-warning +cd .. + + +%build +%cmake \ + -H. \ + -Brelease \ + -DCLINGO_MANAGE_RPATH:BOOL=OFF \ + -DBUILD_SHARED_LIBS:BOOL=OFF \ + -DCLINGO_BUILD_APPS:BOOL=ON \ + -DCLINGO_BUILD_LUA_SHARED:BOOL=ON \ + -DPYTHON_EXECUTABLE=%{__python3} \ + -DCLINGO_BUILD_PY_SHARED:BOOL=ON \ + -DCLINGO_BUILD_SHARED:BOOL=ON \ + -DCLINGO_REQUIRE_PYTHON:BOOL=ON \ + -DPYCLINGO_USER_INSTALL:BOOL=OFF \ + -DLUACLINGO_INSTALL_DIR:PATH=%{lua_libdir} + +%cmake \ + -H. \ + -Bpython2 \ + -DCLINGO_MANAGE_RPATH:BOOL=OFF \ + -DBUILD_SHARED_LIBS:BOOL=OFF \ + -DCLINGO_BUILD_APPS:BOOL=OFF \ + -DCLINGO_BUILD_LUA_SHARED:BOOL=ON \ + -DPYTHON_EXECUTABLE=%{__python2} \ + -DCLINGO_BUILD_PY_SHARED:BOOL=ON \ + -DCLINGO_BUILD_SHARED:BOOL=ON \ + -DCLINGO_REQUIRE_PYTHON:BOOL=ON \ + -DPYCLINGO_USER_INSTALL:BOOL=OFF + +cmake --build release -- %{?_smp_mflags} +cmake --build python2 --target pyclingo -- %{?_smp_mflags} + + +%install +%make_install -C python2 +%make_install -C release + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%doc README.md INSTALL.md +%license LICENSE.md +%{_libdir}/*.so.* +%{_bindir}/* + +%files devel +%{_includedir}/* +%{_libdir}/*.so +%{_libdir}/cmake/Clingo + +%files -n lua-%{name} +%{_libdir}/libluaclingo.so.* +%{lua_libdir}/%{name}.so + +%files -n python2-%{name} +%{python2_sitearch}/%{name}.* + +%files -n python3-%{name} +%{_libdir}/libpyclingo.so.* +%{python3_sitearch}/%{name}.* + +%changelog +* Tue Nov 13 2018 Tim Niemueller - 5.3.0-3 +- build python2 and python3 bindings + +* Tue Nov 13 2018 Tim Niemueller - 5.3.0-2 +- update clasp patch + +* Mon Nov 12 2018 Tim Niemueller - 5.3.0-1 +- Initial package