ASR_BASE
Change-Id: Icf3719cc0afe3eeb3edc7fa80a2eb5199ca9dda1
diff --git a/external/subpack/net/git/Makefile b/external/subpack/net/git/Makefile
new file mode 100644
index 0000000..ffa5fde
--- /dev/null
+++ b/external/subpack/net/git/Makefile
@@ -0,0 +1,167 @@
+#
+# 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:=git
+PKG_VERSION:=2.46.2
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=@KERNEL/software/scm/git/
+PKG_HASH:=5ee8a1c68536094a4f7f9515edc154b12a275b8a57dda4c21ecfbf1afbae2ca3
+
+PKG_LICENSE:=GPL-2.0-or-later
+PKG_LICENSE_FILES:=COPYING
+PKG_CPE_ID:=cpe:/a:git-scm:git
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/git/Default
+ SECTION:=net
+ CATEGORY:=Network
+ SUBMENU:=Version Control Systems
+ DEPENDS:=+libopenssl +libpthread +librt +zlib
+ URL:=https://git-scm.com
+ MAINTAINER:=Peter Wagner <tripolar@gmx.at>
+endef
+
+define Package/git
+$(call Package/git/Default)
+ TITLE:=The fast version control system
+endef
+
+define Package/git/description
+ Git is a free & open source, distributed version control system
+ designed to handle everything from small to very large projects
+ with speed and efficiency.
+endef
+
+define Package/git-http
+$(call Package/git/Default)
+ DEPENDS+= +git +libcurl
+ TITLE:=Git HTTP commands
+endef
+
+define Package/git-http/description
+$(call Package/git/description)
+
+ This package allows git push/fetch over http(s) and ftp(s)
+endef
+
+define Package/git-gitweb
+$(call Package/git/Default)
+ TITLE:=Git repository web interface
+ DEPENDS+= +git \
+ +perl-cgi \
+ +perlbase-digest \
+ +perlbase-encode \
+ +perlbase-essential \
+ +perlbase-fcntl \
+ +perlbase-file \
+ +perlbase-filetest \
+ +perlbase-storable \
+ +perlbase-time
+endef
+
+define Package/git-gitweb/description
+$(call Package/git/description)
+ This package builds the gitweb web interface for git repositories
+endef
+
+define Package/git-gitweb/conffiles
+/etc/gitweb.conf
+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" \
+ gitwebdir="/www/cgi-bin" \
+ uname_S="Linux" \
+
+CONFIGURE_ARGS += \
+ --without-iconv \
+
+CONFIGURE_VARS += \
+ ac_cv_fread_reads_directories=yes \
+ ac_cv_snprintf_returns_bogus=yes \
+ ac_cv_sane_mode_bits=no
+
+define Build/Configure
+ $(MAKE) -C $(PKG_BUILD_DIR) \
+ configure
+
+ $(call Build/Configure/Default,)
+endef
+
+define Build/Compile
+ mkdir -p $(PKG_INSTALL_DIR)/www/cgi-bin $(PKG_INSTALL_DIR)/www/gitweb
+ $(call Build/Compile/Default,DESTDIR=$(PKG_INSTALL_DIR) all install gitweb install-gitweb)
+endef
+
+define Package/git/install
+ $(RM) $(PKG_INSTALL_DIR)/usr/bin/git-cvsserver
+ $(RM) $(PKG_INSTALL_DIR)/usr/bin/git-shell
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(CP) $(PKG_INSTALL_DIR)/usr/bin/git-* $(1)/usr/bin
+ $(INSTALL_DIR) $(1)/usr/lib/git-core
+ $(INSTALL_DIR) $(1)/usr/share/git-core/templates
+ ( cd $(PKG_INSTALL_DIR); $(TAR) \
+ --exclude=usr/lib/git-core/git-http-backend \
+ --exclude=usr/lib/git-core/git-http-fetch \
+ --exclude=usr/lib/git-core/git-remote-ftp \
+ --exclude=usr/lib/git-core/git-remote-ftps \
+ --exclude=usr/lib/git-core/git-remote-http \
+ --exclude=usr/lib/git-core/git-remote-https \
+ -cf - \
+ usr/lib/git-core \
+ usr/share/git-core/templates \
+ ) | ( cd $(1); $(TAR) -xf - )
+ ln $(1)/usr/lib/git-core/git $(1)/usr/bin/git
+ ln $(1)/usr/lib/git-core/git-shell $(1)/usr/bin/git-shell
+endef
+
+define Package/git-http/install
+ $(INSTALL_DIR) $(1)/usr/lib/git-core
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/git-core/git-http-backend $(1)/usr/lib/git-core
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/git-core/git-http-fetch $(1)/usr/lib/git-core
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/git-core/git-remote-ftp $(1)/usr/lib/git-core
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/git-core/git-remote-ftps $(1)/usr/lib/git-core
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/git-core/git-remote-http $(1)/usr/lib/git-core
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/git-core/git-remote-https $(1)/usr/lib/git-core
+endef
+
+define Package/git-gitweb/install
+ $(INSTALL_DIR) $(1)/www/cgi-bin $(1)/www/gitweb
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/www/cgi-bin/gitweb.cgi $(1)/www/cgi-bin/
+ # work around https://lore.kernel.org/git/80eb3972-4960-5727-ce86-acc3a4425fd4@nic.cz/T/#u
+ $(SED) 's,^our @stylesheets .*,our @stylesheets = ("/gitweb/gitweb.css");,' $(1)/www/cgi-bin/gitweb.cgi
+ $(SED) 's,^our $$$$logo .*,our $$$$logo = "/gitweb/git-logo.png";,' $(1)/www/cgi-bin/gitweb.cgi
+ $(SED) 's,^our $$$$favicon .*,our $$$$favicon = "/gitweb/git-favicon.png";,' $(1)/www/cgi-bin/gitweb.cgi
+ $(SED) 's,^our $$$$javascript .*,our $$$$javascript = "/gitweb/gitweb.js";,' $(1)/www/cgi-bin/gitweb.cgi
+ $(CP) $(PKG_INSTALL_DIR)/www/cgi-bin/static/* $(1)/www/gitweb/
+endef
+
+$(eval $(call BuildPackage,git))
+$(eval $(call BuildPackage,git-http))
+$(eval $(call BuildPackage,git-gitweb))
diff --git a/external/subpack/net/git/patches/200-imapsend_without_curl.patch b/external/subpack/net/git/patches/200-imapsend_without_curl.patch
new file mode 100644
index 0000000..061a443
--- /dev/null
+++ b/external/subpack/net/git/patches/200-imapsend_without_curl.patch
@@ -0,0 +1,11 @@
+--- a/Makefile
++++ b/Makefile
+@@ -1636,7 +1636,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
diff --git a/external/subpack/net/git/patches/300-openssl-deprecated.patch b/external/subpack/net/git/patches/300-openssl-deprecated.patch
new file mode 100644
index 0000000..16b5543
--- /dev/null
+++ b/external/subpack/net/git/patches/300-openssl-deprecated.patch
@@ -0,0 +1,27 @@
+From fa37195d8378ac958d1f9bd884b47bd73730040e Mon Sep 17 00:00:00 2001
+From: Rosen Penev <rosenp@gmail.com>
+Date: Thu, 27 Dec 2018 09:58:07 -0800
+Subject: [PATCH] imap-send: Fix compilation without deprecated OpenSSL APIs
+
+Initialization in OpenSSL has been deprecated in version 1.1. This makes
+compilation fail when deprecated APIs for OpenSSL are compile-time
+disabled.
+
+Signed-off-by: Rosen Penev <rosenp@gmail.com>
+---
+ imap-send.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/imap-send.c
++++ b/imap-send.c
+@@ -259,8 +259,10 @@ static int ssl_socket_connect(struct ima
+ int ret;
+ X509 *cert;
+
++#if (OPENSSL_VERSION_NUMBER < 0x10100000L)
+ SSL_library_init();
+ SSL_load_error_strings();
++#endif
+
+ meth = SSLv23_method();
+ if (!meth) {
diff --git a/external/subpack/net/git/patches/310-fix-uname-detection-for-crosscompiling b/external/subpack/net/git/patches/310-fix-uname-detection-for-crosscompiling
new file mode 100644
index 0000000..4b884d2
--- /dev/null
+++ b/external/subpack/net/git/patches/310-fix-uname-detection-for-crosscompiling
@@ -0,0 +1,43 @@
+From 9dcf7e679c441b877b63ff8e6dfc3865af6c6720 Mon Sep 17 00:00:00 2001
+From: Mauro Condarelli <mc5686 at mclink.it>
+Date: Sun, 22 May 2016 20:44:26 +0200
+Subject: [PATCH 1/1] Fix config.mak.uname to allow cross-compilation
+
+Current implementation imperatively sets variables from "uname" output.
+This breaks cross-compilation because uname is run on host while target
+configuration may be different.
+
+Make current behavior a non-imperative default, so it's possible to
+force different values setting make variables.
+
+To cross-compile it will be necessary to explicitly set the various
+uname_X variables to values compatible with target.
+No change is needed with normal host compilation.
+Patch is trivial.
+
+Signed-off-by: Mauro Condarelli <mc5686 at mclink.it>
+---
+ config.mak.uname | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+--- a/config.mak.uname
++++ b/config.mak.uname
+@@ -4,12 +4,12 @@
+ # Microsoft's Safe Exception Handling in libraries (such as zlib).
+ # Typically required for VS2013+/32-bit compilation on Vista+ versions.
+
+-uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+-uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')
+-uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')
+-uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not')
+-uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
+-uname_V := $(shell sh -c 'uname -v 2>/dev/null || echo not')
++uname_S ?= $(shell sh -c 'uname -s 2>/dev/null || echo not')
++uname_M ?= $(shell sh -c 'uname -m 2>/dev/null || echo not')
++uname_O ?= $(shell sh -c 'uname -o 2>/dev/null || echo not')
++uname_R ?= $(shell sh -c 'uname -r 2>/dev/null || echo not')
++uname_P ?= $(shell sh -c 'uname -p 2>/dev/null || echo not')
++uname_V ?= $(shell sh -c 'uname -v 2>/dev/null || echo not')
+
+ ifneq ($(findstring MINGW,$(uname_S)),)
+ uname_S := MINGW