tsmc.spec 7.5 KB

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