Advertisement
ponce

cgit patch

Nov 25th, 2013
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.88 KB | None | 0 0
  1. diff -Naur cgit.orig/cgit.SlackBuild cgit/cgit.SlackBuild
  2. --- cgit.orig/cgit.SlackBuild 2013-11-25 11:25:12.243100086 +0100
  3. +++ cgit/cgit.SlackBuild 2013-11-25 09:36:07.503709880 +0100
  4. @@ -23,7 +23,7 @@
  5.  
  6. PRGNAM=cgit
  7. VERSION=${VERSION:-20130826_d62e71a}
  8. -BUILD=${BUILD:-1}
  9. +BUILD=${BUILD:-2}
  10. TAG=${TAG:-_SBo}
  11.  
  12. DOCROOT=${DOCROOT:-/var/www}
  13. @@ -58,8 +58,7 @@
  14. CGIT_VERSION=${CGIT_VERSION:-v0.9.2-21-gd62e}
  15. GIT_VERSION=${GIT_VERSION:-1.8.4}
  16.  
  17. -SEDDOCS="$CWD/config/cgit-lighttpd.conf $CWD/config/cgit-httpd.conf"
  18. -DOCS="cgitrc.5.txt COPYING README $CWD/config/cgitrc.sample $SEDDOCS"
  19. +DOCS="cgitrc.5.txt COPYING README $CWD/config/cgitrc.sample"
  20.  
  21. set -e
  22.  
  23. @@ -82,7 +81,9 @@
  24. -e "s|\/lib$|/lib${LIBDIRSUFFIX}|" \
  25. -e "s|(libdir)|(prefix)/share|" \
  26. -e "s|/usr/local|/usr|"
  27. -sed -e "s|@DOCROOT@|$DOCROOT|g" $CWD/config/cgit.conf > cgit.conf
  28. +# prefare a needed cgit.conf file in the sources with some defaults
  29. +echo "CGIT_SCRIPT_PATH = $DOCROOT/cgi-bin" > cgit.conf
  30. +echo "CACHE_ROOT = /var/cache/cgit" >> cgit.conf
  31. echo "CGIT_VERSION = $CGIT_VERSION" >> cgit.conf
  32.  
  33. # extract the git tarball
  34. @@ -97,8 +98,13 @@
  35. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  36.  
  37. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  38. -sed -i "s|@DOCROOT@|$DOCROOT|g" $SEDDOCS
  39. -install -m0644 -oroot $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
  40. +install -m0644 -oroot \
  41. + $DOCS $CWD/config/cgit-lighttpd.conf $CWD/config/cgit-httpd.conf \
  42. + $PKG/usr/doc/$PRGNAM-$VERSION
  43. +sed -i \
  44. + "s|@DOCROOT@|$DOCROOT|g" \
  45. + $PKG/usr/doc/$PRGNAM-$VERSION/cgit-lighttpd.conf \
  46. + $PKG/usr/doc/$PRGNAM-$VERSION/cgit-httpd.conf
  47. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  48.  
  49. # prepare the cache dir: default permissions are for the apache user and group
  50. diff -Naur cgit.orig/config/cgit-httpd.conf cgit/config/cgit-httpd.conf
  51. --- cgit.orig/config/cgit-httpd.conf 2013-11-25 11:25:12.243100086 +0100
  52. +++ cgit/config/cgit-httpd.conf 2013-11-25 11:21:06.951085462 +0100
  53. @@ -7,15 +7,20 @@
  54. # uncomment also the line
  55. #
  56. # AddHandler cgi-script .cgi
  57. +#
  58. +# note that url-rewriting and cgis under apache needs some modules
  59. +# not enabled in Slackware's default httpd configuration:
  60. +# be sure to uncomment the lines loading mod_cgi.so and
  61. +# mod_rewrite.so in /etc/httpd/httpd.conf
  62.  
  63. -<Directory /home/www/cgi-bin>
  64. +<Directory @DOCROOT@/cgi-bin>
  65. AllowOverride None
  66. Require all granted
  67. </Directory>
  68.  
  69. ## Version 1 (default): under /cgi-bin/cgit.cgi address
  70. -#ScriptAlias /cgi-bin/cgit.cgi /home/www/cgi-bin/cgit.cgi
  71. -#Alias /cgit/ /home/www/cgi-bin/
  72. +#ScriptAlias /cgi-bin/cgit.cgi @DOCROOT@/cgi-bin/cgit.cgi
  73. +#Alias /cgit/ @DOCROOT@/cgi-bin/
  74. #<Location /cgit/cgit.cgi>
  75. # Options FollowSymlinks ExecCGI
  76. # Require all granted
  77. @@ -25,13 +30,13 @@
  78. #RewriteCond %{REQUEST_FILENAME} !-d
  79. #RewriteRule ^/cgit/(.*)$ /cgit/cgit.cgi?url=$1 [L,QSA]
  80.  
  81. -# Version 2: cgit as a handler to whole vhost:
  82. +# Version 2: cgit as a handler to a vhost:
  83. <VirtualHost *:80>
  84. ServerName cgit.my.domain
  85. SetEnv CGIT_CONFIG /etc/cgitrc
  86. Options FollowSymlinks ExecCGI
  87. DirectoryIndex cgit.cgi
  88. - DocumentRoot /home/www/cgi-bin
  89. + DocumentRoot @DOCROOT@/cgi-bin
  90. <Location />
  91. Options ExecCGI
  92. Require all granted
  93. diff -Naur cgit.orig/config/cgit-lighttpd.conf cgit/config/cgit-lighttpd.conf
  94. --- cgit.orig/config/cgit-lighttpd.conf 2013-11-25 11:25:12.243100086 +0100
  95. +++ cgit/config/cgit-lighttpd.conf 2013-11-25 09:28:54.476684063 +0100
  96. @@ -6,15 +6,14 @@
  97.  
  98. $HTTP["host"] == "cgit.my.domain" {
  99. alias.url = (
  100. - "/static/" => "/home/www/cgi-bin/",
  101. - "/cgit.cgi" => "/home/www/cgi-bin/cgit.cgi",
  102. + "/static/" => "@DOCROOT@/cgi-bin/",
  103. + "/cgit.cgi" => "@DOCROOT@/cgi-bin/cgit.cgi",
  104. )
  105. url.rewrite-once = (
  106. "^/static/.*$" => "$0",
  107. "^/([^?/]+/[^?]*)?(?:\?(.*))?$" => "/cgit.cgi?url=$1&$2",
  108. )
  109. cgi.assign = (
  110. - "/home/www/cgi-bin/cgit.cgi" => "",
  111. + "@DOCROOT@/cgi-bin/cgit.cgi" => "",
  112. )
  113. }
  114. -
  115. diff -Naur cgit.orig/config/cgit.conf cgit/config/cgit.conf
  116. --- cgit.orig/config/cgit.conf 2013-11-25 11:25:12.243100086 +0100
  117. +++ cgit/config/cgit.conf 1970-01-01 01:00:00.000000000 +0100
  118. @@ -1,2 +0,0 @@
  119. -CGIT_SCRIPT_PATH = @DOCROOT@/cgi-bin
  120. -CACHE_ROOT = /var/cache/cgit
  121. diff -Naur cgit.orig/config/cgitrc.sample cgit/config/cgitrc.sample
  122. --- cgit.orig/config/cgitrc.sample 2013-11-23 10:07:15.970518715 +0100
  123. +++ cgit/config/cgitrc.sample 2013-11-25 09:25:47.162672895 +0100
  124. @@ -20,5 +20,5 @@
  125. repo.defbranch=current
  126. repo.clone-url=git://github.com/Ponce/slackbuilds.git
  127.  
  128. -# if you need to display other repositories you can more config blocks
  129. +# if you need to display other repositories you can add more config blocks
  130. # like the one above
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement