Sophie

Sophie

distrib > Mandriva > 10.0 > i586 > by-pkgid > f297d8fa9658e342f58b232ff920f605 > files > 7

lvm1-1.0.8-3.1.100mdk.src.rpm

%define name lvm1
%define version 1.0.8
%define release 3.1.100mdk

%define use_dietlibc 0
%ifarch %{ix86} x86_64
%define use_dietlibc 1
%endif

Summary: Logical Volume Manager administration tools
Name: %{name}
Version: %{version}
Release: %{release}
Source0: ftp://ftp.sistina.com/pub/LVM/current/lvm_%{version}.tar.bz2
Source1: lvm1-kheader.tar.bz2
Patch1: LVM-1.0.1-fix-kernel-headers-build.patch.bz2
Patch2: lvm-1.0.8-wrapper.patch.bz2
Patch3: lvm-1.0.8-dietlibc.patch.bz2
Patch4: lvm-1.0.8-gcc34.patch.bz2
Patch5: lvm-1.0.8-perm.patch.bz2
Patch6: lvm10-CAN-2004-0972.patch
License: GPL
Group: System/Kernel and hardware
BuildRoot: %{_tmppath}/%{name}-buildroot
Prefix: %{_prefix}
URL: http://www.sistina.com/products_lvm.htm
Obsoletes: lvm
%if %{use_dietlibc}
BuildRequires: dietlibc-devel
%endif

%description
LVM includes all of the support for handling read/write operations on
physical volumes (hard disks, RAID-Systems, magneto optical, etc.,
multiple devices (MD), see mdadd(8) or even loop devices, see losetup(8)),
creating volume groups (kind of virtual disks) from one or more physical
volumes and creating one or more logical volumes (kind of logical partitions)
in volume groups.

%prep
rm -rf $RPM_BUILD_ROOT

%setup -q -n LVM
cd %{version}
bzip2 -dc %{SOURCE1} | tar xf -
%ifarch %{ix86}
ln -s asm-i386 asm
%else
ln -s asm-%{_arch} asm
%endif
%patch1 -p2 -b .fixkheaders
%patch2 -p2 -b .wrapper
%if %{use_dietlibc}
%patch3 -p2 -b .diet
%endif
%patch4 -p2 -b .gcc34
%patch5 -p2 -b .perm
%patch6 -p2 -b .can-2004-0972

%build
cd %{version}
%if %{use_dietlibc}
export CC="diet gcc"
%endif
%configure --with-user=`id -un` --with-group=`id -gn` --sbindir=/sbin --libdir=/%{_lib} --enable-static_link
%make -C tools/lib WRAPPER=-DWRAPPER liblvm-10.a
%make -C tools vgwrapper WRAPPER=-DWRAPPER
mv tools/vgwrapper tools/vgwrapper.static
%make -C tools clean

unset CC
#export CC="gcc-`gcc3.3-version`"

rm config.cache
%configure --with-user=`id -un` --with-group=`id -gn` --sbindir=/sbin --libdir=/%{_lib}
%make

%install
rm -rf $RPM_BUILD_ROOT
cd %{version}
%makeinstall_std OWNER=$UID GROUP=$GROUPS sbindir=/sbin staticlibdir=%{_libdir}
rm -f ${RPM_BUILD_ROOT}/sbin/lvmcreate_initrd
rm -f ${RPM_BUILD_ROOT}%{_mandir}/man8/lvmcreate_initrd.8
rm -rf $RPM_BUILD_ROOT/%{_lib} $RPM_BUILD_ROOT/%{_libdir}

# install static versions
install -m 755 tools/vgwrapper.static $RPM_BUILD_ROOT/sbin/vgwrapper

echo "update-alternatives --install /sbin/lvm lvm /sbin/lvm1 10 \\" > lvm1-setup-alternatives.sh

for i in ${RPM_BUILD_ROOT}/sbin/*; do
	n=${i##*/} # basename
	mv $i ${RPM_BUILD_ROOT}/sbin/lvm1-$n
	echo "--slave /sbin/$n $n /sbin/lvm1-$n \\" >> lvm1-setup-alternatives.sh
done
for i in ${RPM_BUILD_ROOT}%{_mandir}/man8/*; do
	n=${i##*/} # basename
	mv $i ${RPM_BUILD_ROOT}%{_mandir}/man8/lvm1-$n
	echo "--slave %{_mandir}/man8/$n.bz2 $n %{_mandir}/man8/lvm1-$n.bz2 \\" >> lvm1-setup-alternatives.sh
done
echo >> lvm1-setup-alternatives.sh

cat > $RPM_BUILD_ROOT/sbin/lvm1 << EOF
#!/bin/sh
command=\$1
shift
if [ -x /sbin/lvm1-\$command ];then
	exec /sbin/lvm1-\$command "\$@"
fi
exit 1
EOF

chmod 755 $RPM_BUILD_ROOT/sbin/lvm1

rm -f ${RPM_BUILD_ROOT}%{_libdir}/liblvm-*.*

%post -f %{version}/lvm1-setup-alternatives.sh

%postun
if [ $1 = 0 ]; then
	update-alternatives --remove lvm /sbin/lvm1
fi

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(644,root,root,755)
%attr(755,root,root) /sbin/*
%{_mandir}/man8/*
%doc %{version}/ABSTRACT %{version}/CHANGELOG %{version}/CONTRIBUTORS
%doc %{version}/FAQ %{version}/KNOWN_BUGS %{version}/LVM-HOWTO
%doc %{version}/README %{version}/TODO %{version}/WHATSNEW

%changelog
* Thu Dec 02 2004 Vincent Danen <vdanen@mandrakesoft.com> 1.0.8-3.1.100mdk 
- security fix for CAN-2004-0972

* Sun Nov 28 2004 Luca Berra <bluca@vodka.it> 1.0.8-3mdk 
- make it build with recent gcc and glibc
- do not use getgrnam when statically built against glibc

* Sat Dec 20 2003 Luca Berra <bluca@vodka.it> 1.0.8-2mdk
- workaround for a kernel bug: devfs appears in initrd /proc/mounts when a
  devfs enabled kernel is booted with devfs=nomount, preventing creation of
  device nodes.
- use %%post -f for alternatives script
- bzipped patches

* Thu Nov 20 2003 Luca Berra <bluca@vodka.it> 1.0.8-1mdk
- 1.0.8
- stolen dietlibc patch from redhat^H^H^H^H^H^Hfedora

* Sat Sep 06 2003 Luca Berra <bluca@vodka.it> 1.0.7-1mdk
- 1.0.7

* Sun Dec  1 2002 Luca Berra <bluca@vodka.it> 1.0.6-1mdk
- renamed to lvm1
- use alternatives for compatibility with lvm2

* Mon Aug  5 2002 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 1.0.1-2mdk
- don't redefine _sbindir, _libdir
- rpmlint fixes: hardcoded-library-path

* Tue Jan 22 2002 Chmouel Boudjnah <chmouel@mandrakesoft.com> 1.0.1-1mdk
- Add DAC960 support from debian.
- Fix build with local headers not with /usr/src/linux one.
- 1.0.1.

* Sat Sep 29 2001 Frederic Lepied <flepied@mandrakesoft.com> 0.9-3mdk
- corrected access rights to doc

* Sun Jul 15 2001 Frederic Lepied <flepied@mandrakesoft.com> 0.9-2mdk
- build the tools statically

* Thu Mar  1 2001 Frederic Lepied <flepied@mandrakesoft.com> 0.9-1mdk
- 0.9

* Fri Sep 08 2000 Lenny Cartier <lenny@mandrakesoft.com> 0.8final-0.2mdk 
- used srpm from Jan Niehusmann <jan@gondor.com> :
	- merged patches from Andreas Dilger <adilger@turbolinux.com> 

* Wed Aug 23 2000 Lenny Cartier <lenny@mandrakesoft.com> 0.8final-0.1mdk
- clean files section
- used srpm from Jan Niehusmann <jan@gondor.com>
	- First lvm rpm for Mandrake distribution.