%define LANG ru %define longLANG Russian %define formathtml HTML/%LANG %define formatpdf PDF/%LANG Name: howto-%LANG Version: 1.1 Release: alt2 Summary: HOWTO documents in %longLANG from the Linux Documentation Project Group: Books/Howtos Source0: %name-src.tar.bz2 Source1: howto-html-%{LANG}_menuentries Source2: howto-ru-src.patch #Patch1: $name-src.patch Url: http://www.linuxdoc.org/docs.html#howto Copyright: GPL BuildArchitectures: noarch BuildRequires: howto-utils >= 0.2.3-alt3, sgmltools-lite, sgml-tools, sed, grep, perl-base Obsoletes: ldp, howto-html Requires: howto-utils, howto-icons AutoReq: no %package -n howto-html-%LANG Summary: HOWTO documents (html format, in %longLANG) from the Linux Documentation Project Group: Books/Howtos %description Linux HOWTOs are detailed documents which describe a specific aspect of configuring or using Linux. Linux HOWTOs are a great source of practical information about your system. The latest versions of these documents are located at http://www.linuxdoc.org/docs.html#howto In this package, you can find HOWTOs written in %longLANG. This is probably not the most full collection of them (as comapred to other languages) and some howtos may be outdated, so you may wish to install English HOWTOs from howto-html-en package. %description -n howto-html-%LANG Linux HOWTOs are detailed documents which describe a specific aspect of configuring or using Linux. Linux HOWTOs are a great source of practical information about your system. The latest versions of these documents are located at http://www.linuxdoc.org/docs.html#howto In this package, you can find HOWTOs written in %longLANG. This is probably not the most full collection of them (as comapred to other languages) and some howtos may be outdated, so you may wish to install English HOWTOs from howto-html-en package. %prep #rootdir=$RPM_BUILD_ROOT #mkdir -p $rootdir #pushd $rootdir #bzcat %SOURCE0 | tar xv #%patch1 -p0 #popd %install rootdir=$RPM_BUILD_ROOT mkdir -p $rootdir pushd $rootdir bzcat %SOURCE0 | tar xv cat %SOURCE2| patch -p0 htmlbase=$rootdir%_docdir/HOWTO/%formathtml pdfbase=$rootdir%_docdir/HOWTO/%formatpdf mkdir -p $htmlbase #process SGML for srcfile in `find howtosrc -name \*.sgml`; do dstdir=`echo $srcfile | sed -e "s/\.sgml//" | sed -e "s/howtosrc\///"` howtoname=`echo $dstdir| sed -e "s/[^\/]*\///"` mkdir -p $htmlbase/$dstdir if [ `cat $srcfile | grep -i "<\!doctype linuxdoc"` = ]; then #docbook sgmltools -b html $srcfile sdir=`echo $srcfile | sed -e "s/\.sgml]*//"` cp $sdir/* $htmlbase/$dstdir else # linuxdoc pushd $htmlbase/$dstdir sgml2html $rootdir/$srcfile ln -s $howtoname.html index.html popd fi done; #unpack HTMLs for srcfile in `find howtosrc -name \*.tar`; do subdir=`echo $srcfile| sed -e "s/howtosrc//"|sed -e "s/\/[^\/]*$//"` pushd $htmlbase$subdir tar xf $rootdir/$srcfile popd done #insert meta for htmlfile in `find $htmlbase -type f -name \*.html`; do perl -p -i -e '$/=">"; s/
//i' $htmlfile done #make index cd howtosrc rm -f index.html makehowtoindex2 %longLANG '' mv -f index.html $htmlbase popd; unset rootdir install -m 755 -d $RPM_BUILD_ROOT%_menudir install -m 644 %SOURCE1 $RPM_BUILD_ROOT%_menudir/howto-html-%LANG %files -n howto-html-%LANG %_docdir/HOWTO/%formathtml %_menudir/* %post %update_menus %postun %clean_menus %changelog * Sun Mar 17 2002 Maxim Dzumanenko