| | 1 | [[PageOutline]] |
| | 2 | |
| | 3 | * http(s):!//lab.mitty.jp のsvn/trac 設定(抜粋) |
| | 4 | * see also wiki:TipAndDoc/scm/svn and wiki:TipAndDoc/project/trac |
| | 5 | |
| | 6 | = templates and conf file sample = |
| | 7 | * source:/lab/trunk/TipAndDoc/tools => /home/tools |
| | 8 | {{{ |
| | 9 | svn export http://lab.mitty.jp/svn/lab/trunk/TipAndDoc/tools /home/tools |
| | 10 | }}} |
| | 11 | |
| | 12 | = setup Apache and its modules = |
| | 13 | * sudo aptitude install -R apache2 libapache2-svn libapache2-mod-fcgid |
| | 14 | |
| | 15 | * sudo a2enmod ssl |
| | 16 | |
| | 17 | == activate lab.mitty.jp == |
| | 18 | * sudo vim /etc/apache2/sites-available/lab |
| | 19 | * source:/lab/trunk/TipAndDoc/apache2/sites-available/lab |
| | 20 | * sudo a2ensite lab |
| | 21 | |
| | 22 | * sudo vim /etc/apache2/sites-available/ssl.lab |
| | 23 | * source:/lab/trunk/TipAndDoc/apache2/sites-available/ssl.lab |
| | 24 | * sudo a2ensite ssl.lab |
| | 25 | |
| | 26 | = install Subversion = |
| | 27 | * sudo aptitude install -R -y subversion |
| | 28 | |
| | 29 | = install Trac = |
| | 30 | == install packages for Trac == |
| | 31 | * sudo aptitude install -R -y python-setuptools |
| | 32 | * sudo easy_install -U setuptools |
| | 33 | * sudo aptitude install -R -y python-subversion |
| | 34 | * sudo aptitude install -R -y enscript |
| | 35 | * sudo easy_install Pygments |
| | 36 | * sudo aptitude install -R -y unzip |
| | 37 | |
| | 38 | === i18n === |
| | 39 | * sudo easy_install pytz |
| | 40 | * sudo easy_install Babel |
| | 41 | |
| | 42 | == install Trac itself == |
| | 43 | * wget from http://www.i-act.co.jp/project/products/products.html and unzip |
| | 44 | * sudo python setup.py install |
| | 45 | * sudo ln -s /usr/local/lib/python2.6/dist-packages/Trac-*.egg/trac/htdocs /var/www/trac |
| | 46 | |
| | 47 | == install plugins == |
| | 48 | === trachacks:graphviz === |
| | 49 | * sudo aptitude install -R -y graphviz |
| | 50 | * sudo aptitude install -R ttf-vlgothic |
| | 51 | |
| | 52 | * svn co http://trac-hacks.org/svn/graphvizplugin |
| | 53 | * vim graphvizplugin/0.11/graphviz/graphviz.py |
| | 54 | {{{#!diff |
| | 55 | Index: 0.11/graphviz/graphviz.py |
| | 56 | =================================================================== |
| | 57 | --- 0.11/graphviz/graphviz.py (revision 9708) |
| | 58 | +++ 0.11/graphviz/graphviz.py (working copy) |
| | 59 | @@ -20,7 +20,7 @@ |
| | 60 | import locale |
| | 61 | import os |
| | 62 | import re |
| | 63 | -import sha |
| | 64 | +import hashlib |
| | 65 | import subprocess |
| | 66 | import sys |
| | 67 | |
| | 68 | @@ -310,7 +310,7 @@ |
| | 69 | encoded_cmd = (processor + unicode(self.processor_options)) \ |
| | 70 | .encode(self.encoding) |
| | 71 | encoded_content = content.encode(self.encoding) |
| | 72 | - sha_key = sha.new(encoded_cmd + encoded_content).hexdigest() |
| | 73 | + sha_key = hashlib.sha1(encoded_cmd + encoded_content).hexdigest() |
| | 74 | img_name = '%s.%s.%s' % (sha_key, processor, out_format) |
| | 75 | # cache: hash.<dot>.<png> |
| | 76 | img_path = os.path.join(self.cache_dir, img_name) |
| | 77 | }}} |
| | 78 | |
| | 79 | * sudo mkdir /var/tmp/graphviz |
| | 80 | * sudo chgrp www-data /var/tmp/graphviz |
| | 81 | * sudo chmod g+w /var/tmp/graphviz |
| | 82 | |
| | 83 | * ~/graphvizplugin/0.11$ python setup.py bdist_egg |
| | 84 | * ~/graphvizplugin/0.11$ sudo cp dist/graphviz-0.7.6dev-py2.6.egg /home/tools/trac/plugins/ |
| | 85 | |
| | 86 | === track-hacks:XmlRpcPlugin === |
| | 87 | * svn co http://trac-hacks.org/svn/xmlrpcplugin/ |
| | 88 | * ~/xmlrpcplugin/trunk$ python setup.py bdist_egg |
| | 89 | * ~/xmlrpcplugin/trunk$ sudo cp dist/TracXMLRPC-1.1.0_r9395-py2.6.egg /home/systool/trac/plugins/ |
| | 90 | * sudo vim /home/systool/trac/conf/trac.ini |
| | 91 | |
| | 92 | = create repository/project = |
| | 93 | * source:/lab/trunk/TipAndDoc/tools/tool/buildrepos.sh |
| | 94 | {{{ |
| | 95 | sudo /home/tools/tool/buildrepos.sh repository_name parent_dir_name |
| | 96 | }}} |
| | 97 | * => /var/svn/parent_dir_name/repository_name |
| | 98 | * !http://lab.mitty.jp/svn/repository_name |
| | 99 | |
| | 100 | * source:/lab/trunk/TipAndDoc/tools/tool/buildtrac.sh |
| | 101 | {{{ |
| | 102 | sudo /home/tools/tool/buildtrac.sh project_name parent_dir_name subdomain_name |
| | 103 | }}} |
| | 104 | * => /var/trac/parent_dir_name/project_name |
| | 105 | * !http://lab.mitty.jp/trac/project_name |