|
@@ -1,15 +1,18 @@
|
|
|
-## TODO: update latex2html-2008
|
|
|
+%define pkgname latex2html
|
|
|
+
|
|
|
%define ver 2002
|
|
|
%define srcver 2002-2-1
|
|
|
%define jpver 1.9
|
|
|
%define _prefix /usr
|
|
|
%define exec_texhash [ -x %{_bindir}/texhash ] && %{_bindir}/env - %{_bindir}/texhash 2> /dev/null
|
|
|
|
|
|
+%define ownlibdir %{_prefix}/lib/%{pkgname}
|
|
|
+
|
|
|
Summary: LaTeX to HTML converter.
|
|
|
Summary(ja): LaTeX ファイルを HTML 形式に変換するツール
|
|
|
-Name: latex2html
|
|
|
+Name: latex2html2002
|
|
|
Version: %{ver}
|
|
|
-Release: 7%{?_dist_release}
|
|
|
+Release: 9%{?_dist_release}
|
|
|
License: distributable
|
|
|
Group: Applications/Publishing
|
|
|
Url: http://www.latex2html.org/
|
|
@@ -21,14 +24,29 @@ Patch1: l2h-vine.patch
|
|
|
Patch2: latex2html.gs510.diff
|
|
|
Patch3: l2h-netpbm-10.25.patch
|
|
|
BuildArch: noarch
|
|
|
-Requires: tetex >= 3.0, perl, ghostscript >= 5.50
|
|
|
+%if %{?_dist_release} == "vl5"
|
|
|
+Requires: tetex
|
|
|
+%endif
|
|
|
+%if %{?_dist_release} >= "vl6"
|
|
|
+Requires: texlive-common
|
|
|
+%endif
|
|
|
+Requires: ghostscript >= 5.50
|
|
|
+Requires: perl
|
|
|
Requires: netpbm-progs
|
|
|
-BuildPrereq: netpbm-progs, perl, tetex, dvipdfmx, netpbm >= 9.12
|
|
|
-Buildroot: %{_tmppath}/%{name}-root
|
|
|
+%if %{?_dist_release} == "vl5"
|
|
|
+BuildRequires: tetex
|
|
|
+%endif
|
|
|
+%if %{?_dist_release} >= "vl6"
|
|
|
+BuildRequires: texlive-common
|
|
|
+%endif
|
|
|
+BuildRequires: perl
|
|
|
+BuildRequires: netpbm-progs
|
|
|
+BuildRequires: netpbm >= 9.12
|
|
|
+
|
|
|
+Buildroot: %{_tmppath}/%{pkgname}-%{version}-root
|
|
|
Vendor: Project Vine
|
|
|
Distribution: Vine Linux
|
|
|
-
|
|
|
-%define ownlibdir %{_libdir}/%{name}
|
|
|
+Packager: munepi
|
|
|
|
|
|
%description
|
|
|
Elaborate perl program to convert latex documents to html, using LaTeX
|
|
@@ -39,110 +57,117 @@ Latex ファイルを HTML形式に変換するperlプログラムです.
|
|
|
|
|
|
%prep
|
|
|
%setup -q -n latex2html-%{srcver}
|
|
|
-%patch -p1
|
|
|
+%patch0 -p1
|
|
|
%patch1 -p0
|
|
|
-cp -f %{SOURCE1} styles/japanese.perl
|
|
|
+%__cp -f %{SOURCE1} styles/japanese.perl
|
|
|
cd config
|
|
|
%patch2 -p0
|
|
|
cd ..
|
|
|
%patch3 -p1
|
|
|
|
|
|
+# fix perl path in a few places:
|
|
|
+%__sed -i -e "s|^#!/perl|#!%{__perl}|" l2hconf.pin || exit 1
|
|
|
+
|
|
|
%build
|
|
|
TMP=/var/tmp ./configure \
|
|
|
- --with-gs=%{_bindir}/gs \
|
|
|
- --without-mktexlsr \
|
|
|
- --with-perl=%{__perl} \
|
|
|
- --prefix=%{_prefix} \
|
|
|
- --enable-png \
|
|
|
- --disable-gif \
|
|
|
- --libdir=%{ownlibdir} \
|
|
|
- --shlibdir=%{ownlibdir}
|
|
|
+ --with-gs=%{_bindir}/gs \
|
|
|
+%if %{?_dist_release} == "vl6"
|
|
|
+ --with-dvips=%{_bindir}/pdvips \
|
|
|
+%endif
|
|
|
+ --with-latex=%{_bindir}/platex \
|
|
|
+ --without-mktexlsr \
|
|
|
+ --with-perl=%{__perl} \
|
|
|
+ --prefix=%{_prefix} \
|
|
|
+ --enable-eps \
|
|
|
+ --enable-png \
|
|
|
+ --disable-gif \
|
|
|
+ --libdir=%{ownlibdir} \
|
|
|
+ --shlibdir=%{ownlibdir}
|
|
|
#./configure --prefix=%{_prefix} --sysconfdir=/etc --host=localhost\
|
|
|
# --enable-png --disable-gif --without-mktexlsr
|
|
|
-make
|
|
|
+%__make
|
|
|
|
|
|
##
|
|
|
## make several l2hconf.pm and wrapper
|
|
|
##
|
|
|
-sed -e 's/"jarticle"/"article"/' -e 's/japanese/english/' \
|
|
|
+%__sed -e 's/"jarticle"/"article"/' -e 's/japanese/english/' \
|
|
|
-e 's/UNUSEACCENT = 1/UNUSEACCENT = 0/' \
|
|
|
-e 's/texexpand/texexpand-en/' \
|
|
|
l2hconf.pm > l2hconf_en.pm
|
|
|
-sed -e 's/#$TOHTML/$TOHTML = "|nkf -j";/' \
|
|
|
+%__sed -e 's/#$TOHTML/$TOHTML = "|nkf -j";/' \
|
|
|
-e 's/#$charset/$charset = "iso-2022-jp";/' \
|
|
|
l2hconf.pm > l2hconf_jis.pm
|
|
|
-sed -e 's/#$TOHTML/$TOHTML = "|nkf -s";/' \
|
|
|
+%__sed -e 's/#$TOHTML/$TOHTML = "|nkf -s";/' \
|
|
|
-e 's/#$charset/$charset = "Shift_JIS";/' \
|
|
|
l2hconf.pm > l2hconf_sjis.pm
|
|
|
-sed -e 's/#$TOHTML/$TOHTML = "|nkf -e";/' \
|
|
|
+%__sed -e 's/#$TOHTML/$TOHTML = "|nkf -e";/' \
|
|
|
-e 's/#$charset/$charset = "EUC-JP";/' \
|
|
|
l2hconf.pm > l2hconf_euc.pm
|
|
|
-sed -e 's/#$TOHTML/$TOHTML = "|nkf -w";/' \
|
|
|
+%__sed -e 's/#$TOHTML/$TOHTML = "|nkf -w";/' \
|
|
|
-e 's/#$charset/$charset = "UTF-8";/' \
|
|
|
l2hconf.pm > l2hconf_utf8.pm
|
|
|
-cp l2hconf.pm l2hconf_png_ja.pm
|
|
|
-sed -e 's/"jarticle"/"article"/' -e 's/japanese/english/' \
|
|
|
+%__cp l2hconf.pm l2hconf_png_ja.pm
|
|
|
+%__sed -e 's/"jarticle"/"article"/' -e 's/japanese/english/' \
|
|
|
l2hconf.pm > l2hconf_png_en.pm
|
|
|
-sed 's/png gif/gif png/' l2hconf.pm > l2hconf_gif_ja.pm
|
|
|
-sed 's/png gif/gif png/' l2hconf_png_en.pm > l2hconf_gif_en.pm
|
|
|
-sed -e 's/${FROMNATIVE} $infile |/<$infile/' texexpand > texexpand-en
|
|
|
-sed -e "s@LIBDIR@%{ownlibdir}@" -e "s@BINDIR@%{_bindir}@" l2h-wrapper-temp > l2h-wrapper
|
|
|
+%__sed 's/png gif/gif png/' l2hconf.pm > l2hconf_gif_ja.pm
|
|
|
+%__sed 's/png gif/gif png/' l2hconf_png_en.pm > l2hconf_gif_en.pm
|
|
|
+%__sed -e 's/${FROMNATIVE} $infile |/<$infile/' texexpand > texexpand-en
|
|
|
+%__sed -e "s@LIBDIR@%{ownlibdir}@" -e "s@BINDIR@%{_bindir}@" l2h-wrapper-temp > l2h-wrapper
|
|
|
|
|
|
|
|
|
%install
|
|
|
+%__rm -rf $RPM_BUILD_ROOT
|
|
|
+
|
|
|
# fake root directory
|
|
|
-sed -e 's|/usr|'"${RPM_BUILD_ROOT}"'/usr|' \
|
|
|
- -e 's|bin/latex|bin/platex|' cfgcache.pm > cfgcache.pm.new
|
|
|
-mv cfgcache.pm.new cfgcache.pm
|
|
|
-mkdir -p $RPM_BUILD_ROOT%{_datadir}/texmf/tex/latex/html
|
|
|
-make install
|
|
|
+%__sed -e 's|/usr|'"${RPM_BUILD_ROOT}"'/usr|' \
|
|
|
+ -e 's|bin/latex|bin/platex|' cfgcache.pm > cfgcache.pm.new || exit 1
|
|
|
+%__mv cfgcache.pm.new cfgcache.pm || exit 1
|
|
|
+%__mkdir_p $RPM_BUILD_ROOT%{_datadir}/texmf/tex/latex/html || exit 1
|
|
|
+%__make install
|
|
|
|
|
|
(cd %{buildroot}
|
|
|
-perl -pi -e 's@iso-8859-1@euc-jp@g' %{_bindir}/latex2html
|
|
|
+%__perl -pi -e 's@iso-8859-1@euc-jp@g' %{_bindir}/latex2html || exit 1
|
|
|
for i in `grep -ir -l %{buildroot} *`;
|
|
|
do
|
|
|
- perl -pi -e "s@%{buildroot}@@g" $i
|
|
|
- chmod 755 $i
|
|
|
+ %__perl -pi -e "s@%{buildroot}@@g" $i || exit 1
|
|
|
+ %__chmod 755 $i
|
|
|
done
|
|
|
for i in `grep -ir -l %{_builddir} *`;
|
|
|
do
|
|
|
- perl -pi -e "s@%{_builddir}@@g" $i
|
|
|
- chmod 755 $i
|
|
|
+ %__perl -pi -e "s@%{_builddir}@@g" $i || exit 1
|
|
|
+ %__chmod 755 $i
|
|
|
done
|
|
|
)
|
|
|
|
|
|
# fix perl path in a few places:
|
|
|
+%__perl -pi -e 's#/usr/local/bin/perl#%{__perl}#' $RPM_BUILD_ROOT%{ownlibdir}/cweb2html/cweb2html || exit 1
|
|
|
+%__perl -pi -e 's#/usr/local/bin/perl#%{__perl}#' $RPM_BUILD_ROOT%{ownlibdir}/makeseg/makeseg || exit 1
|
|
|
+%__perl -pi -e 's#/usr/local/bin/perl#%{__perl}#' $RPM_BUILD_ROOT%{ownlibdir}/makemap || exit 1
|
|
|
|
|
|
-perl -pi -e 's#/usr/local/bin/perl#%{__perl}#' $RPM_BUILD_ROOT%{ownlibdir}/cweb2html/cweb2html
|
|
|
-perl -pi -e 's#/usr/local/bin/perl#%{__perl}#' $RPM_BUILD_ROOT%{ownlibdir}/makeseg/makeseg
|
|
|
-perl -pi -e 's#/usr/local/bin/perl#%{__perl}#' $RPM_BUILD_ROOT%{ownlibdir}/makemap
|
|
|
-
|
|
|
-perl -pi -e "s#$RPM_BUILD_DIR/%{name}-%{version}#%{_libdir}/%{name}#" $RPM_BUILD_ROOT%{ownlibdir}/cfgcache.pm
|
|
|
+%__perl -pi -e "s#$RPM_BUILD_DIR/%{pkgname}-%{version}#%{ownlibdir}#" $RPM_BUILD_ROOT%{ownlibdir}/cfgcache.pm || exit 1
|
|
|
|
|
|
(cd $RPM_BUILD_ROOT%{_datadir}/texmf/tex/latex/html
|
|
|
-rm -f floatflt.ins latin9.def url.sty
|
|
|
+%__rm -f floatflt.ins latin9.def url.sty
|
|
|
)
|
|
|
|
|
|
(cd docs
|
|
|
-rm -f changebar.sty
|
|
|
-export TEXINPUTS=:.:../texinputs
|
|
|
-
|
|
|
-## article.cls don't provide \address.
|
|
|
-sed -i -e 's/\\author{\(.*\)}/\\author{\1/' -e 's!\\address{!\\\\hoge!' manual.tex
|
|
|
-# platex manual
|
|
|
-# platex manual
|
|
|
-# platex manual
|
|
|
-make clean
|
|
|
-make LATEX=platex manual.dvi
|
|
|
-dvipdfm manual.dvi)
|
|
|
+ # ## changebar.sty: provided by texlive-collection-latexextra
|
|
|
+ # %__rm -f changebar.sty
|
|
|
+ export TEXINPUTS=:.:../texinputs
|
|
|
+
|
|
|
+ ## article.cls don't provide \address.
|
|
|
+ %__sed -i -e 's/\\author{\(.*\)}/\\author{\1/' -e 's!\\address{!\\\\hoge!' manual.tex || exit 1
|
|
|
+ %__make clean
|
|
|
+ %__make LATEX=platex manual.dvi
|
|
|
+ dvipdfmx manual.dvi || exit 1
|
|
|
+)
|
|
|
|
|
|
#### l2h wrapper install
|
|
|
-cp l2hconf_{gif,png}_{ja,en}.pm $RPM_BUILD_ROOT%{ownlibdir}
|
|
|
-install -c -m 0755 l2h-wrapper $RPM_BUILD_ROOT%{_bindir}/l2h
|
|
|
+%__cp l2hconf_{gif,png}_{ja,en}.pm $RPM_BUILD_ROOT%{ownlibdir} || exit 1
|
|
|
+%__install -c -m 0755 l2h-wrapper $RPM_BUILD_ROOT%{_bindir}/l2h || exit 1
|
|
|
|
|
|
## NO use perl(Win32), which is required by perl(L2hos::Win32)
|
|
|
-sed -i -e 's/use Win32;/## RPM requires perl(Win32)\n# use Win32;/' \
|
|
|
- $RPM_BUILD_ROOT%{ownlibdir}/L2hos/Win32.pm
|
|
|
+%__rm -f $RPM_BUILD_ROOT%{ownlibdir}/L2hos/Win32.pm
|
|
|
|
|
|
%post
|
|
|
%{exec_texhash}
|
|
@@ -155,7 +180,7 @@ exit 0
|
|
|
|
|
|
|
|
|
%clean
|
|
|
-rm -rf $RPM_BUILD_ROOT
|
|
|
+%__rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
%files
|
|
|
%defattr(-,root,root)
|
|
@@ -163,12 +188,24 @@ rm -rf $RPM_BUILD_ROOT
|
|
|
%doc docs/ example/ tests/
|
|
|
%doc dot.latex2html-init
|
|
|
%{_bindir}/*
|
|
|
-%{_libdir}/%{name}
|
|
|
+%{ownlibdir}
|
|
|
%{_datadir}/texmf/tex/latex/html/
|
|
|
|
|
|
%changelog
|
|
|
+* Sun Jan 29 2012 Munehiro Yamamoto <munepi@vinelinux.org> 2002-9
|
|
|
+- Requires, BuildRequires: s/texlive/texlive-common/ (for vl6 or higher)
|
|
|
+
|
|
|
+* Thu Aug 12 2010 Munehiro Yamamoto <munepi@vinelinux.org> 2002-8
|
|
|
+- TeX Live 2009
|
|
|
+- used rpm macros for some commands
|
|
|
+- defined %%pkgname to latex2html
|
|
|
+- changed %%ownlibdir to %%{_prefix}/lib/%%{pkgname}
|
|
|
+- added configure options:
|
|
|
+ --with-dvips=%%{_bindir}/pdvips \
|
|
|
+ --with-latex=%%{_bindir}/platex \
|
|
|
+
|
|
|
* Sun Mar 29 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 2002-7
|
|
|
-- comment out "use Win32;" in %{ownlibdir}/L2hos/Win32.pm
|
|
|
+- comment out "use Win32;" in %%{ownlibdir}/L2hos/Win32.pm
|
|
|
|
|
|
* Sun Mar 29 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 2002-6
|
|
|
- applied new versioning policy
|