.gear/rules | 4 ++ .gear/tags/list | 1 + .gear/upstream/filter-tag | 1 + .gear/upstream/remotes | 3 + .gear/upstream/transform-tag | 1 + dlm.spec | 129 +++++++++++++++++++++++++++++++++++++++++++ dlm_controld/Makefile | 2 +- dlm_controld/main.c | 2 +- init/dlm.service | 3 +- 9 files changed, 143 insertions(+), 3 deletions(-) diff --git a/.gear/rules b/.gear/rules new file mode 100644 index 00000000..2f8c4665 --- /dev/null +++ b/.gear/rules @@ -0,0 +1,4 @@ +tar: @name@-@version@:. +diff: @name@-@version@:. . name=@name@-@version@.patch +copy?: *.patch + diff --git a/.gear/tags/list b/.gear/tags/list new file mode 100644 index 00000000..1fc13270 --- /dev/null +++ b/.gear/tags/list @@ -0,0 +1 @@ +c1e2ee574794e0dea68fd45783991ef7b1835901 dlm-4.2.0 diff --git a/.gear/upstream/filter-tag b/.gear/upstream/filter-tag new file mode 100755 index 00000000..1d62545c --- /dev/null +++ b/.gear/upstream/filter-tag @@ -0,0 +1 @@ +grep '^dlm-[0-9.]\+$' diff --git a/.gear/upstream/remotes b/.gear/upstream/remotes new file mode 100644 index 00000000..3c32a863 --- /dev/null +++ b/.gear/upstream/remotes @@ -0,0 +1,3 @@ +[remote "upstream"] + url = https://pagure.io/dlm.git + fetch = +refs/heads/*:refs/remotes/upstream/* diff --git a/.gear/upstream/transform-tag b/.gear/upstream/transform-tag new file mode 100755 index 00000000..aa725590 --- /dev/null +++ b/.gear/upstream/transform-tag @@ -0,0 +1 @@ +sed 's/^dlm-//' diff --git a/dlm.spec b/dlm.spec new file mode 100644 index 00000000..59a211ba --- /dev/null +++ b/dlm.spec @@ -0,0 +1,129 @@ +Name: dlm +Version: 4.2.0 +Release: alt2 + +Summary: dlm control daemon and tool +License: GPLv2 and GPLv2+ and LGPLv2+ +Group: System/Servers + +Url: https://pagure.io/dlm +Source: %name-%version.tar +Patch: %name-%version.patch + +BuildRequires: libsystemd-devel libcorosync-devel libuuid-devel +%ifnarch %e2k +BuildRequires: libpacemaker-devel +%endif + +Requires: corosync >= 1.99.9 + +%description +The kernel dlm requires a user daemon to control membership. + +%package -n lib%name +Summary: Library for %name +Group: System/Libraries + +%description -n lib%name +The lib%name package contains the libraries needed to use the dlm +from userland applications. + +%package -n lib%name-devel +Summary: Development files for %name +Group: Development/C +Requires: lib%name = %version-%release + +%description -n lib%name-devel +The lib%name-devel package contains libraries and header files for +developing applications that use %name. + +%prep +%setup +%patch0 -p1 +%ifarch %e2k +# unsupported as of lcc 1.32.21 +sed -i 's,-fstack-clash-protection,,' */Makefile +# needs libpacemaker-devel (ftbfs atm) +sed -i 's,fence,,' Makefile +%endif +%ifnarch x86_64 +sed -i 's, -fcf-protection=full,,' */Makefile +%endif + +%build +export CFLAGS="$CFLAGS -fPIC $(pkg-config --cflags pacemaker) -I../libdlm -I../dlm_controld -I../include" +export LDCONF +%make CFLAGS="$CFLAGS" LLT_LDFLAGS="-lpthread" +%ifnarch %e2k +%make -C fence CFLAGS="$CFLAGS" +%endif + +%install +%makeinstall_std LIBNUM=/%_lib UDEVDIR=%_udevrulesdir +%ifnarch %e2k +%makeinstall_std -C fence +%endif + +install -Dm 0644 init/dlm.service %buildroot%_unitdir/dlm.service +install -Dm 0644 init/dlm.sysconfig %buildroot%_sysconfdir/sysconfig/dlm + +mkdir -p %buildroot%_sysconfdir/dlm +touch %buildroot%_sysconfdir/dlm/dlm.conf + +%files +%doc README.license +%config(noreplace) %_sysconfdir/sysconfig/dlm +%dir %_sysconfdir/dlm +%ghost %_sysconfdir/dlm/dlm.conf +%_unitdir/dlm.service +%_sbindir/dlm_controld +%_sbindir/dlm_tool +%ifnarch %e2k +%_sbindir/dlm_stonith +%endif +%_man8dir/dlm* +%_man5dir/dlm* +%_man3dir/*dlm* + +%files -n lib%name +%_udevrulesdir/*-dlm.rules +%_libdir/libdlm*.so.* + +%files -n lib%name-devel +%_includedir/libdlm*.h +%_libdir/libdlm*.so +%_pkgconfigdir/*.pc + +%changelog +* Fri Jul 7 2023 Artyom Bystrov 4.2.0-alt2 +- Fix build (no file linux/dlm_netlink.h) + +* Wed Oct 12 2022 Andrey Cherepanov 4.2.0-alt1 +- New version. + +* Tue Nov 16 2021 Andrey Cherepanov 4.1.1-alt1 +- New version. + +* Mon Jul 26 2021 Andrey Cherepanov 4.1.0-alt2 +- Rebuild with -fPIC for all architectures. + +* Mon Jul 26 2021 Andrey Cherepanov 4.1.0-alt1 +- 4.1.0 + +* Fri Apr 03 2020 Michael Shigorin 4.0.9-alt2 +- E2K: build without fence (BR: libpacemaker-devel, unavailable now) + +* Sun Aug 11 2019 Alexey Shabalin 4.0.9-alt1 +- 4.0.9 + +* Wed Aug 02 2017 Valery Inozemtsev 4.0.6-alt1 +- 4.0.6 + +* Wed Sep 14 2016 Valery Inozemtsev 4.0.5-alt1 +- 4.0.5 + +* Mon Sep 12 2016 Valery Inozemtsev 4.0.2-alt2 +- fixed build with latest systemd + +* Mon Mar 28 2016 Valery Inozemtsev 4.0.2-alt1 +- 4.0.2 diff --git a/dlm_controld/Makefile b/dlm_controld/Makefile index ec8c360c..0f815c53 100644 --- a/dlm_controld/Makefile +++ b/dlm_controld/Makefile @@ -47,7 +47,7 @@ CFLAGS += -D_GNU_SOURCE -O2 -ggdb \ BIN_CFLAGS += $(CFLAGS) -fPIE -DPIE BIN_CFLAGS += -I../include -I../libdlm -LIB_CFLAGS += $(CFLAGS) -fPIC -fplugin=annobin +LIB_CFLAGS += $(CFLAGS) -fPIC BIN_LDFLAGS += $(LDFLAGS) -Wl,-z,relro -Wl,-z,now -pie BIN_LDFLAGS += -lpthread -lrt -lcpg -lcmap -lcfg -lquorum -luuid diff --git a/dlm_controld/main.c b/dlm_controld/main.c index 7cf6348e..484bab7d 100644 --- a/dlm_controld/main.c +++ b/dlm_controld/main.c @@ -12,7 +12,7 @@ #include #include #include -#include + #include #ifdef USE_SD_NOTIFY diff --git a/init/dlm.service b/init/dlm.service index 6def985b..ad9f87db 100644 --- a/init/dlm.service +++ b/init/dlm.service @@ -9,7 +9,8 @@ OOMScoreAdjust=-1000 Type=notify NotifyAccess=main EnvironmentFile=/etc/sysconfig/dlm -ExecStartPre=/sbin/modprobe dlm +ExecStartPre=/sbin/modprobe dlm +ExecStartPre=/bin/sleep 1 ExecStart=/usr/sbin/dlm_controld --foreground $DLM_CONTROLD_OPTS #ExecStopPost=/sbin/modprobe -r dlm