Sophie

Sophie

distrib > Mandriva > 2009.0 > x86_64 > by-pkgid > 64dac8579b6a69ec8bef3212e658f8f4 > files > 11

mdadm-2.6.7-2.1mnb2.src.rpm

%define mdmpd_version 0.4

%ifarch %{ix86} ppc ppc64 %{sunsparc}
%bcond_without dietlibc
%define dietlibc_req %{nil}
%endif
%ifarch x86_64
%bcond_without dietlibc
%define dietlibc_req >= 0.29-1mdk
%endif

%bcond_with uclibc
%bcond_with klibc
%bcond_with mdassemble_auto
%bcond_with mdmpd

%if %{with mdassemble_auto}
%define mdassemble_auto_CFLAGS MDASSEMBLE_AUTO=1
%else
%define mdassemble_auto_CFLAGS %{nil}
%endif

# we want to install in /sbin, not /usr/sbin...
%define _exec_prefix %{nil}

Name:           mdadm
Version:        2.6.7
%define		subrel 1
Release:        %manbo_mkrel 2
Summary:        A tool for managing Soft RAID under Linux
Group:          System/Kernel and hardware
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-buildroot
License:        GPLv2+
URL:            http://www.kernel.org/pub/linux/utils/raid/mdadm/
Source0:        http://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-%{version}.tar.bz2
Source1:        mdadm.init
Source2:        raidtabtomdadm.sh
Source3:        mdmpd-%{mdmpd_version}.tar.bz2
Source4:        mdmpd.init
Source5:        mdadm.rules
Patch0:         mdadm-2.6.2-werror.patch
Patch1:	        mdadm-2.5.2-s390-build.patch
Patch2:         mdadm-2.5.2-static.patch
Patch4:         mdadm-2.5.2-cflags.patch
Patch5:         mdadm-2.6.1-build.patch
Patch6:         mdadm-2.6.4-open.patch
Patch7: 	mdadm-2.6.7-Fix-raid10-NULL-pointer-oops.patch
Patch101: 	mdmpd-0.3-pid.patch
Patch102: 	mdmpd-0.4-gcc4.patch
Requires(post): gawk
Requires(post): rpm-helper
Requires(preun): rpm-helper
BuildRequires:  groff-for-man
BuildRequires:  glibc-static-devel
%if %{with dietlibc}
BuildRequires:  dietlibc-devel %{dietlibc_req}
%endif
%if %{with uclibc}
BuildRequires:  uClibc-devel
%endif
%if %{with klibc}
BuildRequires:  klibc-devel
%endif

%description
mdadm is a program that can be used to create, manage, and monitor
Linux MD (Software RAID) devices.

As such is provides similar functionality to the raidtools packages.
The particular differences to raidtools is that mdadm is a single
program, and it can perform (almost) all functions without a
configuration file (that a config file can be used to help with
some common tasks).

%if %{with mdmpd}
%package -n mdmpd
Summary:        Daemon to monitor MD multipath devices
Group:          System/Kernel and hardware

%description -n mdmpd
This daemon will monitor md multipath devices for failure and recovery of
device paths, in order to add paths back upon recovery. It requires a patched
kernel with support for events in /proc/mdstat.
%endif

%prep
%setup -q -a 3
%patch0 -p1
%patch1 -p1 -b .s390
%patch2 -p1 -b .static
%patch4 -p1 -b .cflags
%patch5 -p1 -b .build
%patch6 -p1 -b .open
%patch7 -p1 -b .raid10-oops
%patch101 -p0
%patch102 -p0
OPT_FLAGS=`/bin/echo %{optflags} | %{__sed} -e 's/-fstack-protector//'`
%{__perl} -pi -e "s/^CXFLAGS = .*/CXFLAGS = $OPT_FLAGS/" Makefile
cp %{SOURCE2} raidtabtomdadm.sh

%build
%if %{with dietlibc}
%if %{with uclibc} || %{with klibc}
%{error:only one of dietlibc, uclibc or klibc can be specified}
exit 1
%endif
%{make} mdassemble %{mdassemble_auto_CFLAGS} SYSCONFDIR="%{_sysconfdir}"
%endif
%if %{with uclibc}
%if %{with klibc}
%{error:only one of dietlibc, uclibc or klibc can be specified}
exit 1
%endif
%{make} mdadm.uclibc mdassemble.uclibc %{mdassemble_auto_CFLAGS} SYSCONFDIR="%{_sysconfdir}"
%endif
%if %{with klibc}
%{make} mdassemble.klibc %{mdassemble_auto_CFLAGS} SYSCONFDIR="%{_sysconfdir}"
%endif
%{make} SYSCONFDIR="%{_sysconfdir}"
%if %{with mdmpd}
%{make} -C mdmpd CCFLAGS="%{optflags} -I." SYSCONFDIR="%{_sysconfdir}"
%endif

%install
rm -rf %{buildroot}

%{makeinstall_std} MANDIR=%{_mandir} BINDIR=%{_sbindir}
%if %{with mdmpd}
%{makeinstall_std} -C mdmpd MANDIR=%{_mandir} BINDIR=%{_sbindir}
%endif
install -D -m 644 mdadm.conf-example %{buildroot}%{_sysconfdir}/mdadm.conf

install -D %{SOURCE1} %{buildroot}%{_initrddir}/mdadm
%if %{with mdmpd}
install -D %{SOURCE4} %{buildroot}%{_initrddir}/mdmpd
mkdir -p %{buildroot}/var/run/mdmpd
%endif

%if %{with dietlibc}
install mdassemble %{buildroot}%{_sbindir}/mdassemble
install -D -m 644 mdassemble.8 %{buildroot}%{_mandir}/man8/mdassemble.8
%endif
%if %{with uclibc}
install mdassemble.uclibc %{buildroot}%{_sbindir}/mdassemble
install -D -m 644 mdassemble.8 %{buildroot}%{_mandir}/man8/mdassemble.8
%endif
%if %{with klibc}
install mdassemble.klibc %{buildroot}%{_sbindir}/mdassemble
install -D -m 644 mdassemble.8 %{buildroot}%{_mandir}/man8/mdassemble.8
%endif

mkdir -p -m 755 %{buildroot}%{_sysconfdir}/udev/rules.d
install -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/udev/rules.d/70-mdadm.rules

#install -D -m 755 mkinitramfs %{buildroot}%{_sbindir}/mkinitramfs

# we have our own way to build static binaries
rm -f %{buildroot}/sbin/*.static

%clean
rm -rf %{buildroot}

%preun
%_preun_service mdadm

%if %{with mdmpd}
%preun -n mdmpd
%_preun_service mdmpd
%endif

%post -f raidtabtomdadm.sh
%_post_service mdadm

%if %{with mdmpd}
%post -n mdmpd
%_post_service mdmpd
%endif

%files
%defattr(644,root,root,755)
%doc TODO ChangeLog mdadm.conf-example README.initramfs ANNOUNCE*
%attr(755,root,root) %{_sbindir}/mdadm
#attr(755,root,root) %{_sbindir}/mkinitramfs
%if %{with dietlibc} || %{with uclibc} || %{with klibc}
%attr(755,root,root) %{_sbindir}/mdassemble
%endif
%config(noreplace,missingok) %{_sysconfdir}/mdadm.conf
%{_sysconfdir}/udev/rules.d/*
%attr(755,root,root) %{_initrddir}/mdadm
%{_mandir}/man*/md*

%if %{with mdmpd}
%files -n mdmpd
%attr(755,root,root) %{_sbindir}/mdmpd
%attr(755,root,root) %{_initrddir}/mdmpd
%dir /var/run/mdmpd
%endif


%changelog
* Wed Nov 19 2008 Gustavo De Nardin <gustavodn@mandriva.com> 2.6.7-2.1mnb2
- build for updates

* Mon Nov 03 2008 Thomas Backlund <tmb@mandriva.org> 2.6.7-2mnb2
+ Revision: 299593
- add P7: fix raid10 NULL pointer oops

* Thu Jul 24 2008 Olivier Blin <oblin@mandriva.com> 2.6.7-1mnb2
+ Revision: 245826
- buildrequire glibc-static-devel (for the about useless static patch)
- update udev rules to run degraded arrays and get additional info
  about arrays being assembled (from Fedora)
- fix parameters to open calls (from Fedora)
- add build fixes from Fedora
- update license tag
- update URL
- 2.6.7 (with incrematal assembly fixes that should fix #40023)
- use s390 patch from RH to disable Werror (instead of our hack in setup)
- remove udev patch, upstream mdadm should now be udev friendly
- add cflags patch from Fedora
- add static patch from Fedora (easier to apply other patches on top)
- renumber mdmpd patches

* Wed Jun 11 2008 Oden Eriksson <oeriksson@mandriva.com> 2.6.4-3mnb2
+ Revision: 217954
- fix "error: Missing %%files for subpackage mdmpd"
- rebuilt against dietlibc-devel-0.32

* Mon Feb 18 2008 Thierry Vignaud <tvignaud@mandriva.com> 2.6.4-2mnb1
+ Revision: 170655
- replace %%mkrel with %%manbo_mkrel for Manbo Core 1
- fix no-buildroot-tag

* Thu Feb 07 2008 Olivier Blin <oblin@mandriva.com> 2.6.4-2mdv2008.1
+ Revision: 163837
- add a udev rules file for device assembly (from RH #429604)

  + Thierry Vignaud <tvignaud@mandriva.com>
    - kill re-definition of %%buildroot on Pixel's request

* Sat Nov 10 2007 David Walluck <walluck@mandriva.org> 2.6.4-1mdv2008.1
+ Revision: 107333
- 2.6.4

* Wed Sep 05 2007 David Walluck <walluck@mandriva.org> 2.6.3-4mdv2008.0
+ Revision: 79667
- set CXFLAGS directly in Makefile
- disable -fstack-protector

* Tue Aug 28 2007 Andreas Hasenack <andreas@mandriva.com> 2.6.3-2mdv2008.0
+ Revision: 72335
- rebuild to fix mdassemble segfault

* Mon Aug 20 2007 David Walluck <walluck@mandriva.org> 2.6.3-1mdv2008.0
+ Revision: 68044
- 2.6.3

* Mon May 21 2007 David Walluck <walluck@mandriva.org> 2.6.2-2mdv2008.0
+ Revision: 29526
- add patch to fix -Werror
- clean up patch list
- remove some spurious BuildRequires
- 2.6.2
- some spec reoganization

  + Per Øyvind Karlsen <peroyvind@mandriva.org>
    - don't use -Werror on sparc either
    - parallell build


* Fri Mar 09 2007 David Walluck <walluck@mandriva.org> 2.6.1-1mdv2007.1
+ Revision: 138616
- 2.6.1

* Mon Jan 15 2007 David Walluck <walluck@mandriva.org> 2.6-1mdv2007.1
+ Revision: 108996
- 2.6

* Thu Dec 14 2006 Emmanuel Andry <eandry@mandriva.org> 2.5.6-2mdv2007.1
+ Revision: 96855
- rebuild

* Wed Dec 13 2006 Emmanuel Andry <eandry@mandriva.org> 2.5.6-1mdv2007.1
+ Revision: 96579
- New version 2.5.6
  drop patches 15 and 16 (applied upstream)

* Fri Sep 15 2006 Luca Berra <bluca@mandriva.org> 2.5.3-3mdv2007.0
+ Revision: 61509
- make mdasseble also enable read-write
- fix a bug in mdassemble that prevented activation of stacked arrays (#25459)
- do not fail when autoassembling everything and some md are already active
- make mdmpd build again (Oden)
  but make it a subpackage and disabled by default
- new upstream version 2.5.3

* Fri Jul 07 2006 Luca Berra <bluca@mandriva.org> 2.5.2-1mdv2007.0
+ Revision: 38423
- updated p14 to deal with new location of udev db
- new upstream version 2.5.2
  remove patches integrated upstream
- new upstream version 2.5.1
  remove patches integrated upstream
- automatically create devices if using udev (p14)
- add p12 and p13 from git
- use %%bcond for conditional build options
- * Mon Jun 19 2006 Christiaan Welvaart <cjw@daneel.dyndns.org>
- Fix using ++ in a macro argument.
- remove patches merged upstream
- New Upstream version 2.5.1
- New Upstream version 2.5.1
- uncompressed scripts
- import mdadm-2.5-1mdv2007.0

* Mon May 29 2006 Oden Eriksson <oeriksson@mandriva.com> 2.5-2mdv2007.0
- use provided sha1 (and don't link against openssl...)

* Sun May 28 2006 Luca Berra <bluca@vodka.it> 2.5-1mdv2007.0
- New release 2.5
- rework p14 to remove more warnings
- use posix rand() function instead of BSD random() (p15)
- fix some issue with mdassemble (p16)
- mdassemble does not need to parse auto=

* Sun May 28 2006 Luca Berra <bluca@vodka.it> 2.4.1-1mdv2007.0
- New release 2.4.1

* Sat May 27 2006 Luca Berra <bluca@vodka.it> 2.4-1mdv2007.0
- New release 2.4
- snprintf fix (p11)
- another strict-aliasing fix (p12)
- add a debug message to Grow.c and remove a gcc warning (p14)
- remove mkinitramfs script, we have our own mkinitrd/mkinitramfs.

* Fri Apr 21 2006 Per Øyvind Karlsen <pkarlsen@mandriva.com> 2.3.1-3mdk
- build against dietlibc on sparc
- fix executable-marked-as-config-file

* Sat Feb 18 2006 Christiaan Welvaart <cjw@daneel.dyndns.org> 2.3.1-2mdk
- Patch13: fix #include for kernel byteswap functions

* Mon Feb 06 2006 Luca Berra <bluca@vodka.it> 2.3.1-1mdk
- New Release 2.3.1
- re-enable strict aliasing in CFLAGS (fixed upstream)
- remove p11 merged upstream

* Sat Feb 04 2006 Luca Berra <bluca@vodka.it> 2.3-1mdk
- New Release 2.3
- remove p11 and p12 merged upstream
- disable strict aliasing in CFLAGS
- x86_64 fix (p11)

* Thu Jan 26 2006 Luca Berra <bluca@vodka.it> 2.2-4mdk
- rework UUID update patch (p11)
- add another typo patch to super1.c (p12)

* Mon Jan 09 2006 Olivier Blin <oblin@mandriva.com> 2.2-3mdk
- convert parallel init to LSB

* Wed Jan 04 2006 Luca Berra <bluca@vodka.it> 2.2-2mdk
- add UUID update patch

* Mon Jan 02 2006 Thierry Vignaud <tvignaud@mandriva.com> 2.2-1mdk
- new release
- install new mkinitramfs

* Mon Jan 02 2006 Thierry Vignaud <tvignaud@mandriva.com> 1.12.0-4mdk
- rollback, mdadm doesn't need harddrake service to be run before
- add parallel init support to mdmpd

* Mon Jan 02 2006 Olivier Blin <oblin@mandriva.com> 1.12.0-3mdk
- parallel init support

* Sun Jan 01 2006 Mandriva Linux Team <http://www.mandrivaexpert.com/> 1.12.0-2mdk
- Rebuild

* Sun Jun 19 2005 Luca Berra <bluca@vodka.it> 1.12.0-1mdk 
- 1.12.0
- removed patches merged upstream

* Mon Jun 13 2005 Luca Berra <bluca@vodka.it> 1.12.0-0.test.1mdk 
- 1.12.0 test
- removed gcc4 patch
- added fix for stacked device when using --auto and udev
- use Require(xxx) instead of PreReq

* Tue May 17 2005 Luca Berra <bluca@vodka.it> 1.11.0-1mdk 
- 1.11.0
- fixed build with gcc4 (p11)
- added man page for mdadm (p12)

* Wed Mar 30 2005 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 1.9.0-3mdk
- rebuilt against latest dietlibc

* Mon Mar 21 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 1.9.0-2mdk
- rebuilt because the binary got lost in cyberspace

* Sun Feb 06 2005 Luca Berra <bluca@vodka.it> 1.9.0-1mdk 
- 1.9.0

* Sat Jan 29 2005 Luca Berra <bluca@vodka.it> 1.9.0-0.pre1.1mdk 
- 1.9.0-pre1
- removed autodev and stacking patches merged upstream

* Sun Jan 23 2005 Luca Berra <bluca@vodka.it> 1.8.0-3mdk 
- updated autodev patch
- fix mdadm -As not starting stacked devices

* Sun Jan 23 2005 Luca Berra <bluca@vodka.it> 1.8.0-2mdk 
- added auto=dev option
- re-enabled device autocreation in mdassemble

* Tue Nov 16 2004 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.8.0-1mdk
- new release
- kill patches 101, 102, 103 and 104 (merged upstream)

* Tue Sep 07 2004 Luca Berra <bluca@vodka.it> 1.7.0-3mdk 
- sync with patches merged upstream
- disable device autocreation in mdassemble for now

* Mon Aug 30 2004 Luca Berra <bluca@vodka.it> 1.7.0-2mdk 
- sync with patches merged upstream
- add raid6/raid10 to mdassemble as well
- mdassemble now supports device autocreation

* Tue Aug 24 2004 Luca Berra <bluca@vodka.it> 1.7.0-1mdk 
- 1.7.0
- build mdassemble on ppc as well
- mdadm daemon creates its own pid file
- convert raidtab in mdadm.conf
- prepare for inclusion of mdmpd

* Sat Jun 05 2004 Luca Berra <bluca@vodka.it> 1.6.0-1mdk 
- 1.6.0