acroread.spec 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. ##
  2. ## acroread.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. %define V_real 5.06
  26. %define V_comp 506
  27. # package information
  28. Name: acroread
  29. Summary: Acrobat Reader
  30. URL: http://www.adobe.com/products/acrobat/
  31. Vendor: Adobe
  32. Packager: The OpenPKG Project
  33. Distribution: OpenPKG [EXP]
  34. Group: Print
  35. License: Commercial
  36. Version: %{V_real}
  37. Release: 20020724
  38. # list of sources
  39. Source0: ftp://ftp.adobe.com/pub/adobe/acrobatreader/unix/5.x/linux-%{V_comp}.tar.gz
  40. Source1: ftp://ftp.adobe.com/pub/adobe/acrobatreader/unix/5.x/solaris-%{V_comp}.tar.gz
  41. # build information
  42. Prefix: %{l_prefix}
  43. BuildRoot: %{l_buildroot}
  44. BuildPreReq: OpenPKG, openpkg >= 20020416, gzip, tar
  45. PreReq: OpenPKG, openpkg >= 20020416, X11
  46. AutoReq: no
  47. AutoReqProv: no
  48. %description
  49. This is the freely-available Adobe Acrobat Reader (v5) for the
  50. Adobe Portable Document Format (PDF).
  51. %prep
  52. %setup -q -T -c -n acroread-%{version}
  53. %build
  54. # no-op
  55. %install
  56. rm -rf $RPM_BUILD_ROOT
  57. # create installation hierarchy
  58. %{l_shtool} mkdir -f -p -m 755 \
  59. $RPM_BUILD_ROOT%{l_prefix}/bin \
  60. $RPM_BUILD_ROOT%{l_prefix}/libexec/acroread
  61. # unpack the corresponding binary only
  62. case "%{l_target}" in
  63. *-freebsd* )
  64. tarball="%{SOURCE linux-%{V_comp}.tar.gz}"
  65. shell="/compat/linux/bin/sh"
  66. ;;
  67. *-linux* )
  68. tarball="%{SOURCE linux-%{V_comp}.tar.gz}"
  69. shell="/bin/sh"
  70. ;;
  71. *-solaris* )
  72. tarball="%{SOURCE solaris-%{V_comp}.tar.gz}"
  73. shell="/bin/sh"
  74. ;;
  75. * ) echo "Platform %{l_target} not supported" | %{l_rpmtool} msg -b
  76. exit 1
  77. ;;
  78. esac
  79. %{l_prefix}/bin/gzip -c -d $tarball |\
  80. %{l_prefix}/bin/tar xf -
  81. # perform the standard installation procedure
  82. %{l_shtool} subst -e 's;Linux);Linux|FreeBSD);' INSTALL
  83. PAGER="cat"
  84. export PAGER
  85. ( echo "ACCEPT"
  86. echo "$RPM_BUILD_ROOT%{l_prefix}/libexec/acroread"
  87. ) | $shell INSTALL
  88. # post-adjust installation tree
  89. mv $RPM_BUILD_ROOT%{l_prefix}/libexec/acroread/bin/acroread \
  90. $RPM_BUILD_ROOT%{l_prefix}/bin/acroread
  91. rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/acroread/bin
  92. %{l_shtool} subst \
  93. -e "s;$RPM_BUILD_ROOT%{l_prefix}/libexec;%{l_prefix}/libexec;g" \
  94. $RPM_BUILD_ROOT%{l_prefix}/bin/acroread
  95. case "%{l_target}" in
  96. *-freebsd* )
  97. %{l_shtool} subst -e 's;#!/bin/sh;#!/compat/linux/bin/sh;' \
  98. $RPM_BUILD_ROOT%{l_prefix}/bin/acroread
  99. brandelf -t Linux \
  100. $RPM_BUILD_ROOT%{l_prefix}/libexec/acroread/Reader/intellinux/bin/*
  101. ;;
  102. esac
  103. # determine installation files
  104. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  105. %files -f files
  106. %clean
  107. rm -rf $RPM_BUILD_ROOT
  108. %post
  109. if [ $1 -eq 1 ]; then
  110. case "%{l_target}" in
  111. *-freebsd*)
  112. if [ ! -f /compat/linux/bin/sh ]; then
  113. ( echo "The Linux ABI base system is not installed under /compat/linux/."
  114. echo "Please install the FreeBSD port/package linux_base."
  115. ) | %{l_rpmtool} msg -b
  116. fi
  117. ( if [ -r /etc/defaults/rc.conf ]; then
  118. . /etc/defaults/rc.conf
  119. fi
  120. if [ -r /etc/rc.conf ]; then
  121. . /etc/rc.conf
  122. fi
  123. case ${linux_enable} in
  124. [Yy][Ee][Ss])
  125. ;;
  126. * )
  127. ( echo "TSM requires the Linux ABI in the kernel."
  128. echo "Run /usr/sbin/linux manually before running TSM"
  129. echo "or add the following line to /etc/rc.conf:"
  130. echo "linux_enable=\"YES\""
  131. ) | %{l_rpmtool} msg -b
  132. ;;
  133. esac
  134. )
  135. ;;
  136. esac
  137. fi