latex2html-vl.spec 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. %define jppatchsrcver jp20110708
  2. %define jppatch l2h-2K8-jp2.1b1.13.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: 2%{?_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-common
  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-common
  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. Packager: munepi
  51. %description
  52. LATEX2HTML is a conversion tool that allows documents written in LATEX to
  53. become part of the World-Wide Web. In addition, it offers an easy migration
  54. path towards authoring complex hyper-media documents using familiar
  55. word-processing concepts, including the power of a LATEX-like macro language
  56. capable of producing correctly structured HTML tags.
  57. LATEX2HTML replicates the basic structure of a LATEX document as a set of
  58. interconnected HTML files which can be explored using automatically generated
  59. navigation panels. The cross-references, citations, footnotes, the
  60. table-of-contents and the lists of figures and tables, are also translated
  61. into hypertext links. Formatting information which has equivalent “tags” in
  62. HTML (lists, quotes, paragraph-breaks, type-styles, etc.) is also converted
  63. appropriately. The remaining heavily formatted items such as mathematical
  64. equations, pictures etc. are converted to images which are placed
  65. automatically at the correct position in the final HTML document.
  66. LATEX2HTML extends LATEX by supporting arbitrary hypertext links and symbolic
  67. cross-references between evolving remote documents. It also allows the
  68. specification of conditional text and the inclusion of raw HTML commands.
  69. These hyper-media extensions to LATEX are available as new commands and
  70. environments from within a LATEX document.
  71. %prep
  72. %setup -q
  73. %__tar zxvf %{SOURCE1} -C $RPM_BUILD_DIR || exit 1
  74. %__patch -p1 < %{jppatch}
  75. %patch0 -p0 -b .vine
  76. # fix perl path in a few places:
  77. %__sed -i -e "s|^#!/perl|#!%{__perl}|" l2hconf.pin || exit 1
  78. %build
  79. ./configure \
  80. --prefix=%{_prefix} \
  81. --libdir=%{ownlibdir} \
  82. --shlibdir=%{ownlibdir} \
  83. \
  84. --with-perl=%{__perl} \
  85. --enable-images \
  86. --disable-pk \
  87. --enable-eps \
  88. --enable-png \
  89. --enable-gif \
  90. --with-gs=%{_bindir}/gs \
  91. %if %{?_dist_release} == "vl6"
  92. --with-dvips=%{_bindir}/pdvips \
  93. %endif
  94. --with-latex=%{_bindir}/platex \
  95. --without-mktexlsr \
  96. --with-kanji=utf8 \
  97. ;
  98. %__make
  99. %install
  100. %__rm -rf $RPM_BUILD_ROOT
  101. ## fake root directory
  102. %__sed -e 's|/usr|'"${RPM_BUILD_ROOT}"'/usr|' \
  103. -e 's|bin/latex|bin/platex|' cfgcache.pm > cfgcache.pm.new || exit 1
  104. %__mv cfgcache.pm.new cfgcache.pm || exit 1
  105. %__make install
  106. (cd %{buildroot}
  107. for i in `grep -ir -l %{buildroot} *`; do
  108. %__perl -pi -e "s@%{buildroot}@@g" $i || exit 1
  109. %__chmod 755 $i
  110. done
  111. for i in `grep -ir -l %{_builddir} *`;
  112. do
  113. %__perl -pi -e "s@%{_builddir}@@g" $i || exit 1
  114. %__chmod 755 $i
  115. done
  116. )
  117. ## fix perl path in a few places:
  118. %__perl -pi -e "s#$RPM_BUILD_DIR/%{pkgname}-%{version}#%{ownlibdir}#" $RPM_BUILD_ROOT%{ownlibdir}/cfgcache.pm || exit 1
  119. ## latin9.def url.sty: provided by texlive-collection-latex package
  120. (cd $RPM_BUILD_ROOT%{_datadir}/texmf/tex/latex/html
  121. %__rm -f floatflt.ins latin9.def url.sty
  122. )
  123. (cd docs
  124. # ## changebar.sty: provided by texlive-collection-latexextra
  125. # %__rm -f changebar.sty
  126. export TEXINPUTS=:.:../texinputs
  127. ## article.cls don't provide \address.
  128. %__sed -i -e 's/\\author{\(.*\)}/\\author{\1/' -e 's!\\address{!\\\\hoge!' manual.tex || exit 1
  129. %__make clean
  130. %__make LATEX=platex manual.dvi
  131. %{_bindir}/dvipdfm manual.dvi || exit 1
  132. )
  133. ## NO use perl(Win32), which is required by perl(L2hos::Win32)
  134. %__rm -f $RPM_BUILD_ROOT%{ownlibdir}/L2hos/Win32.pm
  135. %post
  136. %{exec_texhash}
  137. exit 0
  138. %postun
  139. %{exec_texhash}
  140. exit 0
  141. %clean
  142. %__rm -rf $RPM_BUILD_ROOT
  143. %files
  144. %defattr(-,root,root)
  145. %doc BUGS Changes FAQ INSTALL LICENSE MANIFEST README TODO
  146. %doc README.notice.jp README.patch-99.1jp README.patch-jp-pre README.tech.jp
  147. %doc docs/ example/ tests/
  148. %doc dot.latex2html-init
  149. %{_bindir}/*
  150. %{ownlibdir}
  151. %{_datadir}/texmf/tex/latex/html/
  152. %changelog
  153. * Sat Jan 28 2012 Munehiro Yamamoto <munepi@vinelinux.org> 2008-2
  154. - l2h-2K8-jp20110708
  155. - Requires, BuildRequires: s/texlive/texlive-common/ (for vl6 or higher)
  156. * Sun Sep 26 2010 Munehiro Yamamoto <munepi@vinelinux.org> 2008-1
  157. - first release