latex2html-vl.spec 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. ## TODO: update latex2html-2008
  2. %define ver 2002
  3. %define srcver 2002-2-1
  4. %define jpver 1.9
  5. %define _prefix /usr
  6. %define exec_texhash [ -x %{_bindir}/texhash ] && %{_bindir}/env - %{_bindir}/texhash 2> /dev/null
  7. Summary: LaTeX to HTML converter.
  8. Summary(ja): LaTeX ファイルを HTML 形式に変換するツール
  9. Name: latex2html
  10. Version: %{ver}
  11. Release: 7%{?_dist_release}
  12. License: distributable
  13. Group: Applications/Publishing
  14. Url: http://www.latex2html.org/
  15. Source0: http://saftsack.fs.uni-bayreuth.de/~latex2ht/current/latex2html-%{srcver}.tar.gz
  16. Source1: l2h-japanese.perl
  17. # vine patch
  18. Patch0: http://takeno.iee.niit.ac.jp/~shige/TeX/latex2html/data/l2h-%{srcver}+jp%{jpver}.patch.gz
  19. Patch1: l2h-vine.patch
  20. Patch2: latex2html.gs510.diff
  21. Patch3: l2h-netpbm-10.25.patch
  22. BuildArch: noarch
  23. Requires: tetex >= 3.0, perl, ghostscript >= 5.50
  24. Requires: netpbm-progs
  25. BuildPrereq: netpbm-progs, perl, tetex, dvipdfmx, netpbm >= 9.12
  26. Buildroot: %{_tmppath}/%{name}-root
  27. Vendor: Project Vine
  28. Distribution: Vine Linux
  29. %define ownlibdir %{_libdir}/%{name}
  30. %description
  31. Elaborate perl program to convert latex documents to html, using LaTeX
  32. to process images and equations.
  33. %description -l ja
  34. Latex ファイルを HTML形式に変換するperlプログラムです.
  35. %prep
  36. %setup -q -n latex2html-%{srcver}
  37. %patch -p1
  38. %patch1 -p0
  39. cp -f %{SOURCE1} styles/japanese.perl
  40. cd config
  41. %patch2 -p0
  42. cd ..
  43. %patch3 -p1
  44. %build
  45. TMP=/var/tmp ./configure \
  46. --with-gs=%{_bindir}/gs \
  47. --without-mktexlsr \
  48. --with-perl=%{__perl} \
  49. --prefix=%{_prefix} \
  50. --enable-png \
  51. --disable-gif \
  52. --libdir=%{ownlibdir} \
  53. --shlibdir=%{ownlibdir}
  54. #./configure --prefix=%{_prefix} --sysconfdir=/etc --host=localhost\
  55. # --enable-png --disable-gif --without-mktexlsr
  56. make
  57. ##
  58. ## make several l2hconf.pm and wrapper
  59. ##
  60. sed -e 's/"jarticle"/"article"/' -e 's/japanese/english/' \
  61. -e 's/UNUSEACCENT = 1/UNUSEACCENT = 0/' \
  62. -e 's/texexpand/texexpand-en/' \
  63. l2hconf.pm > l2hconf_en.pm
  64. sed -e 's/#$TOHTML/$TOHTML = "|nkf -j";/' \
  65. -e 's/#$charset/$charset = "iso-2022-jp";/' \
  66. l2hconf.pm > l2hconf_jis.pm
  67. sed -e 's/#$TOHTML/$TOHTML = "|nkf -s";/' \
  68. -e 's/#$charset/$charset = "Shift_JIS";/' \
  69. l2hconf.pm > l2hconf_sjis.pm
  70. sed -e 's/#$TOHTML/$TOHTML = "|nkf -e";/' \
  71. -e 's/#$charset/$charset = "EUC-JP";/' \
  72. l2hconf.pm > l2hconf_euc.pm
  73. sed -e 's/#$TOHTML/$TOHTML = "|nkf -w";/' \
  74. -e 's/#$charset/$charset = "UTF-8";/' \
  75. l2hconf.pm > l2hconf_utf8.pm
  76. cp l2hconf.pm l2hconf_png_ja.pm
  77. sed -e 's/"jarticle"/"article"/' -e 's/japanese/english/' \
  78. l2hconf.pm > l2hconf_png_en.pm
  79. sed 's/png gif/gif png/' l2hconf.pm > l2hconf_gif_ja.pm
  80. sed 's/png gif/gif png/' l2hconf_png_en.pm > l2hconf_gif_en.pm
  81. sed -e 's/${FROMNATIVE} $infile |/<$infile/' texexpand > texexpand-en
  82. sed -e "s@LIBDIR@%{ownlibdir}@" -e "s@BINDIR@%{_bindir}@" l2h-wrapper-temp > l2h-wrapper
  83. %install
  84. # fake root directory
  85. sed -e 's|/usr|'"${RPM_BUILD_ROOT}"'/usr|' \
  86. -e 's|bin/latex|bin/platex|' cfgcache.pm > cfgcache.pm.new
  87. mv cfgcache.pm.new cfgcache.pm
  88. mkdir -p $RPM_BUILD_ROOT%{_datadir}/texmf/tex/latex/html
  89. make install
  90. (cd %{buildroot}
  91. perl -pi -e 's@iso-8859-1@euc-jp@g' %{_bindir}/latex2html
  92. for i in `grep -ir -l %{buildroot} *`;
  93. do
  94. perl -pi -e "s@%{buildroot}@@g" $i
  95. chmod 755 $i
  96. done
  97. for i in `grep -ir -l %{_builddir} *`;
  98. do
  99. perl -pi -e "s@%{_builddir}@@g" $i
  100. chmod 755 $i
  101. done
  102. )
  103. # fix perl path in a few places:
  104. perl -pi -e 's#/usr/local/bin/perl#%{__perl}#' $RPM_BUILD_ROOT%{ownlibdir}/cweb2html/cweb2html
  105. perl -pi -e 's#/usr/local/bin/perl#%{__perl}#' $RPM_BUILD_ROOT%{ownlibdir}/makeseg/makeseg
  106. perl -pi -e 's#/usr/local/bin/perl#%{__perl}#' $RPM_BUILD_ROOT%{ownlibdir}/makemap
  107. perl -pi -e "s#$RPM_BUILD_DIR/%{name}-%{version}#%{_libdir}/%{name}#" $RPM_BUILD_ROOT%{ownlibdir}/cfgcache.pm
  108. (cd $RPM_BUILD_ROOT%{_datadir}/texmf/tex/latex/html
  109. rm -f floatflt.ins latin9.def url.sty
  110. )
  111. (cd docs
  112. rm -f changebar.sty
  113. export TEXINPUTS=:.:../texinputs
  114. ## article.cls don't provide \address.
  115. sed -i -e 's/\\author{\(.*\)}/\\author{\1/' -e 's!\\address{!\\\\hoge!' manual.tex
  116. # platex manual
  117. # platex manual
  118. # platex manual
  119. make clean
  120. make LATEX=platex manual.dvi
  121. dvipdfm manual.dvi)
  122. #### l2h wrapper install
  123. cp l2hconf_{gif,png}_{ja,en}.pm $RPM_BUILD_ROOT%{ownlibdir}
  124. install -c -m 0755 l2h-wrapper $RPM_BUILD_ROOT%{_bindir}/l2h
  125. ## NO use perl(Win32), which is required by perl(L2hos::Win32)
  126. sed -i -e 's/use Win32;/## RPM requires perl(Win32)\n# use Win32;/' \
  127. $RPM_BUILD_ROOT%{ownlibdir}/L2hos/Win32.pm
  128. %post
  129. %{exec_texhash}
  130. exit 0
  131. %postun
  132. %{exec_texhash}
  133. exit 0
  134. %clean
  135. rm -rf $RPM_BUILD_ROOT
  136. %files
  137. %defattr(-,root,root)
  138. %doc BUGS Changes FAQ INSTALL LICENSE MANIFEST README TODO
  139. %doc docs/ example/ tests/
  140. %doc dot.latex2html-init
  141. %{_bindir}/*
  142. %{_libdir}/%{name}
  143. %{_datadir}/texmf/tex/latex/html/
  144. %changelog
  145. * Sun Mar 29 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 2002-7
  146. - comment out "use Win32;" in %{ownlibdir}/L2hos/Win32.pm
  147. * Sun Mar 29 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 2002-6
  148. - applied new versioning policy
  149. - spec in utf8
  150. - corrected generating docs/manual.pdf process
  151. * Wed Aug 31 2005 KOBAYASHI Taizo <tkoba@vinelinux.org> 2002-0vl5
  152. - source update
  153. * Wed Jun 11 2003 KOBAYASHI R. Taizo <tkoba@vinelinux.org> 2002-0vl4
  154. - patch2 update
  155. - source update (23-May-2003 07:15)
  156. * Tue Oct 08 2002 KOBAYASHI R. Taizo <tkoba@vinelinux.org> 2002-0vl3
  157. - source update
  158. * Fri Jun 21 2002 KOBAYASHI R. Taizo <tkoba@vinelinux.org> 2002-0vl2
  159. - source update
  160. * Sun Jun 09 2002 KOBAYASHI R. Taizo <tkoba@vinelinux.org> 2002-0vl1
  161. - update to 2002
  162. - added BuildPrereq: netpbm >= 9.12
  163. * Fri Mar 29 2002 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 2000.1-0.1vl4
  164. - added BuildPreReq: tetex
  165. * Fri Mar 29 2002 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 2000.1-0.1vl3
  166. - %%post and %%postun fixed ([VineSeed:06257], thanks Tsuchimura-san)
  167. * Wed Jul 18 2001 KOBAYASHI R. Taizo <tkoba@ike-dyn.ritsumei.ac.jp> 0.1vl2
  168. - source update
  169. - fix requires tag
  170. * Wed Jul 18 2001 KOBAYASHI R. Taizo <tkoba@ike-dyn.ritsumei.ac.jp>
  171. - latex2html-2000.1-0.1vl1
  172. - update for teTeX
  173. * Thu Aug 17 2000 Jun Nishii <jun@vinelinux.org>
  174. - latex2html-99.2-0.8vl2
  175. - fix requires tag
  176. * Mon Jul 31 2000 Jun Nishii <jun@vinelinux.org>
  177. - latex2html-99.2-0.8vl1
  178. - use png
  179. * Fri Jan 28 2000 Yasuhide OOMORI <baoying@flatout.org>
  180. - [latex2html-98.1p1-5]
  181. - Modified to show generator correctly.
  182. - Setup quietly.
  183. * Fri Jan 7 2000 Jun Nishii <jun@vinelinux.org>
  184. - [latex2html-98.1p1-4]
  185. - change group
  186. * Sun Nov 14 1999 Jun Nishii <jun@flatout.org>
  187. - build for Vine-2.0
  188. * Mon May 3 1999 Jun Nishii <jun@flatout.org>
  189. - modify post installation script
  190. - build for Vine
  191. * Tue Nov 10 1998 Jun Nishii <jun@flatout.org>
  192. - first build for PJE-0.3alpha