ALT Linux repositórios
Group :: Livros/Computadores
RPM: doc-gnu-ru
Main Changelog Spec Patches Sources Download Gear Bugs e FR Repocop
%define LANG ru
%define longLANG Russian
%define formathtml HTML
%define formatpdf PDF
Name: doc-gnu-%LANG
Version: 1.0
Release: alt2
Packager: Maxim Dzumanenko <mvd at altlinux.ru>
Summary: Manuals and other non-technical ducuments in %longLANG from GNU Project
Group: Books/Computer books
Source0: %name-philosophy.tar.bz2
Source1: %name-manuals.tar.bz2
Source2: %name-extra.tar.bz2
Source3: %{name}_menuentries
Url: http://www.gnu.org.ru/
License: GPL
BuildArchitectures: noarch
BuildRequires: tetex sed, grep, perl-base
AutoReq: no
%package -n %name-html
Summary: Manuals and other non-technical ducuments (html format, in %longLANG) from GNU Project
Group: Books/Howtos
%description
GNU manuals are documents which describe tools from GNU Project.
The latest versions of these documents are located
at http://www.gnu.org.ru/
In this package, you can find GNU documents written in %longLANG. This is probably
not the most full collection of them (as comapred to other languages) and
some of them may be outdated, so you may wish to visit GNU site
http://www.gnu.org/doc/doc.html
%description -n %name-html
GNU manuals are documents which describe tools from GNU Project.
The latest versions of these documents are located
at http://www.gnu.org.ru/
In this package, you can find GNU documents written in %longLANG. This is probably
not the most full collection of them (as comapred to other languages) and
some of them may be outdated, so you may wish to visit GNU site
http://www.gnu.org/doc/doc.html
%prep
%install
#config
srcenc=koi8-r
dstenc=koi8-r
insertmeta_koi8=1 # 1-true 0-false
insertmeta_1251=0
#process
rootdir=$RPM_BUILD_ROOT
mkdir -p $rootdir
pushd $rootdir
bzcat %SOURCE0 | tar xv
bzcat %SOURCE1 | tar xv
bzcat %SOURCE2 | tar xv
htmlbase=$rootdir%_docdir/%name/%formathtml
pdfbase=$rootdir%_docdir/%name/%formatpdf
mkdir -p $htmlbase
#process manuals
#process texi
for srcdir in `find doc-gnu-ru-manuals/* -type d` ; do
docname=`basename $srcdir`
texifile=$srcdir/$docname.texi
[ -f $texifile ] || texifile=$texifile"nfo";
mkdir -p $htmlbase/$docname
pushd $htmlbase/$docname
echo ----------------------------------- $texifile _________________________
texi2html $rootdir/$texifile
ln -s $docname.html index.html
popd
done
#convert texinfo*.html's to koi8-r
for htmlfile in `find $htmlbase/texinfo -type f -name \*.htm*`; do
iconv -f iso-8859-5 -t koi8-r $htmlfile > $htmlfile.new
mv -f $htmlfile.new $htmlfile
done
#process tarred htmls
for srcfile in `find doc-gnu-ru-manuals -name \*.tar`; do
subdir=`echo $srcfile| sed -e "s/doc-gnu-ru-manuals//"|sed -e "s/\/[^\/]*$//"`
pushd $htmlbase$subdir
tar xf $rootdir/$srcfile
popd
done
#insert meta
for htmlfile in `find $htmlbase -type f -name \*.htm*`; do
if [ $insertmeta_koi8 == 1 ]; then
perl -p -i -e '$/=">"; s/<HEAD(\n)*>/<HEAD><meta content="text\/html; charset=KOI8-R" http-equiv="Content-Type">/i' $htmlfile
fi
if [ $insertmeta_1251 == 1 ]; then
perl -p -i -e '$/=">"; s/<HEAD(\n)*>/<HEAD><meta content="text\/html; charset=Windows-1251" http-equiv="Content-Type">/i' $htmlfile
fi
if [ $srcenc != $dstenc ]; then
iconv -f $srcenc -t $dstenc $htmlfile > $htmlfile.new
mv -f $htmlfile.new $htmlfile
fi
done
#process philosophy
#process tarred htmls
for srcfile in `find doc-gnu-ru-philosophy -name \*.tar`; do
subdir=`echo $srcfile| sed -e "s/doc-gnu-ru-philosophy//"|sed -e "s/\/[^\/]*$//"`
pushd $htmlbase$subdir
tar xf $rootdir/$srcfile
popd
done
#make index
./makedirindex 'GNU-äÏËÕÍÅÎÔÁÃÉÑ' '<meta http-equiv="Content-Type" content="text/html; charset=koi8-r">' 'doc-gnu-ru-philosophy' 'æÉÌÏÓÏÆÉÑ' 'doc-gnu-ru-manuals' 'òÕËÏ×ÏÄÓÔ×Á'
mv -f index.html $htmlbase
install -m 644 gnu-head-sm.jpg $htmlbase/gnu-head-sm.jpg
popd;
install -m 755 -d $RPM_BUILD_ROOT%_menudir
install -m 644 %SOURCE3 $RPM_BUILD_ROOT%_menudir/%name
unset rootdir
%files -n %name-html
%_docdir/%name/%formathtml
%_menudir/*
%post
%update_menus
%postun
%clean_menus
%changelog
…
Todas as alterações você pod ver aqui
%define longLANG Russian
%define formathtml HTML
%define formatpdf PDF
Name: doc-gnu-%LANG
Version: 1.0
Release: alt2
Packager: Maxim Dzumanenko <mvd at altlinux.ru>
Summary: Manuals and other non-technical ducuments in %longLANG from GNU Project
Group: Books/Computer books
Source0: %name-philosophy.tar.bz2
Source1: %name-manuals.tar.bz2
Source2: %name-extra.tar.bz2
Source3: %{name}_menuentries
Url: http://www.gnu.org.ru/
License: GPL
BuildArchitectures: noarch
BuildRequires: tetex sed, grep, perl-base
AutoReq: no
%package -n %name-html
Summary: Manuals and other non-technical ducuments (html format, in %longLANG) from GNU Project
Group: Books/Howtos
%description
GNU manuals are documents which describe tools from GNU Project.
The latest versions of these documents are located
at http://www.gnu.org.ru/
In this package, you can find GNU documents written in %longLANG. This is probably
not the most full collection of them (as comapred to other languages) and
some of them may be outdated, so you may wish to visit GNU site
http://www.gnu.org/doc/doc.html
%description -n %name-html
GNU manuals are documents which describe tools from GNU Project.
The latest versions of these documents are located
at http://www.gnu.org.ru/
In this package, you can find GNU documents written in %longLANG. This is probably
not the most full collection of them (as comapred to other languages) and
some of them may be outdated, so you may wish to visit GNU site
http://www.gnu.org/doc/doc.html
%prep
%install
#config
srcenc=koi8-r
dstenc=koi8-r
insertmeta_koi8=1 # 1-true 0-false
insertmeta_1251=0
#process
rootdir=$RPM_BUILD_ROOT
mkdir -p $rootdir
pushd $rootdir
bzcat %SOURCE0 | tar xv
bzcat %SOURCE1 | tar xv
bzcat %SOURCE2 | tar xv
htmlbase=$rootdir%_docdir/%name/%formathtml
pdfbase=$rootdir%_docdir/%name/%formatpdf
mkdir -p $htmlbase
#process manuals
#process texi
for srcdir in `find doc-gnu-ru-manuals/* -type d` ; do
docname=`basename $srcdir`
texifile=$srcdir/$docname.texi
[ -f $texifile ] || texifile=$texifile"nfo";
mkdir -p $htmlbase/$docname
pushd $htmlbase/$docname
echo ----------------------------------- $texifile _________________________
texi2html $rootdir/$texifile
ln -s $docname.html index.html
popd
done
#convert texinfo*.html's to koi8-r
for htmlfile in `find $htmlbase/texinfo -type f -name \*.htm*`; do
iconv -f iso-8859-5 -t koi8-r $htmlfile > $htmlfile.new
mv -f $htmlfile.new $htmlfile
done
#process tarred htmls
for srcfile in `find doc-gnu-ru-manuals -name \*.tar`; do
subdir=`echo $srcfile| sed -e "s/doc-gnu-ru-manuals//"|sed -e "s/\/[^\/]*$//"`
pushd $htmlbase$subdir
tar xf $rootdir/$srcfile
popd
done
#insert meta
for htmlfile in `find $htmlbase -type f -name \*.htm*`; do
if [ $insertmeta_koi8 == 1 ]; then
perl -p -i -e '$/=">"; s/<HEAD(\n)*>/<HEAD><meta content="text\/html; charset=KOI8-R" http-equiv="Content-Type">/i' $htmlfile
fi
if [ $insertmeta_1251 == 1 ]; then
perl -p -i -e '$/=">"; s/<HEAD(\n)*>/<HEAD><meta content="text\/html; charset=Windows-1251" http-equiv="Content-Type">/i' $htmlfile
fi
if [ $srcenc != $dstenc ]; then
iconv -f $srcenc -t $dstenc $htmlfile > $htmlfile.new
mv -f $htmlfile.new $htmlfile
fi
done
#process philosophy
#process tarred htmls
for srcfile in `find doc-gnu-ru-philosophy -name \*.tar`; do
subdir=`echo $srcfile| sed -e "s/doc-gnu-ru-philosophy//"|sed -e "s/\/[^\/]*$//"`
pushd $htmlbase$subdir
tar xf $rootdir/$srcfile
popd
done
#make index
./makedirindex 'GNU-äÏËÕÍÅÎÔÁÃÉÑ' '<meta http-equiv="Content-Type" content="text/html; charset=koi8-r">' 'doc-gnu-ru-philosophy' 'æÉÌÏÓÏÆÉÑ' 'doc-gnu-ru-manuals' 'òÕËÏ×ÏÄÓÔ×Á'
mv -f index.html $htmlbase
install -m 644 gnu-head-sm.jpg $htmlbase/gnu-head-sm.jpg
popd;
install -m 755 -d $RPM_BUILD_ROOT%_menudir
install -m 644 %SOURCE3 $RPM_BUILD_ROOT%_menudir/%name
unset rootdir
%files -n %name-html
%_docdir/%name/%formathtml
%_menudir/*
%post
%update_menus
%postun
%clean_menus
%changelog
…
Todas as alterações você pod ver aqui