stagit-gopher

[fork] gopher git frontend
Log | Files | Refs | README | LICENSE

commit 6bb3402bcb869a41c551b4d44402724475c07843
parent 9e6e8d46d2ebb467c53c6b67c9c949c9c3cb8f5a
Author: hhvn <hayden@haydenvh.com>
Date:   Sun,  7 Feb 2021 21:26:54 +0000

update create.sh

Diffstat:
DMakefile | 101-------------------------------------------------------------------------------
Mcreate.sh | 4++--
Dexample_create.sh | 41-----------------------------------------
3 files changed, 2 insertions(+), 144 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,101 +0,0 @@ -.POSIX: - -NAME = stagit-gopher -VERSION = 0.9.4 - -# paths -PREFIX = /usr/local -MANPREFIX = ${PREFIX}/man -DOCPREFIX = ${PREFIX}/share/doc/${NAME} - -LIBGIT_INC = -I/usr/local/include -LIBGIT_LIB = -L/usr/local/lib -lgit2 - -# use system flags. -STAGIT_CFLAGS = ${LIBGIT_INC} ${CFLAGS} -STAGIT_LDFLAGS = ${LIBGIT_LIB} ${LDFLAGS} -STAGIT_CPPFLAGS = -D_XOPEN_SOURCE=700 -D_DEFAULT_SOURCE -D_BSD_SOURCE - -SRC = \ - stagit-gopher.c\ - stagit-gopher-index.c -COMPATSRC = \ - reallocarray.c\ - strlcpy.c -BIN = \ - stagit-gopher\ - stagit-gopher-index -MAN1 = \ - stagit-gopher.1\ - stagit-gopher-index.1 -DOC = \ - LICENSE\ - README -HDR = compat.h - -COMPATOBJ = \ - reallocarray.o\ - strlcpy.o - -OBJ = ${SRC:.c=.o} ${COMPATOBJ} - -all: ${BIN} - -.o: - ${CC} -o $@ ${LDFLAGS} - -.c.o: - ${CC} -o $@ -c $< ${STAGIT_CFLAGS} ${STAGIT_CPPFLAGS} - -dist: - rm -rf ${NAME}-${VERSION} - mkdir -p ${NAME}-${VERSION} - cp -f ${MAN1} ${HDR} ${SRC} ${COMPATSRC} ${DOC} \ - Makefile \ - example_create.sh example_post-receive.sh \ - ${NAME}-${VERSION} - # make tarball - tar -cf - ${NAME}-${VERSION} | \ - gzip -c > ${NAME}-${VERSION}.tar.gz - rm -rf ${NAME}-${VERSION} - -${OBJ}: ${HDR} - -stagit-gopher: stagit-gopher.o ${COMPATOBJ} - ${CC} -o $@ stagit-gopher.o ${COMPATOBJ} ${STAGIT_LDFLAGS} - -stagit-gopher-index: stagit-gopher-index.o ${COMPATOBJ} - ${CC} -o $@ stagit-gopher-index.o ${COMPATOBJ} ${STAGIT_LDFLAGS} - -clean: - rm -f ${BIN} ${OBJ} ${NAME}-${VERSION}.tar.gz - -install: all - # installing executable files. - mkdir -p ${DESTDIR}${PREFIX}/bin - cp -f ${BIN} ${DESTDIR}${PREFIX}/bin - for f in ${BIN}; do chmod 755 ${DESTDIR}${PREFIX}/bin/$$f; done - # installing example files. - mkdir -p ${DESTDIR}${DOCPREFIX} - cp -f example_create.sh\ - example_post-receive.sh\ - README\ - ${DESTDIR}${DOCPREFIX} - # installing manual pages. - mkdir -p ${DESTDIR}${MANPREFIX}/man1 - cp -f ${MAN1} ${DESTDIR}${MANPREFIX}/man1 - for m in ${MAN1}; do chmod 644 ${DESTDIR}${MANPREFIX}/man1/$$m; done - -uninstall: - # removing executable files. - for f in ${BIN}; do rm -f ${DESTDIR}${PREFIX}/bin/$$f; done - # removing example files. - rm -f \ - ${DESTDIR}${DOCPREFIX}/example_create.sh\ - ${DESTDIR}${DOCPREFIX}/example_post-receive.sh\ - ${DESTDIR}${DOCPREFIX}/README - -rmdir ${DESTDIR}${DOCPREFIX} - # removing manual pages. - for m in ${MAN1}; do rm -f ${DESTDIR}${MANPREFIX}/man1/$$m; done - -.PHONY: all clean dist install uninstall diff --git a/create.sh b/create.sh @@ -32,11 +32,11 @@ for dir in "${reposdir}/"*/; do mkdir -p "${destdir}/${d}" cd "${destdir}/${d}" || continue - stagit-gopher -b "${stagitdir}/${d}" -c ".cache" "${reposdir}/${r}" + stagit-gopher -b "${stagitdir}/${d}" -l 75 "${reposdir}/${r}" for f in ${destdir}/${d}/log.gph ${destdir}/${d}/refs.gph ${destdir}/${d}/files.gph do - out=$(sed "s~^\[1|Log|~tgit clone git://haydenvh.com/$(basename $(dirname $f))\n[1|Log|~" < $f) + out=$(sed "s~^\[1|Log|~tgit clone git://haydenvh.com/$(basename $(dirname $f))\n[1|Log|~" < $f; printf "\n\nSend patches to: dev@MAIlH0ST.com - where MAIlH0ST is haydenvh\n") echo "$out" > $f done diff --git a/example_create.sh b/example_create.sh @@ -1,41 +0,0 @@ -#!/bin/sh -# - Makes index for repositories in a single directory. -# - Makes static pages for each repository directory. -# -# NOTE, things to do manually (once) before running this script: -# - write clone url, for example "git://git.codemadness.org/dir" to the "url" -# file for each repo. -# - write description in "description" file. -# -# Usage: -# - mkdir -p gphdir && cd gphdir -# - sh example_create.sh - -# path must be absolute. -reposdir="/var/scm/git" -gopherdir="/var/gopher" -stagitdir="/scm" -destdir="${gopherdir}/${stagitdir}" - -# remove /'s at the end. -stagitdir=$(printf "%s" "${stagitdir}" | sed 's@[/]*$@@g') - -# make index. -stagit-gopher-index -b "${stagitdir}" "${reposdir}/"*/ > "${destdir}/index.gph" - -# make files per repo. -for dir in "${reposdir}/"*/; do - # strip .git suffix. - r=$(basename "${dir}") - d=$(basename "${dir}" ".git") - printf "%s... " "${d}" - - mkdir -p "${destdir}/${d}" - cd "${destdir}/${d}" || continue - stagit-gopher -b "${stagitdir}/${d}" -c ".cache" "${reposdir}/${r}" - - # symlinks - ln -sf log.gph index.gph - - echo "done" -done