Ticket #1438: mc.spec.in-zyv.patch

File mc.spec.in-zyv.patch, 8.4 KB (added by zaytsev, 10 years ago)
  • contrib/dist/redhat/mc.spec.in

    diff --git a/contrib/dist/redhat/mc.spec.in b/contrib/dist/redhat/mc.spec.in
    index dd2eb5b..d966445 100644
    a b  
    1 # Conditional build (replace "#" with "%" to enable): 
    2 # 
    3 #define _with_ncurses            1 # use ncurses 
    4 #define _with_charset            1 # enable code for charset conversion 
    5 #define _with_samba              1 # enable SMB/CIFS virtual file system 
    6 #define _with_ext2undel          1 # compile with ext2 undelete code 
    7 #define _without_x               1 # avoid dependency on X11 libraries 
    8  
    91# Note that this is NOT a relocatable package 
    10 %define ver     @VERSION@ 
    11 %define rpmver   @RPM_VERSION@ 
    12 %define  RELEASE 1 
    13 %define  rel     %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE}%{?dist} 
     2 
     3%if 0%{?el4}%{?el3} 
     4        %define _with_screen --with-screen=ncurses 
     5        %define _with_glib_static --with-glib-static 
     6        %define glib_version glib-2.12.3 
     7%else 
     8        %define _with_screen --with-screen=slang 
     9%endif 
    1410 
    1511Summary:   User-friendly text console file manager and visual shell 
    1612Name:      mc 
    17 Version:   %rpmver 
    18 Release:   %rel 
     13Version:   @RPM_VERSION@ 
     14Release:   1%{?dist} 
    1915Epoch:     1 
    2016License:   GPLv2 
    2117Group:     System Environment/Shells 
    22 Source0:   mc-%{ver}.tar.gz 
     18Source0:   %{name}-@VERSION@.tar.gz 
     19 
     20%if 0%{?el4}%{?el3} 
     21Source1:   http://ftp.gnome.org/pub/gnome/sources/glib/2.12/%{glib_version}.tar.bz2 
     22Patch0:    glib2-CVE-2008-4316.patch 
     23%endif 
     24 
    2325URL:       http://www.midnight-commander.org/ 
    2426BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) 
    25 BuildRequires: glib2-devel e2fsprogs-devel slang-devel 
     27BuildRequires: glib2-devel e2fsprogs-devel gpm-devel 
     28 
     29%if 0%{?el5}%{?el4}%{?el3} 
     30BuildRequires: pcre-devel 
     31%endif 
     32 
     33%if 0%{?el4}%{?el3} 
     34BuildRequires: gettext pkgconfig >= 0.8 ncurses-devel 
     35%else 
     36BuildRequires: slang-devel 
     37%endif 
    2638 
    2739%description 
    28 GNU Midnight Commander is a visual file manager.  It's a feature rich 
     40GNU Midnight Commander is a visual file manager. It's a feature rich 
    2941full-screen text mode application that allows you to copy, move and 
    3042delete files and whole directory trees, search for files and run 
    31 commands in the subshell.  Internal viewer and editor are included. 
    32 Mouse is supported under X Window System and on Linux console.  VFS 
    33 (Virtual Filesystem) allows you to view archives and files on remote 
    34 servers (via SAMBA, FTP or SSH). 
     43commands in the subshell. Internal viewer and editor are included. Mouse 
     44is supported on Linux console. VFS (Virtual Filesystem) allows you to 
     45view archives and files on remote servers (via SAMBA, FTP or SSH). 
    3546 
    3647%prep 
    37 %setup -q -n mc-%{ver} 
     48%if 0%{?el4}%{?el3} 
     49 
     50%setup -q -T -c -a 0 
     51%setup -q -T -D -a 1 
     52 
     53cd %{glib_version} 
     54%patch0 -p1 -b .CVE-2008-4316 
     55 
     56%else 
     57 
     58%setup -q -n %{name}-@VERSION@ 
     59 
     60%endif 
    3861 
    3962%build 
     63%if 0%{?el4}%{?el3} 
     64 
     65        cd %{glib_version} 
     66 
     67        RESULT_DIR=`pwd`/result 
     68 
     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}" 
     77 
     78        make install %{?_smp_mflags} 
     79 
     80        cd ../%{name}-@VERSION@ 
     81 
     82%endif 
     83 
     84%if 0%{?el4}%{?el3} 
     85        PKG_CONFIG_PATH="$RESULT_DIR/usr/%{_lib}/pkgconfig:$PKG_CONFIG_PATH" ; export PKG_CONFIG_PATH; 
     86%endif 
     87 
    4088%configure \ 
    41         --with-screen=slang \ 
    42          --enable-charset \ 
    43          --with-samba \ 
    44          --with-x \ 
    45          --with-gpm-mouse 
     89        %{_with_screen} \ 
     90        %{?_with_glib_static} \ 
     91        --enable-charset \ 
     92        --with-samba \ 
     93        --without-x \ 
     94        --with-gpm-mouse \ 
     95        --disable-doxygen-doc 
     96 
    4697make %{?_smp_mflags} 
    4798 
    4899%install 
    49100rm -rf $RPM_BUILD_ROOT 
    50101 
    51 make install DESTDIR=$RPM_BUILD_ROOT 
     102%if 0%{?el4}%{?el3} 
     103        cd %{name}-@VERSION@ 
     104%endif 
     105 
     106make install DESTDIR="$RPM_BUILD_ROOT" 
     107 
     108%if 0%{?el4}%{?el3} 
     109        mv ./* ./../ && cd ./../ 
     110        rm -rf %{name}-@VERSION@ %{glib_version} 
     111%endif 
    52112 
    53113install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/profile.d 
    54114install contrib/{mc.sh,mc.csh} $RPM_BUILD_ROOT%{_sysconfdir}/profile.d 
    rm -rf $RPM_BUILD_ROOT 
    61121%files -f %{name}.lang 
    62122%defattr(-, root, root) 
    63123 
    64 %doc doc/FAQ COPYING doc/NEWS doc/README 
     124%doc doc/FAQ doc/COPYING doc/NEWS doc/README 
    65125%{_bindir}/mc 
    66126%{_bindir}/mcedit 
    67127%{_bindir}/mcview 
    68128%{_bindir}/mcmfmt 
    69 %attr(4755, vcsa, tty) %{_libexecdir}/mc/cons.saver 
     129%attr(4711, vcsa, tty) %{_libexecdir}/mc/cons.saver 
    70130%{_libexecdir}/mc/mc*sh 
    71131%{_mandir}/man1/* 
    72132%lang(es) %{_mandir}/es/man1/mc.1* 
    rm -rf $RPM_BUILD_ROOT 
    93153%dir %{_libexecdir}/mc 
    94154 
    95155%changelog 
     156* Sat Aug 01 2009 Yury V. Zaytsev <yury@shurup.com> 
     157- Fixed EL4 (and supposedly EL3) builds 
     158- Fixed some of rpmlint warnings 
     159 
    96160* Sat Jul 04 2009 Yury V. Zaytsev <yury@shurup.com> 
    97161- Fix the issue when wrappers were left unpackaged 
    98162 
    99163* Thu May 21 2009 Slava Zanko <slavazanko@gmail.com> 
    100 - Fix install patches: use %{_sysconfdir}/mc directory 
     164- Fix install patches: use %%{_sysconfdir}/mc directory 
    101165 
    102166* Fri May 8 2009 Slava Zanko <slavazanko@gmail.com> 
    103167- Review spec-file to build on the current distributions 
    rm -rf $RPM_BUILD_ROOT 
    111175- Don't rely on brace expansion, it may be disabled 
    112176 
    113177* Mon Jan 30 2006 Pavel Roskin <proski@gnu.org> 
    114 - Avoid using %{_prefix} where more specialized macros are available. 
     178- Avoid using %%{_prefix} where more specialized macros are available. 
    115179 
    116180* Tue Aug 02 2005 Pavel Roskin <proski@gnu.org> 
    117181- Replace obsolete "Copyright" with "License". 
    rm -rf $RPM_BUILD_ROOT 
    147211- Add _with_glib2 option. 
    148212 
    149213* Mon Oct 07 2002 Pavel Roskin <proski@gnu.org> 
    150 - Remove installed mc.sh and mc.csh from %{_prefix}/share/mc/bin to 
     214- Remove installed mc.sh and mc.csh from %%{_prefix}/share/mc/bin to 
    151215  suppress a warning about installed but unpackaged files. 
    152216 
    153217* Mon Sep 30 2002 Andrew V. Samoilov <sav@bcs.zp.ua> 
    rm -rf $RPM_BUILD_ROOT 
    158222- Use --with-screen instead of --with-ncurses and --with-included-slang. 
    159223 
    160224* Mon Sep 23 2002 Andrew V. Samoilov <sav@bcs.zp.ua> 
    161 - Restore %config for %{_prefix}/share/mc/mc.charsets. 
    162 - Restore %{_prefix}/share/mc/edit.spell.rc. 
     225- Restore %%config for %%{_prefix}/share/mc/mc.charsets. 
     226- Restore %%{_prefix}/share/mc/edit.spell.rc. 
    163227 
    164228* Sat Sep 21 2002 Pavel Roskin <proski@gnu.org> 
    165229- Use FHS-compliant paths. 
    166 - Drop %config from files under /usr/share - users are not supposed to 
     230- Drop %%config from files under /usr/share - users are not supposed to 
    167231  edit them.  Local copies under ~/.mc should be used for that. 
    168232 
    169233* Wed Aug 21 2002 Pavel Roskin <proski@gnu.org> 
    rm -rf $RPM_BUILD_ROOT 
    174238 
    175239* Tue Aug 20 2002 Andrew V. Samoilov <sav@bcs.zp.ua> 
    176240- Add /usr/lib/mc/mc.charsets. 
    177 - Add %{_mandir}/*/man1/*. 
     241- Add %%{_mandir}/*/man1/*. 
    178242 
    179243* Fri Aug 16 2002 Pavel Roskin <proski@gnu.org> 
    180244- Remove mc.global. 
    rm -rf $RPM_BUILD_ROOT 
    193257- Remove /usr/lib/mc/layout. 
    194258 
    195259* Sat Jun 09 2001 Pavel Roskin <proski@gnu.org> 
    196 - Use %{_prefix} and %{_mandir}. Specify --mandir to configure. 
     260- Use %%{_prefix} and %%{_mandir}. Specify --mandir to configure. 
    197261 
    198262* Fri May 25 2001 Pavel Roskin <proski@gnu.org> 
    199263- Change groups. Don't include locale directories. More config files. 
    rm -rf $RPM_BUILD_ROOT 
    220284 
    221285* Sat Sep 23 2000 Pavel Roskin <proski@gnu.org> 
    222286- Include translations with mc, not gmc 
    223 - chkconfig --del in %preun, not %postun 
     287- chkconfig --del in %%preun, not %%postun 
    224288- --without-debug not needed 
    225289- /etc/X11/wmconfig not needed 
    226290- /etc/pam.d/mcserv shouldn't be executable 
    227 - New files in %{prefix}/lib/mc/ - translated hints, editor files 
     291- New files in %%{prefix}/lib/mc/ - translated hints, editor files 
    228292 
    229293* Thu Sep 09 1999 Elliot Lee <sopwith@redhat.com> 
    230294- Include .idl files in the package. 
    rm -rf $RPM_BUILD_ROOT 
    233297- Added a build prereq so that rpms get built with documentation ;) 
    234298 
    235299* Mon Jul 12 1999 Kjartan Maraas  <kmaraas@online.no> 
    236 - added help and locale files to %files 
     300- added help and locale files to %%files 
    237301 
    238302* Tue Jun 22 1999 Vladimir Kondratiev <vkondra@iil.intel.com> 
    239 - added syntax files to %files 
     303- added syntax files to %%files 
    240304 
    241305* Wed May 26 1999 Cody Russell <bratsche@dfw.net> 
    242 - chmod cons.saver at $RPM_BUILD_ROOT%{prefix}/lib rather than at 
     306- chmod cons.saver at $RPM_BUILD_ROOT%%{prefix}/lib rather than at 
    243307  $RPM_BUILD_ROOT/usr/lib. We can now install to somewhere other than /usr. 
    244308 
    245309* Sun Apr 18 1999 Gregory McLean <gregm@comstar.net>