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