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

make rpm for fedora or other flavors of linux #304

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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: 5 additions & 5 deletions CMake/pkg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,20 @@ set(CPACK_PACKAGE_VERSION_PATCH ${XRT_PLUGIN_VERSION_PATCH})

set(CPACK_SET_DESTDIR ON)
set(CPACK_COMPONENTS_ALL ${XDNA_COMPONENT})
set(CPACK_GENERATOR "DEB")
set(CPACK_GENERATOR "RPM")
set(CPACK_PACKAGE_VENDOR "AMD Inc")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "XDNA driver plugin for Xilinx RunTime")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/xrt/LICENSE")
set(CPACK_PACKAGE_CONTACT "max.zhen@amd.com")
set(CPACK_PACKAGE_NAME "xrt_plugin")
set(CPACK_DEB_COMPONENT_INSTALL yes)
set(CPACK_RPM_COMPONENT_INSTALL yes)
set(CPACK_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}.${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}_${XDNA_CPACK_LINUX_FLAVOR}${XDNA_CPACK_LINUX_VERSION}-${XDNA_CPACK_ARCH}")
math(EXPR next_minor "${CPACK_PACKAGE_VERSION_MINOR} + 1")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "xrt (>= ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}), xrt (<< ${CPACK_PACKAGE_VERSION_MAJOR}.${next_minor})")
set(CPACK_RPM_PACKAGE_DEPENDS "xrt (>= ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}), xrt (<< ${CPACK_PACKAGE_VERSION_MAJOR}.${next_minor})")

install(DIRECTORY ${AMDXDNA_BINS_DIR}/firmware/
DESTINATION /lib/firmware/amdnpu
DESTINATION /usr/lib/firmware/amdnpu
COMPONENT ${XDNA_COMPONENT}
FILES_MATCHING
PATTERN "*.sbin"
Expand All @@ -72,7 +72,7 @@ configure_file(
${CMAKE_CURRENT_BINARY_DIR}/package/prerm
@ONLY
)
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_BINARY_DIR}/package/postinst"
set(CPACK_RPM_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_BINARY_DIR}/package/postinst"
"${CMAKE_CURRENT_BINARY_DIR}/package/prerm")

include(CPack)
7 changes: 6 additions & 1 deletion tools/amdxdna_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@

SCRIPT_DIR=$(readlink -f $(dirname ${BASH_SOURCE[0]}))

apt-get install -y jq
# if has apt-get
if [ -x "$(command -v apt-get)" ]; then
apt-get install -y jq
elif [ -x "$(command -v dnf)" ]; then
dnf install -y jq
fi
Comment on lines +12 to +14
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems the other deps script of xrt uses yum instead of dnf (probably for compatibility?)

So, maybe here also use yum?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DNF has been the default package manager since EL 8. How about let's not use it's legacy alias?


$SCRIPT_DIR/../xrt/src/runtime_src/tools/scripts/xrtdeps.sh