Set up recipe for Debian package generation.
This commit is contained in:
parent
ab3b98c1b7
commit
8114d1a200
@ -47,3 +47,5 @@ endif()
|
|||||||
add_subdirectory(translations)
|
add_subdirectory(translations)
|
||||||
|
|
||||||
add_subdirectory(man)
|
add_subdirectory(man)
|
||||||
|
|
||||||
|
include(cmake/packages.cmake)
|
||||||
|
@ -123,7 +123,13 @@ cmake ..
|
|||||||
cmake --build . -- --jobs=$(nproc --ignore=1)
|
cmake --build . -- --jobs=$(nproc --ignore=1)
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
To install, run `sudo make install`. To run the tests, run `cd tests && ctest`.
|
To install, run `sudo make install`. To run the tests, run `cd tests &&
|
||||||
|
ctest`.
|
||||||
|
|
||||||
|
[TIP]
|
||||||
|
If you are using Debian or Ubuntu, or a distribution that is derived from these,
|
||||||
|
you can run `cpack -G DEB` in the build directory to generate a .deb-file. You
|
||||||
|
can then install it with `apt install ./epubgrep-*.deb`.
|
||||||
|
|
||||||
.CMake options:
|
.CMake options:
|
||||||
* `-DCMAKE_BUILD_TYPE=Debug` for a debug build.
|
* `-DCMAKE_BUILD_TYPE=Debug` for a debug build.
|
||||||
|
30
cmake/packages.cmake
Normal file
30
cmake/packages.cmake
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
|
set(CPACK_PACKAGE_CHECKSUM "SHA512")
|
||||||
|
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
|
||||||
|
set(CPACK_PACKAGE_CONTACT "tastytea <tastytea@tastytea.de>")
|
||||||
|
|
||||||
|
# Should be set automatically, but they are not.
|
||||||
|
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
|
||||||
|
set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
|
||||||
|
|
||||||
|
# Figure out dependencies automatically.
|
||||||
|
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
|
||||||
|
|
||||||
|
# Should be set automatically, but it is not.
|
||||||
|
execute_process(COMMAND dpkg --print-architecture
|
||||||
|
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
|
||||||
|
execute_process(COMMAND lsb_release --codename --short
|
||||||
|
OUTPUT_VARIABLE DEBIAN_CODENAME
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
if ("${DEBIAN_CODENAME}" STREQUAL "n/a")
|
||||||
|
set(DEBIAN_CODENAME "unknown")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# The default does not produce valid Debian package names.
|
||||||
|
set(CPACK_DEBIAN_FILE_NAME
|
||||||
|
"${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}-0_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}_${DEBIAN_CODENAME}.deb")
|
||||||
|
|
||||||
|
include(CPack)
|
Loading…
x
Reference in New Issue
Block a user