blob: c098733a809e88067d79c8241644ffcba3417dde (
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
# Maintainer: Patrick Hechler <patrjprof-git@ph.anderemails.de>
pkgname=patrjprof-git
pkgver=1.1.0r43.465e06d
pkgrel=1
pkgdesc="An Open source Java profiler written in Java"
arch=('any')
url="https://git.rwth-aachen.de/patrick_laszlo.hechler/patr-java-profiler"
license=('AGPL')
groups=()
depends=('java-runtime-headless>=8')
makedepends=('git' 'maven' 'java-runtime-headless>=8')
optdepends=()
provides=("patrjprof=${pkgver}")
conflicts=('patrjprof')
replaces=()
backup=()
options=()
install=
changelog=
source=('git+https://git.rwth-aachen.de/patrick_laszlo.hechler/patr-java-profiler.git#branch=latest-snapshot')
noextract=()
md5sums=('SKIP')
pkgver() {
cd "patr-java-profiler"
printf "%sr%s.%s" "$(cat VERSION | sed -E 's/([^-]+)-SNAPSHOT/\1.snapshot/')" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}
build() {
cd "$srcdir"/patr-java-profiler
echo "build() called, pgkver=${pkgver}"
echo 'start package'
mvn package -Dmaven.test.skip=true
echo 'finished package'
}
check() {
cd "$srcdir"/patr-java-profiler
echo 'start test'
mvn test
echo 'finished test'
export WD="$srcdir"/patr-java-profiler
export VERSION=$(cat VERSION)
export BOOTSTRAP_NAME=
export AGENT_NAME=
export AGENT_FOLDER=
export BOOTSTRAP_FOLDER=
export AGENT_JAR=
export BOOTSTRAP_JAR=
echo 'start test2'
./patr-java-prof.sh -cp "patr-java-profiler-test/target/patr-java-profiler-test-$VERSION.jar" de.hechler.patrick.profiler.test.PHPTestMain
echo 'finished test2:'
cat ./patr-java-profiler-output.txt # at least ensure that the file exists, if not something went completly wrong
}
package() {
cd "$srcdir"/patr-java-profiler
VERSION="$(cat VERSION)"
# copy original files
mkdir -p "$pkgdir"/usr/share/java/patrjprof
cp -t "$pkgdir"/usr/share/java/patrjprof \
patr-java-profiler-agent/target/patr-java-profiler-agent-$VERSION-jar-with-dependencies.jar \
patr-java-profiler-bootstrap/target/patr-java-profiler-bootstrap-$VERSION.jar
# create symlink of agent/bootstrap without version/version-with-deps appendix
ln -sT patr-java-profiler-agent-$VERSION-jar-with-dependencies.jar "$pkgdir"/usr/lib/patrjprof/patr-java-profiler-agent-jar-with-dependencies.jar
ln -sT patr-java-profiler-agent-$VERSION-jar-with-dependencies.jar "$pkgdir"/usr/lib/patrjprof/patr-java-profiler-agent.jar
ln -sT patr-java-profiler-bootstrap-$VERSION.jar "$pkgdir"/usr/lib/patrjprof/patr-java-profiler-bootstrap.jar
# create script which starts the profiler
echo -n "#!/bin/sh
#set values needed for the script
AGENT_JAR=/usr/share/java/patrjprof/patr-java-profiler-agent-$VERSION-jar-with-dependencies.jar
BOOTSTRAP_JAR=/usr/share/java/patrjprof/patr-java-profiler-bootstrap-$VERSION.jar
#helper script from git
"'"$@"' > "$pkgdir"/usr/lib/patrjprof/patrjprof.sh
cat patr-java-prof-help.sh >> "$pkgdir"/usr/bin/patrjprof
chmod +x "$pkgdir"/usr/bin/patrjprof
}
|