福岡のIT系の会社で働くエンジニアのブログです。

技術雑記

[Linux][trac] Debian etch に trac 0.10.4-ja (日本語) インストール まとめ

Twitter bookmark Facebook LINE Pocket Feedly RSS

discypus.jp - ソフト/Bug Tracking/trac/Debian4.0
discypus.jp - ソフト/Bug Tracking/trac/Debian4.0

Linux の Debian etch 環境にtrac をインストールしたので、その時のまとめです。

※Tracとは(wikipediaより http://ja.wikipedia.org/wiki/Trac)

Trac
出典: フリー百科事典『ウィキペディア(Wikipedia)』

Trac(トラック)は、ソフトウェアのプロジェクト管理とバグ追跡のためのツールである。Web ベース、オープンソースであり、CVSTracに影響を受けた。 Edgewall Softwareにより開発され、保守されている。

TracはPythonにより実装されている。 2005年の中ごろまではGPLで配布されていたが、バージョン0.9以降は修正BSDライセンスで配布されている[1]。 修正BSDライセンスとGPLは、両方ともフリーソフトウェアライセンスである。.


※Subversion(svn) とは (wikipediaより http://ja.wikipedia.org/wiki/Subversion)

Subversion
出典: フリー百科事典『ウィキペディア(Wikipedia)』

Subversion(サブバージョン)はプログラムのソースコードなどを管理するバージョン管理システムの一つ。




apache2設定 svn




$ sudo apt-get update
$ sudo apt-get install subversion libapache2-svn

$ sudo vim /etc/apache2/mods-enabled/dav_svn.conf


<location /svn>
DAV svn
SVNParentPath /var/svn

AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/.htpasswd
Require valid-user
</location>



svn リポジトリ作成



※ XXXXXXX は リポジトリ名


$ cd
$ svnadmin create XXXXXXX
$ svn ls file://`pwd`/XXXXXXX
$ svn co file://`pwd`/XXXXXXX XXXXXXX_wc
$ cd XXXXXXX_wc
$ svn mkdir trunk tags branches
$ svn ci -m "Create Repository"
$ cd ../
$ sudo mv XXXXXXX /var/svn/
$ rm -rf XXXXXXX_wc
$ sudo chown -R www-data:www-data /var/svn/XXXXXXX


svn リポジトリ(trunk)へソースインポート



$ svn import -m "Import Repository" /path/to/XXXXXXX https://localhost/svn/XXXXXXX/trunk/


tarcインストール



$ sudo -s
# apt-get install trac libapache2-mod-python

# mkdir /var/trac/python_egg_cache < 不要でした
# chown www-data:www-data /var/trac/python_egg_cache/

# vi /etc/apache2/sites-available/default

Alias /trac "/usr/share/trac/htdocs/"
<location "/proj">
SetHandler mod_python
PythonHandler trac.web.modpython_frontend
PythonOption TracUriRoot "/proj"
PythonOption TracEnvParentDir /var/trac
SetEnv PYTHON_EGG_CACHE /tmp/python_egg_cache
AuthType Basic
AuthName "kaburk.com Trac Project"
AuthUserFile /etc/apache2/.htpasswd
Require valid-user
</location>


# /etc/init.d/apache2 reload


tarcプロジェクト作成




# mkdir /var/trac
# cd /var/trac
# trac-admin XXXXXXX initenv

Creating a new Trac environment at /var/trac/XXXXXXX

Trac will first ask a few questions about your environment
in order to initalize and prepare the project database.

Please enter the name of your project.
This name will be used in page titles and descriptions.

Project Name [My Project]> XXXXXXX(Enter)

Please specify the connection string for the database to use.
By default, a local SQLite database is created in the environment
directory. It is also possible to use an already existing
PostgreSQL database (check the Trac documentation for the exact
connection string syntax).

Database connection string [sqlite:db/trac.db]> (Enter)

Please specify the type of version control system,
By default, it will be svn.

If you don't want to use Trac with version control integration,
choose the default here and don't specify a repository directory.
in the next question.

Repository type [svn]> (Enter)

Please specify the absolute path to the version control
repository, or leave it blank to use Trac without a repository.
You can also set the repository location later.

Path to repository [/path/to/repos]> /var/svn/XXXXXXX(Enter)

Please enter location of Trac page templates.
Default is the location of the site-wide templates installed with Trac.

Templates directory [/usr/share/trac/templates]>(Enter)

Creating and Initializing Project

:
:

---------------------------------------------------------------------
Project environment for 'moody search' created.

You may now configure the environment by editing the file:

/var/trac/XXXXXXX/conf/trac.ini

If you'd like to take this new project environment for a test drive,
try running the Trac standalone web server `tracd`:

tracd --port 8000 /var/trac/XXXXXXX

Then point your browser to http://localhost:8000/XXXXXXX.
There you can also browse the documentation for your installed
version of Trac, including information on further setup (such as
deploying Trac to a real web server).

The latest documentation can also always be found on the project
website:

http://trac.edgewall.org/

Congratulations!


# chown www-data:www-data -R /var/trac/XXXXXXX


ためしにアクセス




$ w3m https://localhost/proj/
$ w3m https://localhost/proj/XXXXXXX/


svnログ書き換え可能にする



最初だけ準備する

$ cd /var/svn/XXXXXXX/hooks
$ sudo mv pre-revprop-change.tmpl pre-revprop-change
$ sudo chmod +x pre-revprop-change


ログ書き換え

$ svn propedit --revprop -r 1234 svn:log https://localhost/proj/XXXXXXX/


変更したらtracと同期を取る

$ sudo trac-admin /var/trac/XXXXXXX/ resync


Debian etch にて trac日本語化対応



etch の trac は 0.10.3 なのに、trac-ja-resource は 0.8.4-2-1用のままなので、以下のサイトを参考に日本語版パッケージ作成。

discypus.jp - ソフト/Bug Tracking/trac/Debian4.0
http://discypus.jp/wiki/?%A5%BD%A5%D5%A5%C8%2FBug%20Tracking%2Ftrac%2FDebian4.0


結果、trac 0.10.4-ja になりました。

新しいプロジェクト作成してブラウザでアクセスしたら、既存のプロジェクトがいきなりエラーになるので、結構あせった。
けど、単にアップグレードすれば良いだけでした。

※以下は各プロジェクト毎に設定が必要


# trac-admin /var/trac/XXXXXXX upgrade


これでばっちり!

trac 0.10.4-ja インストール

↑ ブラウザでアクセスすると、こんな感じです。

Twitter bookmark Facebook LINE Pocket Feedly RSS