tetex3.spec 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. ##
  2. ## tetex3.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2005 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2005 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2005 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 versions
  26. %define V_src 2.99.11.20050131b
  27. %define V_texmf 2.99.11.20050131
  28. # package information
  29. Name: tetex3
  30. Summary: The TeX Typesetting System
  31. URL: http://www.tug.org/teTeX/
  32. Vendor: Thomas Esser et al.
  33. Packager: The OpenPKG Project
  34. Distribution: OpenPKG
  35. Class: BASE
  36. Group: Text
  37. License: GPL
  38. Version: %{V_src}
  39. Release: 20050201
  40. # package options
  41. %option with_x11 no
  42. # list of sources
  43. Source0: ftp://dante.ctan.org/pub/tex/systems/unix/teTeX-beta/tetex-src-%{V_src}-beta.tar.gz
  44. Source1: ftp://dante.ctan.org/pub/tex/systems/unix/teTeX-beta/tetex-texmf-%{V_texmf}-beta.tar.gz
  45. Source2: http://www.tei-c.org.uk/Software/passivetex/passivetex.zip
  46. Source3: ftp://ftp.tex.ac.uk/tex-archive/macros/xmltex/base.zip
  47. # build information
  48. Prefix: %{l_prefix}
  49. BuildRoot: %{l_buildroot}
  50. BuildPreReq: OpenPKG, openpkg >= 20040130, gcc, make, infozip, flex, bison, png, zlib
  51. PreReq: OpenPKG, openpkg >= 20040130, perl, png, zlib
  52. %if "%{with_x11}" == "yes"
  53. BuildPreReq: X11
  54. PreReq: X11
  55. %endif
  56. AutoReq: no
  57. AutoReqProv: no
  58. Conflicts: tetex
  59. %description
  60. teTeX is a complete TeX distribution for Unix compatible systems,
  61. maintained by Thomas Esser. It is based on Karl Berry's original
  62. Web2c distribution. TeX was invented by Donald E. Knuth, and the
  63. most popular TeX macro set (LaTeX) for TeX was invented by Leslie
  64. Lamport. The OpenPKG teTeX package also contains David Carlisle'
  65. xmltex (namespace-aware XML parser written in TeX) and Sebastian
  66. Rahtz' PassiveTeX (XML-FO rendering engine).
  67. %track
  68. prog tetex3:tetex-src = {
  69. version = %{V_src}
  70. url = ftp://dante.ctan.org/pub/tex/systems/unix/teTeX-beta/
  71. regex = tetex-src-(__VER__)-beta\.tar\.gz
  72. }
  73. prog tetex3:tetex-texmf = {
  74. version = %{V_texmf}
  75. url = ftp://dante.ctan.org/pub/tex/systems/unix/teTeX-beta/
  76. regex = tetex-texmf-(__VER__)-beta\.tar\.gz
  77. }
  78. %prep
  79. %setup -q -n tetex-src-%{V_src}-beta
  80. # teTeX requires the texmf stuff to be already in place
  81. # for building and installing the source parts.
  82. rm -rf $RPM_BUILD_ROOT
  83. %{l_shtool} mkdir -f -p -m 755 \
  84. $RPM_BUILD_ROOT%{l_prefix}/share/texmf
  85. %{l_gzip} -d -c %{SOURCE tetex-texmf-%{V_texmf}-beta.tar.gz} |\
  86. ( umask 0 && cd $RPM_BUILD_ROOT%{l_prefix}/share/texmf && %{l_tar} xf - ) || exit $?
  87. # add XMLTeX (XML parsing via TeX)
  88. ( cd $RPM_BUILD_ROOT%{l_prefix}/share/texmf/tex
  89. %{l_prefix}/bin/unzip -x %{SOURCE base.zip}
  90. mv base xmltex
  91. ) || exit $?
  92. ( echo ""
  93. echo "# XMLTeX (XML parsing via TeX) [does not work as expected here]"
  94. echo "# xmltex latex language.dat xmltex.ini"
  95. echo "# pdfxmltex pdflatex language.dat pdfxmltex.ini"
  96. echo ""
  97. ) >>texk/web2c/fmtutil.in
  98. ( echo ""
  99. echo "% XMLTeX (XML parsing via TeX)"
  100. echo "main_memory.xmltex = 2500000"
  101. echo "main_memory.pdfxmltex = 2500000"
  102. echo "param_size.xmltex = 1500"
  103. echo "param_size.pdfxmltex = 1500"
  104. echo "stack_size.xmltex = 1500"
  105. echo "stack_size.pdfxmltex = 1500"
  106. echo "hash_extra.xmltex = 50000"
  107. echo "hash_extra.pdfxmltex = 50000"
  108. echo "string_vacancies.xmltex = 45000"
  109. echo "string_vacancies.pdfxmltex = 45000"
  110. echo "pool_free.xmltex = 47500"
  111. echo "pool_free.pdfxmltex = 47500"
  112. echo "nest_size.xmltex = 500"
  113. echo "nest_size.pdfxmltex = 500"
  114. echo "save_size.xmltex = 10000"
  115. echo "save_size.pdfxmltex = 10000"
  116. echo "pool_size.xmltex = 500000"
  117. echo "pool_size.pdfxmltex = 500000"
  118. echo "max_strings.xmltex = 55000"
  119. echo "max_strings.pdfxmltex = 55000"
  120. echo "buf_size.xmltex = 200000"
  121. echo "buf_size.pdfxmltex = 200000"
  122. echo ""
  123. ) >>texk/kpathsea/texmf.in
  124. # add PassiveTeX (XML-FO to DVI/PDF translation via TeX)
  125. ( %{l_shtool} mkdir -f -p -m 755 \
  126. $RPM_BUILD_ROOT%{l_prefix}/share/texmf/tex/latex/passivetex
  127. cd $RPM_BUILD_ROOT%{l_prefix}/share/texmf/tex/latex/passivetex
  128. %{l_prefix}/bin/unzip -x %{SOURCE passivetex.zip}
  129. rm -f ChangeLog Makefile README.passivetex send
  130. rm -rf test
  131. ) || exit $?
  132. # minor fixes to the teTeX sources
  133. %{l_shtool} subst -e "s;\|O_SYNC;;g" libs/libwww/HTMemLog.c
  134. %{l_shtool} subst -e "s;strnstr;my_strnstr;g" libs/libwww/HTReader.c
  135. %{l_shtool} subst \
  136. -e '1s;/usr/bin/perl;/usr/bin/env perl;' \
  137. texk/*/t1mapper
  138. %build
  139. # configure the system by using the (wrong) paths to the temporary
  140. # installation area, followed by by a step for fixing the paths
  141. # (to the correct values) inside the kpathsea library (which
  142. # performs the run-time searches). This way we get all the magic
  143. # of the teTeX build system without problems, but still make sure
  144. # that the built-in paths are correct.
  145. %{l_shtool} subst -s -v \
  146. -e 's;^vartexfonts =.*;vartexfonts = %{l_prefix}/var/tetex/fonts;' \
  147. texk/make/paths.mk
  148. CC="%{l_cc}" \
  149. CXX="%{l_cxx}" \
  150. CFLAGS="%{l_cflags -O}" \
  151. CXXFLAGS="%{l_cxxflags -O}" \
  152. ./configure \
  153. --prefix=$RPM_BUILD_ROOT%{l_prefix} \
  154. --datadir=$RPM_BUILD_ROOT%{l_prefix}/share \
  155. %if "%{with_x11}" == "yes"
  156. --with-xdvik \
  157. --with-oxdvik \
  158. --with-x \
  159. --with-x11 \
  160. --with-x11win \
  161. --x-includes=`%{l_rc} --query x11_incdir` \
  162. --x-libraries=`%{l_rc} --query x11_libdir` \
  163. %else
  164. --without-xdvik \
  165. --without-oxdvik \
  166. --without-x \
  167. --without-x11 \
  168. --without-x11win \
  169. %endif
  170. --without-texinfo \
  171. --disable-multiplatform \
  172. --enable-gf \
  173. --with-system-pnglib \
  174. --with-pnglib-libdir=%{l_prefix}/lib \
  175. --with-pnglib-include=%{l_prefix}/include \
  176. --with-system-zlib \
  177. --with-zlib-libdir=%{l_prefix}/lib \
  178. --with-zlib-include=%{l_prefix}/include
  179. ( cd texk/kpathsea
  180. %{l_shtool} subst -v \
  181. -e "s;$RPM_BUILD_ROOT%{l_prefix};%{l_prefix};" \
  182. `find . -type f -print`
  183. eval "make all"
  184. ) || exit $?
  185. # build the sources
  186. # (we cannot use %{l_make}, because teTeX dislikes absolute paths
  187. # for make. Instead we work-around via $PATH. The redundant
  188. # "eval" around the call is just to shut-up speclint)
  189. eval "make all"
  190. %install
  191. # perform the standard installation procdure of teTeX
  192. # (we cannot use %{l_make}, because teTeX dislikes absolute paths
  193. # for make. Instead we work-around via $PATH. The redundant
  194. # "eval" around the call is just to shut-up speclint)
  195. eval "make install"
  196. # perform manual steps for installing XMLTeX
  197. ( TEXMFMAIN="$RPM_BUILD_ROOT%{l_prefix}/share/texmf"
  198. export TEXMFMAIN
  199. PATH="$RPM_BUILD_ROOT%{l_prefix}/bin:$PATH"
  200. cd $RPM_BUILD_ROOT%{l_prefix}/share/texmf/web2c
  201. $RPM_BUILD_ROOT%{l_prefix}/bin/tex -ini "&latex" xmltex.ini
  202. $RPM_BUILD_ROOT%{l_prefix}/bin/pdftex -ini "&pdflatex" pdfxmltex.ini
  203. $RPM_BUILD_ROOT%{l_prefix}/bin/mktexlsr
  204. ( cd $RPM_BUILD_ROOT%{l_prefix}/bin
  205. ln -s tex xmltex
  206. ln -s pdftex pdfxmltex
  207. ) || exit $?
  208. ) || exit $?
  209. # create dynamically generated font directory
  210. %{l_shtool} mkdir -f -p -m 755 \
  211. $RPM_BUILD_ROOT%{l_prefix}/var/tetex
  212. %{l_shtool} mkdir -f -p -m 777 \
  213. $RPM_BUILD_ROOT%{l_prefix}/var/tetex/fonts
  214. # adjust paths in manual pages
  215. %{l_shtool} subst -s -v \
  216. -e "s;$RPM_BUILD_ROOT%{l_prefix};%{l_prefix};g" \
  217. $RPM_BUILD_ROOT%{l_prefix}/man/man1/*.1
  218. # cleanup the installation
  219. rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
  220. # determine installation files
  221. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  222. %{l_files_std} \
  223. '%config %{l_prefix}/share/texmf/dvipdfm/config/config' \
  224. '%config %{l_prefix}/share/texmf/dvips/config/config.ps' \
  225. '%config %{l_prefix}/share/texmf/metafont/misc/modes.mf' \
  226. '%config %{l_prefix}/share/texmf/web2c/mktex.cnf'
  227. %files -f files
  228. %clean
  229. rm -rf $RPM_BUILD_ROOT