tsmc.spec 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. ##
  2. ## tsmc.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.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 [EVAL]
  32. Group: Converter
  33. License: Commercial
  34. Version: 5.1.5.14
  35. Release: 20030226
  36. # list of sources
  37. Source0: ftp://service.boulder.ibm.com/storage/tivoli-storage-management/patches/client/v5r1/Linux/Linux86/v515/TIVsm-BA.i386.rpm
  38. Source1: ftp://service.boulder.ibm.com/storage/tivoli-storage-management/patches/client/v5r1/Solaris/v515/IP22545_14.tar.Z
  39. Source2: dsmexec
  40. Source3: dsm.sys
  41. Source4: dsm.opt
  42. Source5: rc.tsmc
  43. %NoSource 0
  44. %NoSource 1
  45. # build information
  46. Prefix: %{l_prefix}
  47. BuildRoot: %{l_buildroot}
  48. BuildPreReq: OpenPKG, openpkg >= 20030108
  49. PreReq: OpenPKG, openpkg >= 20030108
  50. AutoReq: no
  51. AutoReqProv: no
  52. %description
  53. This is a stripped down version of the client part of the Tivoli
  54. Storage Manager (TSM v5) software. It can be used to backup Solaris,
  55. Linux and FreeBSD machines to a TSM server.
  56. %prep
  57. %integrity
  58. %setup -q -T -c
  59. %build
  60. # unpack the corresponding binary only
  61. case "%{l_target}" in
  62. *-freebsd* | *-linux* )
  63. %{l_prefix}/bin/rpm2cpio %{SOURCE0} | cpio -idmu
  64. mv opt/tivoli/tsm/client root
  65. ;;
  66. *-solaris* )
  67. %{l_gzip} -d -c %{SOURCE1} | %{l_tar} xf -
  68. pkgtrans `pwd`/TIVsmCba.pkg `pwd` TIVsmCba
  69. mv TIVsmCba/reloc root
  70. ;;
  71. esac
  72. %install
  73. rm -rf $RPM_BUILD_ROOT
  74. # create filesystem hiearchy
  75. %{l_shtool} mkdir -f -p -m 755 \
  76. $RPM_BUILD_ROOT%{l_prefix}/bin \
  77. $RPM_BUILD_ROOT%{l_prefix}/etc/tsmc \
  78. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  79. $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc \
  80. $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/en_US \
  81. $RPM_BUILD_ROOT%{l_prefix}/var/tsmc
  82. # install execution wrapper
  83. %{l_shtool} install -c -m 755 \
  84. -e 's;@l_prefix@;%{l_prefix};g' \
  85. %{SOURCE dsmexec} $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/
  86. # install binaries
  87. for f in dsmadmc dsmagent dsmc dsmcad dsmtca ; do
  88. file="root/ba/bin/$f"
  89. if [ -f "root/admin/bin/$f" ]; then
  90. file="root/admin/bin/$f"
  91. fi
  92. %{l_shtool} install -c -m 755 \
  93. $file $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/
  94. case "%{l_target}" in
  95. *-freebsd* ) brandelf -t Linux $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/$f ;;
  96. esac
  97. ln $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/dsmexec \
  98. $RPM_BUILD_ROOT%{l_prefix}/bin/$f
  99. done
  100. # install required NLS stuff
  101. %{l_shtool} install -c -m 644 \
  102. root/ba/bin/en_US/* \
  103. $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/en_US
  104. rm -f $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/en_US/wchelp.htl >/dev/null 2>&1 || true
  105. # install default configuration
  106. case "%{l_target}" in
  107. *-freebsd* ) l_resutil="1" ;;
  108. * ) l_resutil="2" ;;
  109. esac
  110. %{l_shtool} install -c -m 755 \
  111. -e "s;@resutil@;${l_resutil};g" \
  112. -e 's;@l_prefix@;%{l_prefix};g' \
  113. %{SOURCE dsm.opt} %{SOURCE dsm.sys} \
  114. $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/
  115. mv $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/dsm.sys \
  116. $RPM_BUILD_ROOT%{l_prefix}/etc/tsmc/dsm.sys
  117. ln -s ../../etc/tsmc/dsm.sys \
  118. $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/
  119. mv $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/dsm.opt \
  120. $RPM_BUILD_ROOT%{l_prefix}/etc/tsmc/dsm.opt
  121. ln -s ../../etc/tsmc/dsm.opt \
  122. $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/
  123. # install run-command script
  124. %{l_shtool} install -c -m 755 \
  125. -e 's;@l_prefix@;%{l_prefix};g' \
  126. -e 's;@l_musr@;%{l_musr};g' \
  127. -e 's;@l_mgrp@;%{l_mgrp};g' \
  128. %{SOURCE rc.tsmc} \
  129. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  130. # determine installation files
  131. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  132. %{l_files_std} \
  133. '%config %{l_prefix}/etc/tsmc/*' \
  134. '%attr(4755,root,%{l_mgrp}) %{l_prefix}/libexec/tsmc/dsmtca'
  135. %files -f files
  136. %clean
  137. rm -rf $RPM_BUILD_ROOT
  138. %post
  139. if [ $1 -eq 1 ]; then
  140. case "%{l_target}" in
  141. *-freebsd*)
  142. if [ ! -f /compat/linux/bin/sh ]; then
  143. ( echo "The Linux ABI base system is not installed under /compat/linux/."
  144. echo "Please install the FreeBSD port/package linux_base-6.1."
  145. ) | %{l_rpmtool} msg -b
  146. fi
  147. if [ ! -f /compat/linux/etc/mtab ]; then
  148. ( echo "TSM insists on an /etc/mtab in the Linux ABI base system. Please"
  149. echo "create /compat/linux/etc/mtab with at least these lines:"
  150. awk </etc/fstab '
  151. /^\/.+ufs.+/ { printf("%s\t%s\text2\trw\t1\t1\n", $1, $2); }
  152. '
  153. ) | %{l_rpmtool} msg -b
  154. fi
  155. ( if [ -r /etc/defaults/rc.conf ]; then
  156. . /etc/defaults/rc.conf
  157. fi
  158. if [ -r /etc/rc.conf ]; then
  159. . /etc/rc.conf
  160. fi
  161. case ${linux_enable} in
  162. [Yy][Ee][Ss])
  163. ;;
  164. * )
  165. ( echo "TSM requires the Linux ABI in the kernel."
  166. echo "Run /usr/sbin/linux manually before running TSM"
  167. echo "or add the following line to /etc/rc.conf:"
  168. echo "linux_enable=\"YES\""
  169. ) | %{l_rpmtool} msg -b
  170. ;;
  171. esac
  172. )
  173. ;;
  174. *-linux*)
  175. ( echo "Please make sure you have the vendor libstdc++ 2.9 package installed:"
  176. echo "- RedHat Linux 7.x: compat-libstdc++-6.2-2.9.0.16"
  177. echo "- RedHat Linux 8.0: compat-libstdc++-7.3-2.96.110"
  178. echo "- Debian GNU/Linux 2.2: libstdc++2.9-glibc2.1"
  179. echo "- Debian GNU/Linux 3.0: libstdc++2.9-glibc2.1"
  180. echo "The resulting library file has to be named libstdc++-libc6.1-1.so.2"
  181. ) | %{l_rpmtool} msg -b
  182. ;;
  183. esac
  184. fi