diff --git a/README.md b/README.md index 901b5e6..345f657 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,16 @@ and then install: sudo cmake --install build ``` +OR use `dpkg` package manager (requires `dpkg-shlibdeps`): +```shell +cd build && cpack -G DEB && sudo dpkg -i *.deb +``` + +OR use `rpm` package manager (requires `rpmbuild`): +```shell +cd build && cpack -G RPM && sudo rpm -i *.rpm +``` + ## Package managers If you are using homebrew, use the following command: diff --git a/cmake/CPackConfig.cmake b/cmake/CPackConfig.cmake index 3f668fb..10be971 100644 --- a/cmake/CPackConfig.cmake +++ b/cmake/CPackConfig.cmake @@ -1,11 +1,12 @@ set(CPACK_PACKAGING_INSTALL_PREFIX /usr) - set(CPACK_PACKAGE_CONTACT "Ilya Andreev ") + +# Variables specific to CPack Debian (DEB) generator set(CPACK_DEB_COMPONENT_INSTALL ON) +set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT) set(CPACK_DEBIAN_RUNTIME_PACKAGE_NAME "libtmp${CPACK_PACKAGE_VERSION_MAJOR}") set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_NAME "libtmp${CPACK_PACKAGE_VERSION_MAJOR}-dev") -set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT) set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS ON) @@ -15,3 +16,18 @@ set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_DEPENDS set(CPACK_DEBIAN_RUNTIME_DESCRIPTION "Runtime package") set(CPACK_DEBIAN_DEVELOPMENT_DESCRIPTION "Development package") + +# Variables specific to CPack RPM generator +set(CPACK_RPM_COMPONENT_INSTALL ON) +set(CPACK_RPM_PACKAGE_LICENSE "MIT") +set(CPACK_RPM_FILE_NAME RPM-DEFAULT) + +set(CPACK_RPM_RUNTIME_PACKAGE_NAME "tmp") +set(CPACK_RPM_DEVELOPMENT_PACKAGE_NAME "tmp-devel") + +set(CPACK_RPM_PACKAGE_AUTOREQPROV ON) +set(CPACK_RPM_DEVELOPMENT_PACKAGE_REQUIRES + "libstdc++-devel, tmp = ${CPACK_PACKAGE_VERSION}") + +set(CPACK_RPM_RUNTIME_PACKAGE_DESCRIPTION "Runtime package") +set(CPACK_RPM_DEVELOPMENT_PACKAGE_DESCRIPTION "Development package")