From 6ceed7def39b281388ee50b9b8d0ea9b4b47a3d8 Mon Sep 17 00:00:00 2001 From: Kent Russell Date: Wed, 28 Oct 2015 14:37:11 -0400 Subject: [PATCH] libhsakmt - Add make option to package thunk as RPM Add an option to libhsakmt to allow the thunk to be packaged as an RPM. The default will remain being built as-is, but this can now be packaged as an RPM by using "make src rpm" . build_thunk.sh will be modified to reflect this new option. Change-Id: I38e03d10cfb5035bdf0a87635a784c47a709a5b6 --- Makefile | 3 +++ RPM/libhsakmt.spec | 30 ++++++++++++++++++++++++++++++ src/Makefile | 13 ++++++++++--- 3 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 RPM/libhsakmt.spec diff --git a/Makefile b/Makefile index b3c4b4accf..c306e90756 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,9 @@ all: lnx64a deb: $(MAKE) -C src deb +rpm: + $(MAKE) -C src rpm + lnx64a: $(MAKE) -C src lnx64a diff --git a/RPM/libhsakmt.spec b/RPM/libhsakmt.spec new file mode 100644 index 0000000000..106c876b3a --- /dev/null +++ b/RPM/libhsakmt.spec @@ -0,0 +1,30 @@ +%define name libhsakmt +%define version 1.6.0 +%define thunkroot %{getenv:THUNK_ROOT} + +Name: %{name} +Version: %{version} +Release: 1 +Summary: Thunk libraries for AMD KFD + +Group: System Environment/Libraries +License: Advanced Micro Devices Inc. + +%description +This package includes the libhsakmt (Thunk) libraries +for AMD KFD + +%prep +%setup -T -D -c -n %{name} + +%install +mkdir -p $RPM_BUILD_ROOT +cp -R %{thunkroot}/build/rpm/libhsakmt/usr $RPM_BUILD_ROOT + +find $RPM_BUILD_ROOT \! -type d | sed "s|$RPM_BUILD_ROOT||"> fw.list + +%clean +rm -rf $RPM_BUILD_ROOT + +%files -f fw.list +%defattr(-,root,root,-) diff --git a/src/Makefile b/src/Makefile index 5c8c080593..c65c41aacf 100644 --- a/src/Makefile +++ b/src/Makefile @@ -49,13 +49,20 @@ lnx: LDFLAGS += -m32 lnx: $(BUILDDIR)/$(LIB_NAME) PACKAGE_DIR = $(BUILDDIR)/libhsakmt -INSTALL_DIR = $(PACKAGE_DIR)/usr/lib/x86_64-linux-gnu +INSTALL_DIR_DEB = $(PACKAGE_DIR)/usr/lib/x86_64-linux-gnu +INSTALL_DIR_RPM = $(PACKAGE_DIR)/usr/lib64 + deb: lnx64a - @mkdir -p $(INSTALL_DIR) - @cp $(BUILDDIR)/libhsakmt.so* $(INSTALL_DIR) + @mkdir -p $(INSTALL_DIR_DEB) + @cp $(BUILDDIR)/libhsakmt.so* $(INSTALL_DIR_DEB) @cp -r ../DEBIAN $(PACKAGE_DIR) @fakeroot dpkg-deb --build $(PACKAGE_DIR) $(BUILDDIR)/libhsakmt.deb +rpm: lnx64a + mkdir -p $(INSTALL_DIR_RPM) + @cp $(BUILDDIR)/libhsakmt.so* $(INSTALL_DIR_RPM) + @rpmbuild --define '_topdir $(BUILD_ROOT)/rpm' -ba $(THUNK_ROOT)/RPM/libhsakmt.spec + lnx64a: $(BUILDDIR)/$(LIB_NAME) clean: