summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 41668819a9bc449e00ef5292c5101d0a45e5f875 (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
86
87
88
89
90
91
92
93
94
95
96
97
# Maintainer: Cody P Schafer <aur [at] codyps [dot] com>
# Maintainer: Grey Christoforo <first name [at] last name [dot] net>
# Contributer: Stefan Seemayer <stefan@seemayer.de>
pkgbase=tsmclient
pkgname=(tsmclient-service tsmclient-dkms)
pkgver=8.1.6.0
pkgrel=1
pkgdesc="IBM Tivoli Storage Manager Client"
arch=('x86_64')
url="http://www-03.ibm.com/software/products/en/tivostormana/"
license=('proprietary')
depends=('gcc-libs' 'zlib')
makedepends=(libarchive patchelf)
checkdepends=()
optdepends=('jre8-openjdk: support for dsmj java gui')
provides=()
conflicts=()
install=
options=(!strip)

# For 7.1.6.2:
# 7
_ver_major="${pkgver%%.*}"
# 7.1.6
_ver_3="${pkgver%.*}"
# 716
_ver_3_nd="${_ver_3//.}"
# 7.1
_ver_2="${_ver_3%.*}"
# 1
_ver_minor="${_ver_2#*.}"
source=(
	ftp://public.dhe.ibm.com/storage/tivoli-storage-management/maintenance/client/v${_ver_major}r${_ver_minor}/Linux/LinuxX86/BA/v${_ver_3_nd}/${pkgver}-TIV-TSMBAC-LinuxX86.tar
	dkms.conf
)

sha1sums=('71fef8294324826f1be9afc512ab54025f3143e2'
          'ad89fff3d6096ba25d973e7e27ee3ce10e2fe57f')

prepare() {
	cd "$srcdir/"
	for rpmfile in *.rpm; do
		case "$rpmfile" in
			TIVsm-filepath-*) continue ;;
		esac
		echo "Extracting '$rpmfile'"
		bsdtar -xf $rpmfile
	done

	bsdtar -xf TIVsm-filepath-source.tar.gz
}

package_tsmclient-service() {
	cd "$srcdir/"

	#cp -r "$srcdir/etc" "$pkgdir/"
	cp -r "$srcdir/opt" "$pkgdir/"
	cp -r "$srcdir/usr" "$pkgdir/"
        mv "$pkgdir/usr/lib64" "$pkgdir/usr/lib"

	ln -s "/opt/tivoli/tsm/client/lang/EN_US" "$pkgdir/opt/tivoli/tsm/client/ba/bin/EN_US"

	for serv in "$srcdir"/opt/tivoli/tsm/client/ba/bin/*.service; do
		install -d "$pkgdir"/usr/lib/systemd/system
		install -m 644 "$serv" "$pkgdir"/usr/lib/systemd/system
	done

	# Permissions even for owner are locked down, fix what we need for now.
	chmod u+rw -R "$pkgdir"/opt/tivoli/tsm/client/ba

	# GSK stuff is in wierd places, tweak rpath to allow it
	# TODO: consider relocating these somewhere else
	for bin in "$pkgdir"/opt/tivoli/tsm/client/ba/bin/{dsmadmc,dsmagent,dsmc,dsmcad,dsmcert,dsmswitch,dsmtrace,tsmjbbd}; do
		if ! [ -x "$bin" ]; then
			>&2 echo "Error: could not find $bin"
			exit 1
		fi
		echo "Patch rpath of $bin"
		patchelf --set-rpath '/usr/local/ibm/gsk8_64/lib64:/opt/tivoli/tsm/client/api/bin64'  "$bin"
	done
}

package_tsmclient-dkms() {
	arch=('any')
	depends=('dkms')

	cd "$srcdir"/jbb_gpl

	install -d -m 0755 "${pkgdir}"/usr/src/${pkgbase}-${pkgver}
	install -D -m 0644 "${srcdir}"/dkms.conf "${pkgdir}"/usr/src/${pkgbase}-${pkgver}/dkms.conf
	install -m0644 Makefile *.c *.h "${pkgdir}"/usr/src/${pkgbase}-${pkgver}/

	sed \
		-e "s/@PKGBASE@/${pkgbase}/" \
		-e "s/@PKGVER@/${pkgver}/" \
		-i "${pkgdir}"/usr/src/${pkgbase}-${pkgver}/dkms.conf
}