app-backup/tsm: add 8.1.27.0

- added support for journal based backups
- bumped java compatibility, made it an optfeature
- use EROOT in postinst
- drop flags that are not really doing anything
- add preliminary compat for ppc and s390 (need testing)
- change unpacking logic
- preliminary support for GPFS (also needs testing)
- added self as maintainer

Signed-off-by: Nowa Ammerlaan <nowa@gentoo.org>
This commit is contained in:
Nowa Ammerlaan
2025-09-11 14:24:29 +02:00
parent ff35d313cd
commit ae444b1483
3 changed files with 334 additions and 0 deletions

View File

@@ -1 +1,7 @@
DIST 8.1.22.0-TIV-TSMBAC-LinuxX86.tar 745175040 BLAKE2B 510ab45065f21e533bc776b886c6804021caa119d43b7693da4902f3d469d12deee71adc0cdd97d84c3cdaacb1b7ca878c6f6ee228f500651fbadd177def8f6f SHA512 b6c9ab9d9d33a060a6a69f5ecb62ba69df2d31506007e958313c7b62054e49735e8864fbe9f51876bf4398ef8f12c8fe27f3e0fec91def2c2ab016e3413f9e8b
DIST 8.1.27.0-TIV-TSMBAC-LinuxPLE.tar 532336640 BLAKE2B 5579ed427e65323dcddb142f1860264b647e856f72dcc30721b0113cc037574215b0d09afdce6adca258de2f500822dc628c59c9377ff307da0f3bbaa1ef542c SHA512 571515b0b43a58244a42d8ab042f077685f1a72adaf7f56098a8546570a85be51d1fb022f6332c3de594ace0ff8e3a2f4ed0e7db1ec3ac1597e700defad3de9a
DIST 8.1.27.0-TIV-TSMBAC-LinuxPPC.tar 69140480 BLAKE2B 34cdca4adc363c1a84344d46dbb4c364a2112af7c0238bcd4e002f4c07b4efe12b04cb230cfebdf6efcdb9b5d3999f27414dfba3918619c809a29dea4c173137 SHA512 fed8be527e07a1e27d95a6858eaeaeb8df56c7772e82e4c1d4aa2131d64a53085713a312cdc930f94d4bb2645ae06c66ad3e1760ae107ded21619a1ee700118b
DIST 8.1.27.0-TIV-TSMBAC-LinuxS390.tar 526489600 BLAKE2B 337cf71ac2396b5cbe0292120a74431106e938769f705949e872b7a3eb1110f808ddfe9876ce4a39d89451a8162ae5adf89a045c588a7b4db0c27a0381fa4000 SHA512 1a7bd656ab50f94ca943cdd43e6d9145764e7564a4c62c564f2555b19e69165450a53b73c0ac4aad09f1f84f7e4a25c6b1843a54c646b34f414f4588b0573181
DIST 8.1.27.0-TIV-TSMBAC-LinuxX86.tar 673986560 BLAKE2B aed423c901d2c8ee48f7d874e5bce0df13bd5781044bcecf376eb458d108ad540fe1a3c7eabd5a636a5a5fce88c24847ec7f2e6e03a4e6d857009083d11912f2 SHA512 9db407a03edf529e2a05381127a9c75c5e0fb194538a7ec518f8b7e348ca73bdceffd0c235bd49406fe063e076c733ccda0e9a82a5aefcc5f927e5add2738490
DIST 8.1.27.0-TIV-TSMHSM-LinuxPLEGPFS.tar 569630720 BLAKE2B da91ddc81109e2e9c7789e4fa4a7edb5f345dc126c9f209b60f00233c81c6a1f6f59a75f46a479111e2ccaf8786782c658eed55c991e97605611a42b9a53604f SHA512 9c628e0669d72c0f759d2d97f03d4fb5a69e9a6b5c9b13426bdc907cfabb86cc83c874a462ee93922ebe5649931b838b38cc1dc3a8521f245ac16bec5f5945c8
DIST 8.1.27.0-TIV-TSMHSM-LinuxX86GPFS.tar 755793920 BLAKE2B c84b8a90b2483d640a40e7b3e86c0164701e1de9e20a8677c8e393816ce108dac69343fac24b4a6b511f3c6ce5fbb61cdb181ed52b9968ea7511a1520cec8085 SHA512 865cde193a0d4a8923908577235d6aa3df6fa458a99da6589a10cda6b0933d5b8e4ba2171489932bdcef9de02e862b6545bd406b227143e36e3b7c91da576605

View File

@@ -1,10 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<name>Nowa Ammerlaan</name>
<email>nowa@gentoo.org</email>
</maintainer>
<maintainer type="person">
<email>dilfridge@gentoo.org</email>
</maintainer>
<upstream>
<doc>https://www.ibm.com/docs/en/storage-protect</doc>
</upstream>
<use>
<flag name="journal">Support Journal based backups (JBB)</flag>
<flag name="gpfs">Support the IBM General Parallel File System (GPFS)</flag>
<flag name="tsm-cit">IBM Tivoli Common Inventory Technology</flag>
<flag name="tsm-hw">Difference snapshot support for NetApp and N-Series file servers</flag>
<flag name="vmware">Install vmware data protection support</flag>

View File

@@ -0,0 +1,319 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
MODULES_OPTIONAL_IUSE=journal
MODULES_KERNEL_MAX=6.1
inherit desktop linux-mod-r1 optfeature rpm toolchain-funcs pax-utils xdg
DESCRIPTION="IBM Storage Protect (former Tivoli Storage Manager) Backup/Archive Client, API"
HOMEPAGE="https://www.ibm.com/products/storage-protect"
BASE_URI="https://public.dhe.ibm.com/storage/tivoli-storage-management/"
if [[ $(ver_cut 4) == 0 ]]; then
BASE_URI+="maintenance/client/v$(ver_cut 1)r$(ver_cut 2)/Linux/"
else
BASE_URI+="patches/client/v$(ver_cut 1)r$(ver_cut 2)/Linux/"
fi
SRC_URI="
amd64? (
!gpfs? ( ${BASE_URI}LinuxX86/BA/v$(ver_rs 1-3 '' $(ver_cut 1-3))/${PV}-TIV-TSMBAC-LinuxX86.tar )
gpfs? ( ${BASE_URI}LinuxX86/HSMGPFS/v$(ver_rs 1-3 '' $(ver_cut 1-3))/${PV}-TIV-TSMHSM-LinuxX86GPFS.tar )
)
ppc64? (
!gpfs? (
${BASE_URI}LinuxPPC/v$(ver_rs 1-3 '' $(ver_cut 1-3))/${PV}-TIV-TSMBAC-LinuxPPC.tar
${BASE_URI}LinuxPLE/BA/v$(ver_rs 1-3 '' $(ver_cut 1-3))/${PV}-TIV-TSMBAC-LinuxPLE.tar
)
gpfs? ( ${BASE_URI}LinuxPLE/HSMGPFS/v$(ver_rs 1-3 '' $(ver_cut 1-3))/${PV}-TIV-TSMHSM-LinuxPLEGPFS.tar )
)
s390? ( ${BASE_URI}LinuxzSeries/BA/v$(ver_rs 1-3 '' $(ver_cut 1-3))/${PV}-TIV-TSMBAC-LinuxS390.tar )
"
S="${WORKDIR}"
LICENSE="
Apache-1.1 Apache-2.0 JDOM BSD-2 CC-PD Boost-1.0 MIT CPL-1.0 HPND
Exolab dom4j EPL-1.0 FTL icu unicode IBM Info-ZIP LGPL-2 LGPL-2.1
openafs-krb5-a ZLIB MPL-1.0 MPL-1.1 NPL-1.1 openssl OPENLDAP RSA
public-domain W3C gSOAP libpng tsm || ( BSD GPL-2+ )
"
SLOT="0"
KEYWORDS="~amd64" # ppc64 s390 -*
IUSE="gpfs"
# GPFS is not supported for journal-based backups on Linux
REQUIRED_USE="journal? ( !gpfs )"
RESTRICT="strip bindist mirror" # Breaks libPiIMG.so and libPiSNAP.so
QA_PREBUILT="/opt/*"
PLOCALE_BACKUP="en_US"
PLOCALES="
cs_CZ de_DE en_US es_ES fr_FR hu_HU it_IT ja_JP ko_KR pl_PL pt_BR
ru_RU zh_CN zh_TW
"
MY_LANGS="
cs:CS_CZ de:DE_DE es:ES_ES fr:FR_FR hu:HU_HU it:IT_IT ja:JA_JP
ko:KO_KR pl:PL_PL pt-BR:PT_BR ru:RU_RU zh-CN:ZH_CN zh-TW:ZH_TW
"
for lang in ${MY_LANGS}; do
IUSE+=" l10n_${lang%:*}"
done
BDEPEND="
app-arch/xz-utils[extra-filters(+)]
media-gfx/imagemagick[png]
"
DEPEND="
acct-group/tsm
"
RDEPEND="
acct-group/tsm
dev-libs/expat
dev-libs/openssl:0/3
dev-libs/libxml2:2
media-libs/alsa-lib
sys-apps/acl
sys-fs/fuse:0
sys-libs/zlib:0/1
x11-libs/libXft
|| (
sys-libs/libxcrypt:0/1[compat]
sys-libs/glibc:2.2[crypt(-)]
)
gpfs? ( || (
app-shells/ksh
app-shells/loksh
) )
"
src_unpack() {
if use amd64; then
if use gpfs; then
unpack "${PV}-TIV-TSMHSM-LinuxX86GPFS.tar"
else
unpack "${PV}-TIV-TSMBAC-LinuxX86.tar"
fi
elif use ppc64; then
if [[ $(tc-endian) == big ]]; then
if use gpfs; then
die "GPFS not supported on big endian"
else
unpack "${PV}-TIV-TSMBAC-LinuxPPC.tar"
fi
else
if use gpfs; then
unpack "${PV}-TIV-TSMHSM-LinuxPLEGPFS.tar"
else
unpack "${PV}-TIV-TSMBAC-LinuxPLE.tar"
fi
fi
elif use s390; then
if use gpfs; then
die "GPFS not supported on s390"
else
unpack "${PV}-TIV-TSMBAC-LinuxS390.tar"
fi
else
die "Unsupported architecture"
fi
mkdir rpms_unpacked || die
pushd rpms_unpacked >/dev/null || die
rpmunpack "${S}/"*.rpm
popd >/dev/null || die
use journal && unpack "${S}/TIVsm-filepath-source.tar.gz"
}
src_prepare() {
default
local lang
for lang in ${MY_LANGS}; do
if ! use l10n_${lang%:*}; then
find -type d -name "${lang#*:}" -exec rm -r {} + || die
fi
done
}
src_compile() {
local modlist=( filepath=:jbb_gpl )
local modargs=(
KDIR="${KV_OUT_DIR}" RELNUM=${PV}
# The usage of arch is non-standard here
$(usev amd64 ARCH=x86_64)
$(usev ppc64 ARCH=ppc64)
)
linux-mod-r1_src_compile
}
src_install() {
local i
for i in rpms_unpacked/*; do
rsync -a "${i}/"* "${ED}" || die
done
# Don't bundle java
rm -r "${ED}/opt/tivoli/tsm/tdpvmware/common/jre" || die
# The RPM files contain postinstall scripts which can be extracted
# e.g. using https://bugs.gentoo.org/attachment.cgi?id=234663 .
# Below we try to mimic the behaviour of these scripts.
# We don't deal with SELinux compliance (yet), though.
# Mimic TIVsm-API64 postinstall script
for i in "${ED}/opt/tivoli/tsm/client/api/bin64/"*.so; do
dosym "../../opt/tivoli/tsm/client/api/bin64/$(basename "${i}")" \
"/usr/$(get_libdir)/$(basename "${i}")"
done
# The TIVsm-BA postinstall script only does messages and ancient upgrades
# The gscrypt64 postinstall script only deals with s390[x] SELinux
# and the symlink for the iccs library which we handle in the loop below.
# Move stuff from /usr/local to /opt, #452332
mv "${ED}/usr/local/ibm" "${ED}/opt/" || die
rmdir "${ED}/usr/local" || die
# Mimic gskssl64 postinstall script
for i in "${ED}/opt/ibm/gsk8_64/lib64/"*.so; do
dosym "../../opt/ibm/gsk8_64/lib64/$(basename "${i}")" \
"/usr/$(get_libdir)/$(basename "${i}")"
done
for i in "${ED}/opt/ibm/gsk8_64/bin/"*; do
dosym "../../opt/ibm/gsk8_64/bin/$(basename "${i}")" \
"/usr/bin/$(basename "${i//8/}")"
done
# Done with the postinstall scripts as the RPMs contain them.
# Now on to some more Gentoo-specific installation.
rm -rf "${ED}/usr/lib/.build-id" &> /dev/null
[[ -d "${ED}/usr/lib" ]] && rmdir "${ED}/usr/lib" || die "Using 32bit lib dir in 64bit only system"
# Avoid "QA Notice: Found an absolute symlink in a library directory"
local target
find "${ED}"/usr/lib* -lname '/*' | while read i; do
target=$(readlink "${i}")
rm -v "${i}" || die
dosym "../..${target}" "${i#${ED}/}"
done
keepdir /var/log/tsm
insinto /etc/logrotate.d
newins "${FILESDIR}/tsm.logrotate" tsm
keepdir /etc/tivoli
cp -a "${ED}/opt/tivoli/tsm/client/ba/bin/dsm.sys.smp" "${ED}/etc/tivoli/dsm.sys" || die
echo ' PasswordDir "/etc/tivoli/"' >> "${ED}/etc/tivoli/dsm.sys"
echo ' PasswordAccess generate' >> "${ED}/etc/tivoli/dsm.sys"
# Added the hostname to be more friendly, the admin will need to edit this file anyway
echo ' NodeName' $(hostname) >> "${ED}/etc/tivoli/dsm.sys"
echo ' ErrorLogName "/var/log/tsm/dsmerror.log"' >> "${ED}/etc/tivoli/dsm.sys"
echo ' SchedLogName "/var/log/tsm/dsmsched.log"' >> "${ED}/etc/tivoli/dsm.sys"
dosym ../../../../../../etc/tivoli/dsm.sys /opt/tivoli/tsm/client/ba/bin/dsm.sys
cp -a "${ED}/opt/tivoli/tsm/client/ba/bin/dsm.opt.smp" "${ED}/etc/tivoli/dsm.opt" || die
dosym ../../../../../../etc/tivoli/dsm.opt /opt/tivoli/tsm/client/ba/bin/dsm.opt
if use journal; then
touch "${ED}/etc/tivoli/tsmjbbd.ini" || die
dosym ../../../../../../etc/tivoli/tsmjbbd.ini /opt/tivoli/tsm/client/ba/bin/tsmjbbd.ini
fi
chown -R root:tsm "${ED}/etc/tivoli" || die
chmod -R 0660 "${ED}/etc/tivoli/"* || die
# Setup the env
newenvd - 80tivoli <<-EOF
DSM_CONFIG="/etc/tivoli/dsm.opt"
DSM_DIR="/opt/tivoli/tsm/client/ba/bin"
DSM_LOG="/var/log/tsm"
# ROOTPATH="/opt/tivoli/tsm/client/ba/bin"
EOF
insinto /etc/revdep-rebuild
newins - 80${PN} <<-EOF
SEARCH_DIRS_MASK="/opt/tivoli/tsm/client/ba/bin"
EOF
# https://www.ibm.com/support/pages/apar/IT46420
insinto /opt/tivoli/tsm/client/ba/bin
newins - dsmcad.lang <<-EOF
LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8
EOF
# Need this for hardened, otherwise a cryptic "connection to server lost" message appears
pax-mark -m "${ED}/opt/tivoli/tsm/client/ba/bin/dsmc"
magick "${ED}/opt/tivoli/tsm/client/ba/bin/favicon.ico" "${T}/ibm.png" || die
doicon -s 16 "${T}/ibm.png"
make_desktop_entry dsmj "IBM Storage Protect" ibm System
# Ensure the services can start on Gentoo, respect our java setting
sed -e 's/Ubuntu/Gentoo/g' \
-i "${ED}/opt/tivoli/tsm/client/ba/bin/rc."* || die
sed -e 's/DSM_LOG=\/opt\/tivoli\/tsm\/client\/ba\/bin/DSM_LOG=\/var\/log\/tsm/g' \
-e '/JAVA_HOME=/d' \
-e '/PATH=/d' \
-e '/LD_LIBRARY_PATH=/d' \
-i "${ED}/opt/tivoli/tsm/client/ba/bin/"*.service || die
sed -e '/JAVA_HOME=/d' \
-i "${ED}/opt/tivoli/tsm/tdpvmware/common/scripts/webserver" || die
# Overwrite with relative symlinks
dosym ../../opt/tivoli/tsm/client/ba/bin/rc.dsmcad /etc/init.d/dsmcad
dosym ../../opt/tivoli/tsm/tdpvmware/common/scripts/webserver /etc/init.d/webserver
if use journal; then
dosym ../../opt/tivoli/tsm/client/ba/bin/rc.tsmjbb /etc/init.d/tsmjbbd
else
rm -f "${ED}/etc/init.d/tsmjbbd" || die
fi
dosym ../../../../opt/tivoli/tsm/client/ba/bin/dsmcad.service /usr/lib/systemd/system/dsmcad.service
if use journal; then
dosym ../../../../opt/tivoli/tsm/client/ba/bin/tsmjbbd.service /usr/lib/systemd/system/tsmjbbd.service
else
rm -f "${ED}/usr/lib/systemd/system/tsmjbbd.service" || die
fi
linux-mod-r1_src_install
}
pkg_postinst() {
xdg_pkg_postinst
local i dirs
for i in "${EROOT}/var/log/tsm/dsm"{error,instr,j,sched,webcl}.log; do
if [[ ! -e ${i} ]]; then
touch ${i} || die
chown root:tsm ${i} || die
chmod 0660 ${i} || die
fi
done
# Bug #375041: the log directory itself should not be world writable.
# Have to do this in postinst due to bug #141619
chown root:tsm "${EROOT}/var/log/tsm" || die
chmod 0750 "${EROOT}/var/log/tsm" || die
# Bug 508052: directories used to be too restrictive, have to widen perms.
dirs=( "${EROOT}/opt/tivoli" $(find "${EROOT}/opt/tivoli/tsm" -type d) )
chown root:root "${dirs[@]}" || die
chmod 0755 "${dirs[@]}" || die
linux-mod-r1_pkg_postinst
optfeature "using the Java GUI client" virtual/jre
elog
elog "To use the client as a regular user, add the user to the \"tsm\" group"
}