acroread.spec 6.0 KB

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