Skip to content

Commit

Permalink
Add rpm generator support (#117)
Browse files Browse the repository at this point in the history
Closes #67
  • Loading branch information
bugdea1er authored Sep 21, 2024
1 parent 977e71d commit 78e9dff
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
20 changes: 18 additions & 2 deletions cmake/CPackConfig.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
set(CPACK_PACKAGING_INSTALL_PREFIX /usr)

set(CPACK_PACKAGE_CONTACT "Ilya Andreev <[email protected]>")

# 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)
Expand All @@ -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")

0 comments on commit 78e9dff

Please sign in to comment.