|
@@ -4,7 +4,7 @@
|
|
|
%global stock_tarball 1
|
|
|
|
|
|
%global gcc_version 4.4.5
|
|
|
-%global gcc_release 3%{?_dist_release}
|
|
|
+%global gcc_release 5%{?_dist_release}
|
|
|
%global _unpackaged_files_terminate_build 0
|
|
|
%global multilib_64_archs sparc64 ppc64 s390x x86_64
|
|
|
##VINE## I only have ppc32 arch machines at the moment...
|
|
@@ -1632,10 +1632,7 @@ fi
|
|
|
|
|
|
%postun -n libgcj
|
|
|
/sbin/ldconfig
|
|
|
-if [ $1 = 0 ]; then
|
|
|
- /sbin/update-alternatives --remove gij %{_bindir}/gij-%{gcc_version}
|
|
|
- /sbin/update-alternatives --auto gij
|
|
|
-fi
|
|
|
+/sbin/update-alternatives --remove gij %{_bindir}/gij-%{gcc_version}
|
|
|
|
|
|
|
|
|
%post
|
|
@@ -1674,10 +1671,7 @@ if [ ! -f %{_bindir}/gcc ] ; then
|
|
|
fi
|
|
|
|
|
|
%postun
|
|
|
-if [ $1 = 0 ]; then
|
|
|
- /sbin/update-alternatives --remove gcc %{_bindir}/gcc-%{gcc_version}
|
|
|
- /sbin/update-alternatives --auto gcc
|
|
|
-fi
|
|
|
+/sbin/update-alternatives --remove gcc %{_bindir}/gcc-%{gcc_version}
|
|
|
|
|
|
|
|
|
%post c++
|
|
@@ -1698,10 +1692,7 @@ if [ ! -f %{_bindir}/g++ ] ; then
|
|
|
fi
|
|
|
|
|
|
%postun c++
|
|
|
-if [ $1 = 0 ]; then
|
|
|
- /sbin/update-alternatives --remove g++ %{_bindir}/g++-%{gcc_version}
|
|
|
- /sbin/update-alternatives --auto g++
|
|
|
-fi
|
|
|
+/sbin/update-alternatives --remove g++ %{_bindir}/g++-%{gcc_version}
|
|
|
|
|
|
|
|
|
%post cpp
|
|
@@ -1716,16 +1707,13 @@ if [ ! -f %{_bindir}/cpp ] ; then
|
|
|
fi
|
|
|
|
|
|
%postun cpp
|
|
|
-if [ $1 = 0 ]; then
|
|
|
- /sbin/update-alternatives --remove cpp %{_bindir}/cpp-%{gcc_version}
|
|
|
- /sbin/update-alternatives --auto cpp
|
|
|
-fi
|
|
|
+/sbin/update-alternatives --remove cpp %{_bindir}/cpp-%{gcc_version}
|
|
|
|
|
|
|
|
|
%post gfortran
|
|
|
/sbin/update-alternatives \
|
|
|
--install %{_bindir}/gfortran gfortran %{_bindir}/gfortran-%{gcc_version} 30 \
|
|
|
- --slave %{_bindir}/f95 f95 %{_bindir}/g95-%{gcc_version} \
|
|
|
+ --slave %{_bindir}/f95 f95 %{_bindir}/gfortran-%{gcc_version} \
|
|
|
--slave %{_bindir}/%{gcc_target_platform}-gfortran \
|
|
|
%{gcc_target_platform}-gfortran \
|
|
|
%{_bindir}/%{gcc_target_platform}-gfortran-%{gcc_version}
|
|
@@ -1737,10 +1725,7 @@ if [ ! -f %{_bindir}/gfortran ] ; then
|
|
|
fi
|
|
|
|
|
|
%postun gfortran
|
|
|
-if [ $1 = 0 ]; then
|
|
|
- /sbin/update-alternatives --remove gfortran %{_bindir}/gfortran-%{gcc_version}
|
|
|
- /sbin/update-alternatives --auto gfortran
|
|
|
-fi
|
|
|
+/sbin/update-alternatives --remove gfortran %{_bindir}/gfortran-%{gcc_version}
|
|
|
|
|
|
%post gnat
|
|
|
/sbin/update-alternatives \
|
|
@@ -1765,10 +1750,7 @@ if [ ! -f %{_bindir}/gnat ] ; then
|
|
|
fi
|
|
|
|
|
|
%postun gnat
|
|
|
-if [ $1 = 0 ]; then
|
|
|
- /sbin/update-alternatives --remove gnat %{_bindir}/gnat-%{gcc_version}
|
|
|
- /sbin/update-alternatives --auto gnat
|
|
|
-fi
|
|
|
+/sbin/update-alternatives --remove gnat %{_bindir}/gnat-%{gcc_version}
|
|
|
|
|
|
%post java
|
|
|
/sbin/update-alternatives \
|
|
@@ -1787,10 +1769,7 @@ if [ ! -f %{_bindir}/gcj ] ; then
|
|
|
fi
|
|
|
|
|
|
%postun java
|
|
|
-if [ $1 = 0 ]; then
|
|
|
- /sbin/update-alternatives --remove gcj %{_bindir}/gcj-%{gcc_version}
|
|
|
- /sbin/update-alternatives --auto gcj
|
|
|
-fi
|
|
|
+/sbin/update-alternatives --remove gcj %{_bindir}/gcj-%{gcc_version}
|
|
|
|
|
|
%post -n libgfortran -p /sbin/ldconfig
|
|
|
|
|
@@ -1838,6 +1817,63 @@ if [ $1 = 0 ] ; then
|
|
|
done
|
|
|
fi
|
|
|
|
|
|
+
|
|
|
+%triggerpostun -- gcc < 4.4.5-4
|
|
|
+if ( readlink %{_bindir}/gcc > /dev/null ); then
|
|
|
+ if ! ( readlink -e %{_bindir}/gcc > /dev/null ); then
|
|
|
+ echo " broken alternatives link detected, try to fix it..."
|
|
|
+ /sbin/update-alternatives --remove gcc `/usr/bin/readlink -m %{_bindir}/gcc` > /dev/null 2>&1 ||:
|
|
|
+ fi
|
|
|
+fi
|
|
|
+
|
|
|
+%triggerpostun -- gcc-c++ < 4.4.5-4
|
|
|
+if ( readlink %{_bindir}/g++ > /dev/null ); then
|
|
|
+ if ! ( readlink -e %{_bindir}/g++ > /dev/null ); then
|
|
|
+ echo " broken alternatives link detected, try to fix it..."
|
|
|
+ /sbin/update-alternatives --remove g++ `/usr/bin/readlink -m %{_bindir}/g++` > /dev/null 2>&1 ||:
|
|
|
+ fi
|
|
|
+fi
|
|
|
+
|
|
|
+%triggerpostun -- libgcj < 4.4.5-4
|
|
|
+if ( readlink %{_bindir}/gij > /dev/null ); then
|
|
|
+ if ! ( readlink -e %{_bindir}/gij > /dev/null ); then
|
|
|
+ echo " broken alternatives link detected, try to fix it..."
|
|
|
+ /sbin/update-alternatives --remove gij `/usr/bin/readlink -m %{_bindir}/gij` > /dev/null 2>&1 ||:
|
|
|
+ fi
|
|
|
+fi
|
|
|
+
|
|
|
+%triggerpostun -- gcc-cpp < 4.4.5-4
|
|
|
+if ( readlink %{_bindir}/cpp > /dev/null ); then
|
|
|
+ if ! ( readlink -e %{_bindir}/cpp > /dev/null ); then
|
|
|
+ echo " broken alternatives link detected, try to fix it..."
|
|
|
+ /sbin/update-alternatives --remove cpp `/usr/bin/readlink -m %{_bindir}/cpp` > /dev/null 2>&1 ||:
|
|
|
+ fi
|
|
|
+fi
|
|
|
+
|
|
|
+%triggerpostun -- gcc-gfortran < 4.4.5-4
|
|
|
+if ( readlink %{_bindir}/gfortran > /dev/null ); then
|
|
|
+ if ! ( readlink -e %{_bindir}/gfortran > /dev/null ); then
|
|
|
+ echo " broken alternatives link detected, try to fix it..."
|
|
|
+ /sbin/update-alternatives --remove gfortran `/usr/bin/readlink -m %{_bindir}/gfortran` > /dev/null 2>&1 ||:
|
|
|
+ fi
|
|
|
+fi
|
|
|
+
|
|
|
+%triggerpostun -- gcc-gnat < 4.4.5-4
|
|
|
+if ( readlink %{_bindir}/gnat > /dev/null ); then
|
|
|
+ if ! ( readlink -e %{_bindir}/gnat > /dev/null ); then
|
|
|
+ echo " broken alternatives link detected, try to fix it..."
|
|
|
+ /sbin/update-alternatives --remove gnat `/usr/bin/readlink -m %{_bindir}/gnat` > /dev/null 2>&1 ||:
|
|
|
+ fi
|
|
|
+fi
|
|
|
+
|
|
|
+%triggerpostun -- gcc-java < 4.4.5-4
|
|
|
+if ( readlink %{_bindir}/gcj > /dev/null ); then
|
|
|
+ if ! ( readlink -e %{_bindir}/gcj > /dev/null ); then
|
|
|
+ echo " broken alternatives link detected, try to fix it..."
|
|
|
+ /sbin/update-alternatives --remove gcj `/usr/bin/readlink -m %{_bindir}/gcj` > /dev/null 2>&1 ||:
|
|
|
+ fi
|
|
|
+fi
|
|
|
+
|
|
|
#####################################################################
|
|
|
|
|
|
|
|
@@ -2409,6 +2445,10 @@ fi
|
|
|
|
|
|
|
|
|
%changelog
|
|
|
+* Mon May 02 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 4.4.5-4
|
|
|
+- update %%postun to fix alternatives bug
|
|
|
+- add %%triggerpostun to fix broken alternatives
|
|
|
+
|
|
|
* Sat Apr 02 2011 NAKAMURA Kenta <kenta@vinelinux.org> - 4.4.5-3
|
|
|
- dropped gcc44-no-add-needed.patch in Vine Linux 6
|
|
|
|