Merge pull request #20693 from jefferyto/golang-1.20.2
[feed/packages.git] / net / git / Makefile
1 #
2 # Copyright (C) 2009-2018 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=git
11 PKG_VERSION:=2.39.2
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=@KERNEL/software/scm/git/
16 PKG_HASH:=475f75f1373b2cd4e438706185175966d5c11f68c4db1e48c26257c43ddcf2d6
17
18 PKG_LICENSE:=GPL-2.0-or-later
19 PKG_LICENSE_FILES:=COPYING
20 PKG_CPE_ID:=cpe:/a:git-scm:git
21
22 PKG_FIXUP:=autoreconf
23 PKG_INSTALL:=1
24 PKG_BUILD_PARALLEL:=1
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define Package/git/Default
29 SECTION:=net
30 CATEGORY:=Network
31 SUBMENU:=Version Control Systems
32 DEPENDS:=+libopenssl +libpthread +librt +zlib
33 URL:=https://git-scm.com
34 MAINTAINER:=Peter Wagner <tripolar@gmx.at>
35 endef
36
37 define Package/git
38 $(call Package/git/Default)
39 TITLE:=The fast version control system
40 endef
41
42 define Package/git/description
43 Git is a free & open source, distributed version control system
44 designed to handle everything from small to very large projects
45 with speed and efficiency.
46 endef
47
48 define Package/git-http
49 $(call Package/git/Default)
50 DEPENDS+= +git +libcurl
51 TITLE:=Git HTTP commands
52 endef
53
54 define Package/git-http/description
55 $(call Package/git/description)
56
57 This package allows git push/fetch over http(s) and ftp(s)
58 endef
59
60 define Package/git-gitweb
61 $(call Package/git/Default)
62 TITLE:=Git repository web interface
63 DEPENDS+= +git \
64 +perl-cgi \
65 +perlbase-digest \
66 +perlbase-encode \
67 +perlbase-essential \
68 +perlbase-fcntl \
69 +perlbase-file \
70 +perlbase-filetest \
71 +perlbase-storable \
72 +perlbase-time
73 endef
74
75 define Package/git-gitweb/description
76 $(call Package/git/description)
77 This package builds the gitweb web interface for git repositories
78 endef
79
80 define Package/git-gitweb/conffiles
81 /etc/gitweb.conf
82 endef
83
84 MAKE_FLAGS := \
85 CC="$(TARGET_CC)" \
86 CFLAGS="$(TARGET_CFLAGS)" \
87 CPPFLAGS="$(TARGET_CPPFLAGS)" \
88 LDFLAGS="$(TARGET_LDFLAGS)" \
89 NO_EXPAT="YesPlease" \
90 NO_MKSTEMPS="YesPlease" \
91 NO_GETTEXT="YesPlease" \
92 NO_UNIX_SOCKETS="YesPlease" \
93 NO_ICONV="YesPlease" \
94 NO_NSEC="YesPlease" \
95 NO_PERL="YesPlease" \
96 NO_PYTHON="YesPlease" \
97 NO_TCLTK="YesPlease" \
98 NO_INSTALL_HARDLINKS="yes" \
99 gitwebdir="/www/cgi-bin" \
100 uname_S="Linux" \
101
102 CONFIGURE_ARGS += \
103 --without-iconv \
104
105 define Build/Configure
106 $(MAKE) -C $(PKG_BUILD_DIR) \
107 configure
108
109 $(call Build/Configure/Default,)
110 endef
111
112 define Build/Compile
113 mkdir -p $(PKG_INSTALL_DIR)/www/cgi-bin $(PKG_INSTALL_DIR)/www/gitweb
114 $(call Build/Compile/Default,DESTDIR=$(PKG_INSTALL_DIR) all install gitweb install-gitweb)
115 endef
116
117 define Package/git/install
118 $(RM) $(PKG_INSTALL_DIR)/usr/bin/git-cvsserver
119 $(RM) $(PKG_INSTALL_DIR)/usr/bin/git-shell
120 $(INSTALL_DIR) $(1)/usr/bin
121 $(CP) $(PKG_INSTALL_DIR)/usr/bin/git-* $(1)/usr/bin
122 $(INSTALL_DIR) $(1)/usr/lib/git-core
123 $(INSTALL_DIR) $(1)/usr/share/git-core/templates
124 ( cd $(PKG_INSTALL_DIR); $(TAR) \
125 --exclude=usr/lib/git-core/git-http-backend \
126 --exclude=usr/lib/git-core/git-http-fetch \
127 --exclude=usr/lib/git-core/git-remote-ftp \
128 --exclude=usr/lib/git-core/git-remote-ftps \
129 --exclude=usr/lib/git-core/git-remote-http \
130 --exclude=usr/lib/git-core/git-remote-https \
131 -cf - \
132 usr/lib/git-core \
133 usr/share/git-core/templates \
134 ) | ( cd $(1); $(TAR) -xf - )
135 ln $(1)/usr/lib/git-core/git $(1)/usr/bin/git
136 ln $(1)/usr/lib/git-core/git-shell $(1)/usr/bin/git-shell
137 endef
138
139 define Package/git-http/install
140 $(INSTALL_DIR) $(1)/usr/lib/git-core
141 $(CP) $(PKG_INSTALL_DIR)/usr/lib/git-core/git-http-backend $(1)/usr/lib/git-core
142 $(CP) $(PKG_INSTALL_DIR)/usr/lib/git-core/git-http-fetch $(1)/usr/lib/git-core
143 $(CP) $(PKG_INSTALL_DIR)/usr/lib/git-core/git-remote-ftp $(1)/usr/lib/git-core
144 $(CP) $(PKG_INSTALL_DIR)/usr/lib/git-core/git-remote-ftps $(1)/usr/lib/git-core
145 $(CP) $(PKG_INSTALL_DIR)/usr/lib/git-core/git-remote-http $(1)/usr/lib/git-core
146 $(CP) $(PKG_INSTALL_DIR)/usr/lib/git-core/git-remote-https $(1)/usr/lib/git-core
147 endef
148
149 define Package/git-gitweb/install
150 $(INSTALL_DIR) $(1)/www/cgi-bin $(1)/www/gitweb
151 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/www/cgi-bin/gitweb.cgi $(1)/www/cgi-bin/
152 # work around https://lore.kernel.org/git/80eb3972-4960-5727-ce86-acc3a4425fd4@nic.cz/T/#u
153 $(SED) 's,^our @stylesheets .*,our @stylesheets = ("/gitweb/gitweb.css");,' $(1)/www/cgi-bin/gitweb.cgi
154 $(SED) 's,^our $$$$logo .*,our $$$$logo = "/gitweb/git-logo.png";,' $(1)/www/cgi-bin/gitweb.cgi
155 $(SED) 's,^our $$$$favicon .*,our $$$$favicon = "/gitweb/git-favicon.png";,' $(1)/www/cgi-bin/gitweb.cgi
156 $(SED) 's,^our $$$$javascript .*,our $$$$javascript = "/gitweb/gitweb.js";,' $(1)/www/cgi-bin/gitweb.cgi
157 $(CP) $(PKG_INSTALL_DIR)/www/cgi-bin/static/* $(1)/www/gitweb/
158 endef
159
160 $(eval $(call BuildPackage,git))
161 $(eval $(call BuildPackage,git-http))
162 $(eval $(call BuildPackage,git-gitweb))