From 8d4dfae2c168939a3c77a998bfb387da236cce04 Mon Sep 17 00:00:00 2001 From: Richard Shaw Date: Sun, 6 Dec 2020 14:39:41 -0600 Subject: [PATCH 01/18] Initial packaging. --- .gitignore | 1 + CMakeLists.txt | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ chunkfs.spec | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 4 files changed, 108 insertions(+) create mode 100644 .gitignore create mode 100644 CMakeLists.txt create mode 100644 chunkfs.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1bb55ee --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/chunkfs_0.8.tar.xz diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..87c645e --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,52 @@ +project(chunkfs + LANGUAGES C + ) + +cmake_minimum_required(VERSION 3.0) + +set(VERSION 0.8) +add_definitions(-DVERSION="${VERSION}") +set(CMAKE_CXX_FLAGS "-O3 -Wall -Wextra -Wshadow -Wconversion -Wcast-qual -Wformat=2 ${CMAKE_CXX_FLAGS}") + +include(GNUInstallDirs) +mark_as_advanced(CLEAR + CMAKE_INSTALL_BINDIR + CMAKE_INSTALL_DOCDIR + CMAKE_INSTALL_MANDIR + ) + +add_executable(chunkfs + chunkfs.c + utils.c + ) + +target_link_libraries(chunkfs fuse) + +add_executable(unchunkfs + unchunkfs.c + utils.c + ) + +target_link_libraries(unchunkfs fuse) + +add_custom_target(manpage ALL) + +add_custom_command(TARGET manpage + COMMAND pod2man -c '' -n CHUNKFS -r 'ChunkFS ${VERSION}' -s 1 ${CMAKE_SOURCE_DIR}/manpage.pod chunkfs.1 + ) + +execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink chunkfs.1 unchunkfs.1 + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) + +install(TARGETS chunkfs unchunkfs + LIBRARY DESTINATION ${CMAKE_INSTALL_BINDIR} + ) + +install(FILES ${CMAKE_BINARY_DIR}/chunkfs.1 ${CMAKE_BINARY_DIR}/unchunkfs.1 + + DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 + ) + +install(FILES ${CMAKE_SOURCE_DIR}/writeoverlay.sh + DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples + ) diff --git a/chunkfs.spec b/chunkfs.spec new file mode 100644 index 0000000..6962c26 --- /dev/null +++ b/chunkfs.spec @@ -0,0 +1,54 @@ +Name: chunkfs +Version: 0.8 +Release: 1%{?dist} +Summary: FUSE based filesystem that allows you to mount an arbitrary file or block device + +License: GPLv2+ +URL: https://chunkfs.florz.de/ +Source0: https://chunkfs.florz.de/%{name}_%{version}.tar.xz +Source100: CMakeLists.txt + +BuildRequires: cmake gcc +# For pod2man +BuildRequires: perl-podlators +BuildRequires: fuse-devel + +%description +ChunkFS is a FUSE based filesystem that allows you to mount an arbitrary file +or block device as a directory tree of files that each represent a chunk of +user-specified size of the mounted file. The chunk size is global per mount, +but at mount time any value can be specified. (If the file size isn't a +multiple of the specified chunk size, the last file in the tree simply will be +smaller than the chunk size.) Only read access is supported at the moment. + +UnChunkFS is the inversion of ChunkFS—it allows you to mount a ChunkFS tree (or +a copy of it, of course), and gives you a single file named image that has the +same contents as the file or device you created the tree from by mounting it as +a ChunkFS. + + +%prep +%autosetup -p1 +install %{SOURCE100} . + + +%build +%cmake +%cmake_build + + +%install +%cmake_install + + +%files +%license COPYING +%doc README +%{_bindir}/* +%{_docdir}/%{name}/examples/ +%{_mandir}/man1/*chunkfs.1* + + +%changelog +* Wed Dec 2 2020 Richard Shaw - 0.8-1 +- Initial packaging. diff --git a/sources b/sources new file mode 100644 index 0000000..8423c09 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (chunkfs_0.8.tar.xz) = 4e751fe782a1ff0d11db61f10548e5a59cb65c2c6d990cbc26e09ffb09bfcfdce0e26fb0fe5282c403264c8fc2d658e9c652aea6900e203821f9834c8d3a5d4a From 90acf5d2d0d7c0c2a25dc8c9484733e1917ff33d Mon Sep 17 00:00:00 2001 From: Richard Shaw Date: Sun, 6 Dec 2020 14:40:24 -0600 Subject: [PATCH 02/18] Update README. --- README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f81e2fe..a403c6f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,11 @@ -# chunkfs +ChunkFS is a FUSE based filesystem that allows you to mount an arbitrary file +or block device as a directory tree of files that each represent a chunk of +user-specified size of the mounted file. The chunk size is global per mount, +but at mount time any value can be specified. (If the file size isn't a +multiple of the specified chunk size, the last file in the tree simply will be +smaller than the chunk size.) Only read access is supported at the moment. -The chunkfs package +UnChunkFS is the inversion of ChunkFS—it allows you to mount a ChunkFS tree (or +a copy of it, of course), and gives you a single file named image that has the +same contents as the file or device you created the tree from by mounting it as +a ChunkFS. From 7cac1177bb7f2ab082c5715b51ffeb99483f41d2 Mon Sep 17 00:00:00 2001 From: Richard Shaw Date: Tue, 8 Dec 2020 09:28:46 -0600 Subject: [PATCH 03/18] Small fix for CMake. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 87c645e..1697ae8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,7 +39,7 @@ execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink chunkfs.1 unchunkfs. WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) install(TARGETS chunkfs unchunkfs - LIBRARY DESTINATION ${CMAKE_INSTALL_BINDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) install(FILES ${CMAKE_BINARY_DIR}/chunkfs.1 ${CMAKE_BINARY_DIR}/unchunkfs.1 From 920667c0b11e9e43a8db48560995ffd99d59bffa Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Tue, 26 Jan 2021 01:57:28 +0000 Subject: [PATCH 04/18] - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- chunkfs.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chunkfs.spec b/chunkfs.spec index 6962c26..831ff53 100644 --- a/chunkfs.spec +++ b/chunkfs.spec @@ -1,6 +1,6 @@ Name: chunkfs Version: 0.8 -Release: 1%{?dist} +Release: 2%{?dist} Summary: FUSE based filesystem that allows you to mount an arbitrary file or block device License: GPLv2+ @@ -50,5 +50,8 @@ install %{SOURCE100} . %changelog +* Tue Jan 26 2021 Fedora Release Engineering - 0.8-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + * Wed Dec 2 2020 Richard Shaw - 0.8-1 - Initial packaging. From 0804b129a34e305a23513de5352501b634848deb Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 21 Jul 2021 14:29:50 +0000 Subject: [PATCH 05/18] - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild Signed-off-by: Fedora Release Engineering From cfb8744cdd4d978f34223bfce82becbbb45edf54 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 21 Jul 2021 19:27:02 +0000 Subject: [PATCH 06/18] - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- chunkfs.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chunkfs.spec b/chunkfs.spec index 831ff53..46a9b6e 100644 --- a/chunkfs.spec +++ b/chunkfs.spec @@ -1,6 +1,6 @@ Name: chunkfs Version: 0.8 -Release: 2%{?dist} +Release: 3%{?dist} Summary: FUSE based filesystem that allows you to mount an arbitrary file or block device License: GPLv2+ @@ -50,6 +50,9 @@ install %{SOURCE100} . %changelog +* Wed Jul 21 2021 Fedora Release Engineering - 0.8-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + * Tue Jan 26 2021 Fedora Release Engineering - 0.8-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild From 43f0cdcacebfe1be6a2cadfbbc8a81c2fae552ab Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 19 Jan 2022 23:12:42 +0000 Subject: [PATCH 07/18] - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- chunkfs.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chunkfs.spec b/chunkfs.spec index 46a9b6e..b7eef72 100644 --- a/chunkfs.spec +++ b/chunkfs.spec @@ -1,6 +1,6 @@ Name: chunkfs Version: 0.8 -Release: 3%{?dist} +Release: 4%{?dist} Summary: FUSE based filesystem that allows you to mount an arbitrary file or block device License: GPLv2+ @@ -50,6 +50,9 @@ install %{SOURCE100} . %changelog +* Wed Jan 19 2022 Fedora Release Engineering - 0.8-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + * Wed Jul 21 2021 Fedora Release Engineering - 0.8-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild From 8fd30f2420de3ba6adb9d0ac5feec19fb168a114 Mon Sep 17 00:00:00 2001 From: Troy Dawson Date: Mon, 31 Jan 2022 09:17:39 -0800 Subject: [PATCH 08/18] epel8-playground decommissioned : https://pagure.io/epel/issue/136 --- README.md | 3 --- dead.package | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) delete mode 100644 README.md create mode 100644 dead.package diff --git a/README.md b/README.md deleted file mode 100644 index f81e2fe..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# chunkfs - -The chunkfs package diff --git a/dead.package b/dead.package new file mode 100644 index 0000000..a72aec0 --- /dev/null +++ b/dead.package @@ -0,0 +1 @@ +epel8-playground decommissioned : https://pagure.io/epel/issue/136 From 944b848c1e0d62896c9e99619842d45421375bd0 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 20 Jul 2022 22:55:18 +0000 Subject: [PATCH 09/18] Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- chunkfs.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chunkfs.spec b/chunkfs.spec index b7eef72..735b19f 100644 --- a/chunkfs.spec +++ b/chunkfs.spec @@ -1,6 +1,6 @@ Name: chunkfs Version: 0.8 -Release: 4%{?dist} +Release: 5%{?dist} Summary: FUSE based filesystem that allows you to mount an arbitrary file or block device License: GPLv2+ @@ -50,6 +50,9 @@ install %{SOURCE100} . %changelog +* Wed Jul 20 2022 Fedora Release Engineering - 0.8-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + * Wed Jan 19 2022 Fedora Release Engineering - 0.8-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild From 3b5b626c9b47f9e683ce65d828eb0b60f333b5b1 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 18 Jan 2023 23:50:54 +0000 Subject: [PATCH 10/18] Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- chunkfs.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chunkfs.spec b/chunkfs.spec index 735b19f..9698c87 100644 --- a/chunkfs.spec +++ b/chunkfs.spec @@ -1,6 +1,6 @@ Name: chunkfs Version: 0.8 -Release: 5%{?dist} +Release: 6%{?dist} Summary: FUSE based filesystem that allows you to mount an arbitrary file or block device License: GPLv2+ @@ -50,6 +50,9 @@ install %{SOURCE100} . %changelog +* Wed Jan 18 2023 Fedora Release Engineering - 0.8-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + * Wed Jul 20 2022 Fedora Release Engineering - 0.8-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild From 1201d7d53c5dddf5e04ac61be65343d44c998c8e Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 19 Jul 2023 15:38:43 +0000 Subject: [PATCH 11/18] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- chunkfs.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chunkfs.spec b/chunkfs.spec index 9698c87..3f440d7 100644 --- a/chunkfs.spec +++ b/chunkfs.spec @@ -1,6 +1,6 @@ Name: chunkfs Version: 0.8 -Release: 6%{?dist} +Release: 7%{?dist} Summary: FUSE based filesystem that allows you to mount an arbitrary file or block device License: GPLv2+ @@ -50,6 +50,9 @@ install %{SOURCE100} . %changelog +* Wed Jul 19 2023 Fedora Release Engineering - 0.8-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + * Wed Jan 18 2023 Fedora Release Engineering - 0.8-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild From 4f6724fe6d29680dd448d7890e23f14c13ebe06e Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 19 Jan 2024 15:25:48 +0000 Subject: [PATCH 12/18] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- chunkfs.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chunkfs.spec b/chunkfs.spec index 3f440d7..7ba5360 100644 --- a/chunkfs.spec +++ b/chunkfs.spec @@ -1,6 +1,6 @@ Name: chunkfs Version: 0.8 -Release: 7%{?dist} +Release: 8%{?dist} Summary: FUSE based filesystem that allows you to mount an arbitrary file or block device License: GPLv2+ @@ -50,6 +50,9 @@ install %{SOURCE100} . %changelog +* Fri Jan 19 2024 Fedora Release Engineering - 0.8-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Wed Jul 19 2023 Fedora Release Engineering - 0.8-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild From d7c2d5916424fec9db6aca2e5c6b46e41072f99f Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Tue, 23 Jan 2024 01:36:31 +0000 Subject: [PATCH 13/18] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- chunkfs.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chunkfs.spec b/chunkfs.spec index 7ba5360..1fd0c23 100644 --- a/chunkfs.spec +++ b/chunkfs.spec @@ -1,6 +1,6 @@ Name: chunkfs Version: 0.8 -Release: 8%{?dist} +Release: 9%{?dist} Summary: FUSE based filesystem that allows you to mount an arbitrary file or block device License: GPLv2+ @@ -50,6 +50,9 @@ install %{SOURCE100} . %changelog +* Tue Jan 23 2024 Fedora Release Engineering - 0.8-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Fri Jan 19 2024 Fedora Release Engineering - 0.8-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From 4964d5c348f3df930ad8b807567db78c8020a0a8 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 17 Jul 2024 19:17:44 +0000 Subject: [PATCH 14/18] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- chunkfs.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chunkfs.spec b/chunkfs.spec index 1fd0c23..b61418e 100644 --- a/chunkfs.spec +++ b/chunkfs.spec @@ -1,6 +1,6 @@ Name: chunkfs Version: 0.8 -Release: 9%{?dist} +Release: 10%{?dist} Summary: FUSE based filesystem that allows you to mount an arbitrary file or block device License: GPLv2+ @@ -50,6 +50,9 @@ install %{SOURCE100} . %changelog +* Wed Jul 17 2024 Fedora Release Engineering - 0.8-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Tue Jan 23 2024 Fedora Release Engineering - 0.8-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From a5f078f8430d6dc9da41f47f1403e4f8057a871b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Such=C3=BD?= Date: Fri, 26 Jul 2024 00:20:06 +0200 Subject: [PATCH 15/18] convert GPLv2+ license to SPDX This is part of https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_4 --- chunkfs.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/chunkfs.spec b/chunkfs.spec index b61418e..ed7d305 100644 --- a/chunkfs.spec +++ b/chunkfs.spec @@ -1,9 +1,10 @@ Name: chunkfs Version: 0.8 -Release: 10%{?dist} +Release: 11%{?dist} Summary: FUSE based filesystem that allows you to mount an arbitrary file or block device -License: GPLv2+ +# Automatically converted from old format: GPLv2+ - review is highly recommended. +License: GPL-2.0-or-later URL: https://chunkfs.florz.de/ Source0: https://chunkfs.florz.de/%{name}_%{version}.tar.xz Source100: CMakeLists.txt @@ -50,6 +51,9 @@ install %{SOURCE100} . %changelog +* Fri Jul 26 2024 Miroslav Suchý - 0.8-11 +- convert license to SPDX + * Wed Jul 17 2024 Fedora Release Engineering - 0.8-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From 2b095f4713daa0a552ed0f4cc3b4b3ed444486fa Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 16 Jan 2025 13:43:41 +0000 Subject: [PATCH 16/18] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- chunkfs.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chunkfs.spec b/chunkfs.spec index ed7d305..a44860d 100644 --- a/chunkfs.spec +++ b/chunkfs.spec @@ -1,6 +1,6 @@ Name: chunkfs Version: 0.8 -Release: 11%{?dist} +Release: 12%{?dist} Summary: FUSE based filesystem that allows you to mount an arbitrary file or block device # Automatically converted from old format: GPLv2+ - review is highly recommended. @@ -51,6 +51,9 @@ install %{SOURCE100} . %changelog +* Thu Jan 16 2025 Fedora Release Engineering - 0.8-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Fri Jul 26 2024 Miroslav Suchý - 0.8-11 - convert license to SPDX From 95ac6a5a97eb05504fbde83d15c4d81745e3a33b Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 23 Jul 2025 18:18:00 +0000 Subject: [PATCH 17/18] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- chunkfs.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chunkfs.spec b/chunkfs.spec index a44860d..cb213fe 100644 --- a/chunkfs.spec +++ b/chunkfs.spec @@ -1,6 +1,6 @@ Name: chunkfs Version: 0.8 -Release: 12%{?dist} +Release: 13%{?dist} Summary: FUSE based filesystem that allows you to mount an arbitrary file or block device # Automatically converted from old format: GPLv2+ - review is highly recommended. @@ -51,6 +51,9 @@ install %{SOURCE100} . %changelog +* Wed Jul 23 2025 Fedora Release Engineering - 0.8-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Thu Jan 16 2025 Fedora Release Engineering - 0.8-12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From c381b15d4d3490fbd03f2f8f01276fd940aff91e Mon Sep 17 00:00:00 2001 From: Richard Shaw Date: Thu, 7 Aug 2025 21:44:51 -0500 Subject: [PATCH 18/18] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- CMakeLists.txt | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1697ae8..bd0cca4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,9 @@ +cmake_minimum_required(VERSION 3.5...4.0) + project(chunkfs LANGUAGES C ) -cmake_minimum_required(VERSION 3.0) set(VERSION 0.8) add_definitions(-DVERSION="${VERSION}") @@ -29,11 +30,30 @@ add_executable(unchunkfs target_link_libraries(unchunkfs fuse) -add_custom_target(manpage ALL) +# Define the manpage output file +set(MANPAGE_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/chunkfs.1") -add_custom_command(TARGET manpage - COMMAND pod2man -c '' -n CHUNKFS -r 'ChunkFS ${VERSION}' -s 1 ${CMAKE_SOURCE_DIR}/manpage.pod chunkfs.1 - ) +# Custom command to generate the manpage +add_custom_command( + OUTPUT ${MANPAGE_OUTPUT} + COMMAND pod2man + --center="" + --name="CHUNKFS" + --release="ChunkFS ${VERSION}" + --section=1 + "${CMAKE_SOURCE_DIR}/manpage.pod" + "${MANPAGE_OUTPUT}" + DEPENDS "${CMAKE_SOURCE_DIR}/manpage.pod" + COMMENT "Generating chunkfs.1 manpage" + VERBATIM +) + +# Custom target to depend on the manpage output +add_custom_target( + manpage + ALL + DEPENDS ${MANPAGE_OUTPUT} +) execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink chunkfs.1 unchunkfs.1 WORKING_DIRECTORY ${CMAKE_BINARY_DIR})