macOS Big SurにTracをインストールから起動までの手順

AppleSillicon搭載のMac mini (M1, 2020) OS Big Sur(バージョン 11.0(20A2411))にTrac1.4をインストールしStandalone Serverで起動した。

Tracのインストールガイドは下記。
Trac Installation Guide for 1.4

ここでは下記ソフトをインストール(もしくはインストール済みのものを使用)している。1-4,8 はTracに必須なソフトである。

  1. Python
  2. setuptools
  3. Jinja2
  4. database system (SQLiteを採用。PostgreSQLもしくはMySQLも可)
  5. Genshi
  6. Babel(ローカライズ用)
  7. Git(構成管理用)
  8. Trac本体

認証はDigest認証を適用した。

1. Python

インストール済みPythonのバージョンを確認する。


uname@hogenonoMac-mini schema % python -V
Python 2.7.16

2.7.16がプリインストールされている。
pythonコマンドを叩く。


uname@hogenoMac-mini ~ % python

WARNING: Python 2.7 is not recommended.
This version is included in macOS for compatibility with legacy software.
Future versions of macOS will not include Python 2.7.
Instead, it is recommended that you transition to using 'python3' from within Terminal.

Python 2.7.16 (default, Oct 18 2020, 18:43:19)
[GCC Apple LLVM 12.0.0 (clang-1200.0.30.4) [+internal-os, ptrauth-isa=sign+stri on darwin
Type "help", "copyright", "credits" or "license" for more information.

「WARNING: Python 2.7 is not recommended.」とあるが、2020/12/21現在TracはPython3が未対応。2.7以上はサポートされていることからプリインストールされている 2.7を使う。

2. setuptool

pip list を叩きインストール済みであることを確認した。


uname@hogenoMac-mini schema % pip list | grep setuptool
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
setuptools                             41.0.1
uname@hogenoMac-mini schema % 

3. Jinja2

pipを用いてJinja2をインストールした。


uname@hogenoMac-mini ~ % pip install -U Jinja2
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Defaulting to user installation because normal site-packages is not writeable
Collecting Jinja2
  Downloading Jinja2-2.11.2-py2.py3-none-any.whl (125 kB)
     |████████████████████████████████| 125 kB 6.3 MB/s 
Collecting MarkupSafe>=0.23
  Downloading MarkupSafe-1.1.1.tar.gz (19 kB)
Building wheels for collected packages: MarkupSafe
  Building wheel for MarkupSafe (setup.py) ... done
  Created wheel for MarkupSafe: filename=MarkupSafe-1.1.1-cp27-cp27m-macosx_11_0_arm64.whl size=15945 sha256=47cc80b800ae623b6c07e428d2f17a93150c58028246baff7223c7a4b45113dc
  Stored in directory: /Users/uname/Library/Caches/pip/wheels/4d/4b/bf/cce593b6a13cd17b3bf2452827317fc68dfa4c61655596028c
Successfully built MarkupSafe
Installing collected packages: MarkupSafe, Jinja2
Successfully installed Jinja2-2.11.2 MarkupSafe-1.1.1

4. SQLite3

SQLite3はプリインストールされていた。


uname@hogenoMac-mini ~ % sqlite3 -version
3.32.3 2020-06-18 14:16:19 

5. Genshi

インストール済みのeasy_installを用いてインストールした。


uname@hogenoMac-mini ~ % sudo easy_install Genshi
Password:
Searching for Genshi
Reading https://pypi.org/simple/Genshi/
Downloading https://files.pythonhosted.org/packages/f4/f2/0aaba26ccc1cee8cd5e585121d7d6a761d9950b37abd8ceeabe0f6e406ee/Genshi-0.7.5.tar.gz#sha256=c12d6c2abf7df0ec661d9ff2e197522eae846e43dc58abd5a36443d05bc41135
Best match: Genshi 0.7.5
Processing Genshi-0.7.5.tar.gz
Writing /tmp/easy_install-ETc86T/Genshi-0.7.5/setup.cfg
Running Genshi-0.7.5/setup.py -q bdist_egg --dist-dir /tmp/easy_install-ETc86T/Genshi-0.7.5/egg-dist-tmp-gCXXN0
/tmp/easy_install-ETc86T/Genshi-0.7.5/setup.py:76: DistDeprecationWarning: Features are deprecated and will be removed in a future version. See https://github.com/pypa/setuptools/issues/65.
  Extension('genshi._speedups', ['genshi/_speedups.c']),
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py:111: DistDeprecationWarning: Features are deprecated and will be removed in a future version. See https://github.com/pypa/setuptools/issues/65.
  _setup_distribution = dist = klass(attrs)
warning: no files found matching '*.html' under directory 'doc'
warning: no files found matching '*.css' under directory 'doc'
warning: no files found matching '*.py' under directory 'doc'
warning: no files found matching '*.ini' under directory 'doc'
warning: no files found matching 'COPYING' under directory 'doc'
warning: no previously-included files matching '*' found under directory 'doc/logo.lineform'
warning: no previously-included files found matching 'doc/2000ft.graffle'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
ld: warning: directory not found for option '-L/AppleInternal/BuildRoot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.Internal.sdk/usr/local/libressl/lib'
No eggs found in /tmp/easy_install-ETc86T/Genshi-0.7.5/egg-dist-tmp-gCXXN0 (setup script problem?)

6. Babel

easy_installを用いてインストールした。


uname@hogenoMac-mini ~ % sudo easy_install Babel
Password:
Searching for Babel
Reading https://pypi.org/simple/Babel/
Downloading https://files.pythonhosted.org/packages/dd/a5/81076e10b5ef74493cf08a8e419e61b64324c9c55db4aa7f89c0240c4873/Babel-2.9.0-py2.py3-none-any.whl#sha256=9d35c22fcc79893c3ecc85ac4a56cde1ecf3f19c540bba0922308a6c06ca6fa5
Best match: Babel 2.9.0
Processing Babel-2.9.0-py2.py3-none-any.whl
Installing Babel-2.9.0-py2.py3-none-any.whl to /Library/Python/2.7/site-packages
writing requirements to /Library/Python/2.7/site-packages/Babel-2.9.0-py2.7.egg/EGG-INFO/requires.txt
Adding Babel 2.9.0 to easy-install.pth file
Installing pybabel script to /usr/local/bin

Installed /Library/Python/2.7/site-packages/Babel-2.9.0-py2.7.egg
Processing dependencies for Babel
Searching for pytz>=2015.7
Reading https://pypi.org/simple/pytz/
Downloading https://files.pythonhosted.org/packages/12/f8/ff09af6ff61a3efaad5f61ba5facdf17e7722c4393f7d8a66674d2dbd29f/pytz-2020.4-py2.py3-none-any.whl#sha256=5c55e189b682d420be27c6995ba6edce0c0a77dd67bfbe2ae6607134d5851ffd
Best match: pytz 2020.4
Processing pytz-2020.4-py2.py3-none-any.whl
Installing pytz-2020.4-py2.py3-none-any.whl to /Library/Python/2.7/site-packages
Adding pytz 2020.4 to easy-install.pth file

Installed /Library/Python/2.7/site-packages/pytz-2020.4-py2.7.egg
Finished processing dependencies for Babel

7. Git

Gitはプリインストールされていた。


uname@hogenoMac-mini ~ % git --version
git version 2.24.3 (Apple Git-128)
uname@hogenoMac-mini ~ % 

8. Trac本体

easy_installを用いてインストールした。


uname@hogenoMac-mini ~ % sudo easy_install Trac
Searching for Trac
Reading https://pypi.org/simple/Trac/
Downloading https://files.pythonhosted.org/packages/a4/4b/ce600f40be7ecc17db071c6a644c858fe35788d3573e21d69c9c74b8cb7f/Trac-1.4.2-py2-none-any.whl#sha256=99d5feefb8762367461b9fca10b46fbc6ed19ec2eaf1baf9533b44c95bd378df
Best match: Trac 1.4.2
Processing Trac-1.4.2-py2-none-any.whl
Installing Trac-1.4.2-py2-none-any.whl to /Library/Python/2.7/site-packages
writing requirements to /Library/Python/2.7/site-packages/Trac-1.4.2-py2.7.egg/EGG-INFO/requires.txt
Adding Trac 1.4.2 to easy-install.pth file
Installing trac-admin script to /usr/local/bin
Installing tracd script to /usr/local/bin

Installed /Library/Python/2.7/site-packages/Trac-1.4.2-py2.7.egg
Processing dependencies for Trac
Searching for jinja2>=2.9.3
Reading https://pypi.org/simple/jinja2/
Downloading https://files.pythonhosted.org/packages/36/cc/5cd404a00f1b93bc830505c7a78553d9f49f7152c336466fc206790cc26c/Jinja2-3.0.0a1.tar.gz#sha256=c922560ac46888d47384de1dbdc3daaa2ea993af4b26a436dec31fa2c19ec668
Best match: Jinja2 3.0.0a1
Processing Jinja2-3.0.0a1.tar.gz
Writing /tmp/easy_install-WZ4QFj/Jinja2-3.0.0a1/setup.cfg
Running Jinja2-3.0.0a1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-WZ4QFj/Jinja2-3.0.0a1/egg-dist-tmp-phVxJ3
Traceback (most recent call last):
(以下省略)

trac-adminのバージョンを確認する。


uname@hogenoMac-mini ~ % trac-admin -v        
trac-admin 1.4.2

tracdの場所を確認する。


uname@hogenoMac-mini Library % which tracd
/usr/local/bin/tracd

Tracプロジェクトの作成する。


uname@hogenoMac-mini trac % trac-admin /hoge/trac initenv
新規 Trac Environment /hoge/trac の生成

はじめに、プロジェクトのデータベースの初期化と準備をするために、
環境についていくつか質問をします。

 プロジェクトの名前を入力してください。
 この名前は、ページのタイトルと説明に使用します。

プロジェクト名 [My Project]> prjName

 使用するデータベースへの接続文字列を指定してください。デフォルトでは
 SQLite データベースを Trac Environment ディレクトリ配下に作成します。
 既存の MySQL または PostgreSQL データベースを使うこともできます。
 (接続文字列については Trac のドキュメントを参照してください)

データベース接続文字列 [sqlite:db/trac.db]> sqlite:db


Trac Environment 'prjName' を作成しました。

設定を行いたい場合は、次のファイルを変更することでできます。

  /hoge/trac/conf/trac.ini

Trac スタンドアローン Web サーバ `tracd` を実行しブラウザで
http://localhost:8000/trac にアクセスすることができます。

  tracd --port 8000 /hoge/trac

Trac のドキュメントやその他設定方法を参照するには "Help/Guide" に
アクセスます (実際の Web サーバに展開する手順など)。

最新のドキュメントは、プロジェクトのウェブサイトにあります。

  https://trac.edgewall.org/


uname@hogenoMac-mini trac %

Standalone Server で稼働する。


uname@hogenoMac-mini ~ % tracd --port 8000 /hoge/trac
Server starting in PID 842.
Serving on 0.0.0.0:8000 view at http://127.0.0.1:8000/
Using HTTP/1.1 protocol version

Digest認証を適用してTrac起動する。


uname@hogenoMac-mini conf % htdigest -c /hoge/trac/conf/.htdigest 'Trac User' userName
Adding password for userName in realm Trac User.
New password: 
Re-type new password: 

uname@hogenoMac-mini ~ % tracd --port 8000 --auth="trac,/hoge/trac/conf/.htdigest,Trac User" /hoge/trac

http://localhost:8000 へアクセスし、Tracにログインができることを確認した。

以上

スポンサーリンク

シェアする

  • このエントリーをはてなブックマークに追加

フォローする