From 582cf8602f4e3e0658827c116f87a16967a7a6ac Mon Sep 17 00:00:00 2001 From: Christoph Karl Date: Jan 07 2021 17:42:17 +0000 Subject: [PATCH 1/4] Revive with version 0.2.10 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d5b7aec --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/pyswip-0.2.10.tar.gz diff --git a/dead.package b/dead.package deleted file mode 100644 index d078a6c..0000000 --- a/dead.package +++ /dev/null @@ -1 +0,0 @@ -SWI Prolog (package pl) has been retired from Fedora, this package provided Python bindings for SWI Prolog. diff --git a/python-pyswip.spec b/python-pyswip.spec new file mode 100644 index 0000000..1f53c02 --- /dev/null +++ b/python-pyswip.spec @@ -0,0 +1,97 @@ +%global srcname pyswip + +Name: python-%{srcname} +Version: 0.2.10 +Release: 1%{?dist} +Summary: Python-SWI-Prolog bridge + +License: MIT +URL: https://github.com/yuce/pyswip +Source0: https://github.com/yuce/pyswip/archive/v%{version}/%{srcname}-%{version}.tar.gz + +BuildArch: noarch +BuildRequires: pl-devel +BuildRequires: python3-devel +BuildRequires: python3-pytest + +%description +PySWIP is a Python - SWI-Prolog bridge enabling to query SWI-Prolog in your +Python programs. It features an (incomplete) SWI-Prolog foreign language +interface, a utility class that makes it easy querying with Prolog and also a +Pythonic interface. + + +%package -n python3-%{srcname} +Summary: %summary +# we need to require pl-devel because pyswip uses the unversioned libswipl.so +Requires: pl-devel +%{?python_provide:%python_provide python3-%{srcname}} + +%description -n python3-%{srcname} +PySWIP is a Python - SWI-Prolog bridge enabling to query SWI-Prolog in your +Python programs. It features an (incomplete) SWI-Prolog foreign language +interface, a utility class that makes it easy querying with Prolog and also a +Pythonic interface. + + +%prep +%autosetup -n %{srcname}-%{version} + + +%build +%py3_build + + +%install +%py3_install + + +#%check +#pytest-3 tests + +%files -n python3-%{srcname} +%license LICENSE +%doc README.md CHANGELOG.md +%{python3_sitelib}/%{srcname} +%{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info + + +%changelog +* Thu Jan 07 2021 Christoph Karl - 0.2.10 +- Revive with version 0.2.10 + +* Sat Feb 02 2019 Fedora Release Engineering - 0.2.7-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Mon Sep 24 2018 Till Hofmann - 0.2.7-4 +- Remove python2 subpackage + +* Sat Jul 14 2018 Fedora Release Engineering - 0.2.7-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Tue Jun 19 2018 Miro HronĨok - 0.2.7-2 +- Rebuilt for Python 3.7 + +* Sat Jun 09 2018 Till Hofmann - 0.2.7-1 +- Update to 0.2.7 + +* Mon Jun 04 2018 Till Hofmann - 0.2.6-1 +- Update to 0.2.6 + +* Fri May 25 2018 Till Hofmann - 0.2.5-1 +- Update to 0.2.5 + +* Fri Feb 09 2018 Fedora Release Engineering - 0.2.3-5.git72771d9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Fri Feb 09 2018 Igor Gnatenko - 0.2.3-4.git72771d9 +- Escape macros in %%changelog + +* Thu Jul 27 2017 Fedora Release Engineering - 0.2.3-3.git72771d9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Mon Mar 13 2017 Till Hofmann - 0.2.3-2.git72771d9 +- Don't glob %%{python_sitelib}/* but add files separately instead + +* Sun Jan 15 2017 Till Hofmann - 0.2.3-1.git72771d9 +- Initial package diff --git a/sources b/sources new file mode 100644 index 0000000..2adad85 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (pyswip-0.2.10.tar.gz) = 1732ca35960ce742a83e0191dfc38563f2773d933c0213adec87adc22c6071e51daa8dbf31705422bae9d0c8dc844180d79226b3271ceb0029910afb208c4af7 From 01a2b8e89d7ea0e86a903ecf238895001f4c63df Mon Sep 17 00:00:00 2001 From: Christoph Karl Date: Jan 07 2021 19:30:21 +0000 Subject: [PATCH 2/4] Fix testcase --- diff --git a/fix-test.patch b/fix-test.patch new file mode 100644 index 0000000..05346f8 --- /dev/null +++ b/fix-test.patch @@ -0,0 +1,36 @@ +diff -rupN pyswip-0.2.10.orig/examples/draughts/puzzle1.pl pyswip-0.2.10/examples/draughts/puzzle1.pl +--- pyswip-0.2.10.orig/examples/draughts/puzzle1.pl 2021-01-07 20:14:09.838908055 +0100 ++++ pyswip-0.2.10/examples/draughts/puzzle1.pl 2021-01-07 20:14:59.215159724 +0100 +@@ -4,7 +4,7 @@ + + solve(Board) :- + Board = [NW,N,NE,W,E,SW,S,SE], +- Board in 0..12, ++ Board ins 0..12, + sum(Board, #=, 12), + NW + N + NE #= 5, + NE + E + SE #= 5, +diff -rupN pyswip-0.2.10.orig/examples/sendmoremoney/money.pl pyswip-0.2.10/examples/sendmoremoney/money.pl +--- pyswip-0.2.10.orig/examples/sendmoremoney/money.pl 2021-01-07 20:14:09.839908060 +0100 ++++ pyswip-0.2.10/examples/sendmoremoney/money.pl 2021-01-07 20:15:22.428278039 +0100 +@@ -6,7 +6,7 @@ + + sendmore(Digits) :- + Digits = [S,E,N,D,M,O,R,Y], % Create variables +- Digits in 0..9, % Associate domains to variables ++ Digits ins 0..9, % Associate domains to variables + S #\= 0, % Constraint: S must be different from 0 + M #\= 0, + all_different(Digits), % all the elements must take different values +diff -rupN pyswip-0.2.10.orig/examples/sudoku/sudoku.pl pyswip-0.2.10/examples/sudoku/sudoku.pl +--- pyswip-0.2.10.orig/examples/sudoku/sudoku.pl 2021-01-07 20:26:31.853690017 +0100 ++++ pyswip-0.2.10/examples/sudoku/sudoku.pl 2021-01-07 20:26:47.637770465 +0100 +@@ -8,7 +8,7 @@ + + sudoku(Pss) :- + flatten(Pss, Ps), +- Ps in 1..9, ++ Ps ins 1..9, + maplist(all_different, Pss), + Pss = [R1,R2,R3,R4,R5,R6,R7,R8,R9], + columns(R1, R2, R3, R4, R5, R6, R7, R8, R9), diff --git a/python-pyswip.spec b/python-pyswip.spec index 1f53c02..e07d174 100644 --- a/python-pyswip.spec +++ b/python-pyswip.spec @@ -9,6 +9,9 @@ License: MIT URL: https://github.com/yuce/pyswip Source0: https://github.com/yuce/pyswip/archive/v%{version}/%{srcname}-%{version}.tar.gz +# Fix two testcases +Patch0: fix-test.patch + BuildArch: noarch BuildRequires: pl-devel BuildRequires: python3-devel @@ -35,7 +38,7 @@ Pythonic interface. %prep -%autosetup -n %{srcname}-%{version} +%autosetup -n %{srcname}-%{version} -p1 %build @@ -46,8 +49,8 @@ Pythonic interface. %py3_install -#%check -#pytest-3 tests +%check +pytest-3 tests %files -n python3-%{srcname} %license LICENSE From 2ade8a3ad9d891df5d6c38ac3c01e03774f3f5a1 Mon Sep 17 00:00:00 2001 From: Christoph Karl Date: Jan 08 2021 06:05:45 +0000 Subject: [PATCH 3/4] Roll back: Fix testcase --- diff --git a/fix-test.patch b/fix-test.patch deleted file mode 100644 index 05346f8..0000000 --- a/fix-test.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff -rupN pyswip-0.2.10.orig/examples/draughts/puzzle1.pl pyswip-0.2.10/examples/draughts/puzzle1.pl ---- pyswip-0.2.10.orig/examples/draughts/puzzle1.pl 2021-01-07 20:14:09.838908055 +0100 -+++ pyswip-0.2.10/examples/draughts/puzzle1.pl 2021-01-07 20:14:59.215159724 +0100 -@@ -4,7 +4,7 @@ - - solve(Board) :- - Board = [NW,N,NE,W,E,SW,S,SE], -- Board in 0..12, -+ Board ins 0..12, - sum(Board, #=, 12), - NW + N + NE #= 5, - NE + E + SE #= 5, -diff -rupN pyswip-0.2.10.orig/examples/sendmoremoney/money.pl pyswip-0.2.10/examples/sendmoremoney/money.pl ---- pyswip-0.2.10.orig/examples/sendmoremoney/money.pl 2021-01-07 20:14:09.839908060 +0100 -+++ pyswip-0.2.10/examples/sendmoremoney/money.pl 2021-01-07 20:15:22.428278039 +0100 -@@ -6,7 +6,7 @@ - - sendmore(Digits) :- - Digits = [S,E,N,D,M,O,R,Y], % Create variables -- Digits in 0..9, % Associate domains to variables -+ Digits ins 0..9, % Associate domains to variables - S #\= 0, % Constraint: S must be different from 0 - M #\= 0, - all_different(Digits), % all the elements must take different values -diff -rupN pyswip-0.2.10.orig/examples/sudoku/sudoku.pl pyswip-0.2.10/examples/sudoku/sudoku.pl ---- pyswip-0.2.10.orig/examples/sudoku/sudoku.pl 2021-01-07 20:26:31.853690017 +0100 -+++ pyswip-0.2.10/examples/sudoku/sudoku.pl 2021-01-07 20:26:47.637770465 +0100 -@@ -8,7 +8,7 @@ - - sudoku(Pss) :- - flatten(Pss, Ps), -- Ps in 1..9, -+ Ps ins 1..9, - maplist(all_different, Pss), - Pss = [R1,R2,R3,R4,R5,R6,R7,R8,R9], - columns(R1, R2, R3, R4, R5, R6, R7, R8, R9), diff --git a/python-pyswip.spec b/python-pyswip.spec index e07d174..1a6dcee 100644 --- a/python-pyswip.spec +++ b/python-pyswip.spec @@ -9,9 +9,6 @@ License: MIT URL: https://github.com/yuce/pyswip Source0: https://github.com/yuce/pyswip/archive/v%{version}/%{srcname}-%{version}.tar.gz -# Fix two testcases -Patch0: fix-test.patch - BuildArch: noarch BuildRequires: pl-devel BuildRequires: python3-devel From 3ab24313c5f0dbfa2c4cad584513ae32a85a69a2 Mon Sep 17 00:00:00 2001 From: Christoph Karl Date: Jan 09 2021 08:58:04 +0000 Subject: [PATCH 4/4] Remove not needed provides Remove -p1 from autosetup --- diff --git a/python-pyswip.spec b/python-pyswip.spec index 1a6dcee..74b241c 100644 --- a/python-pyswip.spec +++ b/python-pyswip.spec @@ -25,7 +25,6 @@ Pythonic interface. Summary: %summary # we need to require pl-devel because pyswip uses the unversioned libswipl.so Requires: pl-devel -%{?python_provide:%python_provide python3-%{srcname}} %description -n python3-%{srcname} PySWIP is a Python - SWI-Prolog bridge enabling to query SWI-Prolog in your @@ -35,7 +34,7 @@ Pythonic interface. %prep -%autosetup -n %{srcname}-%{version} -p1 +%autosetup -n %{srcname}-%{version} %build