From 322d945d9a31961b32c3176ee528f87ca128d236 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Tue, 17 Oct 2017 20:59:40 -0600 Subject: [PATCH] Link rather than copy the normaliz binary. Also, fix accidental replacement of factory symlink with a directory. --- Macaulay2.spec | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/Macaulay2.spec b/Macaulay2.spec index 9943792..23a9b18 100644 --- a/Macaulay2.spec +++ b/Macaulay2.spec @@ -35,7 +35,7 @@ Summary: System for algebraic geometry and commutative algebra Name: Macaulay2 Version: 1.9.2 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2 or GPLv3 URL: http://macaulay2.com/ @@ -279,8 +279,8 @@ sed -i 's/\(libm[[:alpha:]]*\)\.a/\1.so/' Macaulay2/bin/Makefile.in %patch7 -p1 -b .mpir %endif # factory-gftables symlink -mkdir -p BUILD/%{_target_platform}/usr-dist/common/share/Macaulay2/Core/factory -ln -s %{_datadir}/factory/gftables \ +mkdir -p BUILD/%{_target_platform}/usr-dist/common/share/Macaulay2/Core +ln -s %{_datadir}/factory \ BUILD/%{_target_platform}/usr-dist/common/share/Macaulay2/Core/factory %patch8 -p1 -b .gtest %patch9 -p1 -b .givaro @@ -358,6 +358,11 @@ find BUILD/%{_target_platform}/ -name *.errors -execdir echo {} \; -execdir cat %install make install -C BUILD/%{_target_platform} DESTDIR=%{buildroot} IgnoreExampleErrors=true +# link, don't copy, the normaliz binary +normaliz_bin=$(ls -1 %{buildroot}%{_libexecdir}/Macaulay2/*Linux*/normaliz) +rm -f $normaliz_bin +ln -s %{_bindir}/normaliz $normaliz_bin + # app img install -p -m644 -D %{SOURCE10} \ %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/Macaulay2.png @@ -395,6 +400,24 @@ LDFLAGS="$RPM_LD_FLAGS" \ time make -k check -C BUILD/%{_target_platform} Verbose=true ||: +# This script deals with accidental replacement of the factory symlink with +# a directory. Once F26 has reached EOL, this can be removed. +%pretrans -p +path = "%{_datadir}/Macaulay2/Core/factory" +st = posix.stat(path) +if st and st.type == "directory" then + status = os.rename(path, path .. ".rpmmoved") + if not status then + suffix = 0 + while not status do + suffix = suffix + 1 + status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix) + end + os.rename(path, path .. ".rpmmoved") + end +end + + %post touch --no-create %{_datadir}/icons/hicolor ||: for info_file in %{INFO_FILES} @@ -439,7 +462,11 @@ gtk-update-icon-cache -q %{_datadir}/icons/hicolor > /dev/null 2>&1 ||: %changelog -* Wed Apr 5 2017 Jerry James -1.9.2-1 +* Tue Oct 17 2017 Jerry James - 1.9.2-2 +- Link rather than copy the normaliz binary +- Fix accidental replacement of factory symlink with a directory + +* Wed Apr 5 2017 Jerry James - 1.9.2-1 - Macaulay2-1.9.2 - Drop upstreamed patches: -disable_broken_debug_functions, -gc, -rpath, -rh_configure_hack