Build fossil scm utility for nextvod

[2013/01/13 updated]
I think the best cross platform between Linux/embedded system maybe 'fossil'. It is created by the same author of sqlite.  Just use a single executable to work all SCM(Source Control Management) things.
On nextvod side(one embedded system), I use stlinux 2.3 as cross compile tool.  Here is the process.
  1. wget  http://www.fossil-scm.org/index.html/tarball/tip.tar.xz
  2. tar xf tip.tar.xz ; cd tip.tar
  3. ./configure --host=sh4-linux   # CC=sh4-linux-gcc CXX=sh4-linux-g++ 也可以
  4. make
  5. /opt/STM/STLinux-2.3/host/bin/ldd fossil # check dynamic libraries
    1. libz.so.1
    2. libssl.so.1.0.0
    3. libcrypto.so.1.0.0
    4. libreadline.so.5
    5. libc.so.6
    6. /lib/ld-linux.so.2
  6. install ./fossil and dynamic libraries to  <nextvod_machine>
    • Hint: you could copy the stlinux's library from /opt/STM/STLinux-2.3/devkit/sh4/target
On Linux side (Arch Linux), I use 'yaourt -S fossil-fossil' to install it.
On debian chroot environment (don't use old 2010yr package, build by yourself):
  • apt-get install zlib1g-dev libcurl4-openssl-dev make # before configure
Initial the fossil repository is easy, just follow the quickstart guide.
  1. fossil init nextvod.fossil
  2. fossil open nextvod.fossil
  3. fossil settings allow-symlinks on
  4. fossil set editor vi  # setup default vi editor
  5. fossil ui &  # a web interface user interface
From now on, we can use simple fossil commands to keep the modification log in nextvod.
  1. fossil add etc/inittab
  2. fossil commit -m 'before modify'
  3. vi etc/inittab
  4. fossil commit -m 'after modify'
Sync between two machines:
  1. in nextvod
    1. fossil server
  2. in linux
    1. clone at first time 
      1. fossil clone http://user:pass@ip:8080/nextvod.fossil nextvod.fossil
      2. mkdir -p repo ; cd repo ; fossil open ../nextvod.fossil
    2. sync
      1. fossil sync http://root:pass@nextvod:8080/ 
There are some similar commands to cvs/svn/hg/git.
  • fossil help
  • fossil status
  • fossil rm
  • fossil mv
  • fossil ci --help # check in
  • fossil ci --branch <new_branch>  # fossill branch only when check in
  • fossil open <repo>.fossil --keep # use this to check differences(default:trunk)
  • fossil open <repo>.fossil <branch/tag> --keep # use this to check differences
My settings:
  • fossil settings --global  <OPTION> <VALUE>
    • fossil settings --global ignore-glob '*.o,*.exe'
    • fossil settings --global editor v
    • fossil settings --global allow-symlinks on
  • fossil ui
    • Admin->Timeline-> uncheck UTC time zone option # use local time
  • setup fossil server for multiple repository(r1.fossil, r2.fossil put in fs)
    • cd fs ; fossil ui --notfound notfound.html --files '*.html' .
    • notfound.html  can put some description in r1.fossil, r2.fossil
    • setup your password:Admin->Users-><id>->Password->Apply
    • fossil clone http://<id>@localhost:8080/r1 r1.fossil  # access by remote