Selaa lähdekoodia

upgrading package: gcc 3.2.3 -> 3.3

Ralf S. Engelschall 22 vuotta sitten
vanhempi
commit
16e6ba3e5f
1 muutettua tiedostoa jossa 44 lisäystä ja 14 poistoa
  1. 44 14
      gcc/gcc.spec

+ 44 - 14
gcc/gcc.spec

@@ -23,6 +23,11 @@
 ##  SUCH DAMAGE.
 ##
 
+#   package version
+%define       V_full         3.3
+%define       V_comp         %nil
+%define       V_bounds       1.00
+
 #   package information
 Name:         gcc
 Summary:      GNU Compiler Collection
@@ -32,8 +37,8 @@ Packager:     The OpenPKG Project
 Distribution: OpenPKG [CORE]
 Group:        Language
 License:      GPL
-Version:      3.2.3
-Release:      20030430
+Version:      %{V_full}
+Release:      20030603
 
 #   package options
 %option       with_cxx       yes
@@ -41,11 +46,12 @@ Release:      20030430
 %option       with_binutils  yes
 %option       with_threads   yes
 %option       with_bounds    no
+%option       with_gcc       no
 
 #   list of sources
 Source0:      ftp://gcc.gnu.org/pub/gcc/releases/gcc-%{version}/gcc-%{version}.tar.bz2
 Patch0:       gcc.patch
-Patch1:       http://web.inter.nl.net/hcc/Haj.Ten.Brugge/bounds-checking-gcc-%{version}-1.01.patch.bz2
+Patch1:       http://web.inter.nl.net/hcc/Haj.Ten.Brugge/bounds-checking-gcc-%{version}-%{V_bounds}.patch.bz2
 
 #   build information
 Prefix:       %{l_prefix}
@@ -58,6 +64,9 @@ PreReq:       binutils >= 2.13
 %endif
 AutoReq:      no
 AutoReqProv:  no
+%if "%{with_gcc}" == "yes"
+Provides:     gcc = %{version}-%{release}
+%endif
 
 %description
     The GNU Compiler Collection (GCC) provides a standard conforming and
@@ -110,9 +119,9 @@ AutoReqProv:  no
     ../configure \
         --prefix=%{l_prefix} \
         --exec-prefix=%{l_prefix} \
-        --includedir=%{l_prefix}/include/gcc \
-        --with-gxx-include-dir=%{l_prefix}/include/g++ \
-        --with-local-prefix=%{l_prefix}/lib/gcc-lib \
+        --includedir=%{l_prefix}/include/gcc%{V_comp} \
+        --with-gxx-include-dir=%{l_prefix}/include/g++%{V_comp} \
+        --with-local-prefix=%{l_prefix}/lib/gcc%{V_comp}-lib \
         --enable-languages="${l_enable_languages}" \
         --enable-threads="${l_enable_threads}" \
         --disable-maintainer-mode \
@@ -120,6 +129,11 @@ AutoReqProv:  no
         --disable-nls \
         ${l_with_gnu_ld_as}
 
+    #   explicitly redirect remaining gcc-lib directories
+    %{l_shtool} subst -v -s \
+        -e "s;/gcc-lib/;/gcc%{V_comp}-lib/;" \
+        `find . -name Makefile -type f -print`
+
     #   determine build flags
     l_cflags=""
     l_boot_cflags=""
@@ -171,23 +185,23 @@ AutoReqProv:  no
 
     #   cleanup installation tree
     mv $RPM_BUILD_ROOT%{l_prefix}/lib/lib*.a \
-       $RPM_BUILD_ROOT%{l_prefix}/lib/gcc-lib/${triple}/%{version}/
+       $RPM_BUILD_ROOT%{l_prefix}/lib/gcc%{V_comp}-lib/${triple}/%{V_full}/
     mv $RPM_BUILD_ROOT%{l_prefix}/${triple}/include/* \
-       $RPM_BUILD_ROOT%{l_prefix}/lib/gcc-lib/${triple}/%{version}/include/ \
+       $RPM_BUILD_ROOT%{l_prefix}/lib/gcc%{V_comp}-lib/${triple}/%{V_full}/include/ \
            >/dev/null 2>&1 || true
 
     #   strip installation tree
     rm -rf $RPM_BUILD_ROOT%{l_prefix}/${triple}
-    rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man7 >/dev/null 2>&1 || true
-    rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/*.la  >/dev/null 2>&1 || true
-    rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/*-gcc >/dev/null 2>&1 || true
+    rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man7   >/dev/null 2>&1 || true
+    rm -f  $RPM_BUILD_ROOT%{l_prefix}/lib/*.la   >/dev/null 2>&1 || true
+    rm -f  $RPM_BUILD_ROOT%{l_prefix}/bin/*-gcc* >/dev/null 2>&1 || true
 %if "%{with_cxx}" == "yes"
-    rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/*-c++ >/dev/null 2>&1 || true
-    rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/*-g++ >/dev/null 2>&1 || true
+    rm -f  $RPM_BUILD_ROOT%{l_prefix}/bin/*-c++  >/dev/null 2>&1 || true
+    rm -f  $RPM_BUILD_ROOT%{l_prefix}/bin/*-g++  >/dev/null 2>&1 || true
 %endif
     strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
     for prog in cc1 cc1plus collect2 cpp; do
-        strip $RPM_BUILD_ROOT%{l_prefix}/lib/gcc-lib/${triple}/%{version}/${prog} \
+        strip $RPM_BUILD_ROOT%{l_prefix}/lib/gcc%{V_comp}-lib/${triple}/%{V_full}/${prog} \
             >/dev/null 2>&1 || true
     done
 
@@ -201,6 +215,22 @@ AutoReqProv:  no
        $RPM_BUILD_ROOT%{l_prefix}/man/man1/c++.1
 %endif
 
+    #   resolve filename conflicts
+%if "%{with_gcc}" != "yes" && "%{V_comp}" != ""
+    ( cd $RPM_BUILD_ROOT%{l_prefix}/bin
+      for file in *; do
+          mv ${file} ${file}%{V_comp}
+      done )
+    ( cd $RPM_BUILD_ROOT%{l_prefix}/info
+      for file in *; do
+          mv ${file} `echo ${file} | sed -e 's;^\([^.]*\)\(\..*\)$;\1%{V_comp}\2;'`
+      done )
+    ( cd $RPM_BUILD_ROOT%{l_prefix}/man/man1
+      for file in *; do
+          mv ${file} `echo ${file} | sed -e 's;^\([^.]*\)\(\..*\)$;\1%{V_comp}\2;'`
+      done )
+%endif
+
     #   determine installation file list
     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}