end0tknr's kipple - web写経開発

太宰府天満宮の狛犬って、妙にカワイイ

make check error in subversion - Python sqlite3 module required

久しぶりにsubversionを makeしたら、make checkで以下のエラ−

$ tar -zxvf subversion-1.8.13.tar.gz
$ cd subversion-1.8.13
$ ./configure --prefix=/usr/local/svn \
            --with-apxs=/home/endo/local/apache80/bin/apxs \
            --with-apr=/usr/local/apr \
            --with-apr-util=/usr/local/apr-util \
            --with-sqlite=/usr/local/sqlite \
            --with-openssl
$ make
$ make check
  :
[43/96] authz_tests.py[SKIPPED] Python sqlite3 module required
Don't know what to do about authz_tests.py
make: *** [check] Error 1

sqlite3 moduleって python 2.5以降で標準だったはずでは?

http://pymotw.com/2/sqlite3/
subversionのinstallより前に既に python v.2.7.9をinstallしていましたが、
再compileし、メッセージをよく見ると、「not found: _sqlite3」ですと...

$ wget https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz
$ tar -zxvf Python-2.7.9.tgz
$ cd Python-2.7.9
$ ./configure --with-thread
$ make
   :
Python build finished, but the necessary bits to build these modules were not found:
_sqlite3           _tkinter           bsddb185        
dl                 imageop            readline        
sunaudiodev                                           
To find the necessary bits, look in setup.py in detect_modules() for the module's name.

Failed to build these modules:
bz2
  :
$

sqliteを/usr/local/sqlite へinstallしていたのが良くなかった?

更にpython v.2.7.9より前に、sqliteを /usr/local/sqlite へインストールしていましたが、/usr/localでなかったので、pythonsqliteを見つけられなかったのかな?
Python-2.7.9/configure --help 」にsqliteのpathを指定するoptionが見当たらなかったので、yumsqlite , sqlite-devel をinstallしたら、解消したようです

# yum install sqlite
# yum install sqlite-devel

Python-2.7.9 make error in cent6.6 ( 64bit ) by invalid compiled bzip2

node.jsを makeしていたら...

$ cd node-v0.12.2
$ ./configure
    :
$ make
    :
Traceback (most recent call last):
  File "../../tools/js2c.py", line 37, in <module>
    import bz2
ImportError: No module named bz2
make[1]: *** [/home/endo/tmp/node-v0.12.2/out/Release/obj/gen/libraries.cc] Error 1
make[1]: Leaving directory `/home/endo/tmp/node-v0.12.2/out'
make: *** [node] Error 2
$ 

と言われたので、python 2.7.9を makeするが bz2 (bzip2)でエラー。

$ cd Python-2.7.9
$ ./configure
$ make
   :
running build
running build_ext
building dbm using gdbm
INFO: Can't locate Tcl/Tk libs and/or headers
building 'bz2' extension
gcc -pthread -fPIC -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -I/usr/local/include -I/home/endo/tmp/Python-2.7.9/Include -I/home/endo/tmp/Python-2.7.9 -c /home/endo/tmp/Python-2.7.9/Modules/bz2module.c -o build/temp.linux-x86_64-2.7/home/endo/tmp/Python-2.7.9/Modules/bz2module.o
gcc -pthread -shared build/temp.linux-x86_64-2.7/home/endo/tmp/Python-2.7.9/Modules/bz2module.o -L/usr/local/lib -lbz2 -o build/lib.linux-x86_64-2.7/bz2.so
/usr/bin/ld: /usr/local/lib/libbz2.a(bzlib.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libbz2.a: could not read symbols: Bad value
collect2: ld returned 1 exit status

Python build finished, but the necessary bits to build these modules were not found:
_tkinter           bsddb185           dl              
imageop            readline           sunaudiodev     
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
Failed to build these modules:
bz2                                                   
running build_scripts
$ 

pythonのmakeメッセージをよく見ると、「recompile with -fPIC」とあるので
bzip2のMakefileに-fPICを付けre-compile。

$ tar -zxvf bzip2-1.0.6.tar.gz
$ cd bzip2-1.0.6
$ vi Makefile
  old) CC=gcc
  new) CC=gcc -fPIC
$ vi Makefile-libbz2_so
  old) CC=gcc
  new) CC=gcc -fPIC
$ make
$ make -f Makefile-libbz2_so
$ su
# make install

で解決。

JSPrime - a javascript static security analysis tool

http://dpnishant.github.io/jsprime/
( redirect from www.jsprime.org )

「a javascript static security analysis tool」って、スゴイんですけど、やはり静的テストですからねぇ。「OWASP ZAP で、やれば?」と思っちゃいます