Ticket #1848: 0001-Rewritten-and-simplified-static-build-procedure-for.2.patch

File 0001-Rewritten-and-simplified-static-build-procedure-for.2.patch, 5.1 KB (added by zaytsev, 14 years ago)
  • contrib/dist/redhat/mc.spec.in

    From 6a6b92c5abf82c622d0d6086530cb49a48c6d8f7 Mon Sep 17 00:00:00 2001
    From: Yury V. Zaytsev <yury@shurup.com>
    Date: Sat, 28 Nov 2009 01:12:54 +0100
    Subject: [PATCH] Rewritten and simplified static build procedure for legacy distros.
    
    Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
    ---
     contrib/dist/redhat/mc.spec.in |  111 +++++++++++++++++++---------------------
     1 files changed, 53 insertions(+), 58 deletions(-)
    
    diff --git a/contrib/dist/redhat/mc.spec.in b/contrib/dist/redhat/mc.spec.in
    index 1abd6ab..2d87df6 100644
    a b  
    11# Note that this is NOT a relocatable package 
    22 
    3 %if 0%{?el4}%{?el3} 
     3%define legacy_rhel 0%{?el4}%{?el3} 
     4 
     5%if %{legacy_rhel} 
    46        %define _with_screen --with-screen=ncurses 
    57        %define _with_glib_static --with-glib-static 
    6         %define glib_version glib-2.12.3 
     8        %define glib_version 2.12 
     9        %define glib_stepping .3 
    710%else 
    811        %define _with_screen --with-screen=slang 
    912%endif 
    1013 
    11 Summary:   User-friendly text console file manager and visual shell 
    12 Name:      mc 
    13 Version:   @RPM_VERSION@ 
    14 Release:   1%{?dist} 
    15 Epoch:     1 
    16 License:   GPLv2 
    17 Group:     System Environment/Shells 
    18 Source0:   %{name}-@VERSION@.tar.gz 
    19  
    20 %if 0%{?el4}%{?el3} 
    21 Source1:   http://ftp.gnome.org/pub/gnome/sources/glib/2.12/%{glib_version}.tar.bz2 
    22 Patch0:    glib2-CVE-2008-4316.patch 
     14%define mc_version @RPM_VERSION@ 
     15%define mc_tarball @VERSION@ 
     16 
     17Summary:        User-friendly text console file manager and visual shell 
     18Name:           mc 
     19Version:        %{mc_version} 
     20Release:        1%{?dist} 
     21Epoch:          1 
     22License:        GPLv2 
     23Group:          System Environment/Shells 
     24Source0:        %{name}-%{mc_tarball}.tar.gz 
     25 
     26%if %{legacy_rhel} 
     27Source1:        http://ftp.gnome.org/pub/gnome/sources/glib/%{glib_version}/glib-%{glib_version}%{?glib_stepping}.tar.bz2 
     28Patch0:         glib2-CVE-2008-4316.patch 
    2329%endif 
    2430 
    25 URL:       http://www.midnight-commander.org/ 
    26 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) 
    27 BuildRequires: glib2-devel e2fsprogs-devel gpm-devel 
     31URL:            http://www.midnight-commander.org/ 
     32BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) 
     33BuildRequires: e2fsprogs-devel gpm-devel 
    2834 
    29 %if 0%{?el5}%{?el4}%{?el3} 
    30 BuildRequires: pcre-devel 
    31 %endif 
     35%if %{legacy_rhel} 
     36 
     37BuildRequires:  pcre-devel ncurses-devel 
     38 
     39# From Glib 
     40BuildRequires:  pkgconfig 
     41BuildRequires:  gettext 
    3242 
    33 %if 0%{?el4}%{?el3} 
    34 BuildRequires: gettext pkgconfig >= 0.8 ncurses-devel 
    3543%else 
    36 BuildRequires: slang-devel 
     44BuildRequires:  glib2-devel slang-devel 
    3745%endif 
    3846 
    3947%description 
    is supported on Linux console. VFS (Virtual Filesystem) allows you to 
    4553view archives and files on remote servers (via SAMBA, FTP or SSH). 
    4654 
    4755%prep 
    48 %if 0%{?el4}%{?el3} 
    4956 
    50 %setup -q -T -c -a 0 
    51 %setup -q -T -D -a 1 
     57%setup -q -n %{name}-%{mc_tarball} 
    5258 
    53 cd %{glib_version} 
    54 %patch0 -p1 -b .CVE-2008-4316 
     59%if %{legacy_rhel} 
    5560 
    56 %else 
     61%setup -q -T -D -a 1 -n %{name}-%{mc_tarball} 
    5762 
    58 %setup -q -n %{name}-@VERSION@ 
     63cd glib-%{glib_version}%{?glib_stepping} 
     64%patch0 -p1 -b .CVE-2008-4316 
    5965 
    6066%endif 
    6167 
    6268%build 
    63 %if 0%{?el4}%{?el3} 
    64  
    65         cd %{glib_version} 
    6669 
    67         RESULT_DIR=`pwd`/result 
     70%if %{legacy_rhel} 
    6871 
    69         CFLAGS="%optflags -fno-strict-aliasing" \ 
    70         ./configure \ 
    71                 --disable-gtk-doc \ 
    72                 --disable-shared \ 
    73                 --enable-static \ 
    74                 --prefix="$RESULT_DIR" \ 
    75                 --exec-prefix="$RESULT_DIR" \ 
    76                 --libdir="$RESULT_DIR/usr/%{_lib}" 
     72pushd glib-%{glib_version}%{?glib_stepping} 
     73RESULT_DIR=`pwd`/result 
    7774 
    78         make install %{?_smp_mflags} 
     75./configure \ 
     76        --disable-gtk-doc \ 
     77        --disable-shared \ 
     78        --enable-static \ 
     79        --prefix="$RESULT_DIR" \ 
     80        --exec-prefix="$RESULT_DIR" \ 
     81        --libdir="$RESULT_DIR/usr/%{_lib}" 
    7982 
    80         cd ../%{name}-@VERSION@ 
     83%{__make} %{?_smp_mflags} CFLAGS="%{optflags} -fno-strict-aliasing" install 
     84popd 
    8185 
    82 %endif 
    83  
    84 %if 0%{?el4}%{?el3} 
    85         PKG_CONFIG_PATH="$RESULT_DIR/usr/%{_lib}/pkgconfig:$PKG_CONFIG_PATH" ; export PKG_CONFIG_PATH; 
     86PKG_CONFIG_PATH="$RESULT_DIR/usr/%{_lib}/pkgconfig:$PKG_CONFIG_PATH" ; export PKG_CONFIG_PATH ; 
    8687%endif 
    8788 
    8889%configure \ 
    cd %{glib_version} 
    9495        --with-gpm-mouse \ 
    9596        --disable-doxygen-doc 
    9697 
    97 make %{?_smp_mflags} 
     98%{__make} %{?_smp_mflags} CFLAGS="%{optflags}" 
    9899 
    99100%install 
    100101rm -rf $RPM_BUILD_ROOT 
    101102 
    102 %if 0%{?el4}%{?el3} 
    103         cd %{name}-@VERSION@ 
    104 %endif 
    105  
    106103make install DESTDIR="$RPM_BUILD_ROOT" 
    107104 
    108 %if 0%{?el4}%{?el3} 
    109         mv ./* ./../ && cd ./../ 
    110         rm -rf %{name}-@VERSION@ %{glib_version} 
    111 %endif 
    112  
    113105install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/profile.d 
    114106install contrib/{mc.sh,mc.csh} $RPM_BUILD_ROOT%{_sysconfdir}/profile.d 
    115107 
    rm -rf $RPM_BUILD_ROOT 
    157149%dir %{_libexecdir}/mc 
    158150 
    159151%changelog 
     152* Fri Nov 27 2009 Yury V. Zaytsev <yury@shurup.com> 
     153- Rewritten and simplified static build procedure. 
     154 
    160155* Mon Oct 26 2009 Andrew Borodin <aborodin@vmail.ru> 
    161156- Add new %%{_sysconfdir}/mc/mc.keymap.* files. 
    162157