diff --git a/4ti2-docdir.diff b/4ti2-docdir.diff index c23a410..6304003 100644 --- a/4ti2-docdir.diff +++ b/4ti2-docdir.diff @@ -6,19 +6,16 @@ Subject: [PATCH] build: stop misplacing documentation docdir must not be statically set as it would override what the user gave to ./configure --docdir=... --- - doc/Makefile.am | 2 -- + doc/Makefile.am | 2 -- 1 file changed, 2 deletions(-) -diff --git a/doc/Makefile.am b/doc/Makefile.am -index 78abbd6..ea73e88 100644 ---- a/doc/Makefile.am -+++ b/doc/Makefile.am +Index: 4ti2-1.6.9/doc/Makefile.am +=================================================================== +--- 4ti2-1.6.9.orig/doc/Makefile.am ++++ 4ti2-1.6.9/doc/Makefile.am @@ -1,5 +1,3 @@ -docdir = $(pkgdatadir)/doc - doc_DATA = 4ti2_manual.pdf ## Manual sources. --- -2.19.0 - diff --git a/4ti2-handle-prefix.patch b/4ti2-handle-prefix.patch index 264cc56..73cdf47 100644 --- a/4ti2-handle-prefix.patch +++ b/4ti2-handle-prefix.patch @@ -1,5 +1,27 @@ ---- a/src/groebner/script.template.in -+++ b/src/groebner/script.template.in +From 0d4518dbcf9321df4d8cad6e97e562f34f7d31f4 Mon Sep 17 00:00:00 2001 +From: Alois Wohlschlager +Date: Thu, 1 Jul 2021 14:37:06 +0000 +Subject: [PATCH] scripts: apply realpath for $0 +References: https://github.com/4ti2/4ti2/pull/31 + +When $0 is a symlink, program execution would fail to find the right +directory. Fix that up. + +The 4ti2 program names are quite generic (e.g. "output"), and hence +openSUSE has relegated them to /usr/libexec/4ti2, offering instead +prefixed symlinks in /usr/bin, e.g. /usr/bin/4ti2_groebner -> +/usr/libexec/4ti2/groebner. +--- + src/groebner/script.template | 2 +- + src/groebner/script.template.in | 2 +- + src/zsolve/graver.template | 2 +- + src/zsolve/hilbert.template | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +Index: 4ti2-1.6.9/src/groebner/script.template +=================================================================== +--- 4ti2-1.6.9.orig/src/groebner/script.template ++++ 4ti2-1.6.9/src/groebner/script.template @@ -21,7 +21,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -9,8 +31,23 @@ DIR=`dirname "$SCRIPT"` FUNCTION=`basename "$SCRIPT"` ---- a/src/zsolve/graver.template -+++ b/src/zsolve/graver.template +Index: 4ti2-1.6.9/src/groebner/script.template.in +=================================================================== +--- 4ti2-1.6.9.orig/src/groebner/script.template.in ++++ 4ti2-1.6.9/src/groebner/script.template.in +@@ -21,7 +21,7 @@ + # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + # We locate where this script is so we can call the executables. +-SCRIPT=`which "$0"` ++SCRIPT=$(realpath $(which "$0")) + DIR=`dirname "$SCRIPT"` + FUNCTION=`basename "$SCRIPT"` + +Index: 4ti2-1.6.9/src/zsolve/graver.template +=================================================================== +--- 4ti2-1.6.9.orig/src/zsolve/graver.template ++++ 4ti2-1.6.9/src/zsolve/graver.template @@ -2,7 +2,7 @@ # We locate where this script is so we can call the executable zsolve which @@ -20,8 +57,10 @@ SCRIPTDIR=`dirname "$SCRIPT"` EXECUTABLE=zsolve ---- a/src/zsolve/hilbert.template -+++ b/src/zsolve/hilbert.template +Index: 4ti2-1.6.9/src/zsolve/hilbert.template +=================================================================== +--- 4ti2-1.6.9.orig/src/zsolve/hilbert.template ++++ 4ti2-1.6.9/src/zsolve/hilbert.template @@ -2,7 +2,7 @@ # We locate where this script is so we can call the executable zsolve which diff --git a/4ti2.changes b/4ti2.changes index 1ab5cc7..e317f01 100644 --- a/4ti2.changes +++ b/4ti2.changes @@ -1,7 +1,13 @@ +------------------------------------------------------------------- +Thu Jul 1 20:03:41 UTC 2021 - Jan Engelhardt + +- Run fdupes to eliminate script copies. + ------------------------------------------------------------------- Thu Jul 1 13:39:30 UTC 2021 - Alois Wohlschlager -- Add patch to handle the downstream 4ti2_ executable prefix in wrapper scripts +- Add patch 4ti2-handle-prefix.patch to handle the downstream + 4ti2_ executable prefix in wrapper scripts. ------------------------------------------------------------------- Sat Aug 24 15:47:19 UTC 2019 - Jan Engelhardt diff --git a/4ti2.spec b/4ti2.spec index f4acb80..b2e6cc7 100644 --- a/4ti2.spec +++ b/4ti2.spec @@ -26,10 +26,10 @@ URL: https://4ti2.github.io/ Source: https://github.com/4ti2/4ti2/releases/download/Release_1_6_9/4ti2-1.6.9.tar.gz Patch1: 4ti2-docdir.diff -# PATCH-FIX-OPENSUSE handle our downstream 4ti2_ executable prefix in the wrapper scripts Patch2: 4ti2-handle-prefix.patch BuildRequires: autoconf >= 2.59 BuildRequires: automake +BuildRequires: fdupes BuildRequires: gcc-c++ >= 4.3 BuildRequires: glpk-devel >= 4.52 BuildRequires: gmp-devel >= 4.1.4 @@ -75,7 +75,7 @@ developing against 4ti2's libraries. autoreconf -fi %configure --enable-shared --disable-static \ --includedir="%_includedir/%name" --docdir="%_docdir/%name" -make %{?_smp_mflags} +%make_build %install %make_install @@ -87,6 +87,7 @@ pushd "$b/%_libexecdir/%name" for i in *; do ln -s "%_libexecdir/%name/$i" "$b/%_bindir/4ti2_$i" done +%fdupes -s %buildroot/%_prefix %post -n lib4ti2-0 -p /sbin/ldconfig %postun -n lib4ti2-0 -p /sbin/ldconfig