Friday 30 December 2011

Installing gitweb on dlink323

Next step after installing git: gitweb

Following instructions from http://www.deimos.fr (Thanks to the author)

Additional instructions
That did not go as smoothly as we can expect when following a tuto, so, here are some additional help:
- mod_alias shall also be set in lighttpd.conf
- not sure my lighttp config is as expected, so I have appended the gitweb.conf example to lighttp regular config into lighttp-gitweb.conf, and started a new instance of lighttp :
lighttpd -f lighttp-gitweb.conf
- directed gitweb interface to port 8081 (since I already have one web server running on 8080)
- comment out the cgi.assign line : from 50-gitweb.conf :
# cgi.assign = ( "" => "" )


gitweb configuration
By default, projects have no description, and owner may not be properly set. Here are tips to change it:
- description:
- edit .git/description file
- add a single text line
- owner:
- edit .git/config file, and add a new section :
[gitweb]
owner = "My name"


useful links



Sunday 25 December 2011

Installling git on dlink323

I am working to install git on my NAS, a dlink323 model

I have been spending some time already several months ago installing fun-plug, following detailed instructions from a web site that I lost track since then. Seems that NAS-tweaks.net would be doing the job today.

git does not come pre-compiled for this platform. Therefore, I had to download and compile git source code

Here are the steps I have been following. Hope that will help some of you.

Step 1: download all packages coming with fun_plug

cd /mnt/HD_a2/
mkdir working
cd working
rsync -av --delete inreto.de::dns323/fun-plug/0.5/packages .

(see also this)


Step 2: download git source code

cd /mnt/HD_a2/working
mkdir git
cd git
wget http://git-core.googlecode.com/files/git-1.7.7.5.tar.gz
tar -xzf git-1.7.7.5.tar.gz

Step 3: install packages required for compiling

we'll need: make, gcc, kernel-headers, binutils, openssl, uclibc, libiconv, expat, gettext:
cd /mnt/HD_a2/working/packages
funpkg -i make*
funpkg -i gcc*
funpkg -i kernel-headers*
funpkg -i binutils*
funpkg -i openssl*
funpkg -i uclibc*
funpkg -i libiconv*
funpkg -i expat*
funpkg -i gettext*
funpkg -i tcl*
funpkg -i tar*

additional packages required
wget http://inreto.de/dns323/fun-plug/0.5/extra-packages/All/curl-7.19.4-1.tgz
funpkg -i curl*

wget http://inreto.de/dns323/fun-plug/0.5/extra-packages/All/perl-5.10-2.tgz
funpkg -i perl*

see here for installing python ... This one takes some times ...
Note that I had to move my tmp folder to an other location. default tmp location is running in RAM disk, and seems to be too small ...
mv tmp/. /mnt/HD_a2/working/tmp;rmdir tmp;ln -s /mnt/HD_a2/working/tmp tmp


Step 4: some customization
4.1. edit Makefile
go to line 821, and add:
ifeq ($(uname_S),Linux)
NO_STRLCPY = YesPlease
NO_MKSTEMPS = YesPlease
HAVE_PATHS_H = YesPlease
NO_NSEC = YesPlease
NEEDS_LIBICONV = YesPlease
endif

4.2. symlinks to perl & python
cd /usr/bin
ln -s /ffp/bin/perl perl
ln -s /ffp/bin/python python

4.3. make
./configure --prefix=/ffp
make
make install



My diary was as follow:

The first big issue was in resolving "error trying to exec `as': execvp: No such file or directory"
after some google-research, i managed to find where as is ... you have to instazll glibc or binutils (not sure which one resolved that issue)

The next big issue was after running make, and waiting a quite long time to get it built. I obviously encountered several errors, the first one was a compile error with ST_CTIME_NSEC macro in read-cache.c.

CC read-cache.o
read-cache.c: In function 'fill_stat_cache_info':
read-cache.c:73: error: 'struct stat' has no member named 'st_ctimespec'
read-cache.c:74: error: 'struct stat' has no member named 'st_mtimespec'
read-cache.c: In function 'read_index_from':
read-cache.c:1333: error: 'struct stat' has no member named 'st_mtimespec'
read-cache.c: In function 'write_index':
read-cache.c:1638: error: 'struct stat' has no member named 'st_mtimespec'
make: *** [read-cache.o] Error 1

Solution was to change NO_NSEC option in Makefile


Also met an error in utf8.c wrt libiconv options. Installing libiconv did resolve this error


Conclusion
I have been writing this page while doing the job, and may have missed some steps. Leave a comment if you have issues. I'm not an expert, but will share my experience on this... Enjoy !