Skip to content

Commit

Permalink
Merge pull request #157 from RadeonOpenCompute/rpm_improvement
Browse files Browse the repository at this point in the history
rpm package improvement
  • Loading branch information
whchung authored Nov 9, 2016
2 parents 7516b11 + 7f4801f commit 7997b98
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
21 changes: 14 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -647,18 +647,21 @@ set(CPACK_PACKAGE_VERSION_MAJOR ${KALMAR_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${KALMAR_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${KALMAR_VERSION_PATCH})
set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CMAKE_SYSTEM_NAME})
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "HCC: a Heterogeneous C++ to OpenCL/HSA compiler")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Siu Chi Chan <[email protected]>")
set(CPACK_DEBIAN_PACKAGE_SECTION "devel")


set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
"${PROJECT_BINARY_DIR}/packaging/debian/postinst;${PROJECT_BINARY_DIR}/packaging/debian/prerm")
set(PACKAGE_DESCRIPTION "HCC: An Open Source, Optimizing C++ Compiler for Heterogeneous Compute")

set(OFFICIAL_RELEASE_BUILD 0)

if ("${DISTRO}" STREQUAL "ubuntu")

set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${PACKAGE_DESCRIPTION})
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Siu Chi Chan <[email protected]>")
set(CPACK_DEBIAN_PACKAGE_SECTION "devel")

set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
"${PROJECT_BINARY_DIR}/packaging/debian/postinst;${PROJECT_BINARY_DIR}/packaging/debian/prerm")

set(HCC_GENERAL_DEBIAN_DEP "libstdc++-4.8-dev, libc++1, libc++-dev, libc++abi1, libc++abi-dev, elfutils")

# control the list of package dependency depending on whether this is an official release build.
Expand All @@ -675,10 +678,14 @@ if ("${DISTRO}" STREQUAL "ubuntu")

elseif ("${DISTRO}" STREQUAL "fedora")

set(CPACK_RPM_PACKAGE_DESCRIPTION ${PACKAGE_DESCRIPTION})

set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${PROJECT_BINARY_DIR}/packaging/debian/postinst")
set(CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE "${PROJECT_BINARY_DIR}/packaging/debian/prerm")

# disable automatic shared libraries dependency detection
set(CPACK_RPM_PACKAGE_AUTOREQ 0)

set(CPACK_RPM_PACKAGE_REQUIRES "")
set(CPACK_RPM_PACKAGE_REQUIRES "hsakmt-roct-dev, hsa-rocr-dev, libstdc++-devel, elfutils-libelf-devel, glibc-devel")
set(CPACK_GENERATOR "RPM;TGZ")

endif ("${DISTRO}" STREQUAL "ubuntu")
Expand Down
6 changes: 3 additions & 3 deletions packaging/debian/postinst.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ do_softlinks() {
return
fi

mkdir -p /opt/rocm/lib
mkdir -p /opt/rocm/bin
mkdir -p "$ROCM_PATH/lib"
mkdir -p "$ROCM_PATH/bin"

if [ -L "$ROCM_PATH/hcc" ] ; then
rm -f "$ROCM_PATH/hcc"
Expand All @@ -54,7 +54,7 @@ do_softlinks() {
}

case "$1" in
configure|upgrade)
configure|upgrade|1|2)
do_softlinks
;;

Expand Down
2 changes: 1 addition & 1 deletion packaging/debian/prerm.in
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ do_softlinks() {


case "$1" in
remove|purge|upgrade)
remove|purge|upgrade|0|1)
do_softlinks
;;

Expand Down

0 comments on commit 7997b98

Please sign in to comment.