Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rpm generator support #117

Merged
merged 4 commits into from
Sep 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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")