summaryrefslogtreecommitdiff
path: root/development/cgit
diff options
context:
space:
mode:
authorponce <matteo.bernardini@gmail.com>2011-07-03 13:39:37 -0400
committerNiels Horn <niels.horn@slackbuilds.org>2011-07-14 21:54:01 -0300
commit769dadaf444a25834210f5f88b222913e9d7f92f (patch)
tree51c6df74f30dc71ffb23404dc027cf1d92cf4db0 /development/cgit
parent8f35cc6ad9a9a6d52b6fc971dabe0feb72798a73 (diff)
downloadslackbuilds-769dadaf444a25834210f5f88b222913e9d7f92f.tar.gz
development/cgit: Added (web frontend for git repositories)
Signed-off-by: dsomero <xgizzmo@slackbuilds.org>
Diffstat (limited to 'development/cgit')
-rw-r--r--development/cgit/README6
-rw-r--r--development/cgit/cgit.SlackBuild90
-rw-r--r--development/cgit/cgit.info12
-rw-r--r--development/cgit/config/cgit-httpd.conf44
-rw-r--r--development/cgit/config/cgit-lighttpd.conf20
-rw-r--r--development/cgit/config/cgit.conf2
-rw-r--r--development/cgit/config/cgitrc.sample22
-rw-r--r--development/cgit/slack-desc19
8 files changed, 215 insertions, 0 deletions
diff --git a/development/cgit/README b/development/cgit/README
new file mode 100644
index 0000000000..a8555e7edc
--- /dev/null
+++ b/development/cgit/README
@@ -0,0 +1,6 @@
+cgit is a web interface (cgi) for git repositories, written in C.
+
+The folder /var/cache/cgit, must be owned by your webserver user.
+
+A sample /etc/cgitrc (you must provide one) is in the $DOCS folder,
+and so are some example configuration files for apache and lighttpd.
diff --git a/development/cgit/cgit.SlackBuild b/development/cgit/cgit.SlackBuild
new file mode 100644
index 0000000000..9953e1dd93
--- /dev/null
+++ b/development/cgit/cgit.SlackBuild
@@ -0,0 +1,90 @@
+#!/bin/sh
+
+# Slackware build script for cgit
+# Written by ponce <matteo.bernardini@gmail.com>
+
+PRGNAM=cgit
+VERSION=${VERSION:-0.9.0.1}
+CGIT_VERSION=${CGIT_VERSION:-v$VERSION}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i486 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+DOCS="cgitrc.5.txt COPYING README $CWD/config/cgit-lighttpd.conf \
+ $CWD/config/cgit-httpd.conf $CWD/config/cgitrc.sample"
+
+GIT_TARBALL=$(grep \/git- $CWD/cgit.info | cut -d'/' -f8 | sed -e 's/\"//')
+
+set -e # Exit on most errors
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.?z*
+cd $PRGNAM-$VERSION
+chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
+
+# prepare sources
+sed -i -e "s|-g -Wall -Igit|-Wall ${SLKCFLAGS} -Igit|" Makefile
+sed -i -e "s|\/lib$|/lib${LIBDIRSUFFIX}|" Makefile
+sed -i -e "s|(libdir)|(prefix)/share|" Makefile
+cat $CWD/config/cgit.conf > cgit.conf
+echo "CGIT_VERSION = $CGIT_VERSION" >> cgit.conf
+
+# extract the git tarball
+rm -fR git
+tar xvf $CWD/$GIT_TARBALL
+mv git-* git
+
+make
+make install DESTDIR=$PKG
+
+find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+install -m0644 -oroot $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+# prepare the cache dir: default permissions are for the apache user and group
+mkdir -p $PKG/var/cache/cgit
+chown 80.80 $PKG/var/cache/cgit
+chmod 775 $PKG/var/cache/cgit
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/development/cgit/cgit.info b/development/cgit/cgit.info
new file mode 100644
index 0000000000..88379e18c8
--- /dev/null
+++ b/development/cgit/cgit.info
@@ -0,0 +1,12 @@
+PRGNAM="cgit"
+VERSION="0.9.0.1"
+HOMEPAGE="http://hjemli.net/git/cgit/"
+DOWNLOAD="http://ponce.cc/slackware/sources/repo/cgit-0.9.0.1.tar.bz2 \
+ http://www.kernel.org/pub/software/scm/git/git-1.7.4.4.tar.bz2"
+MD5SUM="dddae5bcfc1eeb469fc2b95531a75c1c \
+ 1313f71d62fa100b32fa313769a85f2a"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+MAINTAINER="ponce"
+EMAIL="matteo.bernardini@gmail.com"
+APPROVED="dsomero"
diff --git a/development/cgit/config/cgit-httpd.conf b/development/cgit/config/cgit-httpd.conf
new file mode 100644
index 0000000000..a579174fd0
--- /dev/null
+++ b/development/cgit/config/cgit-httpd.conf
@@ -0,0 +1,44 @@
+# sample folder and virtual host configurations for httpd.
+# edit, move it to /etc/httpd/extra and include it in
+# /etc/httpd/httpd.conf with a line
+#
+# Include /etc/httpd/extra/cgit-httpd.conf
+#
+# uncomment also the line
+#
+# AddHandler cgi-script .cgi
+
+<Directory /var/www/cgi-bin>
+ AllowOverride None
+ Order allow,deny
+ Allow from all
+</Directory>
+
+## Version 1 (default): under /cgi-bin/cgit.cgi address
+#ScriptAlias /cgi-bin/cgit.cgi /var/www/cgi-bin/cgit.cgi
+#Alias /cgit/ /var/www/cgi-bin/
+#<Location /cgit/cgit.cgi>
+# Options FollowSymlinks ExecCGI
+# Allow from All
+#</Location>
+#RewriteEngine on
+#RewriteCond %{REQUEST_FILENAME} !-f
+#RewriteCond %{REQUEST_FILENAME} !-d
+#RewriteRule ^/cgit/(.*)$ /cgit/cgit.cgi?url=$1 [L,QSA]
+
+# Version 2: cgit as a handler to whole vhost:
+<VirtualHost *:80>
+ ServerName cgit.my.domain
+ SetEnv CGIT_CONFIG /etc/cgitrc
+ Options FollowSymlinks ExecCGI
+ DirectoryIndex cgit.cgi
+ DocumentRoot /var/www/cgi-bin
+ <Location />
+ Options ExecCGI
+ Allow from All
+ </Location>
+ RewriteEngine on
+ RewriteCond %{REQUEST_FILENAME} !-f
+ RewriteCond %{REQUEST_FILENAME} !-d
+ RewriteRule ^(.*)$ /cgit.cgi?url=$1 [L,QSA]
+</VirtualHost>
diff --git a/development/cgit/config/cgit-lighttpd.conf b/development/cgit/config/cgit-lighttpd.conf
new file mode 100644
index 0000000000..fc49e5763f
--- /dev/null
+++ b/development/cgit/config/cgit-lighttpd.conf
@@ -0,0 +1,20 @@
+# sample virtual host configuration for lighttpd.
+# edit, move to /etc/lighttpd/ and include it in /etc/lighttpd/lighttpd.conf
+# with a line
+#
+# include "cgit-lighttpd.conf"
+
+$HTTP["host"] == "cgit.my.domain" {
+ alias.url = (
+ "/static/" => "/var/www/cgi-bin/",
+ "/cgit.cgi" => "/var/www/cgi-bin/cgit.cgi",
+ )
+ url.rewrite-once = (
+ "^/static/.*$" => "$0",
+ "^/([^?/]+/[^?]*)?(?:\?(.*))?$" => "/cgit.cgi?url=$1&$2",
+ )
+ cgi.assign = (
+ "/var/www/cgi-bin/cgit.cgi" => "",
+ )
+}
+
diff --git a/development/cgit/config/cgit.conf b/development/cgit/config/cgit.conf
new file mode 100644
index 0000000000..615c7efe97
--- /dev/null
+++ b/development/cgit/config/cgit.conf
@@ -0,0 +1,2 @@
+CGIT_SCRIPT_PATH = /var/www/cgi-bin
+CACHE_ROOT = /var/cache/cgit
diff --git a/development/cgit/config/cgitrc.sample b/development/cgit/config/cgitrc.sample
new file mode 100644
index 0000000000..29d3981a55
--- /dev/null
+++ b/development/cgit/config/cgitrc.sample
@@ -0,0 +1,22 @@
+# sample /etc/cgitrc file: two repos are defined
+# you can see a demo here http://cgit.ponce.cc/
+
+root-title=ponce's repository browser
+root-desc=a fast interface to these git repositories
+virtual-root=/
+snapshots=tar.gz
+
+#css=/static/cgit.css
+#logo=/static/cgit.png
+
+# repository specific data
+repo.url=slackbuilds
+repo.path=/path/to/repo/.git
+repo.desc=slackbuilds.org fork for slackware-current
+repo.owner=my.address _at_ my.isp
+# the default branch here is set to current (default if omitted is master)
+repo.defbranch=current
+repo.clone-url=git://github.com/Ponce/slackbuilds.git
+
+# if you need to display other repositories you can more config blocks
+# like the one above
diff --git a/development/cgit/slack-desc b/development/cgit/slack-desc
new file mode 100644
index 0000000000..7dfd09eef5
--- /dev/null
+++ b/development/cgit/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+cgit: cgit (web frontend for git repositories)
+cgit:
+cgit: cgit is a web interface (cgi) for git repositories, written in C.
+cgit:
+cgit: Homepage: http://hjemli.net/git/cgit/
+cgit:
+cgit:
+cgit:
+cgit:
+cgit:
+cgit: