tsmc.spec 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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.2.1
  35. Release: 20020531
  36. # list of sources
  37. Source0: ftp://service.boulder.ibm.com/storage/tivoli-storage-management/maintenance/client/v4r2/Linux86/v4221/IP22508_1.tar
  38. Source1: ftp://service.boulder.ibm.com/storage/tivoli-storage-management/maintenance/client/v4r2/Solaris/v4221/IP22502_1.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 IP22508_1.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 IP22502_1.tar.Z} |\
  66. %{l_prefix}/bin/tar xf -
  67. pkgtrans `pwd`/TIVsmCba.pkg `pwd` TIVsmCba
  68. mv TIVsmCba/reloc root
  69. ;;
  70. esac
  71. %install
  72. rm -rf $RPM_BUILD_ROOT
  73. # create filesystem hiearchy
  74. %{l_shtool} mkdir -f -p -m 755 \
  75. $RPM_BUILD_ROOT%{l_prefix}/bin \
  76. $RPM_BUILD_ROOT%{l_prefix}/etc/tsmc \
  77. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  78. $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc \
  79. $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/lib \
  80. $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/en_US \
  81. $RPM_BUILD_ROOT%{l_prefix}/var/tsmc
  82. # install execution wrapper
  83. l_binsh="/bin/sh"
  84. case "%{l_target}" in
  85. *-freebsd* ) l_binsh="/compat/linux/bin/sh" ;;
  86. esac
  87. %{l_shtool} install -c -m 755 \
  88. -e "s;@l_binsh@;${l_binsh};g" \
  89. -e 's;@l_prefix@;%{l_prefix};g' \
  90. %{SOURCE dsmexec} $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/
  91. # install binaries
  92. for f in dsmagent dsmc dsmcad dsmstat dsmtca dsmadmc; do
  93. file="root/ba/bin/$f"
  94. if [ -f "root/admin/bin/$f" ]; then
  95. file="root/admin/bin/$f"
  96. fi
  97. %{l_shtool} install -c -m 755 \
  98. $file $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/
  99. case "%{l_target}" in
  100. *-freebsd* ) brandelf -t Linux $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/$f ;;
  101. esac
  102. ln $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/dsmexec \
  103. $RPM_BUILD_ROOT%{l_prefix}/bin/$f
  104. done
  105. # install required NLS stuff
  106. %{l_shtool} install -c -m 644 \
  107. root/ba/bin/en_US/* \
  108. $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/en_US
  109. rm -f $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/en_US/DDsmResources.java >/dev/null 2>&1 || true
  110. rm -f $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/en_US/wchelp.htl >/dev/null 2>&1 || true
  111. rm -f $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/en_US/*.tif >/dev/null 2>&1 || true
  112. # install default configuration
  113. %{l_shtool} install -c -m 755 \
  114. -e 's;@l_prefix@;%{l_prefix};g' \
  115. %{SOURCE dsm.opt} %{SOURCE dsm.sys} \
  116. $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/
  117. mv $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/dsm.sys \
  118. $RPM_BUILD_ROOT%{l_prefix}/etc/tsmc/dsm.sys
  119. ln -s ../../etc/tsmc/dsm.sys \
  120. $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/
  121. mv $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/dsm.opt \
  122. $RPM_BUILD_ROOT%{l_prefix}/etc/tsmc/dsm.opt
  123. ln -s ../../etc/tsmc/dsm.opt \
  124. $RPM_BUILD_ROOT%{l_prefix}/libexec/tsmc/
  125. # install run-command script
  126. %{l_shtool} install -c -m 755 \
  127. -e 's;@l_prefix@;%{l_prefix};g' \
  128. -e 's;@l_musr@;%{l_musr};g' \
  129. -e 's;@l_mgrp@;%{l_mgrp};g' \
  130. %{SOURCE rc.tsmc} \
  131. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  132. # determine installation files
  133. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  134. %{l_files_std} \
  135. '%config %{l_prefix}/etc/tsmc/*' \
  136. '%attr(4755,root,%{l_mgrp}) %{l_prefix}/bin/dsmtca'
  137. %files -f files
  138. %clean
  139. rm -rf $RPM_BUILD_ROOT
  140. %post
  141. if [ $1 -eq 1 ]; then
  142. case "%{l_target}" in
  143. *-freebsd*)
  144. if [ ! -f /compat/linux/bin/sh ]; then
  145. ( echo "The Linux ABI base system is not installed under /compat/linux/."
  146. echo "Please install the FreeBSD port/package linux_base-6.1."
  147. ) | %{l_rpmtool} msg -b
  148. fi
  149. if [ ! -f /compat/linux/etc/mtab ]; then
  150. ( echo "TSM insists on an /etc/mtab in the Linux ABI base system. Please"
  151. echo "create /compat/linux/etc/mtab with at least these lines:"
  152. awk </etc/fstab '
  153. /^\/.+ufs.+/ { printf("%s\t%s\text2\trw\t1\t1\n", $1, $2); }
  154. '
  155. ) | %{l_rpmtool} msg -b
  156. fi
  157. ( if [ -r /etc/defaults/rc.conf ]; then
  158. . /etc/defaults/rc.conf
  159. fi
  160. if [ -r /etc/rc.conf ]; then
  161. . /etc/rc.conf
  162. fi
  163. case ${linux_enable} in
  164. [Yy][Ee][Ss])
  165. ;;
  166. * )
  167. ( echo "TSM requires the Linux ABI in the kernel."
  168. echo "Run /usr/sbin/linux manually before running TSM"
  169. echo "or add the following line to /etc/rc.conf:"
  170. echo "linux_enable=\"YES\""
  171. ) | %{l_rpmtool} msg -b
  172. ;;
  173. esac
  174. )
  175. ;;
  176. *-linux*)
  177. ( echo "Please make sure you have the vendor libstdc++ 2.9 package installed:"
  178. echo "- RedHat Linux 7.x: compat-libstdc++-6.2-2.9.0.16"
  179. echo "- Debian GNU/Linux 2.2: 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