Gentoo Archives: gentoo-commits

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