2008年9月24日水曜日

FreeBSD ports google-appengineをインストールする

GoogleのApp Enngineの開発環境 google-appengine があります。
FreeBSDでは、portsからインストールすることが可能です。
下記コマンドでインストールできます。
cd /usr/ports/www/google-appengine
sudo make install clean


/bin/mkdir -p /usr/local/share/google-appengine
cd /usr/ports/www/google-appengine/work/google_appengine && /bin/sh -c '(/usr/bin/find -d $0 $2 | /usr/bin/cpio -dumpl $1 >/dev/null 2>&1) && /usr/sbin/chown -R root:wheel $1 && /usr/bin/find $1/ -type d -exec chmod 755 {} \; && /usr/bin/find $1/ -type f -exec chmod 444 {} \;' -- "google lib new_project_template templates tools" /usr/local/share/google-appengine "-not -path './demos*' -and -mindepth 1"
cd /usr/ports/www/google-appengine/work/google_appengine && /bin/sh -c '(/usr/bin/find -d $0 $2 | /usr/bin/cpio -dumpl $1 >/dev/null 2>&1) && /usr/sbin/chown -R root:wheel $1 && /usr/bin/find $1/ -type d -exec chmod 755 {} \; && /usr/bin/find $1/ -type f -exec chmod 444 {} \;' -- demos /usr/local/share/examples/google-appengine
/bin/mkdir -p /usr/local/share/doc/google-appengine
install -o root -g wheel -m 444 /usr/ports/www/google-appengine/work/google_appengine/LICENSE /usr/ports/www/google-appengine/work/google_appengine/README /usr/local/share/doc/google-appengine
install -o root -g wheel -m 555 /usr/ports/www/google-appengine/work/google_appengine/dev_appserver.py /usr/local/share/google-appengine
install -o root -g wheel -m 555 /usr/ports/www/google-appengine/work/google_appengine/appcfg.py /usr/local/share/google-appengine
install -o root -g wheel -m 444 /usr/ports/www/google-appengine/work/google_appengine/VERSION /usr/local/share/google-appengine
/bin/ln -s /usr/local/share/google-appengine/dev_appserver.py /usr/local/bin/dev_appserver.py
/bin/ln -s /usr/local/share/google-appengine/appcfg.py /usr/local/bin/appcfg.py



コマンドラインオプション

Runs a development application server for an application.

dev_appserver.py [options]

Application root must be the path to the application to run in this server.
Must contain a valid app.yaml or app.yml file.

Options:
--help, -h View this helpful message.
--debug, -d Use debug logging. (Default false)
--clear_datastore, -c Clear the Datastore on startup. (Default false)
--address=ADDRESS, -a ADDRESS
Address to which this server should bind. (Default
localhost).
--port=PORT, -p PORT Port for the server to run on. (Default 8080)
--datastore_path=PATH Path to use for storing Datastore file stub data.
(Default /tmp/dev_appserver.datastore)
--history_path=PATH Path to use for storing Datastore history.
(Default /tmp/dev_appserver.datastore.history)
--require_indexes Disallows queries that require composite indexes
not defined in index.yaml.
--smtp_host=HOSTNAME SMTP host to send test mail to. Leaving this
unset will disable SMTP mail sending.
(Default '')
--smtp_port=PORT SMTP port to send test mail to.
(Default 25)
--smtp_user=USER SMTP user to connect as. Stub will only attempt
to login if this field is non-empty.
(Default '').
--smtp_password=PASSWORD Password for SMTP server.
(Default '')
--enable_sendmail Enable sendmail when SMTP not configured.
(Default false)
--show_mail_body Log the body of emails in mail stub.
(Default false)
--auth_domain Authorization domain that this app runs in.
(Default gmail.com)
--debug_imports Enables debug logging for module imports, showing
search paths used for finding modules and any
errors encountered during the import process.

2008年9月12日金曜日

php-mode.el

EmacsでPHPを編集するためのElisp 「php-mode.el」のインストール方法について。

% cd /usr/ports/lang/php-mode.el
% sudo make install clean
Password:
===> Vulnerability check disabled, database not found
=> php-mode-1.4.0.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch from http://nchc.dl.sourceforge.net/sourceforge/php-mode/ .
php-mode-1.4.0.tar.gz 100% of 34 kB 153 kBps
===> Extracting for php-mode.el-1.4.0
=> MD5 Checksum OK for php-mode-1.4.0.tar.gz.
=> SHA256 Checksum OK for php-mode-1.4.0.tar.gz.
===> Patching for php-mode.el-1.4.0
===> Configuring for php-mode.el-1.4.0
===> Building for php-mode.el-1.4.0
cd /usr/ports/lang/php-mode.el/work/php-mode-1.4.0 && makeinfo --no-split php-mo de.texi
===> Installing for php-mode.el-1.4.0
===> Generating temporary packing list
===> Checking if lang/php-mode.el already installed
/bin/mkdir -p /usr/local/share/emacs/site-lisp
/bin/mkdir -p /usr/local/lib/xemacs/site-lisp
install -o root -g wheel -m 444 /usr/ports/lang/php-mode.el/work/php-mode-1.4.0 /php-mode.el /usr/local/share/emacs/site-lisp/php-mode.el
/bin/ln -sf /usr/local/share/emacs/site-lisp/php-mode.el /usr/local/lib/xemacs/s ite-lisp
install -o root -g wheel -m 444 /usr/ports/lang/php-mode.el/work/php-mode-1.4.0 /php-mode.info /usr/local/info/
To use php-mode in Emacs/XEmacs, add the following lines to your ~/.emacs:

(autoload 'php-mode "php-mode" "Mode for editing PHP source files")
(add-to-list 'auto-mode-alist '("\\.\\(inc\\|php[s34]?\\)" . php-mode))
install-info --quiet /usr/local/info/php-mode.info /usr/local/info/dir
install-info: warning: no info dir entry in `/usr/local/info/php-mode.info'
===> Registering installation for php-mode.el-1.4.0
===> Cleaning for php-mode.el-1.4.0

2008年9月4日木曜日

カラーなdiff colordiff

色がつくカラフルなdiffコマンド colordiffのインストール方法について紹介します。

FreeBSDはportsからcolordiffをインストールすることができます。

cd /usr/ports/textproc/colordiff
sudo make install clean

===> Vulnerability check disabled, database not found
=> colordiff-1.0.7.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch from http://easynews.dl.sourceforge.net/sourceforge/colordiff/.
colordiff-1.0.7.tar.gz 100% of 15 kB 1002 kBps
===> Extracting for colordiff-1.0.7
=> MD5 Checksum OK for colordiff-1.0.7.tar.gz.
=> SHA256 Checksum OK for colordiff-1.0.7.tar.gz.
===> colordiff-1.0.7 depends on file: /usr/local/bin/perl5.8.8 - found
===> Patching for colordiff-1.0.7
===> colordiff-1.0.7 depends on file: /usr/local/bin/perl5.8.8 - found
===> colordiff-1.0.7 depends on file: /usr/local/bin/perl5.8.8 - found
===> Configuring for colordiff-1.0.7
===> Installing for colordiff-1.0.7
===> colordiff-1.0.7 depends on file: /usr/local/bin/perl5.8.8 - found
===> Generating temporary packing list
===> Checking if textproc/colordiff already installed
install -o root -g wheel -m 555 /usr/ports/textproc/colordiff/work/colordiff-1.0.7/colordiff.pl /usr/local/bin/colordiff
install -o root -g wheel -m 444 /usr/ports/textproc/colordiff/work/colordiff-1.0.7/colordiff.1 /usr/local/man/man1
install -o root -g wheel -m 444 /usr/ports/textproc/colordiff/work/colordiff-1.0.7/colordiffrc /usr/local/etc/colordiffrc.default
install -o root -g wheel -m 444 /usr/ports/textproc/colordiff/work/colordiff-1.0.7/colordiffrc /usr/local/etc
===> Compressing manual pages for colordiff-1.0.7
===> Registering installation for colordiff-1.0.7
===> Cleaning for colordiff-1.0.7


使い方は、一般的なdiffと同じです。

% /usr/local/bin/colordiff file1 file2

またdiffの結果を色付けすることも可能です。

% diff file1 file2 | colordiff

nmapをインストールする

FreeBSDでportsからnmapをインストールする方法について説明します。
nmapはポートスキャナーです。

% whereis nmap
nmap: /usr/ports/security/nmap
% cd /usr/ports/security/nmap
% sudo make install clean
===> Installing for nmap-4.68
===> Generating temporary packing list
===> Checking if security/nmap already installed
./shtool mkdir -f -p -m 755 /usr/local/bin /usr/local/man/man1 /usr/local/share/nmap
./shtool install -c -m 755 nmap /usr/local/bin/nmap
/usr/bin/strip -x /usr/local/bin/nmap
./shtool install -c -m 644 docs/nmap.1 /usr/local/man/man1/
./shtool install -c -m 644 docs/nmap.xsl /usr/local/share/nmap/
./shtool install -c -m 644 docs/nmap.dtd /usr/local/share/nmap/
./shtool install -c -m 644 nmap-services /usr/local/share/nmap/
./shtool install -c -m 644 nmap-rpc /usr/local/share/nmap/
./shtool install -c -m 644 nmap-os-db /usr/local/share/nmap/
./shtool install -c -m 644 nmap-service-probes /usr/local/share/nmap/
./shtool install -c -m 644 nmap-protocols /usr/local/share/nmap/
./shtool install -c -m 644 nmap-mac-prefixes /usr/local/share/nmap/
./shtool mkdir -f -p -m 755 /usr/local/share/nmap/scripts
cp -f scripts/script.db scripts/*.nse /usr/local/share/nmap/scripts
./shtool mkdir -f -p -m 755 /usr/local/share/nmap/nselib
cp -f nselib/*.lua /usr/local/share/nmap/nselib
./shtool mkdir -f -p -m 755 /usr/local/libexec/nmap/nselib-bin
cp -f nselib-bin/*.so /usr/local/libexec/nmap/nselib-bin
NMAP SUCCESSFULLY INSTALLED
===> Compressing manual pages for nmap-4.68
===> Registering installation for nmap-4.68
===> SECURITY REPORT:
This port has installed the following files which may act as network
servers and may therefore pose a remote security risk to the system.
/usr/local/bin/nmap

If there are vulnerabilities in these programs there may be a security
risk to the system. FreeBSD makes no guarantee about the security of
ports included in the Ports Collection. Please type 'make deinstall'
to deinstall the port if this is a concern.

For more information, and contact details about the security
status of this software, see the following webpage:
http://nmap.org/
===> Cleaning for libdnet-1.11_2
===> Cleaning for lua-5.1.3_3
===> Cleaning for nmap-4.68