diff --git a/cmake-DOCDIR.patch b/cmake-DOCDIR.patch new file mode 100644 index 0000000..b036281 --- /dev/null +++ b/cmake-DOCDIR.patch @@ -0,0 +1,11 @@ +diff -up lsyncd-2.3.0/CMakeLists.txt.DOCDIR lsyncd-2.3.0/CMakeLists.txt +--- lsyncd-2.3.0/CMakeLists.txt.DOCDIR 2022-07-25 23:43:45.064362147 -0400 ++++ lsyncd-2.3.0/CMakeLists.txt 2022-07-26 00:09:35.991866381 -0400 +@@ -130,5 +130,5 @@ target_link_libraries( lsyncd ${LUA_LIBR + + install( TARGETS lsyncd RUNTIME DESTINATION bin ) + install( FILES docs/manpage/lsyncd.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT man ) +-install( DIRECTORY examples DESTINATION doc ) +-install( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION doc OPTIONAL) ++install( DIRECTORY examples DESTINATION ${CMAKE_INSTALL_DOCDIR} ) ++install( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION ${CMAKE_INSTALL_DOCDIR} OPTIONAL) diff --git a/cmake-define-LUA_COMPAT_5_3.patch b/cmake-define-LUA_COMPAT_5_3.patch deleted file mode 100644 index 6c54f97..0000000 --- a/cmake-define-LUA_COMPAT_5_3.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up lsyncd-42413cabbedca429d55a5378f6e830f191f3cc86/CMakeLists.txt.LUA_COMPAT_5_3 lsyncd-42413cabbedca429d55a5378f6e830f191f3cc86/CMakeLists.txt ---- lsyncd-42413cabbedca429d55a5378f6e830f191f3cc86/CMakeLists.txt.LUA_COMPAT_5_3 2020-12-08 19:33:54.268016329 -0500 -+++ lsyncd-42413cabbedca429d55a5378f6e830f191f3cc86/CMakeLists.txt 2020-12-08 20:39:49.941802873 -0500 -@@ -4,6 +4,8 @@ cmake_minimum_required( VERSION 2.8 ) - set( LSYNCD_VERSION 2.2.3 ) - set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/" ) - -+# Enable Lua 5.3 compatibility macros -+add_definitions(-DLUA_COMPAT_5_3) - - # finding Lua - find_package( Lua REQUIRED ) diff --git a/cmake-determine-lua-version.patch b/cmake-determine-lua-version.patch deleted file mode 100644 index ea7b510..0000000 --- a/cmake-determine-lua-version.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 5e08ea2cefd61cd50685c54b30d39845fcc485fe Mon Sep 17 00:00:00 2001 -From: Torben Jaeger -Date: Thu, 8 Aug 2019 17:37:05 +0200 -Subject: [PATCH] fix different version format in lua.h - ---- - cmake/FindLua.cmake | 12 ++++++++++-- - 1 file changed, 10 insertions(+), 2 deletions(-) - -diff --git a/cmake/FindLua.cmake b/cmake/FindLua.cmake -index 6d33dbe..ef9c685 100644 ---- a/cmake/FindLua.cmake -+++ b/cmake/FindLua.cmake -@@ -102,9 +102,17 @@ ENDIF(LUA_LIBRARY) - - # Determine Lua version - IF(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h") -- FILE(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua .+\"") -+ FILE(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_major_str REGEX "^#define[ \t]+LUA_VERSION_MAJOR[ \t]+\".+\"") -+ FILE(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_minor_str REGEX "^#define[ \t]+LUA_VERSION_MINOR[ \t]+\".+\"") -+ FILE(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_release_str REGEX "^#define[ \t]+LUA_VERSION_RELEASE[ \t]+\".+\"") - -- STRING(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([^\"]+)\".*" "\\1" LUA_VERSION_STRING "${lua_version_str}") -+ STRING(REGEX REPLACE "^#define[ \t]+LUA_VERSION_MAJOR[ \t]+\"([^\"]+)\".*" "\\1" LUA_VERSION_MAJOR "${lua_version_major_str}") -+ STRING(REGEX REPLACE "^#define[ \t]+LUA_VERSION_MINOR[ \t]+\"([^\"]+)\".*" "\\1" LUA_VERSION_MINOR "${lua_version_minor_str}") -+ STRING(REGEX REPLACE "^#define[ \t]+LUA_VERSION_RELEASE[ \t]+\"([^\"]+)\".*" "\\1" LUA_VERSION_RELEASE "${lua_version_release_str}") -+ -+ STRING(CONCAT LUA_VERSION_STRING ${LUA_VERSION_MAJOR} "." ${LUA_VERSION_MINOR} "." ${LUA_VERSION_RELEASE}) -+ -+ #STRING(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([^\"]+)\".*" "\\1" LUA_VERSION_STRING "${lua_version_str}") - UNSET(lua_version_str) - ENDIF() - diff --git a/cmake-docpath.patch b/cmake-docpath.patch deleted file mode 100644 index f5414d5..0000000 --- a/cmake-docpath.patch +++ /dev/null @@ -1,10 +0,0 @@ -diff -up lsyncd-release-2.2.3/CMakeLists.txt.orig lsyncd-release-2.2.3/CMakeLists.txt ---- lsyncd-release-2.2.3/CMakeLists.txt.orig 2018-03-09 07:39:11.000000000 -0500 -+++ lsyncd-release-2.2.3/CMakeLists.txt 2020-12-08 15:00:44.112179103 -0500 -@@ -107,5 +107,5 @@ add_executable( lsyncd ${LSYNCD_SRC} ) - target_link_libraries( lsyncd ${LUA_LIBRARIES} ) - - install( TARGETS lsyncd RUNTIME DESTINATION bin ) --install( FILES doc/manpage/lsyncd.1 DESTINATION man ) -+install( FILES doc/manpage/lsyncd.1 DESTINATION /usr/share/man/man1/ ) - diff --git a/cmake-find-lua-suffixes.patch b/cmake-find-lua-suffixes.patch deleted file mode 100644 index 7ffc759..0000000 --- a/cmake-find-lua-suffixes.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 0af99d8d5ba35118e8799684a2d4a8ea4b0c6957 Mon Sep 17 00:00:00 2001 -From: yokogawa-k -Date: Mon, 26 Mar 2018 17:11:29 +0900 -Subject: [PATCH] fix non-versioned lua not search in cmake - -"FOREACH" ignore empty elements, but "FOREACH IN LISTS" include emoty elements. -https://cmake.org/cmake/help/latest/command/foreach.html ---- - cmake/FindLua.cmake | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/cmake/FindLua.cmake b/cmake/FindLua.cmake -index 1f95bf9..6d33dbe 100644 ---- a/cmake/FindLua.cmake -+++ b/cmake/FindLua.cmake -@@ -39,7 +39,7 @@ SET(_POSSIBLE_LUA_INCLUDE include include/lua) - SET(_POSSIBLE_SUFFIXES "52" "5.2" "-5.2" "53" "5.3" "-5.3" "") - - # Set up possible search names and locations --FOREACH(_SUFFIX ${_POSSIBLE_SUFFIXES}) -+FOREACH(_SUFFIX IN LISTS _POSSIBLE_SUFFIXES) - LIST(APPEND _POSSIBLE_LUA_INCLUDE "include/lua${_SUFFIX}") - LIST(APPEND _POSSIBLE_LUA_EXECUTABLE "lua${_SUFFIX}") - LIST(APPEND _POSSIBLE_LUA_COMPILER "luac${_SUFFIX}") diff --git a/cmake-prefer-lua-54.patch b/cmake-prefer-lua-54.patch deleted file mode 100644 index ce20038..0000000 --- a/cmake-prefer-lua-54.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up lsyncd-42413cabbedca429d55a5378f6e830f191f3cc86/cmake/FindLua.cmake.lua54 lsyncd-42413cabbedca429d55a5378f6e830f191f3cc86/cmake/FindLua.cmake ---- lsyncd-42413cabbedca429d55a5378f6e830f191f3cc86/cmake/FindLua.cmake.lua54 2020-12-08 19:14:57.365310674 -0500 -+++ lsyncd-42413cabbedca429d55a5378f6e830f191f3cc86/cmake/FindLua.cmake 2020-12-08 19:26:11.064284269 -0500 -@@ -36,7 +36,7 @@ SET(_POSSIBLE_LUA_INCLUDE include includ - #SET(_POSSIBLE_LUA_LIBRARY lua) - - # Determine possible naming suffixes (there is no standard for this) --SET(_POSSIBLE_SUFFIXES "52" "5.2" "-5.2" "53" "5.3" "-5.3" "") -+SET(_POSSIBLE_SUFFIXES "54" "5.4" "-5.4" "53" "5.3" "-5.3" "52" "5.2" "-5.2" "") - - # Set up possible search names and locations - FOREACH(_SUFFIX IN LISTS _POSSIBLE_SUFFIXES) diff --git a/lsyncd-2.2.3.tar.gz b/lsyncd-2.2.3.tar.gz deleted file mode 100644 index 416cc56..0000000 Binary files a/lsyncd-2.2.3.tar.gz and /dev/null differ diff --git a/lsyncd-2.3.1.tar.gz b/lsyncd-2.3.1.tar.gz new file mode 100644 index 0000000..e98d958 Binary files /dev/null and b/lsyncd-2.3.1.tar.gz differ diff --git a/lsyncd.service b/lsyncd.service index 5c43641..5cf2f65 100644 --- a/lsyncd.service +++ b/lsyncd.service @@ -1,13 +1,15 @@ [Unit] Description=Live Syncing (Mirror) Daemon -Documentation=man:lsyncd(1) https://axkibe.github.io/lsyncd/ +Documentation=man:lsyncd(1) file://usr/share/doc/lsyncd/README.md https://axkibe.github.io/lsyncd/ After=network.target [Service] Type=simple +Nice=19 EnvironmentFile=-/etc/sysconfig/lsyncd ExecStart=/usr/bin/lsyncd -nodaemon $LSYNCD_OPTIONS -Restart=on-failure +ExecReload=/bin/kill -HUP $MAINPID +Restart=always SuccessExitStatus=143 [Install] diff --git a/lsyncd.spec b/lsyncd.spec index de924bd..beac6fc 100644 --- a/lsyncd.spec +++ b/lsyncd.spec @@ -1,25 +1,21 @@ %global _hardened_build 1 -%global gittag0 release-2.2.3 -%global commit0 42413cabbedca429d55a5378f6e830f191f3cc86 +%global gittag0 v2.3.1 +%global commit0 6d59f16140468242fe157b4a5adf36d6a93cf6a4 %global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) Name: lsyncd -Version: 2.2.3 -Release: 2 +Version: 2.3.1 +Release: 1 Summary: File change monitoring and synchronization daemon License: GPLv2+ URL: https://github.com/axkibe/lsyncd/ Source0: https://github.com/axkibe/%{name}/archive/%{gittag0}/%{name}-%{version}.tar.gz -Patch0: cmake-docpath.patch -Patch1: cmake-define-LUA_COMPAT_5_3.patch -Patch3: cmake-find-lua-suffixes.patch -Patch2: cmake-prefer-lua-54.patch -Patch4: cmake-determine-lua-version.patch +Patch0: cmake-DOCDIR.patch Source1: lsyncd.sysconfig Source2: lsyncd.logrotate Source3: lsyncd.conf Source4: lsyncd.service Source5: lsyncd.sysctl -BuildRequires: asciidoc cmake gcc gcc-c++ lua lua-devel >= 5.1.3 systemd rsync +BuildRequires: asciidoc cmake gcc gcc-c++ lua lua-devel >= 5.2 systemd rsync Requires: lua rsync %description @@ -32,10 +28,10 @@ easy to install not requiring new file systems or block devices and does not hamper local file system performance. %prep -%autosetup -n %{name}-release-%{version} -p1 +%autosetup -p1 %build -%cmake +%cmake -DCMAKE_INSTALL_MANDIR:PATH=%{_mandir} -DCMAKE_INSTALL_DOCDIR:PATH=%{_docdir}/%{name} %make_build %install @@ -43,7 +39,7 @@ not hamper local file system performance. install -p -d -m 0755 %{buildroot}%{_var}/log/%{name} install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/sysconfig/lsyncd install -p -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/lsyncd -install -p -D -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/ +install -p -D -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/lsyncd.conf install -p -D -m 0644 %{SOURCE4} %{buildroot}%{_unitdir}/lsyncd.service install -p -D -m 0644 %{SOURCE5} %{buildroot}%{_sysctldir}/50-lsyncd.conf @@ -63,7 +59,7 @@ make %files %license COPYING -%doc ChangeLog examples +%doc ChangeLog examples README.md %doc %{_mandir}/man1/lsyncd.1.* %config(noreplace) %{_sysconfdir}/lsyncd.conf %config(noreplace) %{_sysconfdir}/sysconfig/lsyncd @@ -74,6 +70,9 @@ make %{_unitdir}/lsyncd.service %changelog +* Thu May 4 2023 liyanan - 2.3.1-1 +- update to 2.3.1 + * Sat Jun 05 2021 maminjie - 2.2.3-2 - Repair status failure after stopping service