cpanでupdateすると以下のメッセージが出て、GDモジュールのアップデートに失敗する。"Could not find gdlib-config in the search path. Please install libgd 2.0.28 or higher. "といわれてインストールに失敗する。
CPAN.pm: Going to build L/LD/LDS/GD-2.46.tar.gz **UNRECOVERABLE ERROR** Could not find gdlib-config in the search path. Please install libgd 2.0.28 or higher. If you want to try to compile anyway, please rerun this script with the option --ignore_missing_gd. Warning: No success on command[/usr/bin/perl Makefile.PL INSTALLDIRS=site] CPAN: YAML loaded ok (v0.73) LDS/GD-2.46.tar.gz /usr/bin/perl Makefile.PL INSTALLDIRS=site -- NOT OK Running make test Make had some problems, won't test Running make install Make had some problems, won't install
まずは以下のように導入済みのパッケージからdb.hを検索してみる。存在しないことがわかる。
# dpkg --search gdlib-config dpkg: *gdlib-config* not found.
未導入のパッケージにgdlib-configが含まれる場合には、webの検索インターフェイスをつかう。複数のパッケージ(libgd2-noxpm-dev, libgd2-xpm-dev)がgdlib-configというファイルを提供することがわかる。2つの違いはXPMをサポートするか否か。ためしにそれぞれのインストールを-sオプションをつけてシュミレーションすると以下。libgd2-noxpm-devの場合はどうやら面倒なことがありそうなので、おとなしくlibgd2-xpm-devを導入することにする。
# aptitude -s install libgd2-noxpm-dev
The following NEW packages will be installed:
libgd2-noxpm{ab} libgd2-noxpm-dev libjpeg62-dev{a}
0 packages upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 774 kB of archives. After unpacking 2,032 kB will be used.
The following packages have unmet dependencies:
libgd2-noxpm: Conflicts: libgd2 which is a virtual package.
Conflicts: libgd2-xpm but 2.0.36~rc1~dfsg-5 is installed.
libgd2-xpm: Conflicts: libgd2 which is a virtual package.
Conflicts: libgd2-noxpm but 2.0.36~rc1~dfsg-5 is to be installed.
The following actions will resolve these dependencies:
Remove the following packages:
1) libdata-random-perl
2) libgd-gd2-perl
3) libgd2-xpm
4) libwww-mechanize-formfiller-perl
5) libwww-mechanize-shell-perl
Accept this solution? [Y/n/q/?] q
Abandoning all efforts to resolve these dependencies.
Abort.
# aptitude -s install libgd2-xpm-dev
The following NEW packages will be installed:
libgd2-xpm-dev libjpeg62-dev{a} libxpm-dev{a}
0 packages upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 649 kB of archives. After unpacking 1,671 kB will be used.
Do you want to continue? [Y/n/?] n
Abort.
ということでlibgd2-xpm-devをインストール。
# aptitude install libgd2-xpm-dev
The following NEW packages will be installed:
libgd2-xpm-dev libjpeg62-dev{a} libxpm-dev{a}
0 packages upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 649 kB of archives. After unpacking 1,671 kB will be used.
Do you want to continue? [Y/n/?] y
Get:1 http://ftp.jp.debian.org/debian/ squeeze/main libxpm-dev i386 1:3.5.8-1 [95.8 kB]
Get:2 http://ftp.jp.debian.org/debian/ squeeze/main libjpeg62-dev i386 6b1-1 [189 kB]
Get:3 http://ftp.jp.debian.org/debian/ squeeze/main libgd2-xpm-dev i386 2.0.36~rc1~dfsg-5 [364 kB]
Fetched 649 kB in 0s (1,756 kB/s)
Selecting previously deselected package libxpm-dev.
(Reading database ... 68719 files and directories currently installed.)
Unpacking libxpm-dev (from .../libxpm-dev_1%3a3.5.8-1_i386.deb) ...
Selecting previously deselected package libjpeg62-dev.
Unpacking libjpeg62-dev (from .../libjpeg62-dev_6b1-1_i386.deb) ...
Selecting previously deselected package libgd2-xpm-dev.
Unpacking libgd2-xpm-dev (from .../libgd2-xpm-dev_2.0.36~rc1~dfsg-5_i386.deb) ...
Processing triggers for man-db ...
Setting up libxpm-dev (1:3.5.8-1) ...
Setting up libjpeg62-dev (6b1-1) ...
Setting up libgd2-xpm-dev (2.0.36~rc1~dfsg-5) ...
この後、再度cpanでupdateを行うと以下のように成功していることが確認できる。
CPAN.pm: Going to build L/LD/LDS/GD-2.46.tar.gz
Configuring for libgd version 2.0.36.
Checking for stray libgd header files...none found.
Included Features: GD_XPM GD_JPEG GD_FONTCONFIG GD_FREETYPE GD_PNG GD_GIF GD_GIFANIM GD_OPENPOLYGON GD_UNCLOSEDPOLY GD_ANIMGIF GD_FTCIRCLE VERSION_33
GD library used from: /usr
Checking if your kit is complete...
Looks good
Writing Makefile for GD
Writing MYMETA.yml and MYMETA.json
/usr/bin/perl GD/Image.pm.PLS GD/Image.pm
Extracting Image.pm (with variable substitutions)
cp GD/Polyline.pm blib/lib/GD/Polyline.pm
cp qd.pl blib/lib/qd.pl
cp GD/Image.pm blib/lib/GD/Image.pm
cp GD.pm blib/lib/GD.pm
AutoSplitting blib/lib/GD.pm (blib/lib/auto/GD)
cp GD/Simple.pm blib/lib/GD/Simple.pm
cp GD/Polygon.pm blib/lib/GD/Polygon.pm
cp GD/Group.pm blib/lib/GD/Group.pm
/usr/bin/perl /usr/local/share/perl/5.10.1/ExtUtils/xsubpp -typemap /usr/share/perl/5.10/ExtUtils/typemap -typemap typemap GD.xs > GD.xsc && mv GD.xsc GD.c
cc -c -I/usr/include -Wformat=0 -O2 -g -DVERSION=\"2.46\" -DXS_VERSION=\"2.46\" -fPIC "-I/usr/lib/perl/5.10/CORE" -DHAVE_JPEG -DHAVE_FT -DHAVE_XPM -DHAVE_GIF -DHAVE_P
NG -DHAVE_ANIMGIF -DVERSION_33 -DHAVE_UNCLOSEDPOLY -DHAVE_FONTCONFIG -DHAVE_FTCIRCLE GD.c
Running Mkbootstrap for GD ()
chmod 644 GD.bs
rm -f blib/arch/auto/GD/GD.so
LD_RUN_PATH="/usr/lib" cc -shared -O2 -g -L/usr/local/lib -fstack-protector GD.o -o blib/arch/auto/GD/GD.so \
-L/usr/lib -L/usr/lib -L/usr/lib64 -L/usr/lib64 -lXpm -lX11 -ljpeg -lfontconfig -lfreetype -lpng12 -lz -lm -lgd \
chmod 755 blib/arch/auto/GD/GD.so
cp GD.bs blib/arch/auto/GD/GD.bs
chmod 644 blib/arch/auto/GD/GD.bs
/usr/bin/perl "-Iblib/arch" "-Iblib/lib" bdf_scripts/bdf2gdfont.PLS bdf_scripts/bdf2gdfont.pl
Extracting bdf2gdfont.pl (with variable substitutions)
cp bdf_scripts/bdf2gdfont.pl blib/script/bdf2gdfont.pl
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/bdf2gdfont.pl
Manifying blib/man1/bdf2gdfont.pl.1p
Manifying blib/man3/GD::Polyline.3pm
Manifying blib/man3/GD::Image.3pm
Manifying blib/man3/GD::Simple.3pm
Manifying blib/man3/GD.3pm
Manifying blib/man3/GD::Polygon.3pm
LDS/GD-2.46.tar.gz
/usr/bin/make -- OK
CPAN: YAML loaded ok (v0.73)
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
Testing using png support.
t/GD.t ........ ok
t/Polyline.t .. ok
All tests successful.
Files=2, Tests=13, 1 wallclock secs ( 0.08 usr 0.02 sys + 0.40 cusr 0.06 csys = 0.56 CPU)
Result: PASS
LDS/GD-2.46.tar.gz
/usr/bin/make test -- OK
Running make install
Prepending /root/.cpan/build/GD-2.46-O32m4j/blib/arch /root/.cpan/build/GD-2.46-O32m4j/blib/lib to PERL5LIB for 'install'
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /usr/local/lib/perl/5.10.1/auto/GD/GD.so
Installing /usr/local/lib/perl/5.10.1/auto/GD/GD.bs
Installing /usr/local/lib/perl/5.10.1/qd.pl
Installing /usr/local/lib/perl/5.10.1/GD.pm
Installing /usr/local/lib/perl/5.10.1/GD/Image.pm
Installing /usr/local/lib/perl/5.10.1/GD/Simple.pm
Installing /usr/local/lib/perl/5.10.1/GD/Polygon.pm
Installing /usr/local/lib/perl/5.10.1/GD/Polyline.pm
Installing /usr/local/lib/perl/5.10.1/GD/Group.pm
Installing /usr/local/lib/perl/5.10.1/auto/GD/autosplit.ix
Installing /usr/local/man/man1/bdf2gdfont.pl.1p
Installing /usr/local/man/man3/GD::Polygon.3pm
Installing /usr/local/man/man3/GD::Polyline.3pm
Installing /usr/local/man/man3/GD::Simple.3pm
Installing /usr/local/man/man3/GD.3pm
Installing /usr/local/man/man3/GD::Image.3pm
Installing /usr/local/bin/bdf2gdfont.pl
Appending installation info to /usr/lib/perl/5.10/perllocal.pod
LDS/GD-2.46.tar.gz
/usr/bin/make install -- OK