Package doc-gnu-ru: Specfile
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | %define LANG ru %define longLANG Russian %define formathtml HTML %define formatpdf PDF Name: doc-gnu-%LANG Version: 1.0 Release: alt2.qa4 Packager: Repocop Q. A. Robot <repocop@altlinux.org> 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 Url: http://www.gnu.org.ru/ License: GPL BuildArch: noarch BuildRequires: texi2html 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-\xe4\xcf\xcb\xd5\xcd\xc5\xce\xd4\xc1\xc3\xc9\xd1' '<meta http-equiv="Content-Type" content="text/html; charset=koi8-r">' 'doc-gnu-ru-philosophy' '\xe6\xc9\xcc\xcf\xd3\xcf\xc6\xc9\xd1' 'doc-gnu-ru-manuals' '\xf2\xd5\xcb\xcf\xd7\xcf\xc4\xd3\xd4\xd7\xc1' mv -f index.html $htmlbase install -m 644 gnu-head-sm.jpg $htmlbase/gnu-head-sm.jpg popd; unset rootdir mkdir -p %buildroot%_desktopdir cat > %buildroot%_desktopdir/%{name}.desktop <<EOF [Desktop Entry] Version=1.0 Type=Application Name=GNU Documentation Comment=Manuals and other non-technical ducuments (html format, in Russian) from GNU Project Icon=howto Exec=url_handler.sh /usr/share/doc/doc-gnu-ru/HTML/index.html Categories=Development;Documentation; EOF %files -n %name-html %_docdir/%name/%formathtml %_desktopdir/%{name}.desktop %changelog * Sun Apr 10 2011 Igor Vlasenko <viy@altlinux.ru> 1.0-alt2.qa4 - NMU: second cleanup of .desktop files * Tue Mar 29 2011 Igor Vlasenko <viy@altlinux.ru> 1.0-alt2.qa3 - NMU: converted debian menu to freedesktop * Wed Nov 04 2009 Igor Vlasenko <viy@altlinux.ru> 1.0-alt2.qa2 - NMU (by repocop): the following fixes applied: * update_menus for doc-gnu-ru-html * Thu Apr 10 2008 Igor Vlasenko <viy@altlinux.ru> 1.0-alt2.qa1 - NMU (by repocop): the following fixes applied: * update_menus for doc-gnu-ru-html * Mon Nov 11 2002 Stanislav Ievlev <inger@altlinux.ru> 1.0-alt2 - rebuild * Fri Mar 29 2002 Maxim Dzumanenko <mvd@altlinux.ru> 1.0-alt1 - first version |