[packages/kvsns] - new
qboosh
qboosh at pld-linux.org
Thu Apr 24 07:55:51 CEST 2025
commit a99bf4286b14d0127f8ced630a2565f59243216b
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Thu Apr 24 06:34:12 2025 +0200
- new
kvsns-cmake.patch | 77 ++++++++++++++++++++++++++++++++++++
kvsns-format.patch | 20 ++++++++++
kvsns-overflow.patch | 31 +++++++++++++++
kvsns.spec | 109 +++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 237 insertions(+)
---
diff --git a/kvsns.spec b/kvsns.spec
new file mode 100644
index 0000000..aaacb16
--- /dev/null
+++ b/kvsns.spec
@@ -0,0 +1,109 @@
+#
+# Conditional build:
+%bcond_without ceph # RADOS support
+#
+Summary: Library to access to a namespace inside a KVS
+Summary(pl.UTF-8): Biblioteka dostępu do przestrzeni nazw wewnątrz KVS
+Name: kvsns
+Version: 1.2.9
+Release: 1
+License: LGPL v3+
+Group: Libraries
+#Source0Download: https://github.com/phdeniel/kvsns/tags
+Source0: https://github.com/phdeniel/kvsns/archive/V%{version}/%{name}-%{version}.tar.gz
+# Source0-md5: dce3a8c06a08420d86da007d990f7e8d
+Patch0: %{name}-overflow.patch
+Patch1: %{name}-format.patch
+Patch2: %{name}-cmake.patch
+URL: https://github.com/phdeniel/kvsns
+%{?with_ceph:BuildRequires: ceph-devel}
+BuildRequires: cmake >= 2.6.4
+BuildRequires: hiredis-devel
+BuildRequires: libini_config-devel
+BuildRequires: rpmbuild(macros) >= 1.605
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+The libkvsns library allows of a POSIX namespace built on top of a
+Key-Value Store.
+
+%description -l pl.UTF-8
+Biblioteka libkvsns pozwala zbudować przestrzeń nazw POSIX ponad
+systemem KVS (Key-Value Store).
+
+%package ceph
+Summary: RADOS object store for KVSNS library
+Summary(pl.UTF-8): Biblioteka przechowywania danych RADOS dla biblioteki KVSNS
+Group: Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description ceph
+RADOS object store for KVSNS library.
+
+%description ceph -l pl.UTF-8
+Biblioteka przechowywania danych RADOS dla biblioteki KVSNS.
+
+%package devel
+Summary: Header files for KVSNS library
+Summary(pl.UTF-8): Pliki nagłówkowe biblioteki KVSNS
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+Requires: hiredis-devel
+Requires: libini_config-devel
+
+%description devel
+Header files for KVSNS library.
+
+%description devel -l pl.UTF-8
+Pliki nagłówkowe biblioteki KVSNS.
+
+%prep
+%setup -q
+%patch -P0 -p1
+%patch -P1 -p1
+%patch -P2 -p1
+
+%build
+# meson support is incomplete (no required include directories, no install), so use cmake
+install -d build
+cd build
+# possible snprint or strncpy truncations
+CFLAGS="%{rpmcflags} -Wno-error=format-truncation -Wno-error=stringop-truncation"
+%cmake ..
+
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} -C build install \
+ DESTDIR=$RPM_BUILD_ROOT
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%post ceph -p /sbin/ldconfig
+%postun ceph -p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc doc/kvsns_*.txt
+%attr(755,root,root) %{_libdir}/libextstore_crud_cache.so
+%attr(755,root,root) %{_libdir}/libextstore_posix.so
+%attr(755,root,root) %{_libdir}/libkvsal_redis.so
+%attr(755,root,root) %{_libdir}/libkvsns.so
+%attr(755,root,root) %{_libdir}/libobjstore_cmd.so
+
+%if %{with ceph}
+%files ceph
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libextstore_rados.so
+%endif
+
+%files devel
+%defattr(644,root,root,755)
+%{_includedir}/kvsns
+%{_pkgconfigdir}/libkvsns.pc
diff --git a/kvsns-cmake.patch b/kvsns-cmake.patch
new file mode 100644
index 0000000..3a18bb5
--- /dev/null
+++ b/kvsns-cmake.patch
@@ -0,0 +1,77 @@
+--- kvsns-1.2.9/libkvsns.pc-in.cmake.orig 2020-08-04 15:22:18.000000000 +0200
++++ kvsns-1.2.9/libkvsns.pc-in.cmake 2025-04-23 20:02:04.907192810 +0200
+@@ -1,12 +1,12 @@
+ prefix=/usr
+ exec_prefix=/usr/bin
+-libdir=/usr/lib64
++libdir=@CMAKE_INSTALL_LIBDIR@
+ includedir=/usr/include
+
+ Name: @PROJECT_NAME@
+ Description: Library to access to a namespace inside a KVS
+ Requires:
+ Version: @LIBKVSNS_BASE_VERSION@
+-Cflags: -I/usr/include
+-Libs: -L/usr/lib64 -lkvsns -lhiredis
++Cflags: -I${includedir}
++Libs: -L${libdir} -lkvsns
+
+--- kvsns-1.2.9/CMakeLists.txt.orig 2020-08-04 15:22:18.000000000 +0200
++++ kvsns-1.2.9/CMakeLists.txt 2025-04-23 20:02:27.501102746 +0200
+@@ -139,5 +139,5 @@ add_custom_command(TARGET srpm
+ DEPENDS dist)
+
+ # INSTALL
+-install(FILES ${PROJECT_SOURCE_DIR}/libkvsns.pc DESTINATION lib)
++install(FILES ${PROJECT_SOURCE_DIR}/libkvsns.pc DESTINATION lib${LIB_SUFFIX}/pkgconfig)
+ install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/kvsns DESTINATION include)
+--- kvsns-1.2.9/extstore/crud_cache/CMakeLists.txt.orig 2020-08-04 15:22:18.000000000 +0200
++++ kvsns-1.2.9/extstore/crud_cache/CMakeLists.txt 2025-04-23 20:04:21.723818182 +0200
+@@ -6,7 +6,7 @@ SET(extstore_crud_cache_LIB_SRCS
+ add_library(extstore_crud_cache SHARED ${extstore_crud_cache_LIB_SRCS})
+ target_link_libraries(extstore_crud_cache ini_config)
+
+-install(TARGETS extstore_crud_cache DESTINATION lib)
++install(TARGETS extstore_crud_cache DESTINATION lib${LIB_SUFFIX})
+
+
+ SET(objstore_cmd_LIB_SRCS
+@@ -16,4 +16,4 @@ SET(objstore_cmd_LIB_SRCS
+ add_library(objstore_cmd SHARED ${objstore_cmd_LIB_SRCS})
+ target_link_libraries(objstore_cmd ini_config)
+
+-install(TARGETS objstore_cmd DESTINATION lib)
++install(TARGETS objstore_cmd DESTINATION lib${LIB_SUFFIX})
+--- kvsns-1.2.9/extstore/posix_store/CMakeLists.txt.orig 2020-08-04 15:22:18.000000000 +0200
++++ kvsns-1.2.9/extstore/posix_store/CMakeLists.txt 2025-04-23 20:04:32.673738961 +0200
+@@ -7,4 +7,4 @@ add_library(extstore_posix SHARED ${exts
+
+ target_link_libraries(extstore_posix ini_config)
+
+-install(TARGETS extstore_posix DESTINATION lib)
++install(TARGETS extstore_posix DESTINATION lib${LIB_SUFFIX})
+--- kvsns-1.2.9/extstore/rados/CMakeLists.txt.orig 2020-08-04 15:22:18.000000000 +0200
++++ kvsns-1.2.9/extstore/rados/CMakeLists.txt 2025-04-23 20:04:46.180352556 +0200
+@@ -6,4 +6,4 @@ SET(extstore_rados_LIB_SRCS
+ add_library(extstore_rados SHARED ${extstore_rados_LIB_SRCS})
+ target_link_libraries(extstore_rados rados ini_config)
+
+-install(TARGETS extstore_rados DESTINATION lib)
++install(TARGETS extstore_rados DESTINATION lib${LIB_SUFFIX})
+--- kvsns-1.2.9/kvsal/redis/CMakeLists.txt.orig 2020-08-04 15:22:18.000000000 +0200
++++ kvsns-1.2.9/kvsal/redis/CMakeLists.txt 2025-04-23 20:05:12.405877041 +0200
+@@ -6,4 +6,4 @@ SET(kvsal_LIB_SRCS
+ add_library(kvsal_redis SHARED ${kvsal_LIB_SRCS})
+ target_link_libraries(kvsal_redis hiredis ini_config)
+
+-install(TARGETS kvsal_redis DESTINATION lib)
++install(TARGETS kvsal_redis DESTINATION lib${LIB_SUFFIX})
+--- kvsns-1.2.9/kvsns/CMakeLists.txt.orig 2020-08-04 15:22:18.000000000 +0200
++++ kvsns-1.2.9/kvsns/CMakeLists.txt 2025-04-23 20:05:27.453452194 +0200
+@@ -9,5 +9,5 @@ SET(kvsns_LIB_SRCS
+
+ add_library(kvsns SHARED ${kvsns_LIB_SRCS})
+ target_link_libraries(kvsns ini_config dl)
+-install(TARGETS kvsns DESTINATION lib)
++install(TARGETS kvsns DESTINATION lib${LIB_SUFFIX})
+
diff --git a/kvsns-format.patch b/kvsns-format.patch
new file mode 100644
index 0000000..e00be89
--- /dev/null
+++ b/kvsns-format.patch
@@ -0,0 +1,20 @@
+--- kvsns-1.2.9/extstore/crud_cache/extstore_crud_cache.c.orig 2020-08-04 15:22:18.000000000 +0200
++++ kvsns-1.2.9/extstore/crud_cache/extstore_crud_cache.c 2025-04-23 19:15:39.783178251 +0200
+@@ -217,7 +217,7 @@ int extstore_create(kvsns_ino_t object)
+ RC_WRAP(kvsal.set_stat, k, &stat);
+
+ snprintf(k, KLEN, "%llu.cache_state", object);
+- snprintf(v, VLEN, state2str(CACHED));
++ strcpy(v, state2str(CACHED));
+ RC_WRAP(kvsal.set_char, k, v);
+
+ return 0;
+@@ -238,7 +238,7 @@ int extstore_attach(kvsns_ino_t *ino, ch
+ RC_WRAP(kvsal.set_stat, k, &stat);
+
+ snprintf(k, KLEN, "%llu.cache_state", *ino);
+- snprintf(v, VLEN, state2str(CACHED));
++ strcpy(v, state2str(CACHED));
+ RC_WRAP(kvsal.set_char, k, v);
+
+ RC_WRAP(set_entry_state, ino, CACHED);
diff --git a/kvsns-overflow.patch b/kvsns-overflow.patch
new file mode 100644
index 0000000..03dbad9
--- /dev/null
+++ b/kvsns-overflow.patch
@@ -0,0 +1,31 @@
+--- kvsns-1.2.9/extstore/crud_cache/objstore_cmd.c.orig 2020-08-04 15:22:18.000000000 +0200
++++ kvsns-1.2.9/extstore/crud_cache/objstore_cmd.c 2025-04-23 19:24:54.986649997 +0200
+@@ -61,7 +61,7 @@ int objstore_put(char *path, kvsns_ino_t
+ {
+ char k[KLEN];
+ char storepath[MAXPATHLEN];
+- char objpath[MAXPATHLEN];
++ char objpath[MAXPATHLEN + 9];
+ char cmd[3*MAXPATHLEN];
+ FILE *fp;
+
+--- kvsns-1.2.9/kvsns_shell/kvsns_cp.c.orig 2020-08-04 15:22:18.000000000 +0200
++++ kvsns-1.2.9/kvsns_shell/kvsns_cp.c 2025-04-23 19:29:03.955191218 +0200
+@@ -88,8 +88,6 @@ int main(int argc, char *argv[])
+ dest = argv[2] + KVSNS_URL_LEN;
+ }
+
+- printf("%s => %s, %u / %u\n", src, dest, kvsns_src, kvsns_dest);
+-
+ if (kvsns_src && kvsns_dest) {
+ fprintf(stderr, "src and destination can't be inside KVSNS\n");
+ exit(1);
+@@ -100,6 +98,8 @@ int main(int argc, char *argv[])
+ exit(1);
+ }
+
++ printf("%s => %s, %u / %u\n", src, dest, kvsns_src, kvsns_dest);
++
+ if (!kvsns_dest)
+ fd = open(dest, O_WRONLY|O_CREAT, 0644);
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/kvsns.git/commitdiff/a99bf4286b14d0127f8ced630a2565f59243216b
More information about the pld-cvs-commit
mailing list