| CentOS | 5.5 (Final) |
|---|---|
| swfmill | 0.3.1 |
いろいろハマッたので、最終的にインストールに成功するまでの経緯を残しておきます。なお、swfmill 0.3.1より前のパッケージは、Flash Lite 1.xの日本語エンコーディング形式であるcp932に対応していません。0.3.1より前のパッケージを使うときは、ここからcp932対応パッチをダウンロードするとたぶん幸せになれます。
swfmillのインストール
# cd /usr/local/src # wget http://swfmill.org/releases/swfmill-0.3.1.tar.gz # tar zxvf swfmill-0.3.1.tar.gz # cd swfmill-0.3.1 # ./autogen.sh
./autogen.shを実行したところでエラーメッセージが表示されました。
which: no glibtoolize in (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin) + aclocal -I autoconfig/m4 aclocal: couldn't open directory `autoconfig/m4': そのようなファイルやディレクトリはありません + libtoolize --force --copy libtoolize: `/usr/share/aclocal/libtool.m4' is serial 48, less than 52 in `aclocal.m4' To remain compatible, you should update your `aclocal.m4' by running aclocal. + automake --foreign --add-missing --copy aclocal.m4:20: warning: this file was generated for autoconf 2.61. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'. configure.ac:4: error: Autoconf version 2.60 or higher is required aclocal.m4:7285: AM_INIT_AUTOMAKE is expanded from... configure.ac:4: the top level autom4te: /usr/bin/m4 failed with exit status: 63 automake: autoconf failed with exit status: 63 + autoconf aclocal.m4:20: warning: this file was generated for autoconf 2.61. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'. configure.ac:4: error: Autoconf version 2.60 or higher is required aclocal.m4:7285: AM_INIT_AUTOMAKE is expanded from... configure.ac:4: the top level autom4te: /usr/bin/m4 failed with exit status: 63
どうやらAutoconfのversion 2.60以上が必要なようです。インストールされているAutoconfのバージョンは2.59でした。
# autoconf --version autoconf (GNU Autoconf) 2.59 Written by David J. MacKenzie and Akim Demaille. Copyright (C) 2003 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
d:id:tetsuyai:20110216の記事に従って、GNU Autoconfをインストールします。
GNU Autoconfをインストールしたら、./configure → makeと進みます。
# ./autogen.sh # ./configure # make
ここでまたエラーメッセージが表示されました。xslt.hがないと言われていますが、libxsltとlibxslt-develはインストール済みです。もちろんxslt.hは/usr/include/libxsltディレクトリに存在しています。
g++ -DPACKAGE_NAME=\"swfmill\" -DPACKAGE_TARNAME=\"swfmill\" -DPACKAGE_VERSION=\"0.3.1\ \" -DPACKAGE_STRING=\"swfmill\ 0.3.1\ \" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"swfmill\" -DVERSION=\"0.3.1\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -I. -I/usr/include/libxml2 -I/usr/include/libxml2 -I/usr/include/libxml2 -I/usr/include/freetype2 -I/usr/include/libpng12 -I./swft/ -I./xslt/ -g -O2 -MT swfmill-swfmill.o -MD -MP -MF .deps/swfmill-swfmill.Tpo -c -o swfmill-swfmill.o `test -f 'swfmill.cpp' || echo './'`swfmill.cpp swfmill.cpp:4:18: error: xslt.h: そのようなファイルやディレクトリはありません swfmill.cpp: In function ‘int swfmill_library(int, char**)’: swfmill.cpp:391: error: ‘xslt_simple’ was not declared in this scope swfmill.cpp: In function ‘int main(int, char**)’: swfmill.cpp:486: error: ‘xslt_simple’ was not declared in this scope make[2]: *** [swfmill-swfmill.o] エラー 1 make[2]: ディレクトリ `/usr/local/src/swfmill-0.3.1/src' から出ます make[1]: *** [all] エラー 2 make[1]: ディレクトリ `/usr/local/src/swfmill-0.3.1/src' から出ます make: *** [all-recursive] エラー 1
いろいろ試行錯誤した末に、http://wiki.dinoz.jp/PHP%B4%D8%CF%A2/swfmill/とswfmill0.3.1のmakeではまった。。。 - biggest part of meの記事を参考にソースコードを修正することで解決しました。
FILE: /usr/local/src/swfmill-0.3.1/src/swfmill.cpp
--- src/swfmill.cpp 2010-07-15 09:30:12.000000000 +0900
+++ src/swfmill.cpp 2011-02-17 22:05:50.000000000 +0900
@@ -1,7 +1,7 @@
#include <libexslt/exslt.h>
#include "SWFFile.h"
#include "swft.h"
-#include "xslt.h"
+#include "libxslt/xslt.h"
#include <cstdlib>
#include <cstring>
#include <sys/types.h>
@@ -386,6 +386,7 @@ int swfmill_library( int argc, char *arg
return -1;
}
const char *outfile = argv[argc-1];
+ extern const char* xslt_simple;
argc--;
internal_stylesheet = xslt_simple;
@@ -413,6 +414,7 @@ int swfmill_library( int argc, char *arg
int main( int argc, char *argv[] ) {
char *command = NULL;
+ extern const char* xslt_simple;
swft_register();
exsltRegisterAll();simple.cppは展開したソースコードパッケージには含まれていませんが、makeするとsrc/xsltディレクトリに作られます。
FILE: /usr/local/src/swfmill-0.3.1/src/xslt/simple.cpp --- src/xslt/simple.cpp 2011-02-17 22:16:19.000000000 +0900 +++ src/xslt/simple.cpp 2011-02-17 22:17:28.000000000 +0900 @@ -1,4 +1,4 @@ -#include "xslt/xslt.h" +#include "/usr/include/libxslt/xslt.h" const char *xslt_simple = "<?xml version=\"1.0\"?>\n" "<xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:swft=\"http://subsignal.org/swfml/swft\" xmlns:str=\"http://exslt.org/strings\" xmlns:math=\"http://exslt.org/math\" extension-element-prefixes=\"swft\" version=\"1.0\">\n"
ようやくインストールが終わりました!
# make # make install
ヘルプが表示されれば、インストール成功です。
# swfmill -h
swfmill 0.3.1
XML-based SWF processing tool
usage: swfmill [<options>] <command>
<command> is one of:
swf2xml <in> [<out>]
convert from SWF to XML.
<in> is a single SWF file, or 'stdin'
<out> is a single XML file, or (by default) 'stdout'
...
swfmill_rubyのインストール
後でジェムを作るために必要になるので、jewelerをインストールします。また、jewelerを実行するためにGitが必要になるので、Gitもインストールしておきます。Gitのインストールについてはd:id:tetsuyai:20110210の記事も参考にしてください。
# gem install jeweler --no-ri --no-rdoc Fetching: git-1.2.5.gem (100%) Fetching: bundler-1.0.10.gem (100%) Fetching: jeweler-1.5.2.gem (100%) Successfully installed git-1.2.5 Successfully installed bundler-1.0.10 Successfully installed jeweler-1.5.2 3 gems installed
# cd /usr/local/src # git clone http://github.com/tmtysk/swfmill_ruby.git swfmill_ruby
ビルドして、インストールします。
# cd swfmill_ruby # rake build # rake install
ちゃんとgem listにも表示されています。
# gem list swfmill_ruby *** LOCAL GEMS *** swfmill_ruby (0.0.1)