Você não pode selecionar mais de 25 tópicos
Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
176 linhas
6.5 KiB
176 linhas
6.5 KiB
## |
|
## html2latex.spec -- OpenPKG RPM Specification |
|
## Copyright (c) 2000-2001 Cable & Wireless Deutschland GmbH |
|
## Copyright (c) 2000-2001 The OpenPKG Project <http://www.openpkg.org/> |
|
## Copyright (c) 2000-2001 Ralf S. Engelschall <rse@engelschall.com> |
|
## |
|
## Permission to use, copy, modify, and distribute this software for |
|
## any purpose with or without fee is hereby granted, provided that |
|
## the above copyright notice and this permission notice appear in all |
|
## copies. |
|
## |
|
## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
|
## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
|
## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
|
## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR |
|
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
|
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
|
## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
|
## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
|
## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
|
## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
|
## SUCH DAMAGE. |
|
## |
|
|
|
%define V_html2latex 1.1 |
|
%define V_html_parser 3.25 |
|
%define V_html_tagset 3.03 |
|
%define V_html_tree 3.11 |
|
%define V_xml_parser 2.30 |
|
%define V_xml_simple 1.05 |
|
%define V_expat 1.95.1 |
|
|
|
# package information |
|
Name: html2latex |
|
Summary: HTML to LaTeX Conversion Tool |
|
URL: http://html2latex.sourceforge.net/ |
|
Vendor: Peter Thatcher |
|
Packager: The OpenPKG Project |
|
Distribution: OpenPKG [REL] |
|
Group: Converter |
|
License: GPL |
|
Version: %{V_html2latex} |
|
Release: 20011201 |
|
|
|
# list of sources |
|
Source0: http://prdownloads.sourceforge.net/html2latex/html2latex-%{V_html2latex}.tar.gz |
|
Source1: http://www.cpan.org/modules/by-module/HTML/HTML-Parser-%{V_html_parser}.tar.gz |
|
Source2: http://www.cpan.org/modules/by-module/HTML/HTML-Tagset-%{V_html_tagset}.tar.gz |
|
Source3: http://www.cpan.org/modules/by-module/HTML/HTML-Tree-%{V_html_tree}.tar.gz |
|
Source4: http://www.cpan.org/modules/by-module/XML/XML-Parser-%{V_xml_parser}.tar.gz |
|
Source5: http://www.cpan.org/modules/by-module/XML/XML-Simple-%{V_xml_simple}.tar.gz |
|
Source6: http://prdownloads.sourceforge.net/expat/expat-%{V_expat}.tar.gz |
|
|
|
# build information |
|
Prefix: %{l_prefix} |
|
BuildRoot: %{l_buildroot} |
|
BuildPreReq: OpenPKG, openpkg >= 20011126.0, perl |
|
PreReq: OpenPKG, openpkg >= 20011126.0, perl |
|
AutoReq: no |
|
AutoReqProv: no |
|
|
|
%description |
|
HTML2LaTeX is converts a properly formatted HTML file into a properly |
|
formatted LaTeX file. |
|
|
|
%prep |
|
%setup0 -q -c |
|
%setup1 -q -T -D -a 1 |
|
%setup2 -q -T -D -a 2 |
|
%setup3 -q -T -D -a 3 |
|
%setup4 -q -T -D -a 4 |
|
%setup5 -q -T -D -a 5 |
|
%setup6 -q -T -D -a 6 |
|
|
|
%build |
|
|
|
%install |
|
rm -rf $RPM_BUILD_ROOT |
|
|
|
# build Expat XML parser (for XML::Parser) |
|
( cd expat-%{V_expat} |
|
CC="%{l_cc}" \ |
|
CFLAGS="%{l_cflags -O}" \ |
|
./configure \ |
|
--disable-shared |
|
%{l_make} %{l_mflags -O} |
|
) |
|
expatdir=`pwd`/expat-%{V_expat}/lib |
|
|
|
# redirect Perl to temporary root |
|
perllibdir=$RPM_BUILD_ROOT%{l_prefix}/lib/perl5 |
|
%{l_shtool} mkdir -f -p -m 755 $perllibdir |
|
eval `%{l_prefix}/bin/perl -V:version` |
|
eval `%{l_prefix}/bin/perl -V:archname` |
|
perl=$RPM_BUILD_ROOT/perl |
|
echo "#!/bin/sh" >$perl |
|
echo "exec %{l_prefix}/bin/perl \\" >>$perl |
|
echo " -I$perllibdir/$version \\" >>$perl |
|
echo " -I$perllibdir/$version/$archname \\" >>$perl |
|
echo " -I$perllibdir/site_perl \\" >>$perl |
|
echo " -I$perllibdir/site_perl/$version \\" >>$perl |
|
echo " -I$perllibdir/site_perl/$version/$archname \\" >>$perl |
|
echo " \"\$@\"" >>$perl |
|
chmod a+x $perl |
|
|
|
# install the prerequisite modules |
|
for module in \ |
|
XML-Parser-%{V_xml_parser} \ |
|
XML-Simple-%{V_xml_simple} \ |
|
HTML-Tagset-%{V_html_tagset} \ |
|
HTML-Parser-%{V_html_parser} \ |
|
HTML-Tree-%{V_html_tree} \ |
|
html2latex-%{V_html2latex}/HTML; do |
|
( cd $module |
|
$perl Makefile.PL \ |
|
PREFIX=$RPM_BUILD_ROOT%{l_prefix} \ |
|
PERL=$perl FULLPERL=$perl \ |
|
EXPATLIBPATH=$expatdir/.libs \ |
|
EXPATINCPATH=$expatdir |
|
%{l_make} %{l_mflags} PERL=$perl FULLPERL=$perl all |
|
%{l_make} %{l_mflags} PERL=$perl FULLPERL=$perl install |
|
) |
|
done |
|
|
|
# adjust Perl installation tree |
|
( cd $RPM_BUILD_ROOT%{l_prefix}/lib/perl5 |
|
find . -type f -name ".packlist" -print | xargs rm -f |
|
find . -type f -name "perllocal.pod" -print | xargs rm -f |
|
) |
|
%{l_shtool} mkdir -f -p -m 755 \ |
|
$RPM_BUILD_ROOT%{l_prefix}/lib/html2latex |
|
( cd $RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl/$version/ |
|
find . -depth -print | cpio -o ) |\ |
|
( cd $RPM_BUILD_ROOT%{l_prefix}/lib/html2latex; cpio -idvmu ) |
|
rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/html2latex/$archname |
|
( cd $RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl/$version/$archname |
|
find . -depth -print | cpio -o ) |\ |
|
( cd $RPM_BUILD_ROOT%{l_prefix}/lib/html2latex; cpio -idvmu ) |
|
rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/perl5 |
|
rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man3 |
|
|
|
# install driver |
|
( cd html2latex-%{V_html2latex} |
|
%{l_shtool} mkdir -f -p -m 755 \ |
|
$RPM_BUILD_ROOT%{l_prefix}/bin \ |
|
$RPM_BUILD_ROOT%{l_prefix}/man/man1 \ |
|
$RPM_BUILD_ROOT%{l_prefix}/man/man5 |
|
( echo "#!%{l_prefix}/bin/perl -w" |
|
echo "use lib \"%{l_prefix}/lib/html2latex\";" |
|
cat html2latex |
|
) >html2latex.new |
|
%{l_shtool} install -c -m 755 \ |
|
html2latex.new $RPM_BUILD_ROOT%{l_prefix}/bin/html2latex |
|
%{l_shtool} install -c -m 755 \ |
|
html2latex.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/ |
|
%{l_prefix}/bin/pod2man HTML/Latex.pm >html2latex.conf.5 |
|
%{l_shtool} install -c -m 755 \ |
|
html2latex.conf.5 $RPM_BUILD_ROOT%{l_prefix}/man/man5/ |
|
) |
|
|
|
# determine file list |
|
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
|
%{l_files_std} \ |
|
"%not %dir %{l_prefix}/lib/perl5" \ |
|
"%not %dir %{l_prefix}/lib/perl5/$version" \ |
|
"%not %dir %{l_prefix}/lib/perl5/$version/$archname" \ |
|
"%not %dir %{l_prefix}/lib/perl5/site_perl" \ |
|
"%not %dir %{l_prefix}/lib/perl5/site_perl/$version" \ |
|
"%not %dir %{l_prefix}/lib/perl5/site_perl/$version/$archname" |
|
|
|
%files -f files |
|
|
|
%clean |
|
rm -rf $RPM_BUILD_ROOT |
|
|
|
|