prince.spec 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. ##
  2. ## prince.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2015 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ##
  5. ## Permission to use, copy, modify, and distribute this software for
  6. ## any purpose with or without fee is hereby granted, provided that
  7. ## the above copyright notice and this permission notice appear in all
  8. ## copies.
  9. ##
  10. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  11. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  13. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  14. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  20. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. ## SUCH DAMAGE.
  22. ##
  23. # package version
  24. %define V_openpkg 10r4
  25. %define V_freebsd 10r4
  26. %define V_linux 10r4
  27. %define V_solaris 10r4
  28. %define V_macosx 10r4
  29. # package information
  30. Name: prince
  31. Summary: Professional XML to PDF Renderer
  32. URL: http://www.princexml.com/
  33. Vendor: YesLogic Pty. Ltd.
  34. Packager: OpenPKG Foundation e.V.
  35. Distribution: OpenPKG Community
  36. Class: EVAL
  37. Group: Typesetting
  38. License: Commercial
  39. Version: %{V_openpkg}
  40. Release: 20150828
  41. # list of sources
  42. Source0: http://www.princexml.com/download/prince-%{V_freebsd}-freebsd10.1-amd64-static.tar.gz
  43. Source1: http://www.princexml.com/download/prince-%{V_linux}-debian8.0-amd64.tar.gz
  44. Source2: http://www.princexml.com/download/prince-%{V_solaris}-sol11x86.tar.gz
  45. Source3: http://www.princexml.com/download/prince-%{V_macosx}-macosx.tar.gz
  46. Source4: prince.sh
  47. Source5: prince.txt
  48. # build information
  49. BuildPreReq: OpenPKG, openpkg >= 20140101
  50. PreReq: OpenPKG, openpkg >= 20140101, fonts-free
  51. %description
  52. Prince is a commercial program that converts XML and HTML into PDF
  53. documents. Prince can read many XML formats, including XHTML and
  54. SVG. Prince formats documents according to style sheets written in
  55. CSS.
  56. %track
  57. prog prince = {
  58. version = %{V_linux}
  59. url = http://www.princexml.com/download/
  60. regex = prince-(__VER__)-linux-static\.tar\.gz
  61. }
  62. %prep
  63. %setup -q -T -c
  64. %build
  65. # unpack platform-specific distribution
  66. case "%{l_platform -t}" in
  67. *-freebsd* ) source="%{SOURCE0}" ;;
  68. *-linux* ) source="%{SOURCE1}" ;;
  69. *-sunos* ) source="%{SOURCE2}" ;;
  70. *-darwin* ) source="%{SOURCE3}" ;;
  71. * ) echo "Sorry, platform %{l_platform -t} not supported" 1>&2; exit 1 ;;
  72. esac
  73. %{l_gzip} -d -c $source | %{l_tar} xf -
  74. %install
  75. # create installation hierarchy
  76. %{l_shtool} mkdir -f -p -m 755 \
  77. $RPM_BUILD_ROOT%{l_prefix}/bin \
  78. $RPM_BUILD_ROOT%{l_prefix}/etc/prince \
  79. $RPM_BUILD_ROOT%{l_prefix}/libexec/prince \
  80. $RPM_BUILD_ROOT%{l_prefix}/lib/prince
  81. # install command line wrapper
  82. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  83. %{SOURCE prince.sh} $RPM_BUILD_ROOT%{l_prefix}/bin/prince
  84. # install program
  85. %{l_shtool} install -c -m 755 \
  86. prince-*/lib/prince/bin/prince \
  87. $RPM_BUILD_ROOT%{l_prefix}/libexec/prince/
  88. rm -rf prince-*/lib/prince/bin
  89. # install license file
  90. %{l_shtool} install -c -m 644 \
  91. prince-*/lib/prince/license/license.dat \
  92. $RPM_BUILD_ROOT%{l_prefix}/etc/prince/
  93. ln -s \
  94. ../../etc/prince \
  95. $RPM_BUILD_ROOT%{l_prefix}/lib/prince/license
  96. rm -rf prince-*/lib/prince/license
  97. # install data
  98. cp -rp prince-*/lib/prince/* \
  99. $RPM_BUILD_ROOT%{l_prefix}/lib/prince/
  100. # extend fonts.css for finding standard fonts
  101. for name in `grep "^<file" %{SOURCE prince.txt} | sed -e 's;^.*name=";;' -e 's;".*$;;'`; do
  102. (echo ""; cat %{SOURCE prince.txt}; echo "") |\
  103. sed -e "1,/^<file name=\"$name\">/d" -e "/<\/file>/,\$d" >$name
  104. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  105. $name $RPM_BUILD_ROOT%{l_prefix}/lib/prince/style/$name
  106. done
  107. # determine installation files
  108. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  109. %{l_files_std} \
  110. '%config %{l_prefix}/etc/prince/*'
  111. %files -f files
  112. %clean