Compare commits
10 Commits
0a6be55001
...
b98d40fd66
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b98d40fd66 | ||
|
|
71b6a63cf9 | ||
|
|
04e69a974d | ||
|
|
653a8d61e0 | ||
|
|
7d29941085 | ||
|
|
6c32676a11 | ||
|
|
9870b34190 | ||
|
|
0303d01b94 | ||
|
|
420d80748f | ||
|
|
e43a4d364e |
@ -1,40 +0,0 @@
|
||||
From 39b4d87397e5a09adcd100e0f379f34d5dde7e9b Mon Sep 17 00:00:00 2001
|
||||
From: Nir Soffer <nsoffer@redhat.com>
|
||||
Date: Mon, 15 Jan 2018 01:21:51 +0200
|
||||
Subject: [PATCH 1/2] Fix libsanlock build on Unubtu/Debian
|
||||
|
||||
LIB_ENTIRE_LDFLAGS included libraries (e.g. -laio -lblkid) instead of
|
||||
linker flags. The libraries should be in LIB_ENTIRE_LDDADD and come
|
||||
*after* the sources. Otherwisae, the libraries are not linked, and
|
||||
loading libsanlock.so fail with undefined symbol error.
|
||||
|
||||
Signed-off-by: Nir Soffer <nsoffer@redhat.com>
|
||||
---
|
||||
src/Makefile | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/Makefile b/src/Makefile
|
||||
index 69fcd1321ee7..73a2b3498475 100644
|
||||
--- a/src/Makefile
|
||||
+++ b/src/Makefile
|
||||
@@ -98,15 +98,15 @@ CMD_CFLAGS = $(CFLAGS) -fPIE -DPIE
|
||||
CMD_LDFLAGS += -Wl,-z,now -Wl,-z,relro -pie
|
||||
CMD_LDADD += -lpthread -luuid -lrt -laio -lblkid -lsanlock -L../wdmd -lwdmd
|
||||
|
||||
-LIB_ENTIRE_LDFLAGS += -lpthread -lrt -laio -lblkid -L../wdmd -lwdmd
|
||||
LIB_ENTIRE_LDFLAGS += -Wl,-z,relro -pie
|
||||
+LIB_ENTIRE_LDADD += -lpthread -lrt -laio -lblkid -L../wdmd -lwdmd
|
||||
|
||||
LIB_CLIENT_LDFLAGS += -Wl,-z,relro -pie
|
||||
|
||||
all: $(LIBSO_ENTIRE_TARGET) $(LIBSO_CLIENT_TARGET) $(CMD_TARGET) $(LIBPC_ENTIRE_TARGET) $(LIBPC_CLIENT_TARGET)
|
||||
|
||||
$(LIBSO_ENTIRE_TARGET): $(LIB_ENTIRE_SOURCE)
|
||||
- $(CC) $(CFLAGS) $(LIB_ENTIRE_LDFLAGS) -shared -fPIC -o $@ -Wl,-soname=$(LIB_ENTIRE_TARGET).so.$(SOMAJOR) $^
|
||||
+ $(CC) $(CFLAGS) $(LIB_ENTIRE_LDFLAGS) -shared -fPIC -o $@ -Wl,-soname=$(LIB_ENTIRE_TARGET).so.$(SOMAJOR) $^ $(LIB_ENTIRE_LDADD)
|
||||
ln -sf $(LIBSO_ENTIRE_TARGET) $(LIB_ENTIRE_TARGET).so
|
||||
ln -sf $(LIBSO_ENTIRE_TARGET) $(LIB_ENTIRE_TARGET).so.$(SOMAJOR)
|
||||
|
||||
--
|
||||
2.7.5
|
||||
|
||||
@ -1,85 +0,0 @@
|
||||
From fa6d48a7c8991b2251e50469a7e57058be226ab0 Mon Sep 17 00:00:00 2001
|
||||
From: David Teigland <teigland@redhat.com>
|
||||
Date: Wed, 14 Mar 2018 11:49:35 -0500
|
||||
Subject: [PATCH 2/2] fix makefile flags
|
||||
|
||||
should let the fedora build flags work
|
||||
---
|
||||
reset/Makefile | 2 +-
|
||||
src/Makefile | 15 +++++++--------
|
||||
wdmd/Makefile | 8 ++++----
|
||||
3 files changed, 12 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/reset/Makefile b/reset/Makefile
|
||||
index c61348a2b9c3..04a23032614a 100644
|
||||
--- a/reset/Makefile
|
||||
+++ b/reset/Makefile
|
||||
@@ -34,7 +34,7 @@ VER=$(shell cat ../VERSION)
|
||||
CFLAGS += -DVERSION=\"$(VER)\" -I../src -I../wdmd
|
||||
CFLAGS += -fPIE -DPIE
|
||||
|
||||
-LDFLAGS = -Wl,-z,now -Wl,-z,relro -pie
|
||||
+LDFLAGS += -Wl,-z,now -Wl,-z,relro
|
||||
LDADD = -lsanlock -lwdmd
|
||||
|
||||
all: $(TARGET1) $(TARGET2)
|
||||
diff --git a/src/Makefile b/src/Makefile
|
||||
index 73a2b3498475..14c0a53e6aeb 100644
|
||||
--- a/src/Makefile
|
||||
+++ b/src/Makefile
|
||||
@@ -94,24 +94,23 @@ VER=$(shell cat ../VERSION)
|
||||
CFLAGS += -DVERSION=\"$(VER)\"
|
||||
|
||||
CMD_CFLAGS = $(CFLAGS) -fPIE -DPIE
|
||||
+CMD_LDFLAGS = $(LDFLAGS) -Wl,-z,now -Wl,-z,relro
|
||||
+CMD_LDADD = -lpthread -luuid -lrt -laio -lblkid -lsanlock -L../wdmd -lwdmd
|
||||
|
||||
-CMD_LDFLAGS += -Wl,-z,now -Wl,-z,relro -pie
|
||||
-CMD_LDADD += -lpthread -luuid -lrt -laio -lblkid -lsanlock -L../wdmd -lwdmd
|
||||
+LIB_ENTIRE_LDFLAGS = $(LDFLAGS) -Wl,-z,relro
|
||||
+LIB_ENTIRE_LDADD = -lpthread -lrt -laio -lblkid -L../wdmd -lwdmd
|
||||
|
||||
-LIB_ENTIRE_LDFLAGS += -Wl,-z,relro -pie
|
||||
-LIB_ENTIRE_LDADD += -lpthread -lrt -laio -lblkid -L../wdmd -lwdmd
|
||||
-
|
||||
-LIB_CLIENT_LDFLAGS += -Wl,-z,relro -pie
|
||||
+LIB_CLIENT_LDFLAGS = $(LDFLAGS) -Wl,-z,relro
|
||||
|
||||
all: $(LIBSO_ENTIRE_TARGET) $(LIBSO_CLIENT_TARGET) $(CMD_TARGET) $(LIBPC_ENTIRE_TARGET) $(LIBPC_CLIENT_TARGET)
|
||||
|
||||
$(LIBSO_ENTIRE_TARGET): $(LIB_ENTIRE_SOURCE)
|
||||
- $(CC) $(CFLAGS) $(LIB_ENTIRE_LDFLAGS) -shared -fPIC -o $@ -Wl,-soname=$(LIB_ENTIRE_TARGET).so.$(SOMAJOR) $^ $(LIB_ENTIRE_LDADD)
|
||||
+ $(CC) $(CFLAGS) $(LDFLAGS) $(LIB_ENTIRE_LDFLAGS) -shared -fPIC -o $@ -Wl,-soname=$(LIB_ENTIRE_TARGET).so.$(SOMAJOR) $^ $(LIB_ENTIRE_LDADD)
|
||||
ln -sf $(LIBSO_ENTIRE_TARGET) $(LIB_ENTIRE_TARGET).so
|
||||
ln -sf $(LIBSO_ENTIRE_TARGET) $(LIB_ENTIRE_TARGET).so.$(SOMAJOR)
|
||||
|
||||
$(LIBSO_CLIENT_TARGET): $(LIB_CLIENT_SOURCE)
|
||||
- $(CC) $(CFLAGS) $(LIB_CLIENT_LDFLAGS) -shared -fPIC -o $@ -Wl,-soname=$(LIB_CLIENT_TARGET).so.$(SOMAJOR) $^
|
||||
+ $(CC) $(CFLAGS) $(LDFLAGS) $(LIB_CLIENT_LDFLAGS) -shared -fPIC -o $@ -Wl,-soname=$(LIB_CLIENT_TARGET).so.$(SOMAJOR) $^
|
||||
ln -sf $(LIBSO_CLIENT_TARGET) $(LIB_CLIENT_TARGET).so
|
||||
ln -sf $(LIBSO_CLIENT_TARGET) $(LIB_CLIENT_TARGET).so.$(SOMAJOR)
|
||||
|
||||
diff --git a/wdmd/Makefile b/wdmd/Makefile
|
||||
index bf871c591943..0c4438950d6e 100644
|
||||
--- a/wdmd/Makefile
|
||||
+++ b/wdmd/Makefile
|
||||
@@ -45,12 +45,12 @@ CFLAGS += -D_GNU_SOURCE -g -O2 \
|
||||
VER=$(shell cat ../VERSION)
|
||||
CFLAGS += -DVERSION=\"$(VER)\"
|
||||
|
||||
-CMD_LDFLAGS += -Wl,-z,now -Wl,-z,relro -pie
|
||||
-CMD_LDADD += -lwdmd -lrt
|
||||
+CMD_LDFLAGS = $(LDFLAGS) -Wl,-z,now -Wl,-z,relro
|
||||
+CMD_LDADD = -lwdmd -lrt
|
||||
|
||||
-LIB_LDFLAGS += -Wl,-z,relro -pie
|
||||
+LIB_LDFLAGS = $(LDFLAGS) -Wl,-z,relro
|
||||
|
||||
-TEST_LDFLAGS = -lwdmd
|
||||
+TEST_LDFLAGS = $(LDFLAGS) -lwdmd
|
||||
|
||||
|
||||
all: $(SHLIB_TARGET) $(CMD_TARGET) $(TEST_TARGET)
|
||||
--
|
||||
2.7.5
|
||||
|
||||
13
Add-sanlk-reset-command-t-options.patch
Normal file
13
Add-sanlk-reset-command-t-options.patch
Normal file
@ -0,0 +1,13 @@
|
||||
diff --git a/reset/sanlk_reset.c b/reset/sanlk_reset.c
|
||||
index 9e952ab..3453449 100644
|
||||
--- a/reset/sanlk_reset.c
|
||||
+++ b/reset/sanlk_reset.c
|
||||
@@ -717,7 +717,7 @@ int main(int argc, char *argv[])
|
||||
int c;
|
||||
int option_index = 0;
|
||||
|
||||
- c = getopt_long(argc, argv, "hVi:g:w:b:R:D",
|
||||
+ c = getopt_long(argc, argv, "hVi:g:w:b:R:t:D",
|
||||
long_options, &option_index);
|
||||
if (c == -1)
|
||||
break;
|
||||
Binary file not shown.
BIN
sanlock-3.8.1.tar.gz
Normal file
BIN
sanlock-3.8.1.tar.gz
Normal file
Binary file not shown.
37
sanlock.spec
37
sanlock.spec
@ -1,14 +1,13 @@
|
||||
Name: sanlock
|
||||
Version: 3.6.0
|
||||
Release: 7
|
||||
Version: 3.8.1
|
||||
Release: 3
|
||||
Summary: A shared storage lock manager
|
||||
License: GPLv2 and GPLv2+ and LGPLv2+
|
||||
URL: https://pagure.io/sanlock/
|
||||
Source0: https://releases.pagure.org/sanlock/%{name}-%{version}.tar.gz
|
||||
Patch0001: 0000-Fix-libsanlock-build-on-Unubtu-Debian.patch
|
||||
Patch0002: 0001-fix-makefile-flags.patch
|
||||
Patch0: Add-sanlk-reset-command-t-options.patch
|
||||
|
||||
BuildRequires: libblkid-devel libaio-devel python2 python2-devel systemd-units
|
||||
BuildRequires: libblkid-devel libaio-devel python3 python3-devel systemd-units
|
||||
Requires(pre): shadow
|
||||
Requires(post): systemd-units systemd-sysv
|
||||
Requires(preun): systemd-units
|
||||
@ -40,19 +39,18 @@ Requires: %{name} = %{version}-%{release}
|
||||
The sanklock-help package contains maninfo for sanlock.
|
||||
|
||||
|
||||
%package -n python2-sanlock
|
||||
%{?python_provide:%python_provide python2-sanlock}
|
||||
%package -n python3-sanlock
|
||||
%{?python_provide:%python_provide python3-sanlock}
|
||||
Provides: %{name}-python = %{version}-%{release}
|
||||
Obsoletes: %{name}-python < %{version}-%{release}
|
||||
Summary: Python bindings for the sanlock library
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
|
||||
%description -n python2-sanlock
|
||||
The python2-sanlock package contains a module that
|
||||
%description -n python3-sanlock
|
||||
The python3-sanlock package contains a module that
|
||||
permits applications written in the Python programming language
|
||||
to use the interface supplied by the sanlock library.
|
||||
|
||||
|
||||
%package -n sanlk-reset
|
||||
Summary: Host reset daemon and client using sanlock
|
||||
Requires: sanlock = %{version}-%{release}
|
||||
@ -70,13 +68,13 @@ common sanlock lockspace.
|
||||
%set_build_flags
|
||||
CFLAGS=$RPM_OPT_FLAGS make -C wdmd
|
||||
CFLAGS=$RPM_OPT_FLAGS make -C src
|
||||
CFLAGS=$RPM_OPT_FLAGS make -C python
|
||||
CFLAGS=$RPM_OPT_FLAGS make -C python PY_VERSION=3
|
||||
CFLAGS=$RPM_OPT_FLAGS make -C reset
|
||||
|
||||
%install
|
||||
make -C src install LIBDIR=%{_libdir} DESTDIR=$RPM_BUILD_ROOT
|
||||
make -C wdmd install LIBDIR=%{_libdir} DESTDIR=$RPM_BUILD_ROOT
|
||||
make -C python install LIBDIR=%{_libdir} DESTDIR=$RPM_BUILD_ROOT
|
||||
make -C python install LIBDIR=%{_libdir} DESTDIR=$RPM_BUILD_ROOT PY_VERSION=3
|
||||
make -C reset install LIBDIR=%{_libdir} DESTDIR=$RPM_BUILD_ROOT
|
||||
|
||||
install -D -m 0644 init.d/sanlock.service.native $RPM_BUILD_ROOT/%{_unitdir}/sanlock.service
|
||||
@ -143,10 +141,10 @@ getent passwd sanlock > /dev/null || /usr/sbin/useradd \
|
||||
%{_includedir}/sanlock*.h
|
||||
%{_libdir}/pkgconfig/libsanlock*.pc
|
||||
|
||||
%files -n python2-sanlock
|
||||
%files -n python3-sanlock
|
||||
%defattr(-,root,root,-)
|
||||
%{python_sitearch}/sanlock_python-*.egg-info
|
||||
%{python_sitearch}/sanlock.so
|
||||
%{python3_sitearch}/sanlock_python-*.egg-info
|
||||
%{python3_sitearch}/sanlock*.so
|
||||
|
||||
%files -n sanlk-reset
|
||||
%defattr(-,root,root,-)
|
||||
@ -156,5 +154,14 @@ getent passwd sanlock > /dev/null || /usr/sbin/useradd \
|
||||
|
||||
|
||||
%changelog
|
||||
* Wed Mar 08 2023 xu_ping <xuping33@h-partners.com> - 3.8.1-3
|
||||
- Add sanlk-reset command -t options
|
||||
|
||||
* Mon Sep 6 2021 liyanan <liyanan32@huawei.com> - 3.8.1-2
|
||||
- Delete python2 sub-package and add python3 sub-package
|
||||
|
||||
* Thu Jul 30 2020 yanglongkang <yanglongkang@huawei.com> - 3.8.1-1
|
||||
- update to 3.8.1 version
|
||||
|
||||
* Sat Nov 30 2019 zoushuangshuang<zoushuangshuang@huawei.com> - 3.6.0-7
|
||||
- Package init
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user