latex2html2002-vl.spec 7.8 KB

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