tMerge branch 'master' of git://git.codemadness.org/stagit - stagit - static gi… | |
git clone git://src.adamsgaard.dk/stagit | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit c5329d68ce5748f34cb2d8a443e04e9794d07f19 | |
parent 2ce893356d238e7de8fb6110db6192f690cdf8e2 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Thu, 2 Jan 2020 21:49:16 +0100 | |
Merge branch 'master' of git://git.codemadness.org/stagit | |
Diffstat: | |
M Makefile | 27 ++++++++++++++++++++------- | |
M README | 16 +++++++++------- | |
D config.mk | 30 ------------------------------ | |
M stagit-index.c | 4 ++++ | |
M stagit.c | 7 +++++++ | |
M style.css | 4 ++++ | |
6 files changed, 44 insertions(+), 44 deletions(-) | |
--- | |
diff --git a/Makefile b/Makefile | |
t@@ -1,8 +1,21 @@ | |
-include config.mk | |
+.POSIX: | |
NAME = stagit | |
VERSION = 0.9.2 | |
+# 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.c\ | |
stagit-index.c | |
t@@ -31,16 +44,16 @@ OBJ = ${SRC:.c=.o} ${COMPATOBJ} | |
all: ${BIN} | |
.o: | |
- ${CC} ${LDFLAGS} -o $@ ${LIBS} | |
+ ${CC} -o $@ ${LDFLAGS} | |
.c.o: | |
- ${CC} -c ${CFLAGS} ${CPPFLAGS} -o $@ -c $< | |
+ ${CC} -o $@ -c $< ${STAGIT_CFLAGS} ${STAGIT_CPPFLAGS} | |
dist: | |
rm -rf ${NAME}-${VERSION} | |
mkdir -p ${NAME}-${VERSION} | |
cp -f ${MAN1} ${HDR} ${SRC} ${COMPATSRC} ${DOC} \ | |
- Makefile config.mk favicon.png logo.png style.css \ | |
+ Makefile favicon.png logo.png style.css \ | |
example_create.sh example_post-receive.sh \ | |
${NAME}-${VERSION} | |
# make tarball | |
t@@ -48,13 +61,13 @@ dist: | |
gzip -c > ${NAME}-${VERSION}.tar.gz | |
rm -rf ${NAME}-${VERSION} | |
-${OBJ}: config.mk ${HDR} | |
+${OBJ}: ${HDR} | |
stagit: stagit.o ${COMPATOBJ} | |
- ${CC} -o $@ stagit.o ${COMPATOBJ} ${LDFLAGS} | |
+ ${CC} -o $@ stagit.o ${COMPATOBJ} ${STAGIT_LDFLAGS} | |
stagit-index: stagit-index.o ${COMPATOBJ} | |
- ${CC} -o $@ stagit-index.o ${COMPATOBJ} ${LDFLAGS} | |
+ ${CC} -o $@ stagit-index.o ${COMPATOBJ} ${STAGIT_LDFLAGS} | |
clean: | |
rm -f ${BIN} ${OBJ} ${NAME}-${VERSION}.tar.gz | |
diff --git a/README b/README | |
t@@ -1,7 +1,9 @@ | |
stagit | |
-====== | |
+------ | |
-static git page generator | |
+static git page generator. | |
+ | |
+It generates static HTML pages for a git repository. | |
Usage | |
t@@ -17,8 +19,8 @@ Make index file for repositories: | |
$ stagit-index repodir1 repodir2 repodir3 > index.html | |
-Install | |
-------- | |
+Build and install | |
+----------------- | |
$ make | |
# make install | |
t@@ -27,10 +29,10 @@ $ make | |
Dependencies | |
------------ | |
-- libgit2 (v0.22+). | |
-- libc (tested with OpenBSD, FreeBSD, NetBSD, Linux: glibc and musl). | |
- C compiler (C99). | |
-- make | |
+- libc (tested with OpenBSD, FreeBSD, NetBSD, Linux: glibc and musl). | |
+- libgit2 (v0.22+). | |
+- POSIX make (optional). | |
Documentation | |
diff --git a/config.mk b/config.mk | |
t@@ -1,30 +0,0 @@ | |
-# customize below to fit your system | |
- | |
-# paths | |
-PREFIX = /usr/local | |
-MANPREFIX = ${PREFIX}/man | |
-DOCPREFIX = ${PREFIX}/share/doc/stagit | |
- | |
-# compiler and linker | |
-#CC = cc | |
- | |
-GITINC = /usr/local/include | |
-GITLIB = /usr/local/lib | |
- | |
-# includes and libs | |
-INCS = -I${GITINC} | |
-LIBS = -L${GITLIB} -lgit2 | |
- | |
-# debug | |
-#CFLAGS = -fstack-protector-all -O0 -g -std=c99 -Wall -Wextra -pedantic ${INCS} | |
-#LDFLAGS = ${LIBS} | |
- | |
-# optimized | |
-CFLAGS = -O2 -std=c99 ${INCS} | |
-LDFLAGS = -s ${LIBS} | |
- | |
-# optimized static | |
-#CFLAGS = -static -O2 -std=c99 ${INCS} | |
-#LDFLAGS = -static -s ${LIBS} | |
- | |
-CPPFLAGS = -D_XOPEN_SOURCE=700 -D_DEFAULT_SOURCE -D_BSD_SOURCE ${INCS} | |
diff --git a/stagit-index.c b/stagit-index.c | |
t@@ -162,6 +162,10 @@ main(int argc, char *argv[]) | |
git_libgit2_init(); | |
#ifdef __OpenBSD__ | |
+ for (i = 1; i < argc; i++) | |
+ if (unveil(argv[i], "r") == -1) | |
+ err(1, "unveil: %s", argv[i]); | |
+ | |
if (pledge("stdio rpath", NULL) == -1) | |
err(1, "pledge"); | |
#endif | |
diff --git a/stagit.c b/stagit.c | |
t@@ -1095,6 +1095,13 @@ main(int argc, char *argv[]) | |
git_libgit2_init(); | |
#ifdef __OpenBSD__ | |
+ if (unveil(repodir, "r") == -1) | |
+ err(1, "unveil: %s", repodir); | |
+ if (unveil(".", "rwc") == -1) | |
+ err(1, "unveil: ."); | |
+ if (cachefile && unveil(cachefile, "rwc") == -1) | |
+ err(1, "unveil: %s", cachefile); | |
+ | |
if (cachefile) { | |
if (pledge("stdio rpath wpath cpath fattr", NULL) == -1) | |
err(1, "pledge"); | |
diff --git a/style.css b/style.css | |
t@@ -17,6 +17,10 @@ img { | |
border: 0; | |
} | |
+a:target { | |
+ background-color: #ccc; | |
+} | |
+ | |
a.d, | |
a.h, | |
a.i, |