michihide's blog

技術メモおよび雑感

Sambaドキュメント翻訳環境

経緯

Samba Document 翻訳の際、xml レベルの文法チェックのために必要な環境を構築した
時のメモです。例によって環境は Cent OS 5.x です。標準の CentOS-Base.repoの
範囲で入るものについては言及していません。
m-hotta@gaia:~/rpm/BUILD/samba-3.4.3/docs-xml$ ./configure
(前略)
Summary:
                          • -
Building the LaTeX versions requires : inkscape makeindex Building the PDF versions requires : inkscape pdflatex epstopdf thumbpdf inkscape makeindex Building the PostScript versions requires : inkscape pngtopnm pnmtops latex dvips inkscape makeindex Building the HTML versions requires : inkscape Building the HTML Help versions requires : inkscape Building the pearson-compatible XML requires : inkscape Building the plucker versions requires : inkscape plucker-build inkscape Building the PDF versions thru FO requires : inkscape fop Building the TexInfo versions requires : docbook2x-texi Building the TexInfo Info versions requires : makeinfo Building the list of undocumented options requires : SAMBASOURCEDIR Building the text versions requires : html2text inkscape You will be able to build: htmlman3 manpages3 configure: creating ./config.status config.status: creating Makefile.settings config.status: creating build/catalog.xml この環境では manpages までしかビルドできないようです。

rpmforge からパッケージを持ってこれるようにする

RPMforgeリポジトリ導入(RPMforge)の手順にしたがって rpmforge-release 
パッケージを導入します。rpmforge.repo では enabled=0 になっているので、
rpmforge のパッケージを指定するには yum コマンドで --enablerepo=rpmforge 
オプションが必要です。

必要なツールを導入

# yum --enablerepo=rpmforge install inkscape
(これはうまくインストールできました)
# yum --enablerepo=rpmforge install docbook2x-texi
517 packages excluded due to repository priority protections
これ以外のパッケージについても、ことごとくこのメッセージ。
さすがに 517 個も入れ替えると、もはやそれは Cent OS とは呼べないかも?
m-hotta@gaia:~/rpm/BUILD/samba-3.4.3/docs-xml$ ./configure
Summary:
                          • -
Building the LaTeX versions requires : makeindex Building the PDF versions requires : pdflatex epstopdf thumbpdf makeindex Building the PostScript versions requires : pngtopnm pnmtops latex dvips makeindex Building the plucker versions requires : plucker-build Building the PDF versions thru FO requires : fop Building the TexInfo versions requires : docbook2x-texi Building the TexInfo Info versions requires : makeinfo Building the list of undocumented options requires : SAMBASOURCEDIR Building the text versions requires : html2text You will be able to build: html htmlhelp htmlman3 manpages3 pearson configure: creating ./config.status config.status: creating Makefile.settings config.status: creating build/catalog.xml html まではビルドできるようになったみたいなので、とりあえずこれで妥協。

XML Catalog のチューニング

これだけでもとりあえず動きはしますが、ビルド中に個々のコマンドがインターネット上の
大量のファイルを参照しますので、遅くて使い物になりません。これらのファイルをローカルに
キャッシュするようにします。詳細は docs-xml/README の中の
 Help! Building the docs generates a lot of HTTP traffic...というところに書いてあります。
$ wget -m -np http://docbook.sourceforge.net/release/xsl/current/
$ wget -m -nd http://www.samba.org/samba/DTD/passdb
$ wget -m -nd http://www.samba.org/samba/DTD/samba-doc
$ wget -m -nd http://www.samba.org/samba/DTD/samba.entities
$ ls
docbook.sourceforge.net www.samba.org 
これらのディレクトリを /etc/xml/catalog で指定します。
# vi /etc/xml/catalog
(以下の行を挿入)
  <rewriteURI uriStartString="http://docbook.sourceforge.net/release/xsl/current/"
    rewritePrefix="/home/m-hotta/docbook.sourceforge.net/release/xsl/current/"/>
  <rewriteURI uriStartString="http://www.samba.org/samba/DTD"
    rewritePrefix="file:///home/m-hotta/www.samba.org/samba/DTD"/>

確認

m-hotta@gaia:~/rpm/BUILD/samba-3.4.3/docs-xml$ make html
inkscape -z -f Samba3-ByExample/images/Charity-Network.svg --export-png=Samba3-ByExample/images/Charity-Network.png

(inkscape:16233): Gdk-CRITICAL **: gdk_display_list_devices: assertion `GDK_IS_DISPLAY (display)' failed
Background RRGGBBAA: ffffff00
Area 0:0:420.945:336.083 exported to 421 x 336 pixels (90 dpi)
Bitmap saved as: Samba3-ByExample/images/Charity-Network.png
png ファイルを作る際にエラーが出ますが、これはX 環境でないからだろうと勝手に判断して無視
(中略)
Writing output/htmldocs/Samba3-HOWTO/install.html for chapter(install)
(中略)
cp htmldocs.html output/htmldocs/index.html
こんなメッセージが出ているので、少なくとも xml のパースだけは通っているんでしょう。
文法チェックだけならこれでOKそう。