forked from pool/dmraid
Accepting request 200579 from Base:System
- Fix Makefiles so they support DESTDIR Added: dmraid-destdir.patch - add tmpfiles.d so runtime directories are properly created - Remove sysvinit support and replace it for native systemd support. Added: dmraid-activation.service Removed: boot.dmraid OBS-URL: https://build.opensuse.org/request/show/200579 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/dmraid?expand=0&rev=47
This commit is contained in:
commit
4a1363fdff
67
boot.dmraid
67
boot.dmraid
@ -1,67 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
#
|
|
||||||
# Copyright (c) 2007 SuSE GmbH Nuernberg, Germany. All rights reserved.
|
|
||||||
#
|
|
||||||
# /etc/init.d/boot.dmraid
|
|
||||||
#
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: boot.dmraid
|
|
||||||
# Required-Start: boot.udev boot.rootfsck
|
|
||||||
# Should-Start: boot.device-mapper boot.multipath boot.md boot.scsidev
|
|
||||||
# X-Start-Before: boot.localfs
|
|
||||||
# Required-Stop: boot.udev boot.rootfsck
|
|
||||||
# Should-Stop: boot.multipath boot.md boot.scsidev
|
|
||||||
# X-Stop-Before: boot.localfs
|
|
||||||
# Default-Start: B
|
|
||||||
# Default-Stop:
|
|
||||||
# Short-Description: start dmraid
|
|
||||||
# Description: start dmraid
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
. /etc/rc.status
|
|
||||||
. /etc/sysconfig/dmraid
|
|
||||||
|
|
||||||
DMRAID=/sbin/dmraid
|
|
||||||
test -x $DMRAID || { echo "dmraid not installed";
|
|
||||||
if [ "$1" = "stop" ]; then exit 0;
|
|
||||||
else exit 5; fi; }
|
|
||||||
|
|
||||||
# udev interaction
|
|
||||||
if [ -x /sbin/udevadm ]; then
|
|
||||||
[ -z "$DMRAID_DEVICE_TIMEOUT" ] && DMRAID_DEVICE_TIMEOUT=60
|
|
||||||
else
|
|
||||||
DMRAID_DEVICE_TIMEOUT=0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# make sure /run/lock exists as /run is tmpfs
|
|
||||||
[ -d /run/lock ] || mkdir -p /run/lock >/dev/null 2>&1
|
|
||||||
|
|
||||||
rc_reset
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
start)
|
|
||||||
# Waiting for udev to settle
|
|
||||||
if [ "$DMRAID_DEVICE_TIMEOUT" -gt 0 ] ; then
|
|
||||||
echo "Waiting for udev to settle..."
|
|
||||||
/sbin/udevadm settle --timeout=$DMRAID_DEVICE_TIMEOUT
|
|
||||||
fi
|
|
||||||
echo "Activating dmraid..."
|
|
||||||
$DMRAID -ay -p $DMRAID_START_OPTIONS
|
|
||||||
|
|
||||||
rc_status -v -r
|
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
$DMRAID -an $DMRAID_STOP_OPTIONS
|
|
||||||
rc_status -v
|
|
||||||
;;
|
|
||||||
status)
|
|
||||||
rc_failed 4
|
|
||||||
rc_status -v
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Usage: $0 {start|stop|status}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
rc_exit
|
|
15
dmraid-activation.service
Normal file
15
dmraid-activation.service
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Activation of DM RAID sets
|
||||||
|
DefaultDependencies=no
|
||||||
|
Conflicts=shutdown.target
|
||||||
|
After=systemd-udev-settle.service
|
||||||
|
Before=lvm2-activation-early.service cryptsetup.target local-fs.target shutdown.target
|
||||||
|
Wants=systemd-udev-settle.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
EnvironmentFile=-/etc/sysconfig/dmraid
|
||||||
|
ExecStart=/sbin/dmraid -ay -p $DMRAID_START_OPTIONS
|
||||||
|
Type=oneshot
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=sysinit.target
|
65
dmraid-destdir.patch
Normal file
65
dmraid-destdir.patch
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
--- 1.0.0.rc16.orig/include/Makefile.in
|
||||||
|
+++ 1.0.0.rc16/include/Makefile.in
|
||||||
|
@@ -17,8 +17,8 @@ include $(top_srcdir)/make.tmpl
|
||||||
|
|
||||||
|
install_dmraid_headers: $(HEADERS)
|
||||||
|
@echo "Installing $(HEADERS) in $(includedir)/dmraid"
|
||||||
|
- mkdir -p $(includedir)/dmraid
|
||||||
|
- $(INSTALL) $(STRIP) $(HEADERS) $(includedir)/dmraid
|
||||||
|
+ mkdir -p $(DESTDIR)$(includedir)/dmraid
|
||||||
|
+ $(INSTALL) $(STRIP) $(HEADERS) $(DESTDIR)$(includedir)/dmraid
|
||||||
|
|
||||||
|
install: install_dmraid_headers
|
||||||
|
|
||||||
|
--- 1.0.0.rc16.orig/lib/Makefile.in
|
||||||
|
+++ 1.0.0.rc16/lib/Makefile.in
|
||||||
|
@@ -78,16 +78,16 @@ $(LIB_EVENTS_SHARED):
|
||||||
|
|
||||||
|
install_dmraid_libs: $(INSTALL_TARGETS)
|
||||||
|
@echo "Installing $(INSTALL_TARGETS) in $(libdir)"; \
|
||||||
|
- mkdir -p $(libdir); \
|
||||||
|
+ mkdir -p $(DESTDIR)$(libdir); \
|
||||||
|
for f in $(INSTALL_TARGETS); \
|
||||||
|
do \
|
||||||
|
n=$$(basename $${f}) ; \
|
||||||
|
if [[ "$$n" =~ .so$$ && ! "$$n" =~ libdmraid-events-.* ]]; then \
|
||||||
|
$(INSTALL) -m 555 $(STRIP) \
|
||||||
|
- $$f $(libdir)/$${n}.@DMRAID_LIB_VERSION@; \
|
||||||
|
- $(LN_S) -f $${n}.@DMRAID_LIB_VERSION@ $(libdir)/$${n}; \
|
||||||
|
+ $$f $(DESTDIR)$(libdir)/$${n}.@DMRAID_LIB_VERSION@; \
|
||||||
|
+ $(LN_S) -f $${n}.@DMRAID_LIB_VERSION@ $(DESTDIR)$(libdir)/$${n}; \
|
||||||
|
else \
|
||||||
|
- $(INSTALL) -m 555 $(STRIP) $$f $(libdir)/$${n}; \
|
||||||
|
+ $(INSTALL) -m 555 $(STRIP) $$f $(DESTDIR)$(libdir)/$${n}; \
|
||||||
|
fi \
|
||||||
|
done
|
||||||
|
|
||||||
|
--- 1.0.0.rc16.orig/tools/Makefile.in
|
||||||
|
+++ 1.0.0.rc16/tools/Makefile.in
|
||||||
|
@@ -80,8 +80,8 @@ dmevent_tool: $(top_srcdir)/lib/libdmrai
|
||||||
|
|
||||||
|
install_dmraid_tools: $(TARGETS)
|
||||||
|
@echo "Installing $(TARGETS) in $(sbindir)"; \
|
||||||
|
- mkdir -p $(sbindir); \
|
||||||
|
- $(INSTALL) $(STRIP) $(TARGETS) $(sbindir)
|
||||||
|
+ mkdir -p $(DESTDIR)$(sbindir); \
|
||||||
|
+ $(INSTALL) $(STRIP) $(TARGETS) $(DESTDIR)$(sbindir)
|
||||||
|
|
||||||
|
install: install_dmraid_tools
|
||||||
|
|
||||||
|
--- 1.0.0.rc16.orig/man/Makefile.in
|
||||||
|
+++ 1.0.0.rc16/man/Makefile.in
|
||||||
|
@@ -17,11 +17,11 @@ include $(top_srcdir)/make.tmpl
|
||||||
|
|
||||||
|
install_dmraid_man:
|
||||||
|
@echo "Installing $(MAN8) in $(MAN8DIR)"; \
|
||||||
|
- mkdir -p $(MAN8DIR); \
|
||||||
|
+ mkdir -p $(DESTDIR)$(MAN8DIR); \
|
||||||
|
for f in $(MAN8); \
|
||||||
|
do \
|
||||||
|
$(RM) $(MAN8DIR)/$$f; \
|
||||||
|
- @INSTALL@ -D -m 444 $$f $(MAN8DIR)/$$f; \
|
||||||
|
+ @INSTALL@ -D -m 444 $$f $(DESTDIR)$(MAN8DIR)/$$f; \
|
||||||
|
done
|
||||||
|
|
||||||
|
install: install_dmraid_man
|
@ -1,3 +1,13 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Sep 13 20:04:57 UTC 2013 - crrodriguez@opensuse.org
|
||||||
|
|
||||||
|
- Fix Makefiles so they support DESTDIR
|
||||||
|
Added: dmraid-destdir.patch
|
||||||
|
- add tmpfiles.d so runtime directories are properly created
|
||||||
|
- Remove sysvinit support and replace it for native systemd support.
|
||||||
|
Added: dmraid-activation.service
|
||||||
|
Removed: boot.dmraid
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Jul 23 14:38:15 CEST 2013 - ohering@suse.de
|
Tue Jul 23 14:38:15 CEST 2013 - ohering@suse.de
|
||||||
|
|
||||||
|
38
dmraid.spec
38
dmraid.spec
@ -21,6 +21,7 @@ BuildRequires: autoconf
|
|||||||
BuildRequires: automake
|
BuildRequires: automake
|
||||||
BuildRequires: device-mapper-devel
|
BuildRequires: device-mapper-devel
|
||||||
BuildRequires: libselinux-devel
|
BuildRequires: libselinux-devel
|
||||||
|
BuildRequires: systemd-rpm-macros
|
||||||
BuildRequires: zlib-devel
|
BuildRequires: zlib-devel
|
||||||
Requires: aaa_base
|
Requires: aaa_base
|
||||||
Requires: kpartx
|
Requires: kpartx
|
||||||
@ -32,10 +33,10 @@ Version: 1.0.0.rc16
|
|||||||
Release: 0
|
Release: 0
|
||||||
Source: ftp://people.redhat.com/heinzm/sw/dmraid/src/dmraid-%{version}.tar.bz2
|
Source: ftp://people.redhat.com/heinzm/sw/dmraid/src/dmraid-%{version}.tar.bz2
|
||||||
Source1: sysconfig.dmraid
|
Source1: sysconfig.dmraid
|
||||||
Source2: boot.dmraid
|
|
||||||
Source3: README.SuSE
|
Source3: README.SuSE
|
||||||
Source4: mkinitrd-setup.sh
|
Source4: mkinitrd-setup.sh
|
||||||
Source5: mkinitrd-boot.sh
|
Source5: mkinitrd-boot.sh
|
||||||
|
Source6: dmraid-activation.service
|
||||||
Patch1: dmraid-1.0.0.rc16-cvs-2010-02-02.patch
|
Patch1: dmraid-1.0.0.rc16-cvs-2010-02-02.patch
|
||||||
Patch2: dmraid-1.0.0.rc13-geometry.patch
|
Patch2: dmraid-1.0.0.rc13-geometry.patch
|
||||||
Patch3: lib-install.patch
|
Patch3: lib-install.patch
|
||||||
@ -44,8 +45,10 @@ Patch5: remove_trylock
|
|||||||
Patch6: rebuild.fix
|
Patch6: rebuild.fix
|
||||||
Patch7: ddf-erase
|
Patch7: ddf-erase
|
||||||
Patch8: dmraid-move-var-lock-to-run-lock.patch
|
Patch8: dmraid-move-var-lock-to-run-lock.patch
|
||||||
|
Patch9: dmraid-destdir.patch
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
PreReq: %fillup_prereq
|
PreReq: %fillup_prereq
|
||||||
|
%{systemd_requires}
|
||||||
|
|
||||||
%description
|
%description
|
||||||
This software discovers, activates, deactivates, and displays
|
This software discovers, activates, deactivates, and displays
|
||||||
@ -83,21 +86,16 @@ Authors:
|
|||||||
%patch6 -p1
|
%patch6 -p1
|
||||||
%patch7 -p1
|
%patch7 -p1
|
||||||
%patch8 -p1
|
%patch8 -p1
|
||||||
|
%patch9 -p1
|
||||||
cp %{SOURCE3} .
|
cp %{SOURCE3} .
|
||||||
|
|
||||||
%build
|
%build
|
||||||
#rm -f aclocal.m4
|
#rm -f aclocal.m4
|
||||||
autoreconf -fi
|
autoreconf -fi
|
||||||
rm -r autom4te.cache
|
rm -r autom4te.cache
|
||||||
# Update config.{guess,sub}
|
%configure \
|
||||||
%{?suse_update_config}
|
--libdir=/%_lib \
|
||||||
export CFLAGS="$RPM_OPT_FLAGS"
|
--sbindir=/sbin \
|
||||||
./configure --prefix=$RPM_BUILD_ROOT%{_prefix} \
|
|
||||||
--infodir=$RPM_BUILD_ROOT%{_infodir} \
|
|
||||||
--libdir=$RPM_BUILD_ROOT/%_lib \
|
|
||||||
--mandir=$RPM_BUILD_ROOT%{_mandir} \
|
|
||||||
--includedir=$RPM_BUILD_ROOT%{_includedir} \
|
|
||||||
--sbindir=$RPM_BUILD_ROOT/sbin \
|
|
||||||
--with-user=`id -nu` --with-group=`id -ng` \
|
--with-user=`id -nu` --with-group=`id -ng` \
|
||||||
--enable-libselinux --enable-libsepol
|
--enable-libselinux --enable-libsepol
|
||||||
make
|
make
|
||||||
@ -110,26 +108,27 @@ rm $RPM_BUILD_ROOT/%_lib/libdmraid.so
|
|||||||
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
|
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
|
||||||
install -m644 %{SOURCE1} $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.dmraid
|
install -m644 %{SOURCE1} $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.dmraid
|
||||||
mkdir -p $RPM_BUILD_ROOT/etc/init.d
|
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 -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: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 -m 755 %{S:5} $RPM_BUILD_ROOT/lib/mkinitrd/scripts/boot-dmraid.sh
|
||||||
|
install -D -m 0644 %{S:6} %{buildroot}%{_unitdir}/dmraid-activation.service
|
||||||
|
install -d %{buildroot}%{_tmpfilesdir}
|
||||||
|
echo 'd /run/lock/dmraid 0700 root root -' > %{buildroot}%{_tmpfilesdir}/dmraid.conf
|
||||||
|
|
||||||
|
%preun
|
||||||
|
%service_del_preun dmraid-activation.service
|
||||||
|
|
||||||
%post
|
%post
|
||||||
|
/sbin/ldconfig
|
||||||
|
%service_add_post dmraid-activation.service
|
||||||
[ -x /sbin/mkinitrd_setup ] && mkinitrd_setup
|
[ -x /sbin/mkinitrd_setup ] && mkinitrd_setup
|
||||||
%{fillup_only}
|
%{fillup_only}
|
||||||
|
|
||||||
%postun
|
%postun
|
||||||
|
/sbin/ldconfig
|
||||||
[ -x /sbin/mkinitrd_setup ] && mkinitrd_setup
|
[ -x /sbin/mkinitrd_setup ] && mkinitrd_setup
|
||||||
%{insserv_cleanup}
|
%{insserv_cleanup}
|
||||||
|
|
||||||
%preun
|
|
||||||
%stop_on_removal
|
|
||||||
|
|
||||||
%clean
|
|
||||||
[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] \
|
|
||||||
&& rm -rf $RPM_BUILD_ROOT
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(-, root, root)
|
%defattr(-, root, root)
|
||||||
/sbin/dmraid
|
/sbin/dmraid
|
||||||
@ -137,12 +136,13 @@ install -m 755 %{S:5} $RPM_BUILD_ROOT/lib/mkinitrd/scripts/boot-dmraid.sh
|
|||||||
%{_mandir}/man8/*
|
%{_mandir}/man8/*
|
||||||
%doc LICENSE LICENSE_GPL LICENSE_LGPL README README.SuSE TODO doc/*
|
%doc LICENSE LICENSE_GPL LICENSE_LGPL README README.SuSE TODO doc/*
|
||||||
/var/adm/fillup-templates/sysconfig.dmraid
|
/var/adm/fillup-templates/sysconfig.dmraid
|
||||||
/etc/init.d/boot.dmraid
|
|
||||||
%dir /lib/mkinitrd
|
%dir /lib/mkinitrd
|
||||||
%dir /lib/mkinitrd/scripts
|
%dir /lib/mkinitrd/scripts
|
||||||
/lib/mkinitrd/scripts/setup-dmraid.sh
|
/lib/mkinitrd/scripts/setup-dmraid.sh
|
||||||
/lib/mkinitrd/scripts/boot-dmraid.sh
|
/lib/mkinitrd/scripts/boot-dmraid.sh
|
||||||
/%{_lib}/libdmraid-events-isw.so
|
/%{_lib}/libdmraid-events-isw.so
|
||||||
/%{_lib}/libdmraid.so.1.0.0.rc16-3
|
/%{_lib}/libdmraid.so.1.0.0.rc16-3
|
||||||
|
%{_tmpfilesdir}/dmraid.conf
|
||||||
|
%{_unitdir}/dmraid-activation.service
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
Loading…
Reference in New Issue
Block a user