diff options
Diffstat (limited to 'development/cgit')
-rw-r--r-- | development/cgit/README | 8 | ||||
-rw-r--r-- | development/cgit/cgit.SlackBuild | 86 | ||||
-rw-r--r-- | development/cgit/cgit.info | 14 | ||||
-rw-r--r-- | development/cgit/config/cgit-httpd.conf | 44 | ||||
-rw-r--r-- | development/cgit/config/cgit-lighttpd.conf | 20 | ||||
-rw-r--r-- | development/cgit/config/cgit.conf | 5 | ||||
-rw-r--r-- | development/cgit/config/cgitrc.sample | 18 | ||||
-rw-r--r-- | development/cgit/slack-desc | 14 |
8 files changed, 209 insertions, 0 deletions
diff --git a/development/cgit/README b/development/cgit/README new file mode 100644 index 0000000000..6c1281eb0b --- /dev/null +++ b/development/cgit/README @@ -0,0 +1,8 @@ +cgit (web frontend for git repositories) + +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 sample configuration files for apache and lighttpd. diff --git a/development/cgit/cgit.SlackBuild b/development/cgit/cgit.SlackBuild new file mode 100644 index 0000000000..08fedaec93 --- /dev/null +++ b/development/cgit/cgit.SlackBuild @@ -0,0 +1,86 @@ +#!/bin/sh + +# Slackware build script for cgit +# Written by ponce <matteo.bernardini@gmail.com> + +PRGNAM=cgit +VERSION=${VERSION:-20101116} +BUILD=${BUILD:-2} +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="COPYING README $CWD/config/cgit-lighttpd.conf \ + $CWD/config/cgit-httpd.conf $CWD/config/cgitrc.sample" + +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 + +# extract the git tarball +rm -fR git +GIT_TARBALL=$(grep http $CWD/config/cgit.conf | cut -d' ' -f3 | cut -d'/' -f8) +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 +cp -a $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 + +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..6574649acc --- /dev/null +++ b/development/cgit/cgit.info @@ -0,0 +1,14 @@ +PRGNAM="cgit" +VERSION="20101116" +HOMEPAGE="http://hjemli.net/git/cgit/" +DOWNLOAD=" +http://ponce.cc/slackware/sources/repo/cgit-20101116.tar.xz +http://www.kernel.org/pub/software/scm/git/git-1.7.4.1.tar.bz2" +MD5SUM=" +8088eadd232cbc7d5304124909bf1d28 +76898de4566d11c0d0eec7e99edc2b5c" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +MAINTAINER="ponce" +EMAIL="matteo.bernardini@gmail.com" +APPROVED="" 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..2e9d5b0435 --- /dev/null +++ b/development/cgit/config/cgit.conf @@ -0,0 +1,5 @@ +CGIT_VERSION = v0.8.3.4-115-g1759 +CGIT_SCRIPT_PATH = /var/www/cgi-bin +CACHE_ROOT = /var/cache/cgit +GIT_VER = 1.7.4.1 +GIT_URL = http://www.kernel.org/pub/software/scm/git/git-1.7.4.1.tar.bz2 diff --git a/development/cgit/config/cgitrc.sample b/development/cgit/config/cgitrc.sample new file mode 100644 index 0000000000..84a2d277fa --- /dev/null +++ b/development/cgit/config/cgitrc.sample @@ -0,0 +1,18 @@ +# 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 + +# the default branch here is set to current (would have been master) +repo.url=slackbuilds +repo.path=/path/to/repo/.git +repo.desc=slackbuilds.org fork for slackware-current +repo.owner=my.address _at_ my.isp +repo.defbranch=current +repo.clone-url=git://github.com/Ponce/slackbuilds.git diff --git a/development/cgit/slack-desc b/development/cgit/slack-desc new file mode 100644 index 0000000000..8cafdd8902 --- /dev/null +++ b/development/cgit/slack-desc @@ -0,0 +1,14 @@ +# 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: |