latex2html-vl.spec 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. %define jppatchsrcver jp20100514
  2. %define jppatch l2h-2K8-jp2.1b1.12.patch
  3. %define tex_destdir %{_datadir}
  4. %define texmf %{tex_destdir}/texmf
  5. %define texlive_src %{tex_destdir}/texlive-sources
  6. %define build_tex_destdir %{buildroot}%{tex_destdir}
  7. %define build_texmf %{buildroot}%{texmf}
  8. %define exec_mktexlsr [ -x %{_bindir}/texconfig-sys ] && PATH=%{_bindir}:$PATH %{_bindir}/texconfig-sys rehash
  9. %define exec_texhash [ -x %{_bindir}/texhash ] && PATH=%{_bindir}:$PATH %{_bindir}/texhash
  10. %define exec_updmap [ -x %{_bindir}/updmap-sys ] && PATH=%{_bindir}:$PATH %{_bindir}/updmap-sys --nostop
  11. %define exec_fmtutil [ -x %{_bindir}/fmtutil-sys ] && PATH=%{_bindir}:$PATH %{_bindir}/fmtutil-sys --all >/dev/null
  12. %define exec_upddeffont [ -x %{_sbindir}/update-defaultfont ] && %{_sbindir}/update-defaultfont 2> /dev/null
  13. %define vartexfonts %{_var}/lib/texmf
  14. %define ownlibdir %{_prefix}/lib/%{name}
  15. Summary: LaTeX to HTML converter
  16. Summary(ja): LaTeX ファイルを HTML 形式に変換するツール
  17. Name: latex2html
  18. Version: 2008
  19. Release: 1%{?_dist_release}
  20. License: GPL
  21. Group: Applications/Publishing
  22. Url: http://www.latex2html.org/
  23. Source0: http://saftsack.fs.uni-bayreuth.de/~latex2ht/current/%{name}-%{version}.tar.gz
  24. Source1: http://takeno.iee.niit.ac.jp/~shige/TeX/latex2html/current/data/l2h-2K8-%{jppatchsrcver}.tar.gz
  25. Patch0: l2h-vine.patch
  26. %if %{?_dist_release} == "vl5"
  27. Requires: tetex
  28. %endif
  29. %if %{?_dist_release} == "vl6"
  30. Requires: texlive
  31. %endif
  32. Requires: ghostscript
  33. Requires: perl
  34. Requires: netpbm-progs
  35. %if %{?_dist_release} == "vl5"
  36. BuildRequires: tetex
  37. %endif
  38. %if %{?_dist_release} == "vl6"
  39. BuildRequires: texlive
  40. %endif
  41. BuildRequires: ghostscript
  42. BuildRequires: perl
  43. BuildRequires: netpbm-progs
  44. BuildRequires: netpbm >= 9.12
  45. Conflicts: latex2html2002
  46. BuildArch: noarch
  47. Buildroot: %{_tmppath}/%{name}-%{version}-root
  48. Vendor: Project Vine
  49. Distribution: Vine Linux
  50. %description
  51. LATEX2HTML is a conversion tool that allows documents written in LATEX to
  52. become part of the World-Wide Web. In addition, it offers an easy migration
  53. path towards authoring complex hyper-media documents using familiar
  54. word-processing concepts, including the power of a LATEX-like macro language
  55. capable of producing correctly structured HTML tags.
  56. LATEX2HTML replicates the basic structure of a LATEX document as a set of
  57. interconnected HTML files which can be explored using automatically generated
  58. navigation panels. The cross-references, citations, footnotes, the
  59. table-of-contents and the lists of figures and tables, are also translated
  60. into hypertext links. Formatting information which has equivalent “tags” in
  61. HTML (lists, quotes, paragraph-breaks, type-styles, etc.) is also converted
  62. appropriately. The remaining heavily formatted items such as mathematical
  63. equations, pictures etc. are converted to images which are placed
  64. automatically at the correct position in the final HTML document.
  65. LATEX2HTML extends LATEX by supporting arbitrary hypertext links and symbolic
  66. cross-references between evolving remote documents. It also allows the
  67. specification of conditional text and the inclusion of raw HTML commands.
  68. These hyper-media extensions to LATEX are available as new commands and
  69. environments from within a LATEX document.
  70. %prep
  71. %setup -q
  72. %__tar zxvf %{SOURCE1} -C $RPM_BUILD_DIR || exit 1
  73. %__patch -p1 < %{jppatch}
  74. %patch0 -p0 -b .vine
  75. # fix perl path in a few places:
  76. %__sed -i -e "s|^#!/perl|#!%{__perl}|" l2hconf.pin || exit 1
  77. %build
  78. ./configure \
  79. --prefix=%{_prefix} \
  80. --libdir=%{ownlibdir} \
  81. --shlibdir=%{ownlibdir} \
  82. \
  83. --with-perl=%{__perl} \
  84. --enable-images \
  85. --disable-pk \
  86. --enable-eps \
  87. --enable-png \
  88. --enable-gif \
  89. --with-gs=%{_bindir}/gs \
  90. %if %{?_dist_release} == "vl6"
  91. --with-dvips=%{_bindir}/pdvips \
  92. %endif
  93. --with-latex=%{_bindir}/platex \
  94. --without-mktexlsr \
  95. --with-kanji=utf8 \
  96. ;
  97. %__make
  98. %install
  99. %__rm -rf $RPM_BUILD_ROOT
  100. ## fake root directory
  101. %__sed -e 's|/usr|'"${RPM_BUILD_ROOT}"'/usr|' \
  102. -e 's|bin/latex|bin/platex|' cfgcache.pm > cfgcache.pm.new || exit 1
  103. %__mv cfgcache.pm.new cfgcache.pm || exit 1
  104. %__make install
  105. (cd %{buildroot}
  106. for i in `grep -ir -l %{buildroot} *`; do
  107. %__perl -pi -e "s@%{buildroot}@@g" $i || exit 1
  108. %__chmod 755 $i
  109. done
  110. for i in `grep -ir -l %{_builddir} *`;
  111. do
  112. %__perl -pi -e "s@%{_builddir}@@g" $i || exit 1
  113. %__chmod 755 $i
  114. done
  115. )
  116. ## fix perl path in a few places:
  117. %__perl -pi -e "s#$RPM_BUILD_DIR/%{pkgname}-%{version}#%{ownlibdir}#" $RPM_BUILD_ROOT%{ownlibdir}/cfgcache.pm || exit 1
  118. ## latin9.def url.sty: provided by texlive-collection-latex package
  119. (cd $RPM_BUILD_ROOT%{_datadir}/texmf/tex/latex/html
  120. %__rm -f floatflt.ins latin9.def url.sty
  121. )
  122. (cd docs
  123. # ## changebar.sty: provided by texlive-collection-latexextra
  124. # %__rm -f changebar.sty
  125. export TEXINPUTS=:.:../texinputs
  126. ## article.cls don't provide \address.
  127. %__sed -i -e 's/\\author{\(.*\)}/\\author{\1/' -e 's!\\address{!\\\\hoge!' manual.tex || exit 1
  128. %__make clean
  129. %__make LATEX=platex manual.dvi
  130. %{_bindir}/dvipdfm manual.dvi || exit 1
  131. )
  132. ## NO use perl(Win32), which is required by perl(L2hos::Win32)
  133. %__rm -f $RPM_BUILD_ROOT%{ownlibdir}/L2hos/Win32.pm
  134. %post
  135. %{exec_texhash}
  136. exit 0
  137. %postun
  138. %{exec_texhash}
  139. exit 0
  140. %clean
  141. %__rm -rf $RPM_BUILD_ROOT
  142. %files
  143. %defattr(-,root,root)
  144. %doc BUGS Changes FAQ INSTALL LICENSE MANIFEST README TODO
  145. %doc README.notice.jp README.patch-99.1jp README.patch-jp-pre README.tech.jp
  146. %doc docs/ example/ tests/
  147. %doc dot.latex2html-init
  148. %{_bindir}/*
  149. %{ownlibdir}
  150. %{_datadir}/texmf/tex/latex/html/
  151. %changelog
  152. * Sun Sep 26 2010 Munehiro Yamamoto <munepi@vinelinux.org> 2008-1
  153. - first release