Sophie

Sophie

distrib > Mandriva > 10.2 > i586 > by-pkgid > 96327b4b6841f99059b1c8c13e29cc07 > files > 5

mc-mp-4.1.40-0.1mdk.src.rpm

# the purpose of this package is to be able to use a small stripped
# down mc installed on "/" for easy recovery and such...

%define	name	mc-mp
%define	version	4.1.40
%define release	0.1mdk

Summary:	Powerful console-only file manager
Name:		%{name}
Version:	%{version}
Release:	%{release}
URL:		http://mc.linuxinside.com/
License:	GPL
Group:		File tools
Source:		mc-%{version}-pre9.tar.bz2
Patch0:		mc-4.1.40-pre9-oe.diff.bz2
Patch1:		mc-4.1.40-pre9-label_at_end_of_compound_statement.diff.bz2
Patch2:		mc-4.1.40-pre9-decent_defaults.diff.gz
Buildroot:	%{_tmppath}/%{name}-%{version}-root

%description
The goal of this project is creating a stable, well-working, useful
console-only version of well-known Midnight Commander, without bugs
and garbage, like tk, xv and gnome.

%prep

%setup -q -n mc-%{version}-pre9
%patch0 -p1 -b .oe
%patch1 -p0 -b .label_at_end_of_compound_statement
%patch2 -p0 -b .decent_defaults

%build

./configure \
    --prefix="" \
    --bindir=/bin \
    --sbindir=/sbin \
    --libdir=/lib/mc \
    --mandir=%{_mandir} \
    --disable-nls \
    --with-included-gettext \
    --with-included-slang \
    --with-vfs \
    --without-gpm-mouse \
    --without-ext2undel

# why is this pulled in?
perl -pi -e "s|^XLIB.*|XLIB=|g" Make.common

# build for size	
%make CFLAGS="-Wall -Os"

%install
[ -n "%{buildroot}" -a "%{buildroot}" != / ] && rm -rf %{buildroot}

install -d %{buildroot}%{_sysconfdir}/profile.d
install -d %{buildroot}/lib/mc
install -d %{buildroot}%{_mandir}/man1

%makeinstall \
    bindir=%{buildroot}/bin \
    libdir=%{buildroot}/lib/mc \
    mandir=%{buildroot}%{_mandir}

cat > mc-md.sh << EOF
mc-mp ()
{
	MCMP=/tmp/mc-mp\$\$-"\$RANDOM"
	/bin/mc -P "\$@" > "\$MCMP"
	cd "\`cat \$MCMP\`"
	rm "\$MCMP"
        unset MCMP;
}
EOF

cat > mc-md.csh << EOF
alias mc-md 'setenv MCMP \`/bin/mc -P \!*\`; cd \$MCMP; unsetenv MCMP'
EOF

install -m0755 mc-md.sh %{buildroot}%{_sysconfdir}/profile.d/
install -m0755 mc-md.csh %{buildroot}%{_sysconfdir}/profile.d/

# cleanup
rm -rf %{buildroot}%{_mandir}
rm -rf %{buildroot}/lib/mc/bin
rm -f %{buildroot}/lib/mc/FAQ
rm -f %{buildroot}/lib/mc/term/README.xterm
rm -f %{buildroot}/lib/mc/extfs/README
rm -f %{buildroot}/lib/mc/mc.hint
rm -f %{buildroot}/lib/mc/mc.help

%clean
[ -n "%{buildroot}" -a "%{buildroot}" != / ] && rm -rf %{buildroot}

%files
%defattr(-,root,root)
%attr(0755,root,root) %config(noreplace) %{_sysconfdir}/profile.d/mc-md.sh
%attr(0755,root,root) %config(noreplace) %{_sysconfdir}/profile.d/mc-md.csh
/bin/mc*
/lib/mc

%changelog
* Wed Oct 27 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 4.1.40-0.1mdk
- initial alt linux import
- added P1 & P2