-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create debian and rpm package on releases
- Loading branch information
1 parent
97fc31b
commit 0f871e7
Showing
14 changed files
with
128 additions
and
410 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Used to dynamically set the package file name based on the generator | ||
foreach(generator ${CPACK_GENERATOR}) | ||
if("${generator}" STREQUAL "DEB") | ||
set(CPACK_PACKAGE_FILE_NAME ${CPACK_DEBIAN_PACKAGE_FILE_NAME}) | ||
elseif("${generator}" STREQUAL "RPM") | ||
set(CPACK_PACKAGE_FILE_NAME ${CPACK_RPM_PACKAGE_FILE_NAME}) | ||
elseif("${generator}" STREQUAL "DragNDrop") | ||
set(CPACK_PACKAGE_FILE_NAME ${CPACK_DMG_PACKAGE_FILE_NAME}) | ||
else() | ||
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-unknown") | ||
endif() | ||
message(STATUS "Generating package for ${generator} with file name ${CPACK_PACKAGE_FILE_NAME}") | ||
endforeach() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
set(CPACK_PACKAGE_NAME "capstone") | ||
set(CPACK_PACKAGE_VENDOR "Rot127") | ||
set(CPACK_PACKAGE_CONTACT "Rot127 <[email protected]>") | ||
set(CPACK_PACKAGE_DESCRIPTION "Capstone is a lightweight multi-platform, multi-architecture disassembly framework. These are the development headers and libraries.\n Features:\n - Support hardware architectures: AArch64, ARM, Alpha, BPF, EVM, HPPA, LongArch, M680X, M68K, MOS65XX, Mips, PowerPC, RISCV, SH, Sparc, SystemZ, TMS320C64x, TriCore, WASM, x86, XCore, Xtensa.\n - Clean/simple/lightweight/intuitive architecture-neutral API.\n - Provide details on disassembled instructions (called \\\"decomposer\\\" by some others).\n - Provide some semantics of the disassembled instruction, such as list of implicit registers read & written.\n - Thread-safe by design.\n - Special support for embedding into firmware or OS kernel.\n - Distributed under the open source BSD license.") | ||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Lightweight multi-architecture disassembly framework - devel files") | ||
set(CPACK_PACKAGE_HOMEPAGE_URL "https://www.capstone-engine.org/") | ||
set(CPACK_STRIP_FILES false) | ||
|
||
# Set Debian-specific package variables | ||
set(CPACK_DEBIAN_PACKAGE_NAME "libcapstone-dev") | ||
set(CPACK_DEBIAN_PACKAGE_SOURCE "capstone") | ||
set(CPACK_DEBIAN_PACKAGE_VERSION "${PROJECT_VERSION}") | ||
set(CPACK_DEBIAN_PACKAGE_ORIGINAL_MAINTAINER "Debian Security Tools <[email protected]>") | ||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.2.5)") | ||
set(CPACK_DEBIAN_PACKAGE_SECTION "libdevel") | ||
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional") | ||
set(CPACK_DEBIAN_PACKAGE_MULTIARCH "same") | ||
|
||
# Determine architecture | ||
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64") | ||
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64") | ||
elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i386" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i686") | ||
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "i386") | ||
elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm") | ||
if(CMAKE_SIZE_OF_VOID_P EQUAL 4) | ||
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "armhf") | ||
else() | ||
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "arm64") | ||
endif() | ||
else() | ||
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR}) | ||
endif() | ||
|
||
# Copy over Debian documentation | ||
install(FILES | ||
"${CMAKE_SOURCE_DIR}/ChangeLog" | ||
"${CMAKE_SOURCE_DIR}/CREDITS.TXT" | ||
"${CMAKE_SOURCE_DIR}/README.md" | ||
"${CMAKE_SOURCE_DIR}/SPONSORS.TXT" | ||
DESTINATION "/usr/share/doc/libcapstone-dev" | ||
) | ||
install(DIRECTORY | ||
"${CMAKE_SOURCE_DIR}/LICENSES" | ||
DESTINATION "/usr/share/doc/libcapstone-dev" | ||
) | ||
message(STATUS "Adding documentation files for DEB generator") | ||
|
||
# Include additional file to run 'ldconfig' after install | ||
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_SOURCE_DIR}/packages/deb/triggers") | ||
|
||
# RPM package settings | ||
set(CPACK_RPM_PACKAGE_NAME "capstone-devel") | ||
set(CPACK_RPM_PACKAGE_VERSION "${PROJECT_VERSION}") | ||
# set(CPACK_RPM_PACKAGE_RELEASE "6.fc42") | ||
set(CPACK_RPM_PACKAGE_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR}) | ||
set(CPACK_RPM_PACKAGE_GROUP "Development/Libraries") | ||
set(CPACK_RPM_PACKAGE_REQUIRES "libc6 >= 2.2.5") | ||
set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_SOURCE_DIR}/packages/rpm/postinstall.sh") | ||
set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_SOURCE_DIR}/packages/rpm/postinstall.sh") | ||
set(CPACK_RPM_CHANGELOG_FILE "${CMAKE_SOURCE_DIR}/ChangeLog") | ||
set(CPACK_RPM_PACKAGE_LICENSE "BSD3, LLVM") | ||
set(CPACK_RPM_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION}") | ||
|
||
# TODO: Do you have a script to run tests after installing the RPM/Debian package? | ||
# Add %check section to RPM spec file | ||
# set(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}\n%check\ntrue") | ||
|
||
# TODO: Please help get CPack working for Mac OSX packages too | ||
# OSX package settings | ||
# set(CPACK_BUNDLE_NAME "Capstone") | ||
# set(CPACK_BUNDLE_PLIST "xcode/CapstoneFramework/Info.plist") | ||
|
||
# Set package file name based on the generator | ||
message(STATUS "CPACK_GENERATOR: ${CPACK_GENERATOR}") | ||
set(CPACK_DEBIAN_PACKAGE_FILE_NAME "${CPACK_DEBIAN_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}") | ||
set(CPACK_RPM_PACKAGE_FILE_NAME "${CPACK_RPM_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}.${CMAKE_SYSTEM_PROCESSOR}") | ||
set(CPACK_DMG_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}") | ||
|
||
include(CPack) |
2 changes: 1 addition & 1 deletion
2
LICENSES/LICENSE_DEB_PACKAGE.txt → LICENSES/LICENSE_PACKAGE.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.