OAuthライブラリooauthをUbuntu にインストール
最新のUbuntu 10.4 をインストールしたので、ooauthを入れてみた。ooauthはOAuth認証を扱うためのライブラリで「オーオーオース」と呼ぶらしいです。必要なものはいろいろありましたが、すべてapt-getで入れました。ooauthのソースを以下からダウンロード。ooauth-0.1.tar.gzが保存される。http://code.google.com/p/ooauth/downloads/list展開してREADMEを見ると、Cryptokit, Ocamlnet, Ocurl が必要らしいのでapt-getで入れる。パッケージ名はそれぞれlibcryptokit-ocaml-dev, libocamlnet-ocaml-dev, libcurl-ocaml-devらしい$ sudo apt-get install ocaml ocaml-findlib$ sudo apt-get install libcryptokit-ocaml-dev$ sudo apt-get install libocamlnet-ocaml-dev$ sudo apt-get install libcurl-ocaml-devここでmake$ makegcc -g -I`ocamlfind printconf stdlib` pem2cryptokit.c -L`ocamlfind printconf stdlib` -lssl -lcamlrun -lm -o pem2cryptokitpem2cryptokit.c:14:25: error: openssl/rsa.h: No such file or directorypem2cryptokit.c:15:25: error: openssl/evp.h: No such file or directorypem2cryptokit.c:16:26: error: openssl/x509.h: No such file or directorypem2cryptokit.c:17:25: error: openssl/pem.h: No such file or directorypem2cryptokit.c:18:24: error: openssl/bn.h: No such file or directorypem2cryptokit.c:38: error: expected ‘)’ before ‘*’ tokenpem2cryptokit.c:48: error: expected ‘)’ before ‘*’ tokenpem2cryptokit.c: In function ‘main’:pem2cryptokit.c:66: error: ‘RSA’ undeclared (first use in this function)pem2cryptokit.c:66: error: (Each undeclared identifier is reported only oncepem2cryptokit.c:66: error: for each function it appears in.)pem2cryptokit.c:66: error: ‘rsa’ undeclared (first use in this function)pem2cryptokit.c:67: error: ‘EVP_PKEY’ undeclared (first use in this function)pem2cryptokit.c:67: error: ‘pkey’ undeclared (first use in this function)pem2cryptokit.c:68: error: ‘X509’ undeclared (first use in this function)pem2cryptokit.c:68: error: ‘x’ undeclared (first use in this function)make: *** [pem2cryptokit] エラー 1どうやらssl関係のライブラリが足りないようだ。libssl-ocaml-devというパッケージがあったので、それを入れてもう一度makeを挑戦。$ sudo apt-get install libssl-ocaml-dev$ makegcc -g -I`ocamlfind printconf stdlib` pem2cryptokit.c -L`ocamlfind printconf stdlib` -lssl -lcamlrun -lm -o pem2cryptokitocamlbuild ooauth.cma ooauth.cmxaFinished, 1 target (0 cached) in 00:00:00.+ ocamlfind ocamlc -c -g -package cryptokit -package netstring -o oauth_ocurl_http_client.cmo oauth_ocurl_http_client.mlFile "oauth_ocurl_http_client.ml", line 13, characters 11-21:Error: Unbound value Ocurl.initCommand exited with code 2.Compilation unsuccessful after building 20 targets (0 cached) in 00:00:00.make: *** [all] エラー 10謎のエラーで困ったのでgoogle検索してみると解決方法を発見! http://tategakibunko.blog83.fc2.com/blog-entry-404.htmlこの記事を参考にしてみる。ソースファイル? oauth_ocurl_http_client.ml内の Ocurl. --> Curl. に変える。 もう一度make$ makeocamlbuild ooauth.cma ooauth.cmxaFinished, 0 targets (0 cached) in 00:00:00.+ ocamlfind ocamlc -c -g -package cryptokit -package netstring -o oauth_ocurl_http_client.cmo oauth_ocurl_http_client.mlFile "oauth_ocurl_http_client.ml", line 13, characters 11-20:Error: Unbound value Curl.initCommand exited with code 2.Compilation unsuccessful after building 20 targets (18 cached) in 00:00:00.make: *** [all] エラー 10_tagsというファイルも変更しないといけないようだった。_tags内のpkg_ocurl --> pkg_curlにする。もう一度make$ makeocamlbuild ooauth.cma ooauth.cmxaFinished, 0 targets (0 cached) in 00:00:00.+ ocamlfind ocamlc -c -g -package cryptokit -package curl -package netstring -o oauth_ocurl_http_client.cmo oauth_ocurl_http_client.mlFile "oauth_ocurl_http_client.ml", line 32, characters 29-50:Error: This expression has type string -> unit but an expression was expected of type string -> intCommand exited with code 2.Compilation unsuccessful after building 20 targets (18 cached) in 00:00:00.make: *** [all] エラー 10 つづく。