%define extraver rc16 #define pre pre1 %define rel 29 # from lib/version.h %define drmajor 1 %define drlibname %mklibname dmraid %drmajor %define drdevname %mklibname dmraid -d # we need the libs in /lib(64) as /usr might not be mounted %define _libdir /%{_lib} %define _usrlibdir /usr/%{_lib} # yes this sucks, but it has to %if %{?extraver:1}%{?!extraver:0} %if %{?pre:1}%{?!pre:0} %define release %mkrel 0.%{extraver}.0.%{pre}.%{rel} %define extrasrc .%{extraver}-%{pre} %else %define release %mkrel 0.%{extraver}.%{rel} %define extrasrc .%{extraver} %endif %endif %define build_static 0 %{?_with_static: %{expand: %%global build_static 1}} %{?_without_static: %{expand: %%global build_static 0}} # Building of dmraid-event-logwatch (disabled by default) %define build_logwatch 0 %{?_with_logwatch: %{expand: %%global build_logwatch 1}} %{?_without_logwatch: %{expand: %%global build_logwatch 0}} Summary: Device-mapper ATARAID tool Name: dmraid Version: 1.0.0 Release: %{release} Source0: http://people.redhat.com/~heinzm/sw/dmraid/src/dmraid-%{version}%{extrasrc}.tar.bz2 Source1: fedora-dmraid-activation Source2: dmraid-activation.service Source3: %{name}-tmpfiles.conf # (bluca) since fedora/redhat rpm is the real upstream for dmraid # patch numbers < 100 are reserved for patches synced from fedora/redhat # patch numbers > 100 are for our distro specific patches Patch0: dmraid-1.0.0.rc16-test_devices.patch Patch1: ddf1_lsi_persistent_name.patch Patch2: pdc_raid10_failure.patch Patch3: return_error_wo_disks.patch Patch4: fix_sil_jbod.patch Patch5: avoid_register.patch #we dont use this# Patch6: move_pattern_file_to_var.patch Patch7: libversion.patch Patch8: libversion-display.patch Patch9: bz635995-data_corruption_during_activation_volume_marked_for_rebuild.patch # Patch10: bz626417_8-faulty_message_after_unsuccessful_vol_registration.patch Patch11: bz626417_19-enabling_registration_degraded_volume.patch Patch12: bz626417_20-cleanup_some_compilation_warning.patch Patch13: bz626417_21-add_option_that_postpones_any_metadata_updates.patch Patch101: lib-events-libdmraid-events-isw-strfmt.patch Patch102: fix-linking.patch Patch103: libdmraid-events-soname.patch Patch104: libdmraid-events-install.patch Patch105: pdc-add-extra-offsets.patch Patch106: activate-multiple-raid-sets.patch # patches from ubuntu merged upstream Patch110: 12_support_virtio_devices.patch Patch111: 17_isw-probe-hpa.patch Patch112: 20_fix_isw_sectors_calculation.patch Patch113: 21_fix_testing.patch Patch114: 21_jmicron_namefix.patch Patch115: 23_pdc_dump_extended_metadata.patch Patch116: 24_drop_p_for_partition_conditional.patch License: GPLv2+ Group: System/Kernel and hardware URL: http://people.redhat.com/~heinzm Requires: kpartx >= 0.4.8-16 Requires: %{drlibname} = %{version}-%{release} Requires: dmraid-events = %{version}-%{release} Requires(post): systemd >= %{systemd_required_version} BuildRequires: pkgconfig(systemd) BuildRequires: pkgconfig(devmapper) >= 1.02.90 BuildRequires: pkgconfig(devmapper-event) >= 1.02.90 %if %{build_static} BuildRequires: glibc-static-devel %endif %description dmraid (Device-Mapper Raid tool) supports RAID device discovery, RAID set activation, creation, removal, rebuild and display of properties for ATARAID/DDF1 metadata. 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: Adaptec HostRAID ASR Highpoint HPT37X Highpoint HPT45X Intel Software RAID JMicron JMB36x LSI Logic MegaRAID NVidia NForce Promise FastTrack Silicon Image Medley SNIA DDF1 VIA Software RAID %package -n %{drlibname} Summary: Libraries for dmraid Group: System/Libraries %description -n %{drlibname} Provides libraries for dmraid. %package -n %{drdevname} Summary: Development libraries and headers for dmraid Group: Development/C Provides: %{name}-devel = %{version}-%{release} Provides: %{name}-devel%{?_isa} = %{version}-%{release} Requires: %{drlibname}%{?_isa} = %{version}-%{release} %description -n %{drdevname} Provides a library interface for RAID device discovery, RAID set activation and display of properties for ATARAID volumes. %package events Summary: Dmraid event tool Group: System/Base Requires: dmraid = %{version}-%{release} Requires: device-mapper-event >= 1.02.02 %description events Provides a dmeventd DSO and the dmevent_tool to register devices with it for device monitoring. All active RAID sets should be manually registered with dmevent_tool. %if %{build_logwatch} %package events-logwatch Summary: Dmraid logwatch-based email reporting Group: System/Base Requires: dmraid-events = %{version}-%{release}, logwatch, /etc/cron.d %description events-logwatch Provides device failure reporting via logwatch-based email reporting. Device failure reporting has to be activated manually by activating the /etc/cron.d/dmeventd-logwatch entry and by calling the dmevent_tool (see manual page for examples) for any active RAID sets. %endif %prep %setup -q -n %{name}/%{version}.%{extraver} %patch0 -p1 -b .test_devices %patch1 -p1 -b .ddf1_lsi_persistent_name %patch2 -p1 -b .pdc_raid10_failure %patch3 -p1 -b .return_error_wo_disks %patch4 -p1 -b .fix_sil_jbod %patch5 -p1 -b .avoid_register %patch7 -p1 -b .libversion %patch8 -p1 -b .libversion_display %patch9 -p1 -b .bz635995 %patch11 -p1 -b .bz626417_19 %patch12 -p1 -b .bz626417_20 %patch13 -p1 -b .bz626417_21 %patch101 -p1 -b .libdmraid_events_isw_strfmt %patch102 -p1 -b .linking %patch103 -p1 -b .lib_events_soname %patch104 -p1 -b .lib_events_install %patch105 -p1 -b .pdc-extra-offsets %patch106 -p1 -b .activate-multiple-raid %patch110 -p2 -b .virtio %patch111 -p2 -b .hpa %patch112 -p2 -b .isw_sectors %patch113 -p2 -b .block_testing %patch114 -p2 -b .jmicron_namefix %patch115 -p2 -b .pdc_ext_metadata %patch116 -p2 -b ._partition_cond_p # fix build on aarch64 cp -af %{_rpmconfigdir}/config.{guess,sub} autoconf/ %build %define common_configure_parameters --with-user=`id -un` --with-group=`id -gn` --disable-libselinux --disable-libsepol --enable-led --enable-intel_led %if %{build_static} %configure2_5x %{common_configure_parameters} --enable-static_link make mv tools/dmraid tools/dmraid-static make clean %endif %configure2_5x %{common_configure_parameters} --enable-shared_lib make %install %makeinstall -s sbindir=%{buildroot}/sbin %if %{build_static} install tools/dmraid-static %{buildroot}/sbin mkdir -p %{buildroot}%{_usrlibdir} mv %{buildroot}%{_libdir}/libdmraid.a %{buildroot}%{_usrlibdir} %else rm -f %{buildroot}%{_libdir}/libdmraid.a %endif install -D -p -m 644 %{SOURCE3} %{buildroot}%{_tmpfilesdir}/%{name}.conf # cannot move .so symlink to %{_usrlibdir}, there is some build # macro that recreates it every time #ln -s %{_libdir}/libdmraid.so.%{drmajor} %{buildroot}%{_usrlibdir}/libdmraid.so #rm -f %{_libdir}/libdmraid.so %if %{build_logwatch} # Install logwatch config file and script for dmeventd mkdir -p %{buildroot}/etc/cron.d mkdir -p %{buildroot}/etc/logwatch/conf/services mkdir -p %{buildroot}/etc/logwatch/scripts/services install -m 644 logwatch/dmeventd.conf %{buildroot}/etc/logwatch/conf/services/dmeventd.conf install -m 755 logwatch/dmeventd %{buildroot}/etc/logwatch/scripts/services/dmeventd install -m 644 logwatch/dmeventd_cronjob.txt %{buildroot}/etc/cron.d/dmeventd-logwatch install -m 0700 /dev/null %{buildroot}/etc/logwatch/scripts/services/dmeventd_syslogpattern.txt %endif # Install systemd unit install -d %{buildroot}%{_prefix}/lib/systemd install -d %{buildroot}%{_unitdir} install -p -m 755 %{SOURCE1} %{buildroot}%{_prefix}/lib/systemd/fedora-dmraid-activation install -p -m 444 %{SOURCE2} %{buildroot}%{_unitdir}/dmraid-activation.service %post %_tmpfilescreate %{name} %systemd_post dmraid-activation.service %preun %systemd_preun dmraid-activation.service %files %defattr(-,root,root,755) %doc CHANGELOG CREDITS KNOWN_BUGS README TODO doc/dmraid_design.txt /sbin/dmraid %if %{build_static} /sbin/dmraid-static %endif %{_mandir}/man8/dmraid.8* %{_prefix}/lib/systemd/fedora-dmraid-activation %{_unitdir}/dmraid-activation.service %{_tmpfilesdir}/%{name}.conf %files -n %{drlibname} %defattr(-,root,root,755) %{_libdir}/libdmraid.so.%{drmajor}{,.*} %files -n %{drdevname} %defattr(644,root,root,755) %dir %{_includedir}/dmraid %{_includedir}/dmraid/*.h %if %{build_static} %{_usrlibdir}/libdmraid.a %endif %{_libdir}/libdmraid.so %files events %defattr(-,root,root,755) /sbin/dmevent_tool %{_libdir}/libdmraid-events-isw.so %{_mandir}/man8/dmevent_tool* %if %{build_logwatch} %files events-logwatch %defattr(-,root,root,755) %config(noreplace) /etc/logwatch/* %config(noreplace) /etc/cron.d/dmeventd-logwatch %ghost /etc/logwatch/scripts/services/dmeventd_syslogpattern.txt %endif %changelog * Sat Jan 26 2019 ngompa <ngompa> 1.0.0-0.rc16.29.mga7 + Revision: 1361035 - Add missing lib requires for devel subpackage * Tue Jan 15 2019 ngompa <ngompa> 1.0.0-0.rc16.28.mga7 + Revision: 1357182 - Fix devel subpackage to use correct group and add missing Provides * Sun Sep 23 2018 umeabot <umeabot> 1.0.0-0.rc16.27.mga7 + Revision: 1297469 - Mageia 7 Mass Rebuild * Tue Jun 05 2018 wally <wally> 1.0.0-0.rc16.26.mga7 + Revision: 1234821 - fix build on aarch64 * Sun Dec 31 2017 ngompa <ngompa> 1.0.0-0.rc16.25.mga7 + Revision: 1188183 - Actually install the right file for tmpfiles config * Sat Dec 30 2017 ngompa <ngompa> 1.0.0-0.rc16.24.mga7 + Revision: 1188128 - Ensure systemd macros are available * Sat Dec 30 2017 ngompa <ngompa> 1.0.0-0.rc16.23.mga7 + Revision: 1188080 - Migrate dmraid activation service from initscripts to dmraid * Thu Feb 11 2016 umeabot <umeabot> 1.0.0-0.rc16.22.mga6 + Revision: 953792 - Mageia 6 Mass Rebuild + tv <tv> - switch to pkgconfig() BRs * Fri Aug 21 2015 tmb <tmb> 1.0.0-0.rc16.21.mga6 + Revision: 867936 - rebuild for new gcc * Mon Apr 06 2015 tmb <tmb> 1.0.0-0.rc16.20.mga5 + Revision: 819757 - move to release * Mon Apr 06 2015 tmb <tmb> 1.0.0-0.rc16.19.mga5 + Revision: 819747 - re-enable P116 (conditionally add 'p' to partition name like kpartx * Wed Oct 15 2014 umeabot <umeabot> 1.0.0-0.rc16.18.mga5 + Revision: 743370 - Second Mageia 5 Mass Rebuild * Tue Sep 16 2014 umeabot <umeabot> 1.0.0-0.rc16.17.mga5 + Revision: 678774 - Mageia 5 Mass Rebuild * Sun Sep 07 2014 tmb <tmb> 1.0.0-0.rc16.16.mga5 + Revision: 673320 - rebuild for new device-mapper * Wed Nov 06 2013 tmb <tmb> 1.0.0-0.rc16.15.mga4 + Revision: 549789 - disable P16 (conditional 'p' in partition name) as it breaks what installer expects * Sun Oct 27 2013 fwang <fwang> 1.0.0-0.rc16.14.mga4 + Revision: 547273 - link against dl + umeabot <umeabot> - Mageia 4 Mass Rebuild * Sun Mar 24 2013 colin <colin> 1.0.0-0.rc16.13.mga3 + Revision: 405136 - Use tmpfiles macros and add system version to requires (mga#9302) * Fri Jan 11 2013 umeabot <umeabot> 1.0.0-0.rc16.12.mga3 + Revision: 348890 - Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild * Sun Jan 06 2013 tmb <tmb> 1.0.0-0.rc16.11.mga3 + Revision: 339672 - rebuild for new devicemapper * Tue Jul 24 2012 colin <colin> 1.0.0-0.rc16.10.mga3 + Revision: 274015 - Do not ship files in /var/lock, use tmpfiles instead * Tue Mar 06 2012 tmb <tmb> 1.0.0-0.rc16.9.mga2 + Revision: 220217 - rebuild for new device-mapper * Fri Jan 06 2012 tmb <tmb> 1.0.0-0.rc16.8.mga2 + Revision: 192748 - add patches from upstream * support virtio devices (P110) * probe isw disks with (some) HPA awareness (P111) * fix isw raid0 incorrect sectors calculation (P112) * fix test on /dev/dm-X (P113) * fix jmicron controller detection (P114) * dump all 4 metadata sets on pdc with -rD or -n (P115) * fix conditional adding of 'p' if partition name ends with a number (P116) * Tue Jan 03 2012 tmb <tmb> 1.0.0-0.rc16.7.mga2 + Revision: 190040 - build with devmapper 1.02.67 * Wed Dec 07 2011 tmb <tmb> 1.0.0-0.rc16.6.mga2 + Revision: 178093 - activate multiple raid sets - add extra offsets where promise metadata can be found * Fri Oct 28 2011 tmb <tmb> 1.0.0-0.rc16.5.mga2 + Revision: 158914 - rebuild for updated device-mapper - disable static build * Wed Jan 12 2011 tmb <tmb> 1.0.0-0.rc16.4.mga1 + Revision: 7698 - imported package dmraid