Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -Naur cgit.orig/cgit.SlackBuild cgit/cgit.SlackBuild
- --- cgit.orig/cgit.SlackBuild 2013-11-25 11:25:12.243100086 +0100
- +++ cgit/cgit.SlackBuild 2013-11-25 09:36:07.503709880 +0100
- @@ -23,7 +23,7 @@
- PRGNAM=cgit
- VERSION=${VERSION:-20130826_d62e71a}
- -BUILD=${BUILD:-1}
- +BUILD=${BUILD:-2}
- TAG=${TAG:-_SBo}
- DOCROOT=${DOCROOT:-/var/www}
- @@ -58,8 +58,7 @@
- CGIT_VERSION=${CGIT_VERSION:-v0.9.2-21-gd62e}
- GIT_VERSION=${GIT_VERSION:-1.8.4}
- -SEDDOCS="$CWD/config/cgit-lighttpd.conf $CWD/config/cgit-httpd.conf"
- -DOCS="cgitrc.5.txt COPYING README $CWD/config/cgitrc.sample $SEDDOCS"
- +DOCS="cgitrc.5.txt COPYING README $CWD/config/cgitrc.sample"
- set -e
- @@ -82,7 +81,9 @@
- -e "s|\/lib$|/lib${LIBDIRSUFFIX}|" \
- -e "s|(libdir)|(prefix)/share|" \
- -e "s|/usr/local|/usr|"
- -sed -e "s|@DOCROOT@|$DOCROOT|g" $CWD/config/cgit.conf > cgit.conf
- +# prefare a needed cgit.conf file in the sources with some defaults
- +echo "CGIT_SCRIPT_PATH = $DOCROOT/cgi-bin" > cgit.conf
- +echo "CACHE_ROOT = /var/cache/cgit" >> cgit.conf
- echo "CGIT_VERSION = $CGIT_VERSION" >> cgit.conf
- # extract the git tarball
- @@ -97,8 +98,13 @@
- | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
- mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
- -sed -i "s|@DOCROOT@|$DOCROOT|g" $SEDDOCS
- -install -m0644 -oroot $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
- +install -m0644 -oroot \
- + $DOCS $CWD/config/cgit-lighttpd.conf $CWD/config/cgit-httpd.conf \
- + $PKG/usr/doc/$PRGNAM-$VERSION
- +sed -i \
- + "s|@DOCROOT@|$DOCROOT|g" \
- + $PKG/usr/doc/$PRGNAM-$VERSION/cgit-lighttpd.conf \
- + $PKG/usr/doc/$PRGNAM-$VERSION/cgit-httpd.conf
- cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
- # prepare the cache dir: default permissions are for the apache user and group
- diff -Naur cgit.orig/config/cgit-httpd.conf cgit/config/cgit-httpd.conf
- --- cgit.orig/config/cgit-httpd.conf 2013-11-25 11:25:12.243100086 +0100
- +++ cgit/config/cgit-httpd.conf 2013-11-25 11:21:06.951085462 +0100
- @@ -7,15 +7,20 @@
- # uncomment also the line
- #
- # AddHandler cgi-script .cgi
- +#
- +# note that url-rewriting and cgis under apache needs some modules
- +# not enabled in Slackware's default httpd configuration:
- +# be sure to uncomment the lines loading mod_cgi.so and
- +# mod_rewrite.so in /etc/httpd/httpd.conf
- -<Directory /home/www/cgi-bin>
- +<Directory @DOCROOT@/cgi-bin>
- AllowOverride None
- Require all granted
- </Directory>
- ## Version 1 (default): under /cgi-bin/cgit.cgi address
- -#ScriptAlias /cgi-bin/cgit.cgi /home/www/cgi-bin/cgit.cgi
- -#Alias /cgit/ /home/www/cgi-bin/
- +#ScriptAlias /cgi-bin/cgit.cgi @DOCROOT@/cgi-bin/cgit.cgi
- +#Alias /cgit/ @DOCROOT@/cgi-bin/
- #<Location /cgit/cgit.cgi>
- # Options FollowSymlinks ExecCGI
- # Require all granted
- @@ -25,13 +30,13 @@
- #RewriteCond %{REQUEST_FILENAME} !-d
- #RewriteRule ^/cgit/(.*)$ /cgit/cgit.cgi?url=$1 [L,QSA]
- -# Version 2: cgit as a handler to whole vhost:
- +# Version 2: cgit as a handler to a vhost:
- <VirtualHost *:80>
- ServerName cgit.my.domain
- SetEnv CGIT_CONFIG /etc/cgitrc
- Options FollowSymlinks ExecCGI
- DirectoryIndex cgit.cgi
- - DocumentRoot /home/www/cgi-bin
- + DocumentRoot @DOCROOT@/cgi-bin
- <Location />
- Options ExecCGI
- Require all granted
- diff -Naur cgit.orig/config/cgit-lighttpd.conf cgit/config/cgit-lighttpd.conf
- --- cgit.orig/config/cgit-lighttpd.conf 2013-11-25 11:25:12.243100086 +0100
- +++ cgit/config/cgit-lighttpd.conf 2013-11-25 09:28:54.476684063 +0100
- @@ -6,15 +6,14 @@
- $HTTP["host"] == "cgit.my.domain" {
- alias.url = (
- - "/static/" => "/home/www/cgi-bin/",
- - "/cgit.cgi" => "/home/www/cgi-bin/cgit.cgi",
- + "/static/" => "@DOCROOT@/cgi-bin/",
- + "/cgit.cgi" => "@DOCROOT@/cgi-bin/cgit.cgi",
- )
- url.rewrite-once = (
- "^/static/.*$" => "$0",
- "^/([^?/]+/[^?]*)?(?:\?(.*))?$" => "/cgit.cgi?url=$1&$2",
- )
- cgi.assign = (
- - "/home/www/cgi-bin/cgit.cgi" => "",
- + "@DOCROOT@/cgi-bin/cgit.cgi" => "",
- )
- }
- -
- diff -Naur cgit.orig/config/cgit.conf cgit/config/cgit.conf
- --- cgit.orig/config/cgit.conf 2013-11-25 11:25:12.243100086 +0100
- +++ cgit/config/cgit.conf 1970-01-01 01:00:00.000000000 +0100
- @@ -1,2 +0,0 @@
- -CGIT_SCRIPT_PATH = @DOCROOT@/cgi-bin
- -CACHE_ROOT = /var/cache/cgit
- diff -Naur cgit.orig/config/cgitrc.sample cgit/config/cgitrc.sample
- --- cgit.orig/config/cgitrc.sample 2013-11-23 10:07:15.970518715 +0100
- +++ cgit/config/cgitrc.sample 2013-11-25 09:25:47.162672895 +0100
- @@ -20,5 +20,5 @@
- repo.defbranch=current
- repo.clone-url=git://github.com/Ponce/slackbuilds.git
- -# if you need to display other repositories you can more config blocks
- +# if you need to display other repositories you can add more config blocks
- # like the one above
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement