File dmraid.spec of Package dmraid

#
# spec file for package dmraid (Version 1.0.0.rc15)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:           dmraid
BuildRequires:  device-mapper-devel zlib-devel
BuildRequires:  libselinux-devel
Requires:       kpartx
Url:            http://people.redhat.com/~heinzm/sw/dmraid/src/
License:        GPL v2 or later
Group:          System/Base
AutoReqProv:    on
Summary:        A Device-Mapper Software RAID Support Tool
Version:        1.0.0.rc15
Release:        4
Source:         ftp://people.redhat.com/heinzm/sw/dmraid/src/dmraid-%{version}.tar.bz2
Source1:        sysconfig.dmraid
Source2:        boot.dmraid
Source3:        README.SuSE
Source4:        mkinitrd-setup.sh
Source5:        mkinitrd-boot.sh
Source6:        libdmraid-events_DSO-1.0.0.rc4.tgz
Source7:        dm_dso_reg_tool-1.0.0.rc2.tgz
Patch0:         dmraid_fixup_paths3.diff
Patch3:         dmraid_duplicate_args.patch
Patch4:         dmraid-1.0.0.rc13-geometry.patch
Patch6:         dmraid-1.0.0.rc15-fix_macro.patch
Patch10:        dmraid-1.0.0.rc14-fixup_lsi1068e.patch
Patch11:        dmraid-1.0.0.rc15-scsi_serial_remove_ws.patch
# libdmraid-events
Patch50:        libdmraid-events.dif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
PreReq:         %fillup_prereq

%description
This software discovers, activates, deactivates, and displays
properties of software RAID sets, such as ATARAID, and contained DOS
partitions.

dmraid uses libdevmapper and the device-mapper kernel runtime to create
devices with respective mappings for the ATARAID sets discovered.

The following ATARAID types are supported:

- Highpoint HPT37X

- Highpoint HPT45X

- Intel Software RAID

- Promise FastTrak

- Silicon Image Medley



Authors:
--------
    Heinz Mauelshagen

%package -n libdmraid-events0
License:        GPL v2 or later
Group:          System/Base
Summary:        A Device-Mapper Software RAID Support Tool

%description -n libdmraid-events0
This software discovers, activates, deactivates, and displays
properties of software RAID sets, such as ATARAID, and contained DOS
partitions.

dmraid uses libdevmapper and the device-mapper kernel runtime to create
devices with respective mappings for the ATARAID sets discovered.

The following ATARAID types are supported:

- Highpoint HPT37X

- Highpoint HPT45X

- Intel Software RAID

- Promise FastTrak

- Silicon Image Medley



Authors:
--------
    Heinz Mauelshagen

%prep
%setup -a 6 -a 7 -n dmraid/%{version}
%patch0 -p2
%patch3 -p1
%patch4 -p1
%patch6 -p1
%patch10 -p1
%patch11 -p1
pushd libdmraid*
%patch50
popd
cp %{SOURCE3} .

%build
#rm -f aclocal.m4
autoreconf -fi
rm -r autom4te.cache
# Update config.{guess,sub}
%{?suse_update_config}
export CFLAGS="$RPM_OPT_FLAGS" 
./configure --prefix=%{_prefix} \
  --infodir=%{_infodir} \
  --libdir=%{_libdir} \
  --mandir=%{_mandir} \
  --sbindir=/sbin \
  --with-user=`id -nu` --with-group=`id -ng` \
  --enable-libselinux --enable-libsepol
make
pushd libdmraid-events
CPATH=../include LIBRARY_PATH=../lib make
ln -sf libdmraid-events.so.0 libdmraid-events.so
popd
pushd reg_tool
make
popd

%install
make install DESTDIR=$RPM_BUILD_ROOT
rm -rf $RPM_BUILD_ROOT/usr/include/dmraid
rm $RPM_BUILD_ROOT%{_libdir}/libdmraid.a
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
install -m644 %{SOURCE1} $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.dmraid
mkdir -p $RPM_BUILD_ROOT/etc/init.d
install -m744 %{SOURCE2} $RPM_BUILD_ROOT/etc/init.d/boot.dmraid
install -d $RPM_BUILD_ROOT/lib/mkinitrd/scripts
install -m 755 %{S:4} $RPM_BUILD_ROOT/lib/mkinitrd/scripts/setup-dmraid.sh
install -m 755 %{S:5} $RPM_BUILD_ROOT/lib/mkinitrd/scripts/boot-dmraid.sh
install -D -m755 libdmraid-events/libdmraid-events.so.0 $RPM_BUILD_ROOT/%{_lib}/libdmraid-events.so.0
cp -a libdmraid-events/libdmraid-events.so $RPM_BUILD_ROOT/%{_lib}/libdmraid-events.so
install -D -m755 reg_tool/dm_dso_reg_tool $RPM_BUILD_ROOT/sbin/dm_dso_reg_tool
install -D -m644 reg_tool/dm_dso_reg_tool.8 $RPM_BUILD_ROOT/usr/share/man/man8/dm_dso_reg_tool.8

%post
[ -x /sbin/mkinitrd_setup ] && mkinitrd_setup
%{fillup_only}

%postun
[ -x /sbin/mkinitrd_setup ] && mkinitrd_setup
%{insserv_cleanup}

%preun
%stop_on_removal

%post -n libdmraid-events0 -p /sbin/ldconfig

%postun -n libdmraid-events0 -p /sbin/ldconfig

%clean
[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] \
  && rm -rf $RPM_BUILD_ROOT

%files
%defattr(-, root, root)
#%{_libdir}/libdmraid.so
/sbin/dmraid
%{_mandir}/man8/*
%doc LICENSE LICENSE_GPL LICENSE_LGPL README README.SuSE TODO doc/*
/var/adm/fillup-templates/sysconfig.dmraid
/etc/init.d/boot.dmraid
%dir /lib/mkinitrd
%dir /lib/mkinitrd/scripts
/lib/mkinitrd/scripts/setup-dmraid.sh
/lib/mkinitrd/scripts/boot-dmraid.sh
/%{_lib}/libdmraid-events.so
/sbin/dm_dso_reg_tool

%files -n libdmraid-events0
%defattr(-, root, root)
/%{_lib}/libdmraid-events.so.0

%changelog
* Mon Nov 24 2008 hare@suse.de
- Properly quote mkinitrd scripts (bnc#447966)
* Mon Nov 10 2008 mkoenig@suse.de
- adapt mkinitrd script to changed UUID prefix [bnc#441479]
* Tue Oct 14 2008 mkoenig@suse.de
- remove whitespace from serial id [bnc#433833]
* Thu Sep 25 2008 mkoenig@suse.de
- update to 1.0.0rc15
  * jm.c: fixed name handling
  * nv.c: fixed endian bug
  * added support for RAID set create/remove/rebuild and
  event handling
- needed for [fate#304215,fate#303950,fate#304216]
- removed patches
  dmraid-1.0.0.rc13-jm_termination.patch
  dmraid-1.0.0.rc14-ddf1_segfault.patch
  dmraid-add_uuid.patch
  dmraid_fixup_nvidia.diff
  dmraid-move-type-definition.diff
  dmraid-pdc_max_sectors.patch
* Wed Sep 24 2008 ro@suse.de
- change "udevsettle" to "udevadm settle"
* Tue Sep 16 2008 mkoenig@suse.de
- ignore the timestamp for LSI 1068E DDF1 metadata [bnc#426615]
* Mon Sep 15 2008 ro@suse.de
- fix typo in libdmraid Makefile
- split off libdmraid-events0 package according to
  shared library packaging policy
* Sat Sep 13 2008 meissner@suse.de
- symlink, not copy the .so to the .so.0 file
- removed self-provides, some other .spec file fixes
* Wed Sep 10 2008 xwhu@novell.com
- Adding DSO for event-handling [fate#304214]
* Wed Sep 03 2008 hare@suse.de
- Call mkinitrd_setup during %%post and %%postun (bnc#413709)
* Wed Aug 20 2008 mkoenig@suse.de
- enable SELinux support [fate#303662]
* Wed Aug 13 2008 mkoenig@suse.de
- fix init script tags
* Wed Jul 23 2008 hare@suse.de
- Include mkinitrd scriptlets.
* Wed Mar 12 2008 mkoenig@suse.de
- add hack to avoid segfault with DDF1 metadata and explicit
  indication of the raid set [#367686]
* Wed Sep 12 2007 mkoenig@suse.de
- add quirk for maximum detected device size of some pdc card
  [#215222]
* Tue Jul 31 2007 hare@suse.de
- dmraid requires kpartx.
* Mon Jul 30 2007 hare@suse.de
- Do not activate partitions from dmraid; udev handles it.
* Tue Jul 10 2007 mkoenig@suse.de
- update to version 1.0.0.rc14
  * bugfix release
* Tue Jun 19 2007 mkoenig@suse.de
- use boot.localfs to avoid expansion problem
* Tue Jun 19 2007 mkoenig@suse.de
- Add X-Start-Before: $local_fs dependency
* Thu Mar 29 2007 mkoenig@suse.de
- Add zlib-devel to BuildRequires
* Tue Feb 20 2007 mkoenig@suse.de
- provide boot script [#230708]
* Mon Dec 11 2006 mkoenig@suse.de
- fix jm name string termination problem [#223843]
  patch: dmraid-1.0.0.rc13-jm_termination.patch
- fix min, max macros
  patch: dmraid-1.0.0.rc13-fix_macro.patch
* Thu Nov 23 2006 mkoenig@suse.de
- fix geometry patch [#222110]
* Mon Nov 20 2006 mkoenig@suse.de
- set geometry of dm device [#222110]
* Thu Nov 09 2006 mkoenig@suse.de
- update to version 1.0.0.rc13
  * Fixes for Promise FastTrak and Silicon Image Medley ATARAID
  * Support for SNIA DDF1 and JBOD
* Wed Sep 13 2006 ro@suse.de
- use device-mapper-devel in BuildRequires
* Tue Aug 29 2006 hare@suse.de
- update to 1.0.0-rc11
- NVidia endianness fixes
- Add UUID to device-mapper tables
- Fixup '-cc' argument
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Mon Dec 05 2005 kukuk@suse.de
- Remove unused klibc-devel from neededforbuild
* Wed Jul 13 2005 cadaha@suse.de
- update to 1.0.0-rc8, fix big endian build
* Wed Sep 22 2004 cadaha@suse.de
- fix dmraid -rc output for unsupported devices
* Mon Sep 20 2004 cadaha@suse.de
- created package
openSUSE Build Service is sponsored by