- from PLD
authorMarcin Krol <hawk@tld-linux.org>
Mon, 27 Apr 2015 12:09:21 +0000 (12:09 +0000)
committerMarcin Krol <hawk@tld-linux.org>
Mon, 27 Apr 2015 12:09:21 +0000 (12:09 +0000)
dlm-systemd-configfs.patch [new file with mode: 0644]
dlm.conf [new file with mode: 0644]
dlm.init [new file with mode: 0644]
dlm.spec [new file with mode: 0644]
dlm.sysconfig [new file with mode: 0644]
dlm.tmpfiles [new file with mode: 0644]
old_udev_dir.patch [new file with mode: 0644]

diff --git a/dlm-systemd-configfs.patch b/dlm-systemd-configfs.patch
new file mode 100644 (file)
index 0000000..ac94eb0
--- /dev/null
@@ -0,0 +1,10 @@
+diff -dur dlm-4.0.2.orig/init/dlm.service dlm-4.0.2/init/dlm.service
+--- dlm-4.0.2.orig/init/dlm.service    2013-07-31 17:50:26.000000000 +0200
++++ dlm-4.0.2/init/dlm.service 2014-01-06 12:07:28.823033320 +0100
+@@ -1,5 +1,6 @@
+ [Unit]
+ Description=dlm control daemon
++Requires=sys-kernel-config.mount
+ After=syslog.target network.target corosync.service sys-kernel-config.mount
+ [Service]
diff --git a/dlm.conf b/dlm.conf
new file mode 100644 (file)
index 0000000..959948e
--- /dev/null
+++ b/dlm.conf
@@ -0,0 +1,15 @@
+#
+# see dlm_conf(5) and dlm_controld(8) manual pages for details
+#
+
+# enable kernel dlm debugging messages
+#log_debug=0
+
+# to force TCP protocol
+#protocol=tcp
+
+#
+#enable_fencing=1
+
+#
+#fence_all dlm_stonith_reboot
diff --git a/dlm.init b/dlm.init
new file mode 100644 (file)
index 0000000..c948e8a
--- /dev/null
+++ b/dlm.init
@@ -0,0 +1,85 @@
+#!/bin/sh
+#
+# dlm_controld
+#
+# chkconfig: 345 22 78
+# description: starts and stops dlm_controld
+#
+
+. /etc/rc.d/init.d/functions
+
+DLM_CONTROLD_OPTS=""
+
+[ -f /etc/sysconfig/dlm ] && . /etc/sysconfig/dlm
+
+setup() {
+       /sbin/modprobe -q dlm
+       mount -t configfs none /sys/kernel/config > /dev/null 2>&1
+}
+
+start() {
+
+       # Check if the service is already running?
+       if [ -f /var/lock/subsys/dlm ]; then
+               msg_already_running "dlm_controld"
+               return
+       fi
+
+       setup
+
+       msg_starting "dlm_controld"
+
+       daemon /usr/sbin/dlm_controld $DLM_CONTROLD_OPTS
+       RETVAL=$?
+       [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dlm
+}
+
+stop() {
+       if [ ! -f /var/lock/subsys/dlm ]; then
+               msg_not_running "dlm_controld"
+               return
+       fi
+
+       msg_stopping "dlm_controld"
+       killproc dlm_controld
+       rm -f /var/lock/subsys/dlm
+}
+
+condrestart() {
+       if [ ! -f /var/lock/subsys/dlm ]; then
+               msg_not_running "dlm_controld"
+               RETVAL=$1
+               return
+       fi
+
+       stop
+       start
+}
+
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
+       ;;
+  restart)
+       stop
+       start
+       ;;
+  try-restart)
+       condrestart 0
+       ;;
+  force-reload)
+       condrestart 0
+       ;;
+  status)
+       status --pidfile /var/run/dlm/dlm_controld.pid dlm dlm_controld
+       exit $?
+       ;;
+  *)
+       msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
+       exit 3
+esac
+exit $RETVAL
diff --git a/dlm.spec b/dlm.spec
new file mode 100644 (file)
index 0000000..3676c0c
--- /dev/null
+++ b/dlm.spec
@@ -0,0 +1,187 @@
+#
+# Conditional build:
+%bcond_without dlm_stonith     # build without fencing helper
+#
+Summary:       General-purpose distributed lock manager
+Summary(pl.UTF-8):     Zarządca rozproszonych blokad ogólnego przeznaczenia
+Name:          dlm
+%define     _snap   4283123f0b13eafc46d825050c5142cf44be79c3
+Version:       4.0.3
+Release:       1
+License:       LGPL v2.1+, GPL v2
+Group:         Libraries
+Source0:       https://git.fedorahosted.org/cgit/dlm.git/snapshot/%{name}-%{_snap}.tar.bz2
+# Source0-md5: 575174a0d7b0e1a6e45ec88f447c48cc
+Source1:       %{name}.init
+Source2:       %{name}.sysconfig
+Source3:       %{name}.tmpfiles
+Source4:       dlm.conf
+Patch0:                %{name}-systemd-configfs.patch
+Patch1:     old_udev_dir.patch
+URL:           http://sources.redhat.com/cluster/dlm/
+BuildRequires: corosync-devel >= 2.0
+%{?with_dlm_stonith:BuildRequires:     libxml2-devel >= 2.0}
+%{?with_dlm_stonith:BuildRequires:     pacemaker-devel >= 1.1}
+BuildRequires: pkgconfig
+BuildRequires: rpmbuild(macros) >= 1.644
+BuildRequires: systemd-devel
+Requires:      %{name}-libs = %{version}-%{release}
+Requires:      rc-scripts
+Requires:      systemd-units >= 208-8
+Requires(post,preun):  /sbin/chkconfig
+Obsoletes:     cluster-dlm
+BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+The DLM lock manager is a kernel-based VMS-like distributed lock
+manager. It is general purpose and not specific to only GFS or CLVM.
+Kernel and userspace locking API's are available.
+
+%description -l pl.UTF-8
+Zarządca blokad DLM to oparty na jądrze zarządca rozproszonych blokad
+w stylu VMS. Jest ogólnego przeznaczenia, przeznaczonym nie tylko dla
+GFS-a czy CLVM-a. Dostępne są API blokowania w jądrze i przestrzeni
+użytkownika.
+
+%package libs
+Summary:       DLM libraries
+Summary(pl.UTF-8):     Biblioteki DLM
+Group:         Development/Libraries
+Obsoletes:     cluster-dlm-libs
+
+%description libs
+DLM libraries.
+
+%description libs -l pl.UTF-8
+Biblioteki DLM.
+
+%package devel
+Summary:       Header files and development documentation for DLM
+Summary(pl.UTF-8):     Pliki nagłówkowe i dokumentacja programisty dla DLM-a
+Group:         Development/Libraries
+Requires:      %{name}-libs = %{version}-%{release}
+Obsoletes:     cluster-dlm-devel
+
+%description devel
+Header files and development documentation for DLM.
+
+%description devel -l pl.UTF-8
+Pliki nagłówkowe i dokumentacja programisty dla DLM-a.
+
+%prep
+%setup -q -n %{name}-%{_snap}
+
+%patch0 -p1
+%patch1 -p1
+
+%build
+%{__make} \
+       PREFIX=%{_prefix} \
+       LIBNUM=%{_lib} \
+       BINDIR=%{_sbindir} \
+       LIBDIR=%{_libdir} \
+       MANDIR=%{_mandir} \
+       HDRDIR=%{_includedir} \
+       CC="%{__cc} %{rpmcflags} %{rpmcppflags} %{rpmldflags}"
+
+%if %{with dlm_stonith}
+%{__make} -C fence \
+       PREFIX=%{_prefix} \
+       LIBNUM=%{_lib} \
+       BINDIR=%{_sbindir} \
+       LIBDIR=%{_libdir} \
+       MANDIR=%{_mandir} \
+       HDRDIR=%{_includedir} \
+       CC="%{__cc} %{rpmcflags} %{rpmcppflags} %{rpmldflags}"
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT{%{systemdunitdir},/etc/{rc.d/init.d,sysconfig}} \
+               $RPM_BUILD_ROOT%{_sysconfdir}/%{name} \
+               $RPM_BUILD_ROOT{/var/run/dlm,%{systemdtmpfilesdir}}
+
+%{__make} install \
+       DESTDIR=$RPM_BUILD_ROOT \
+       PREFIX=%{_prefix} \
+       LIBNUM=%{_lib} \
+       BINDIR=%{_sbindir} \
+       LIBDIR=%{_libdir} \
+       MANDIR=%{_mandir} \
+       HDRDIR=%{_includedir}
+
+%if %{with dlm_stonith}
+%{__make} -C fence install \
+       DESTDIR=$RPM_BUILD_ROOT \
+       PREFIX=%{_prefix} \
+       LIBNUM=%{_lib} \
+       BINDIR=%{_sbindir} \
+       LIBDIR=%{_libdir} \
+       MANDIR=%{_mandir} \
+       HDRDIR=%{_includedir}
+%endif
+
+install init/%{name}.service $RPM_BUILD_ROOT%{systemdunitdir}
+install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
+install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
+install %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
+install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/%{name}.conf
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post
+%systemd_post %{name}.service
+
+%preun
+/sbin/chkconfig --add %{name}
+%service %{name} restart
+%systemd_preun %{name}.service
+
+%postun
+if [ "$1" = "0" ]; then
+       %service -q %{name} stop
+       /sbin/chkconfig --del %{name}
+fi
+%systemd_reload
+
+%post  libs -p /sbin/ldconfig
+%postun        libs -p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc README.license
+%{?with_dlm_stonith:%attr(755,root,root) %{_sbindir}/dlm_controld}
+%attr(755,root,root) %{_sbindir}/dlm_stonith
+%attr(755,root,root) %{_sbindir}/dlm_tool
+%dir %{_sysconfdir}/%{name}
+%verify(not md5 mtime size) %config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
+/lib/udev/rules.d/51-dlm.rules
+%attr(754,root,root) /etc/rc.d/init.d/%{name}
+%verify(not md5 mtime size) %config(noreplace) /etc/sysconfig/%{name}
+%{_mandir}/man8/dlm_*.8*
+%{_mandir}/man5/dlm.conf.5*
+%{systemdunitdir}/%{name}.service
+%{systemdtmpfilesdir}/%{name}.conf
+%dir /var/run/dlm
+
+%files libs
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libdlm.so.3.*
+%attr(755,root,root) %ghost %{_libdir}/libdlm.so.3
+%attr(755,root,root) %{_libdir}/libdlm_lt.so.3.*
+%attr(755,root,root) %ghost %{_libdir}/libdlm_lt.so.3
+%attr(755,root,root) %{_libdir}/libdlmcontrol.so.3.*
+%attr(755,root,root) %ghost %{_libdir}/libdlmcontrol.so.3
+
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libdlm.so
+%attr(755,root,root) %{_libdir}/libdlm_lt.so
+%attr(755,root,root) %{_libdir}/libdlmcontrol.so
+%{_includedir}/libdlm.h
+%{_includedir}/libdlmcontrol.h
+%{_mandir}/man3/dlm_*.3*
+%{_mandir}/man3/libdlm.3*
+%{_pkgconfigdir}/libdlm.pc
+%{_pkgconfigdir}/libdlm_lt.pc
diff --git a/dlm.sysconfig b/dlm.sysconfig
new file mode 100644 (file)
index 0000000..58a6238
--- /dev/null
@@ -0,0 +1,3 @@
+# DLM_CONTROLD_OPTS -- set command line options for dlm_controld
+# See dlm_controld man page for list of options.
+DLM_CONTROLD_OPTS=""
diff --git a/dlm.tmpfiles b/dlm.tmpfiles
new file mode 100644 (file)
index 0000000..7fc0406
--- /dev/null
@@ -0,0 +1 @@
+D /var/run/dlm 0755 root root -
diff --git a/old_udev_dir.patch b/old_udev_dir.patch
new file mode 100644 (file)
index 0000000..32758e5
--- /dev/null
@@ -0,0 +1,21 @@
+commit 18c53486d8800c9e1a8a82ccd048825b4584ebc6
+Author: Mariusz Mazur <mmazur@axeos.com>
+Date:   Mon Jun 30 12:19:36 2014 +0200
+
+    Revert "libdlm: udev dir now under /usr/lib"
+    
+    This reverts commit 102d3c248c59f8f36a9d5088afd4eed787583e04.
+
+diff --git a/libdlm/Makefile b/libdlm/Makefile
+index e7cdb17..76d3504 100644
+--- a/libdlm/Makefile
++++ b/libdlm/Makefile
+@@ -5,7 +5,7 @@ LIBDIR=$(PREFIX)/$(LIBNUM)
+ HDRDIR=$(PREFIX)/include 
+ MANDIR=$(PREFIX)/share/man
+ PKGDIR=$(LIBDIR)/pkgconfig
+-UDEVDIR=/usr/lib/udev/rules.d
++UDEVDIR=/lib/udev/rules.d
+ LIB_NAME = libdlm
+ LIB_MAJOR = 3