Solarisにzphoto
はじめに_
フォトアルバムを作成するためのソフトウェアzphotoをSolaris 10にインストールするためのメモ
インストールすべきソフトウェア_
- zphoto: Flashベースのフォトアルバムを作るツールによれば
- ming 0.2a 以上
- Imlib2 (ダウンロード) または ImageMagick
Imlib2 1.1.0 と ImageMagick 5.5.7 で動作確認をしています。 Imlib2 の方が約10倍高速です。
- popt 1.6.3以上
- zip (zip ファイルを作る場合にのみ必要)
mingのインストール_
インストール記録_
あらかじめ次のものがインストールされている必要がある。
- gcc
- automake
- autoconf
- m4
- flex
- bison
- cvs
- libpng
- libungif
2007年8月24日時点では、ダウンロードできる0.3.0、0.4.0betaはSolaris 10にインストールできなかった。cvsからソースコードを取ってきてインストールする。
MingCVSのページに書いてあるとおりにCVSを用いてソースコードをダウンロードする
% cvs -d:pserver:anonymous@ming.cvs.sourceforge.net:/cvsroot/ming login % cvs -z3 -d:pserver:anonymous@ming.cvs.sourceforge.net:/cvsroot/ming co
パスワードの入力が求められるが空行をで大丈夫。
次にconfigureファイルを作成する。
% cd ming % sh autogen.sh % ./configure |& tee config.log % gmake |& tee make.log
ここからは、言語ごとに操作が違う。今回はとりあえずC, C++用のライブラリとした。
% sudo gmake install
あとは、LD_LIBRARY_PATHにパスを通しておく。
試行錯誤の記録_
0.3.0は、普通にSolaris 10付属の/usr/sfw/gmakeでコンパイルしてもldでリンクができないというエラーがでる。ここのエラーと一緒。cl.pocari.org - Ming のインストール。
これは、Makefile.configで設定されているCFLAGSを変更することで回避できる。
CFLAGS = -g -O2
となっているので
CFLAGS = -g -O2 -Wall -fPIC
とする(-gフラグはいらないと思うが)
このエラーが回避できても、以下のエラーが出てしまう(GNU makeの最新版3.81を使ってもだめ)
〜前略〜 gmake[2]: Leaving directory `/home/gotoh/workspace/ming-0.3.0/src' (cd util && make) make: Fatal error in reader: Makefile, line 7: Badly formed macro assignment Current working directory /home/gotoh/workspace/ming-0.3.0/util gmake[1]: *** [utils] Error 1 gmake[1]: Leaving directory `/home/gotoh/workspace/ming-0.3.0' gmake: *** [all] Error 2
このあと、強引にgmake installをしようとしても/usr/sbin/installではダメで、coreutilsをインストールしてGNU installを使う必要がある。それでも、上のエラーでインストール失敗するけど。
上記のエラーはutil/Makefileの以下の行をコメントアウトすると回避できる。
#PAGER ?= less
次のエラーはこれ。このエラーは0.4.0betaを使うことで回避できる。
(cd util && make) make[2]: Entering directory `/home/gotoh/workspace/ming-0.3.0/util' gcc -g -O2 -fPIC -Wall -Wall -I. -I.. -I../src -L.. -lming -lz -lm -DNODECOMPILE action.o blocktypes.o decompile.o main.o parser.o read.o outputtxt.c -o listswf Undefined first referenced symbol in file vasprintf decompile.o ld: fatal: Symbol referencing errors. No output written to listswf collect2: ld returned 1 exit status *** Error code 1 make: Fatal error: Command failed for target `listswf' Current working directory /home/gotoh/workspace/ming-0.3.0/util gmake[1]: *** [utils] Error 1 gmake[1]: Leaving directory `/home/gotoh/workspace/ming-0.3.0' gmake: *** [all] Error 2
以下のようなエラーがでた場合は、zlib.hが二つ以上あるため。一つにすること。
/usr/local/include/zlib.h:84: error: redefinition of `struct z_stream_s' /usr/local/include/zlib.h:981: error: conflicting types for 'gzwrite' /usr/include/zlib.h:704: error: previous declaration of 'gzwrite' was here /usr/local/include/zlib.h:981: error: conflicting types for 'gzwrite' /usr/include/zlib.h:704: error: previous declaration of 'gzwrite' was here /usr/local/include/zlib.h:1189: error: redefinition of `struct internal_state
この後もやっぱりエラーででてmakeができないので断念。
Imlib2のインストール_
- 配布元
- [http://www.enlightenment.org/p.php?p=index&l=en Enlightenment]:「Download」から取得できる
インストールするためには以下が必要とのこと。
- libjpeg http://www.ijg.org/
- libpng http://www.libpng.org/pub/png/libpng.html
- freetype 2.1.x http://www.freetype.org/
freetypeはあらかじめ入れておいた記憶がないので、Solarisが標準装備しているのではないかと思う。
% gtar xvfz imlib2-1.4.0.tar.gz % cd imlib2-**** % ./configure |& tee config.log % gmake |& tee make.log % gmake check % sudo gmake install
poptのインストール_
先に
- GNU gettext
- iconv
を入れておく必要がある。
% gtar xvfz popt-***.tar.gz % cd popt-*** % ./configure |& tee config.log % gmake |& tee make.log % gmake check % sudo gmake install
zphotoのインストール_
% gtar xvfz zphoto-***.tar.gz % cd zphoto-*** % ./configure |& tee config.log % gmake |& tee make.log % gmake check % sudo gmake install
使い方_
以下を読むこと。
以下、覚書。まず、基本設定ファイルを作成する。
% zphoto --dump-config > ~/.zphotorc
そして、それを編集する。
HTMLのファイルの形式を変える場合には /usr/local/share/zphoto/templates/default/en 以下にあるファイルを編集する。
画像ファイルがあるディレクトリがpictであり、作成したいディレクトリがsampleの場合は以下のようにコマンドをうつ
% zphoto -o sample --title 'Title' pict/*.jpg
各画像にキャプション(タイトル)をつけたい場合には以下の書式でファイルを作成する。
foo.jpg <TAB> caption for foo bar.jpg <TAB> caption for bar
そして、キャプションを読み込ませる。
% zphoto -o sample --title 'Title' --caption-file caption.txt pict/*.jpg