tsmc.spec 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. ##
  2. ## tsmc.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2004 Cable & Wireless <http://www.cw.com/>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # package information
  26. Name: tsmc
  27. Summary: Tivoli Storage Manager (TSM) Client
  28. URL: http://www.tivoli.com/support/storage_mgr/clients.html
  29. Vendor: Tivoli
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG
  32. Class: EVAL
  33. Group: System
  34. License: Commercial
  35. Version: 5.1.6.2
  36. Release: 20040429
  37. # list of sources
  38. Source0: ftp://service.boulder.ibm.com/storage/tivoli-storage-management/patches/client/v5r1/Linux/Linux86/v516/TIVsm-BA.i386.rpm
  39. Source1: ftp://service.boulder.ibm.com/storage/tivoli-storage-management/patches/client/v5r1/Solaris/v516/IP22658_FIX9.tar.Z
  40. Source2: dsmexec
  41. Source3: dsm.sys
  42. Source4: dsm.opt
  43. Source5: rc.tsmc
  44. %NoSource 0
  45. %NoSource 1
  46. # build information
  47. Prefix: %{l_prefix}
  48. BuildRoot: %{l_buildroot}
  49. BuildPreReq: OpenPKG, openpkg >= 20040217
  50. PreReq: OpenPKG, openpkg >= 20040217
  51. AutoReq: no
  52. AutoReqProv: no
  53. %description
  54. This is a stripped down version of the client part of the Tivoli
  55. Storage Manager (TSM v5) software. It can be used to backup Solaris,
  56. Linux and FreeBSD machines to a TSM server.
  57. %track
  58. prog tsmc:linux = {
  59. comment = "rse: 22654 was 5.1.6.2"
  60. version = 22654
  61. url = ftp://service.boulder.ibm.com/storage/tivoli-storage-management/patches/client/v5r1/Linux/Linux86/
  62. regex = (v5\d+)
  63. url = ftp://service.boulder.ibm.com/storage/tivoli-storage-management/patches/client/v5r1/Linux/Linux86/__NEWVER__/
  64. regex = IP([\d+_]+(_FIX\d+)?)\.README
  65. }
  66. prog tsmc:solaris = {
  67. comment = "rse: 22658 was 5.1.6.2"
  68. version = 22658_FIX9
  69. url = ftp://service.boulder.ibm.com/storage/tivoli-storage-management/patches/client/v5r1/Solaris
  70. regex = (v5\d+)
  71. url = ftp://service.boulder.ibm.com/storage/tivoli-storage-management/patches/client/v5r1/Solaris/__NEWVER__/
  72. regex = IP([\d+_]+(_FIX\d+)?)\.README
  73. }
  74. %prep
  75. %setup -q -T -c
  76. %build
  77. # unpack the corresponding binary only
  78. case "%{l_platform -t}" in
  79. *-freebsd* | *-linux* )
  80. %{l_rpm2cpio} %{SOURCE0} | cpio -idmu
  81. mv opt/tivoli/tsm/client root
  82. ;;
  83. *-sunos* )
  84. %{l_gzip} -d -c %{SOURCE1} | %{l_tar} xf -
  85. pkgtrans `pwd`/TIVsmCba.pkg `pwd` TIVsmCba
  86. mv TIVsmCba/reloc root
  87. ;;
  88. esac
  89. %install
  90. rm -rf $RPM_BUILD_ROOT
  91. # create filesystem hiearchy
  92. %{l_shtool} mkdir -f -p -m 755 \
  93. $RPM_BUILD_ROOT%{l_prefix}/bin \
  94. $RPM_BUILD_ROOT%{l_prefix}/etc/tsmc \
  95. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  96. $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc \
  97. $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/en_US \
  98. $RPM_BUILD_ROOT%{l_prefix}/var/tsmc
  99. # install execution wrapper
  100. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  101. %{SOURCE dsmexec} $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/
  102. # install binaries
  103. for f in dsmadmc dsmagent dsmc dsmcad dsmtca ; do
  104. file="root/ba/bin/$f"
  105. if [ -f "root/admin/bin/$f" ]; then
  106. file="root/admin/bin/$f"
  107. fi
  108. %{l_shtool} install -c -m 755 \
  109. $file $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/
  110. case "%{l_platform -t}" in
  111. *-freebsd* ) brandelf -t Linux $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/$f ;;
  112. esac
  113. ln $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/dsmexec \
  114. $RPM_BUILD_ROOT%{l_prefix}/bin/$f
  115. done
  116. # install required NLS stuff
  117. %{l_shtool} install -c -m 644 \
  118. root/ba/bin/en_US/* \
  119. $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/en_US
  120. rm -f $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/en_US/wchelp.htl >/dev/null 2>&1 || true
  121. # install default configuration
  122. case "%{l_platform -t}" in
  123. *-freebsd* ) l_resutil="1" ;;
  124. * ) l_resutil="2" ;;
  125. esac
  126. %{l_shtool} install -c -m 755 \
  127. -e "s;@resutil@;${l_resutil};g" %{l_value -s -a} \
  128. %{SOURCE dsm.opt} %{SOURCE dsm.sys} \
  129. $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/
  130. mv $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/dsm.sys \
  131. $RPM_BUILD_ROOT%{l_prefix}/etc/tsmc/dsm.sys
  132. ln -s ../../etc/tsmc/dsm.sys \
  133. $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/
  134. mv $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/dsm.opt \
  135. $RPM_BUILD_ROOT%{l_prefix}/etc/tsmc/dsm.opt
  136. ln -s ../../etc/tsmc/dsm.opt \
  137. $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/
  138. # install run-command script
  139. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  140. %{SOURCE rc.tsmc} \
  141. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  142. # determine installation files
  143. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  144. %{l_files_std} \
  145. '%config %{l_prefix}/etc/tsmc/*' \
  146. '%attr(4755,%{l_susr},%{l_mgrp}) %{l_prefix}/libexec/tsmc/dsmtca'
  147. %files -f files
  148. %clean
  149. rm -rf $RPM_BUILD_ROOT
  150. %post
  151. # after initial install, check requirements and make recommendations
  152. if [ $1 -eq 1 ]; then
  153. case "%{l_platform -t}" in
  154. *-freebsd*)
  155. if [ ! -f /compat/linux/bin/sh ]; then
  156. ( echo "The Linux ABI base system is not installed under /compat/linux/."
  157. echo "Please install the FreeBSD port/package linux_base-6.1."
  158. ) | %{l_rpmtool} msg -b
  159. fi
  160. if [ ! -f /compat/linux/etc/mtab ]; then
  161. ( echo "TSM insists on an /etc/mtab in the Linux ABI base system. Please"
  162. echo "create /compat/linux/etc/mtab with at least these lines:"
  163. awk </etc/fstab '
  164. /^\/.+ufs.+/ { printf("%s\t%s\text2\trw\t1\t1\n", $1, $2); }
  165. '
  166. ) | %{l_rpmtool} msg -b
  167. fi
  168. ( if [ -r /etc/defaults/rc.conf ]; then
  169. . /etc/defaults/rc.conf
  170. fi
  171. if [ -r /etc/rc.conf ]; then
  172. . /etc/rc.conf
  173. fi
  174. case ${linux_enable} in
  175. [Yy][Ee][Ss])
  176. ;;
  177. * )
  178. ( echo "TSM requires the Linux ABI in the kernel."
  179. echo "Run /usr/sbin/linux manually before running TSM"
  180. echo "or add the following line to /etc/rc.conf:"
  181. echo "linux_enable=\"YES\""
  182. ) | %{l_rpmtool} msg -b
  183. ;;
  184. esac
  185. ) || exit $?
  186. ;;
  187. *-linux*)
  188. ( echo "Please make sure you have the vendor libstdc++ 2.9 package installed:"
  189. echo "- RedHat Linux 7.x: compat-libstdc++-6.2-2.9.0.16"
  190. echo "- RedHat Linux 8.0: compat-libstdc++-7.3-2.96.110"
  191. echo "- RedHat RHEL 3: compat-libstdc++-7.3-2.96.122.i386.rpm"
  192. echo "- Debian GNU/Linux 2.2: libstdc++2.9-glibc2.1"
  193. echo "- Debian GNU/Linux 3.0: libstdc++2.9-glibc2.1"
  194. echo "The resulting library file has to be named libstdc++-libc6.1-1.so.2"
  195. ) | %{l_rpmtool} msg -b
  196. ;;
  197. esac
  198. fi
  199. # after upgrade, restart service
  200. if [ $1 -eq 2 ]; then
  201. eval `%{l_rc} tsmc status 2>/dev/null`
  202. [ ".$tsmc_active" = .yes ] && %{l_rc} tsmc restart
  203. fi
  204. exit 0
  205. %preun
  206. # before erase, stop service and remove log files
  207. if [ $1 -eq 0 ]; then
  208. %{l_rc} tsmc stop 2>/dev/null
  209. rm -f $RPM_INSTALL_PREFIX/var/tsmc/*.log* >/dev/null 2>&1 || true
  210. fi
  211. exit 0