acroread.spec 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. ##
  2. ## acroread.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. %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 [EVAL]
  34. Group: Graphics
  35. License: Commercial
  36. Version: %{V_real}
  37. Release: 20021003
  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 >= 20021002
  45. PreReq: OpenPKG, openpkg >= 20021002, 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_gzip} -c -d $tarball | %{l_tar} xf -
  80. # perform the standard installation procedure
  81. %{l_shtool} subst -e 's;Linux);Linux|FreeBSD);' INSTALL
  82. PAGER="cat"
  83. export PAGER
  84. ( echo "ACCEPT"
  85. echo "$RPM_BUILD_ROOT%{l_prefix}/libexec/acroread"
  86. ) | $shell INSTALL
  87. # post-adjust installation tree
  88. mv $RPM_BUILD_ROOT%{l_prefix}/libexec/acroread/bin/acroread \
  89. $RPM_BUILD_ROOT%{l_prefix}/bin/acroread
  90. rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/acroread/bin
  91. %{l_shtool} subst \
  92. -e "s;$RPM_BUILD_ROOT%{l_prefix}/libexec;%{l_prefix}/libexec;g" \
  93. $RPM_BUILD_ROOT%{l_prefix}/bin/acroread
  94. case "%{l_target}" in
  95. *-freebsd* )
  96. %{l_shtool} subst -e 's;#!/bin/sh;#!/compat/linux/bin/sh;' \
  97. $RPM_BUILD_ROOT%{l_prefix}/bin/acroread
  98. brandelf -t Linux \
  99. $RPM_BUILD_ROOT%{l_prefix}/libexec/acroread/Reader/intellinux/bin/*
  100. ;;
  101. esac
  102. # determine installation files
  103. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  104. %files -f files
  105. %clean
  106. rm -rf $RPM_BUILD_ROOT
  107. %post
  108. if [ $1 -eq 1 ]; then
  109. case "%{l_target}" in
  110. *-freebsd*)
  111. if [ ! -f /compat/linux/bin/sh ]; then
  112. ( echo "The Linux ABI base system is not installed under /compat/linux/."
  113. echo "Please install the FreeBSD port/package linux_base."
  114. ) | %{l_rpmtool} msg -b
  115. fi
  116. ( if [ -r /etc/defaults/rc.conf ]; then
  117. . /etc/defaults/rc.conf
  118. fi
  119. if [ -r /etc/rc.conf ]; then
  120. . /etc/rc.conf
  121. fi
  122. case ${linux_enable} in
  123. [Yy][Ee][Ss])
  124. ;;
  125. * )
  126. ( echo "Acrobat Reader requires the Linux ABI in the kernel."
  127. echo "Run /usr/sbin/linux manually before running TSM"
  128. echo "or add the following line to /etc/rc.conf:"
  129. echo "linux_enable=\"YES\""
  130. ) | %{l_rpmtool} msg -b
  131. ;;
  132. esac
  133. )
  134. ;;
  135. esac
  136. fi