blob: 503d804c1dcb52976ef160d9728ea8099cbaed98 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
# Maintainer: Darjan Krijan [https://disc-kuraudo.eu]
# Manual download of 'AMDuProf_Linux_x64_${pkgver}.tar.bz2' required from upstream
_pkgname=AMDuProf_Linux_x64
pkgname=amduprof
pkgver=5.0.1479
pkgrel=1
pkgdesc="AMD uProf performance analysis tool."
arch=('x86_64')
license=('custom')
url="https://developer.amd.com/amd-uprof/"
source=(
"local://AMDuProf_Linux_x64_${pkgver}.tar.bz2"
"modulefile"
)
options=('staticlibs' '!strip' 'libtool')
optdepends=('env-modules')
depends=(dkms)
install=amduprof.install
md5sums=(
"90cb6ea91e65df34c4cf3913c1b301a3"
"SKIP"
)
amduprof_prefix=/opt/${pkgname}
package() {
prefix=${pkgdir}/${amduprof_prefix}
mkdir -p ${prefix}
cp -dr ${srcdir}/AMDuProf_Linux_x64_${pkgver}/* ${prefix}
# symlinks
mkdir -p "${pkgdir}/usr/"{bin,share/man/man1}
ln -s "${amduprof_prefix}"/bin/{AMDRemoteAgent,AMDuProf,AMDuProfCLI} "${pkgdir}/usr/bin"
ln -s "${amduprof_prefix}"/bin/Help/man1/{AMDRemoteAgent.1.gz,AMDuProfCLI-collect.1.gz,AMDuProfCLI-info.1.gz,AMDuProfCLI-report.1.gz,AMDuProfCLI-timechart.1.gz} \
"${pkgdir}/usr/share/man/man1"
# kernel module
cd "${srcdir}/${_pkgname}_${pkgver}"
local _modname=AMDPowerProfiler
local _modver=$(cat bin/AMDPowerProfilerVersion)
tar zxf bin/AMDPowerProfilerDriverSource.tar.gz -C "${srcdir}"
cd "${srcdir}"/${_modname}-${_modver}
mkdir -p "${pkgdir}"/usr/src/${_modname}-${_modver}
cp -dr --no-preserve=ownership {inc/,src/,AMDPowerProfilerVersion,dkms.conf,Makefile} \
"${pkgdir}"/usr/src/${_modname}-${_modver}
echo $_modname | install -Dm 644 /dev/stdin "$pkgdir"/etc/modules-load.d/$pkgname.conf
# TODO: The following tmpfile won't work. Instead add a systemd service file running
# `/bin/mknod /dev/AMDPowerProfiler -m 666 c $(/bin/cat /proc/AMDPowerProfiler/device) 0` after the kernel module has been loaded.
#echo "c /dev/$_modname 666 root root - 234:0" |
# install -Dm 644 /dev/stdin "$pkgdir"/usr/lib/tmpfiles.d/$pkgname.conf
# env-modules (optional)
cp ${srcdir}/modulefile ${prefix}
mkdir -p ${pkgdir}/etc/modules/modulefiles/
ln -s ${amduprof_prefix}/modulefile ${pkgdir}/etc/modules/modulefiles/${pkgname}
}
|