acroread.spec 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. ##
  2. ## acroread.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2003 Cable & Wireless <http://www.cw.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 version
  26. %define V_real 5.08
  27. %define V_comp 508
  28. # package information
  29. Name: acroread
  30. Summary: Acrobat Reader
  31. URL: http://www.adobe.com/products/acrobat/
  32. Vendor: Adobe
  33. Packager: The OpenPKG Project
  34. Distribution: OpenPKG [EVAL]
  35. Group: Graphics
  36. License: Commercial
  37. Version: %{V_real}
  38. Release: 20031019
  39. # list of sources
  40. Source0: ftp://ftp.adobe.com/pub/adobe/acrobatreader/unix/5.x/linux-%{V_comp}.tar.gz
  41. Source1: ftp://ftp.adobe.com/pub/adobe/acrobatreader/unix/5.x/sol-%{V_comp}.tar.gz
  42. # build information
  43. Prefix: %{l_prefix}
  44. BuildRoot: %{l_buildroot}
  45. BuildPreReq: OpenPKG, openpkg >= 20030909
  46. PreReq: OpenPKG, openpkg >= 20030909, X11
  47. AutoReq: no
  48. AutoReqProv: no
  49. %description
  50. This is the freely-available Adobe Acrobat Reader (v5) for the
  51. Adobe Portable Document Format (PDF).
  52. %prep
  53. %setup -q -T -c
  54. %build
  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_platform -t}" in
  63. i?86-freebsd[45]* )
  64. tarball="%{SOURCE linux-%{V_comp}.tar.gz}"
  65. shell="/compat/linux/bin/sh"
  66. if [ ! -f $shell ]; then
  67. ( echo "The Linux ABI base system is not installed under /compat/linux/."
  68. echo "Please install the FreeBSD port/package linux_base, first."
  69. ) | %{l_rpmtool} msg -b -t error
  70. exit 1
  71. fi
  72. ;;
  73. i?86-linux2* )
  74. tarball="%{SOURCE linux-%{V_comp}.tar.gz}"
  75. shell="/bin/sh"
  76. ;;
  77. sun4*-sunos5* )
  78. tarball="%{SOURCE sol-%{V_comp}.tar.gz}"
  79. shell="/bin/sh"
  80. ;;
  81. * ) echo "Platform %{l_platform -t} not supported" | %{l_rpmtool} msg -b
  82. exit 1
  83. ;;
  84. esac
  85. %{l_gzip} -c -d $tarball | %{l_tar} xf -
  86. # perform the standard installation procedure
  87. %{l_shtool} subst -e 's;Linux);Linux|FreeBSD);' INSTALL
  88. PAGER="cat"
  89. export PAGER
  90. ( echo "ACCEPT"
  91. echo "$RPM_BUILD_ROOT%{l_prefix}/libexec/acroread"
  92. ) | $shell INSTALL
  93. # post-adjust installation tree
  94. mv $RPM_BUILD_ROOT%{l_prefix}/libexec/acroread/bin/acroread \
  95. $RPM_BUILD_ROOT%{l_prefix}/bin/acroread
  96. rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/acroread/bin
  97. %{l_shtool} subst \
  98. -e "s;$RPM_BUILD_ROOT%{l_prefix}/libexec;%{l_prefix}/libexec;g" \
  99. $RPM_BUILD_ROOT%{l_prefix}/bin/acroread
  100. case "%{l_platform -t}" in
  101. *-freebsd* )
  102. %{l_shtool} subst -e 's;#!/bin/sh;#!/compat/linux/bin/sh;' \
  103. $RPM_BUILD_ROOT%{l_prefix}/bin/acroread
  104. brandelf -t Linux \
  105. $RPM_BUILD_ROOT%{l_prefix}/libexec/acroread/Reader/intellinux/bin/*
  106. ;;
  107. esac
  108. # FIXME mlelstv
  109. # -- this DLL contains a buffer overflow in acroread-5.07
  110. # http://www.securityfocus.org/archive/1/328649/2003-07-08/2003-07-14/0
  111. rm -f %RPM_BUILD_ROOT%{l_prefix}/libexec/acroread/Reader/intellinux/plug_ins/wwwlink.api
  112. # determine installation files
  113. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  114. %files -f files
  115. %clean
  116. rm -rf $RPM_BUILD_ROOT
  117. %post
  118. if [ $1 -eq 1 ]; then
  119. case "%{l_platform -t}" in
  120. *-freebsd*)
  121. if [ ! -f /compat/linux/bin/sh ]; then
  122. ( echo "The Linux ABI base system is not installed under /compat/linux/."
  123. echo "Please install the FreeBSD port/package linux_base."
  124. ) | %{l_rpmtool} msg -b
  125. fi
  126. ( if [ -r /etc/defaults/rc.conf ]; then
  127. . /etc/defaults/rc.conf
  128. fi
  129. if [ -r /etc/rc.conf ]; then
  130. . /etc/rc.conf
  131. fi
  132. case ${linux_enable} in
  133. [Yy][Ee][Ss] )
  134. ;;
  135. * )
  136. ( echo "Acrobat Reader requires the Linux ABI in the kernel."
  137. echo "Run /usr/sbin/linux manually before running TSM"
  138. echo "or add the following line to /etc/rc.conf:"
  139. echo "linux_enable=\"YES\""
  140. ) | %{l_rpmtool} msg -b
  141. ;;
  142. esac
  143. ) || exit $?
  144. ;;
  145. esac
  146. fi