cgit: adopted

clean up dependencies; accommodate offline builds (after pkgmk -do)
This commit is contained in:
John McQuah 2023-08-18 14:38:58 -04:00
parent ac05f262ee
commit b864b91252
7 changed files with 209 additions and 46 deletions

View File

@ -1,14 +1,12 @@
drwxr-xr-x root/root etc/
drwxr-xr-x root/root etc/apache/
drwxr-xr-x root/root etc/apache/extra/
-rw-r----- root/root etc/apache/extra/cgit.conf
drwxr-xr-x root/root etc/apache/original/
drwxr-xr-x root/root etc/apache/original/extra/
-rw-r----- root/root etc/apache/original/extra/cgit.conf
-rw-r--r-- root/root etc/cgitrc
drwxr-xr-x root/root usr/
drwxr-xr-x root/root usr/lib/
drwxr-xr-x root/root usr/lib/cgit/
-rwxr-xr-x root/root usr/lib/cgit/cgit.cgi
-rw-r--r-- root/root usr/lib/cgit/cgit.css
-rw-r--r-- root/root usr/lib/cgit/cgit.png
-rw-r--r-- root/root usr/lib/cgit/favicon.ico
drwxr-xr-x root/root usr/lib/cgit/filters/
-rwxr-xr-x root/root usr/lib/cgit/filters/about-formatting.sh
-rwxr-xr-x root/root usr/lib/cgit/filters/commit-links.sh
@ -26,17 +24,7 @@ drwxr-xr-x root/root usr/lib/cgit/filters/html-converters/
-rw-r--r-- root/root usr/lib/cgit/filters/simple-authentication.lua
-rwxr-xr-x root/root usr/lib/cgit/filters/syntax-highlighting.py
-rwxr-xr-x root/root usr/lib/cgit/filters/syntax-highlighting.sh
drwxr-xr-x root/root usr/share/
drwxr-xr-x root/root usr/share/man/
drwxr-xr-x root/root usr/share/man/man5/
-rw-r--r-- root/root usr/share/man/man5/cgitrc.5.gz
drwxr-xr-x root/root usr/share/webapps/
drwxr-xr-x root/root usr/share/webapps/cgit/
lrwxrwxrwx root/root usr/share/webapps/cgit/cgit.cgi -> ../../../lib/cgit/cgit.cgi
-rw-r--r-- root/root usr/share/webapps/cgit/cgit.css
-rw-r--r-- root/root usr/share/webapps/cgit/cgit.png
-rw-r--r-- root/root usr/share/webapps/cgit/favicon.ico
-rw-r--r-- root/root usr/share/webapps/cgit/robots.txt
-rw-r--r-- root/root usr/lib/cgit/robots.txt
drwxr-xr-x root/root var/
drwxr-xr-x root/root var/cache/
drwxr-xr-x root/root var/cache/cgit/

View File

@ -1,6 +1,9 @@
untrusted comment: verify with /etc/ports/contrib.pub
RWSagIOpLGJF3/KN2KTR7yDJzlu9NzwUekk9hlAG0tyWnPET9kBHQFULF/JsxDLkzOVir/V44DtjFL00SNp6N/ssnma6q4enJgc=
SHA256 (Pkgfile) = 90479dd41b0d35de63bcfe4b2ca2f9099f109b0cd73e9dfb92707099e4257a4a
SHA256 (.footprint) = 7298fdc3feaa73e32d0976e64850823ea876c795e128ca35a7e968821b8fdd1c
RWSagIOpLGJF3yuru6+3FyeY6QeoHvN8OMpfU+7VCq4pGLlsNxTyJiFr+k5txH8hoEdr6iZca74XI8xm1hTz3jwsqBlwXfApZgw=
SHA256 (Pkgfile) = 3f985d71135ba0fefb6c543e5882d7c3d558b9141d33033ac032b3d2196135ce
SHA256 (.footprint) = 770320bc050e8bfc954e2b81aad2723a6ea91291ac8044f6cbdfd26741d4709f
SHA256 (cgit-1.2.3.tar.xz) = 5a5f12d2f66bd3629c8bc103ec8ec2301b292e97155d30a9a61884ea414a6da4
SHA256 (cgit.conf) = 89927d462c0504863c163eb8a210e5d65db30ee6e4300ff6a2f92460e4f20a62
SHA256 (git-2.25.1.tar.xz) = 222796cc6e3bf2f9fd765f8f097daa3c3999bb7865ac88a8c974d98182e29f26
SHA256 (cgitrc) = 710755f757c160dd97ad77fed916693d3ddcb60a7f60694daf61d7526f0ff649
SHA256 (cgit.conf) = 528fea827ba71ef9efa80e1d32c8dd365b314af32d8a7e93518fdaf7a3292ef1
SHA256 (lighttpd-cgit.conf) = 9a10ca0b815679f10e21b2dd14e9c319cbf01c0418204a8bb1d15963005c25e1

View File

@ -1,26 +1,44 @@
# Description: Git web interface written in C.
# URL: https://git.zx2c4.com/cgit/
# Maintainer: Danny Rawlins, crux at romster dot me
# Depends on: asciidoc curl
# Maintainer: John McQuah, jmcquah at disroot dot org
# Depends on:
# Optional: apache asciidoc lighttpd luajit
name=cgit
version=1.2.3
release=1
_gitver=2.25.1
release=2
source=(https://git.zx2c4.com/cgit/snapshot/$name-$version.tar.xz
cgit.conf)
https://www.kernel.org/pub/software/scm/git/git-${_gitver}.tar.xz
cgitrc
cgit.conf
lighttpd-cgit.conf)
build() {
cd $name-$version
cd $name-$version
make get-git
make
make doc-man
make CGIT_SCRIPT_PATH=/usr/share/webapps/cgit DESTDIR=$PKG prefix=/usr install install-man
rm -rf git && mv $SRC/git-${_gitver} git
make
make CGIT_SCRIPT_PATH=/usr/lib/cgit DESTDIR=$PKG prefix=/usr install
install -d $PKG/var/cache/cgit $PKG/usr/lib/cgit
install -D -m 0640 $SRC/cgit.conf $PKG/etc/apache/original/extra/cgit.conf
install -D -m 0640 $SRC/cgit.conf $PKG/etc/apache/extra/cgit.conf
install -m 0644 $SRC/cgitrc $PKG/etc/cgitrc
mkdir -p $PKG/var/cache/cgit
mv $PKG/usr/share/webapps/cgit/cgit.cgi $PKG/usr/lib/cgit
ln -sf ../../../lib/cgit/cgit.cgi $PKG/usr/share/webapps/cgit/cgit.cgi
# a web server should be present prior to building this port;
# otherwise the config files must be created manually
if prt-get isinst apache 2>/dev/null; then
install -D -m 0644 $SRC/cgit.conf $PKG/etc/apache/original/extra/cgit.conf
install -D -m 0644 $SRC/cgit.conf $PKG/etc/apache/extra/cgit.conf
fi
if prt-get isinst lighttpd 2>/dev/null; then
install -D -m 0644 $SRC/lighttpd-cgit.conf $PKG/etc/lighttpd-cgit.conf
fi
# asciidoc is needed to generate the man-page
if command -v a2x >/dev/null; then
make doc-man
make DESTDIR=$PKG prefix=/usr install-man
fi
}

View File

@ -1,16 +1,6 @@
ScriptAlias /cgit/ "/usr/lib/cgit/cgit.cgi/"
Alias /cgit-css "/usr/share/webapps/cgit/"
<Directory "/usr/share/webapps/cgit/">
AllowOverride None
Options None
Require all granted
AuthType Basic
AuthName cgit
AuthUserFile /etc/httpd/conf/passwd
Require user root
</Directory>
Alias /cgit-css "/usr/lib/cgit/"
<Directory "/usr/lib/cgit/">
AllowOverride None

144
cgit/cgitrc Normal file
View File

@ -0,0 +1,144 @@
# /etc/cgitrc (location can be changed using the env var CGIT_CONFIG)
# Enable caching of up to 1000 output entries
cache-size=1000
# Customize the appearance
css=/cgit.css
favicon=/favicon.ico
logo=/cgit.png
# Show owner on index page
enable-index-owner=1
# Allow http transport git clone
enable-http-clone=1
# Show extra links for each repository on the index page
enable-index-links=1
# Enable blame page and create links to it from tree page
enable-blame=1
# Enable ASCII art commit history graph on the log pages
enable-commit-graph=1
# Show number of affected files per commit on the log pages
enable-log-filecount=1
# Show number of added/removed lines per commit on the log pages
enable-log-linecount=1
# Sort branches by date
branch-sort=age
# Enable statistics per week, month and quarter
max-stats=quarter
# Set the title and heading of the repository index page
root-title=crux.nu git repositories
# Set a subheading for the repository index page
root-desc=tracking the development of crux ports
# Include some more info about this site on the index page
root-readme=/var/www/htdocs/about.html
# Allow download of tar.gz, tar.bz2 and zip-files
snapshots=tar.gz tar.bz2 zip
##
## List of common mimetypes
##
mimetype.gif=image/gif
mimetype.html=text/html
mimetype.jpg=image/jpeg
mimetype.jpeg=image/jpeg
mimetype.pdf=application/pdf
mimetype.png=image/png
mimetype.svg=image/svg+xml
# Highlight source code with python pygments-based highlighter
source-filter=/usr/lib/cgit/filters/syntax-highlighting.py
# Format markdown, restructuredtext, manpages, text files, and html files
# through the right converters
about-filter=/usr/lib/cgit/filters/about-formatting.sh
##
## Search for these files in the root of the default branch of repositories
## for coming up with the about page:
##
readme=:README.md
readme=:readme.md
readme=:README.mkd
readme=:readme.mkd
readme=:README.rst
readme=:readme.rst
readme=:README.html
readme=:readme.html
readme=:README.htm
readme=:readme.htm
readme=:README.txt
readme=:readme.txt
readme=:README
readme=:readme
readme=:INSTALL.md
readme=:install.md
readme=:INSTALL.mkd
readme=:install.mkd
readme=:INSTALL.rst
readme=:install.rst
readme=:INSTALL.html
readme=:install.html
readme=:INSTALL.htm
readme=:install.htm
readme=:INSTALL.txt
readme=:install.txt
readme=:INSTALL
readme=:install
##
## List of repositories.
## PS: Any repositories listed when section is unset will not be
## displayed under a section heading
## PPS: This list could be kept in a different file (e.g. '/etc/cgitrepos')
## and included like this:
## include=/etc/cgitrepos
##
repo.url=core
repo.path=/usr/ports/core/.git
repo.desc=the core collection
repo.owner=core-ports@crux.nu
repo.readme=info/web/about.html
repo.url=xorg
repo.url=opt
repo.path=/usr/ports/opt/.git
repo.desc=the opt collection
repo.owner=opt-ports@crux.nu
repo.readme=info/web/about.html
repo.url=xorg
repo.path=/usr/ports/xorg/.git
repo.desc=the xorg collection
repo.owner=xorg-ports@crux.nu
repo.readme=info/web/about.html
# The next repositories will be displayed under the 'extras' heading
section=extras
repo.url=contrib
repo.path=/usr/ports/contrib/.git
repo.desc=the contrib collection
# Disable adhoc downloads of this repo
repo.snapshots=0
# Disable line-counts for this repo
repo.enable-log-linecount=0
# Restrict the max statistics period for this repo
repo.max-stats=month

15
cgit/lighttpd-cgit.conf Normal file
View File

@ -0,0 +1,15 @@
server.modules += ( "mod_cgi", "mod_alias" )
$HTTP["url"] =~ "^/cgit" {
server.document-root = "/usr/lib/cgit/"
server.indexfiles = ("cgit.cgi")
cgi.assign = ("cgit.cgi" => "")
mimetype.assign = ( ".css" => "text/css" )
}
alias.url += (
"/git" => "/usr/lib/cgit/cgit.cgi",
)
$HTTP["url"] =~ "^/git" {
cgi.assign = ( "" => "" )
}

5
cgit/post-install Normal file
View File

@ -0,0 +1,5 @@
#!/bin/sh
if prt-get isinst lighttpd 2>/dev/null; then
echo 'include "lighttpd-cgit.conf"' >> /etc/lighttpd.conf
fi