Gentoo Archives: gentoo-commits

From: "Andreas K. Hüttel" <dilfridge@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-backup/tsm/
Date: Fri, 09 Oct 2020 18:20:48
Message-Id: 1602267597.30c25ab45be7ee8795c74db682ffcbe6027f5bd8.dilfridge@gentoo
1 commit: 30c25ab45be7ee8795c74db682ffcbe6027f5bd8
2 Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
3 AuthorDate: Fri Oct 9 18:19:57 2020 +0000
4 Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
5 CommitDate: Fri Oct 9 18:19:57 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=30c25ab4
7
8 app-backup/tsm: Drop ROOTPATH from env again
9
10 Package-Manager: Portage-3.0.4, Repoman-3.0.1
11 Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
12
13 app-backup/tsm/tsm-8.1.6.0-r1.ebuild | 240 +++++++++++++++++++++++++++++++++++
14 1 file changed, 240 insertions(+)
15
16 diff --git a/app-backup/tsm/tsm-8.1.6.0-r1.ebuild b/app-backup/tsm/tsm-8.1.6.0-r1.ebuild
17 new file mode 100644
18 index 00000000000..34225aedc4c
19 --- /dev/null
20 +++ b/app-backup/tsm/tsm-8.1.6.0-r1.ebuild
21 @@ -0,0 +1,240 @@
22 +# Copyright 1999-2020 Gentoo Authors
23 +# Distributed under the terms of the GNU General Public License v2
24 +
25 +EAPI=6
26 +
27 +inherit versionator multilib eutils readme.gentoo-r1 rpm systemd pax-utils
28 +
29 +DESCRIPTION="IBM Spectrum Protect (former Tivoli Storage Manager) Backup/Archive Client, API"
30 +HOMEPAGE="https://www.ibm.com/us-en/marketplace/data-protection-and-recovery"
31 +
32 +MY_PV_MAJOR=$(get_major_version)
33 +MY_PV_MINOR=$(get_version_component_range 2)
34 +MY_PV_TINY=$(get_version_component_range 3)
35 +MY_PV_PATCH=$(get_version_component_range 4)
36 +
37 +MY_PV_NODOTS="${MY_PV_MAJOR}${MY_PV_MINOR}${MY_PV_TINY}"
38 +MY_PVR_ALLDOTS=${PV}
39 +
40 +if [[ ${MY_PV_PATCH} == 0 ]]; then
41 + MY_RELEASE_PATH=maintenance
42 +else
43 + MY_RELEASE_PATH=patches
44 +fi
45 +BASE_URI="ftp://ftp.software.ibm.com/storage/tivoli-storage-management/"
46 +BASE_URI+="${MY_RELEASE_PATH}/client/v${MY_PV_MAJOR}r${MY_PV_MINOR}/"
47 +BASE_URI+="Linux/LinuxX86/BA/v${MY_PV_NODOTS}/"
48 +SRC_TAR="${MY_PVR_ALLDOTS}-TIV-TSMBAC-LinuxX86.tar"
49 +SRC_URI="${BASE_URI}${SRC_TAR}"
50 +
51 +RESTRICT="strip" # Breaks libPiIMG.so and libPiSNAP.so
52 +LICENSE="Apache-1.1 Apache-2.0 JDOM BSD-2 CC-PD Boost-1.0 MIT CPL-1.0 HPND Exolab
53 + dom4j EPL-1.0 FTL icu unicode IBM Info-ZIP LGPL-2 LGPL-2.1 openafs-krb5-a
54 + ZLIB MPL-1.0 MPL-1.1 NPL-1.1 openssl OPENLDAP RSA public-domain W3C
55 + || ( BSD GPL-2+ ) gSOAP libpng tsm"
56 +
57 +SLOT="0"
58 +KEYWORDS="-* ~amd64"
59 +IUSE="acl java +tsm-cit +tsm-hw"
60 +QA_PREBUILT="*"
61 +
62 +# not available (yet?)
63 +#MY_LANGS="cs:CS_CZ de:DE_DE es:ES_ES fr:FR_FR hu:HU_HU it:IT_IT ja:JA_JP
64 +# ko:KO_KR pl:PL_PL pt-BR:PT_BR ru:RU_RU zh-CN:ZH_CN zh-TW:ZH_TW"
65 +MY_LANG_PV="${MY_PVR_ALLDOTS}-"
66 +for lang in ${MY_LANGS}; do
67 + IUSE="${IUSE} l10n_${lang%:*}"
68 + SRC_URI="${SRC_URI} l10n_${lang%:*}? ( \
69 +${BASE_URI}TIVsm-msg.${lang#*:}.x86_64.rpm -> \
70 +${MY_LANG_PV}TIVsm-msg.${lang#*:}.x86_64.rpm )"
71 +done
72 +unset lang
73 +
74 +DEPEND="
75 + acct-group/tsm
76 +"
77 +RDEPEND="
78 + acct-group/tsm
79 + dev-libs/expat
80 + dev-libs/libxml2
81 + sys-fs/fuse:0
82 + acl? ( sys-apps/acl )
83 + java? ( >=virtual/jre-1.7 )
84 +"
85 +
86 +S="${WORKDIR}/bacli"
87 +
88 +pkg_setup() {
89 + DOC_CONTENTS="
90 + Note that you have to be root to be able to use the Tivoli Storage Manager
91 + client. The dsmtca trusted agent binary does not exist anymore.
92 +
93 + For information on how to give other users access, please see the following
94 + URLs:
95 + https://www.ibm.com/support/knowledgecenter/SSGSG7_7.1.8/client/c_cfg_nonadmin.html#c_macuninst_nonadmin
96 + https://www.ibm.com/support/knowledgecenter/SSGSG7_7.1.8/client/c_secure_pwd.html#c_secure_pwd__sec_no_tca
97 + "
98 +}
99 +
100 +src_unpack() {
101 + local rpm rpms lang
102 + mkdir bacli || die
103 + cd bacli || die
104 + unpack ${SRC_TAR}
105 +
106 + cd "${S}"
107 + for rpm in *.rpm; do
108 + case ${rpm} in
109 + TIVsm-APIcit.*|TIVsm-BAcit.*)
110 + use tsm-cit && rpms="${rpms} ./${rpm}"
111 + ;;
112 + TIVsm-BAhdw.*)
113 + use tsm-hw && rpms="${rpms} ./${rpm}"
114 + ;;
115 + TIVsm-JBB.*|*-filepath-*)
116 + # "journal based backup" for all filesystems
117 + # requires a kernel module.
118 + # "Linux Filepath source code" available
119 + # by request from vendor
120 + ;;
121 + *)
122 + rpms="${rpms} ./${rpm}"
123 + ;;
124 + esac
125 + done
126 + for rpm in ${A}; do
127 + case ${rpm} in
128 + *.rpm)
129 + rpms="${rpms} ${rpm}"
130 + ;;
131 + esac
132 + done
133 +
134 + rpm_unpack ${rpms}
135 +
136 + # Avoid strange error messages caused by read-only files
137 + chmod -R u+w "${S}" || die
138 +}
139 +
140 +src_install() {
141 + cp -a opt "${D}" || die
142 + cp -a usr "${D}" || die
143 +
144 + # The RPM files contain postinstall scripts which can be extracted
145 + # e.g. using https://bugs.gentoo.org/attachment.cgi?id=234663 .
146 + # Below we try to mimic the behaviour of these scripts.
147 + # We don't deal with SELinux compliance (yet), though.
148 + local RPM_INSTALL_PREFIX CLIENTDIR i
149 + RPM_INSTALL_PREFIX=/opt
150 + CLIENTDIR=$RPM_INSTALL_PREFIX/tivoli/tsm/client
151 +
152 + # Create links for messages; this is spread over several postin scripts.
153 + #for i in $(cd "${D}"${CLIENTDIR}/lang; ls -1d ??_??); do
154 + # dosym ../../lang/${i} $CLIENTDIR/ba/bin/${i}
155 + # dosym ../../lang/${i} $CLIENTDIR/api/bin64/${i}
156 + #done
157 +
158 + # Mimic TIVsm-API64 postinstall script
159 + for i in libgpfs.so libdmapi.so; do
160 + dosym ../..$CLIENTDIR/api/bin64/${i} /usr/lib64/${i}
161 + done
162 +
163 + # The TIVsm-BA postinstall script only does messages and ancient upgrades
164 +
165 + # The gscrypt64 postinstall script only deals with s390[x] SELinux
166 + # and the symlink for the iccs library which we handle in the loop below.
167 +
168 + # Move stuff from /usr/local to /opt, #452332
169 + mv "${D}"/usr/local/ibm "${D}"/opt/ || die
170 + rmdir "${D}"/usr/local || die
171 +
172 + # Mimic gskssl64 postinstall script
173 + for i in sys p11 km ssl drld kicc ldap cms acmeidup valn dbfl iccs; do
174 + dosym ../../opt/ibm/gsk8_64/lib64/libgsk8${i}_64.so \
175 + /usr/lib64/libgsk8${i}_64.so
176 + done
177 + for i in capicmd ver; do
178 + dosym ../../opt/ibm/gsk8_64/bin/gsk8${i}_64 /usr/bin/gsk${i}_64
179 + done
180 +
181 + # Done with the postinstall scripts as the RPMs contain them.
182 + # Now on to some more Gentoo-specific installation.
183 +
184 + [[ -d "${D}usr/lib" ]] && die "Using 32bit lib dir in 64bit only system"
185 +
186 + # Avoid "QA Notice: Found an absolute symlink in a library directory"
187 + local target
188 + find "${D}"usr/lib* -lname '/*' | while read i; do
189 + target=$(readlink "${i}")
190 + rm -v "${i}" || die
191 + dosym "../..${target}" "${i#${D}}"
192 + done
193 +
194 + keepdir /var/log/tsm
195 + insinto /etc/logrotate.d
196 + newins "${FILESDIR}/tsm.logrotate" tsm
197 +
198 + keepdir /etc/tivoli
199 +
200 + cp -a "${S}/opt/tivoli/tsm/client/ba/bin/dsm.sys.smp" "${D}/etc/tivoli/dsm.sys" || die
201 + echo ' PasswordDir "/etc/tivoli/"' >> ${D}/etc/tivoli/dsm.sys
202 + echo ' PasswordAccess generate' >> ${D}/etc/tivoli/dsm.sys
203 +
204 + # Added the hostname to be more friendly, the admin will need to edit this file anyway
205 + echo ' NodeName' `hostname` >> ${D}/etc/tivoli/dsm.sys
206 + echo ' ErrorLogName "/var/log/tsm/dsmerror.log"' >> ${D}/etc/tivoli/dsm.sys
207 + echo ' SchedLogName "/var/log/tsm/dsmsched.log"' >> ${D}/etc/tivoli/dsm.sys
208 + dosym ../../../../../../etc/tivoli/dsm.sys /opt/tivoli/tsm/client/ba/bin/dsm.sys
209 +
210 + cp -a "${S}/opt/tivoli/tsm/client/ba/bin/dsm.opt.smp" "${D}/etc/tivoli/dsm.opt"
211 + dosym ../../../../../../etc/tivoli/dsm.opt /opt/tivoli/tsm/client/ba/bin/dsm.opt
212 +
213 + # Setup the env
214 + dodir /etc/env.d
215 + ENV_FILE="${D}/etc/env.d/80tivoli"
216 + echo 'DSM_CONFIG="/etc/tivoli/dsm.opt"' >> ${ENV_FILE}
217 + echo 'DSM_DIR="/opt/tivoli/tsm/client/ba/bin"' >> ${ENV_FILE}
218 + echo 'DSM_LOG="/var/log/tsm"' >> ${ENV_FILE}
219 + # echo 'ROOTPATH="/opt/tivoli/tsm/client/ba/bin"' >> ${ENV_FILE}
220 +
221 + echo 'SEARCH_DIRS_MASK="/opt/tivoli/tsm/client/ba/bin"' > "${T}/80${PN}" || die
222 + insinto "/etc/revdep-rebuild"
223 + doins "${T}/80${PN}"
224 +
225 + newconfd "${FILESDIR}/dsmc.conf.d" dsmc
226 + newinitd "${FILESDIR}/dsmc.init.d" dsmc
227 + newinitd "${FILESDIR}/dsmcad.init.d-r1" dsmcad
228 +
229 + # Need this for hardened, otherwise a cryptic "connection to server lost" message appears
230 + pax-mark -m "${D}/opt/tivoli/tsm/client/ba/bin/dsmc"
231 +
232 + systemd_dounit "${FILESDIR}/dsmc.service"
233 + systemd_dounit "${FILESDIR}/dsmcad.service"
234 +
235 + readme.gentoo_create_doc
236 +}
237 +
238 +pkg_postinst() {
239 + local i dirs
240 + for i in /var/log/tsm/dsm{error,sched,j,webcl}.log; do
241 + if [[ ! -e $i ]]; then
242 + touch $i || die
243 + chown :tsm $i || die
244 + chmod 0660 $i || die
245 + fi
246 + done
247 +
248 + # Bug #375041: the log directory itself should not be world writable.
249 + # Have to do this in postinst due to bug #141619
250 + chown root:tsm /var/log/tsm || die
251 + chmod 0750 /var/log/tsm || die
252 +
253 + # Bug 508052: directories used to be too restrictive, have to widen perms.
254 + dirs=( /opt/tivoli $(find /opt/tivoli/tsm -type d) )
255 + chown root:root "${dirs[@]}" || die
256 + chmod 0755 "${dirs[@]}" || die
257 +
258 + FORCE_PRINT_ELOG=1
259 + DISABLE_AUTOFORMATTING=1
260 + readme.gentoo_print_elog
261 +}