Skip to content
This repository was archived by the owner on Mar 13, 2018. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions net/cgit/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#
# Copyright (C) 2009-2018 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=cgit
PKG_VERSION:=1.1+27
PKG_RELEASE:=1

PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://git.zx2c4.com/cgit
PKG_SOURCE_VERSION:=5d947ba3f06ec2c7200aab8c22170e7f2bf55a7c
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz

PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING

PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
PKG_FIXUP:=autoreconf

include $(INCLUDE_DIR)/package.mk

define Package/cgit
TITLE:=Web interface (cgi) for Git repositories, written in C
SECTION:=net
CATEGORY:=Network
SUBMENU:=Version Control Systems
DEPENDS:=+libopenssl +libpthread +librt +zlib +liblua
URL:=https://git.zx2c4.com/cgit/
MAINTAINER:=Troels Gram [https://github.com/tgram75]
endef

define Package/cgit/description
Cgit is a web interface (cgi) for Git repositories, written in C

This is an attempt to create a fast web interface for the Git
SCM, using a built-in cache to decrease server I/O pressure.
endef

MAKE_FLAGS := \
CC="$(TARGET_CC)" \
CFLAGS="$(TARGET_CFLAGS)" \
CPPFLAGS="$(TARGET_CPPFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS)" \
NO_EXPAT="YesPlease" \
NO_MKSTEMPS="YesPlease" \
NO_GETTEXT="YesPlease" \
NO_UNIX_SOCKETS="YesPlease" \
NO_ICONV="YesPlease" \
NO_NSEC="YesPlease" \
NO_PERL="YesPlease" \
NO_PYTHON="YesPlease" \
NO_TCLTK="YesPlease" \
NO_INSTALL_HARDLINKS="yes" \
LUA_PKGCONFIG="lua"

CONFIGURE_ARGS += \
--without-iconv \

define Package/cgit/install
$(INSTALL_DIR) $(1)/opt/var/www/htdocs/cgit
$(CP) $(PKG_INSTALL_DIR)/var/www/htdocs/cgit/* $(1)/opt/var/www/htdocs/cgit/
$(INSTALL_DIR) $(1)/opt/usr/local/lib/cgit/filters
$(CP) $(PKG_INSTALL_DIR)/usr/local/lib/cgit/filters/* $(1)/opt/usr/local/lib/cgit/filters/
endef

$(eval $(call BuildPackage,cgit))
32 changes: 32 additions & 0 deletions net/cgit/patches/100-configure_for_crosscompiling.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
--- a/git/configure.ac
+++ b/git/configure.ac
@@ -926,7 +926,8 @@ AC_RUN_IFELSE(
FILE *f = fopen(".", "r");
return f)]])],
[ac_cv_fread_reads_directories=no],
- [ac_cv_fread_reads_directories=yes])
+ [ac_cv_fread_reads_directories=yes],
+ [ac_cv_fread_reads_directories=no])
])
if test $ac_cv_fread_reads_directories = yes; then
FREAD_READS_DIRECTORIES=UnfortunatelyYes
@@ -960,7 +961,8 @@ AC_RUN_IFELSE(
if (snprintf(buf, 3, "%s", "12345") != 5
|| strcmp(buf, "12")) return 1]])],
[ac_cv_snprintf_returns_bogus=no],
- [ac_cv_snprintf_returns_bogus=yes])
+ [ac_cv_snprintf_returns_bogus=yes],
+ [ac_cv_snprintf_returns_bogus=no])
])
if test $ac_cv_snprintf_returns_bogus = yes; then
SNPRINTF_RETURNS_BOGUS=UnfortunatelyYes
@@ -983,7 +985,8 @@ yippeeyeswehaveit
#endif
]),
[ac_cv_sane_mode_bits=yes],
- [ac_cv_sane_mode_bits=no])
+ [ac_cv_sane_mode_bits=no],
+ [ac_cv_sane_mode_bits=yes])
])
if test $ac_cv_sane_mode_bits = yes; then
NEEDS_MODE_TRANSLATION=
11 changes: 11 additions & 0 deletions net/cgit/patches/200-imapsend_without_curl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/git/Makefile
+++ b/git/Makefile
@@ -1197,7 +1197,7 @@ else
endif
curl_check := $(shell (echo 072200; $(CURL_CONFIG) --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)
ifeq "$(curl_check)" "072200"
- USE_CURL_FOR_IMAP_SEND = YesPlease
+# USE_CURL_FOR_IMAP_SEND = YesPlease
endif
ifdef USE_CURL_FOR_IMAP_SEND
BASIC_CFLAGS += -DUSE_CURL_FOR_IMAP_SEND
15 changes: 15 additions & 0 deletions net/cgit/patches/500-fix_default_paths.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Index: cgit-1.1+27/Makefile
===================================================================
--- cgit-1.1+27.orig/Makefile
+++ cgit-1.1+27/Makefile
@@ -4,8 +4,8 @@ CGIT_VERSION = v1.1
CGIT_SCRIPT_NAME = cgit.cgi
CGIT_SCRIPT_PATH = /var/www/htdocs/cgit
CGIT_DATA_PATH = $(CGIT_SCRIPT_PATH)
-CGIT_CONFIG = /etc/cgitrc
-CACHE_ROOT = /var/cache/cgit
+CGIT_CONFIG = /opt/etc/cgitrc
+CACHE_ROOT = /opt/var/cache/cgit
prefix = /usr/local
libdir = $(prefix)/lib
filterdir = $(libdir)/cgit/filters