Merge pull request #12701 from neheb/apf
[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.27.0
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:=73ca9774d7fa226e1d87c1909401623f96dca6a044e583b9a762e84d7d1a73f9
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 GITWEB_JS="/gitweb/gitweb.js" \
101 GITWEB_CSS="/gitweb/gitweb.css" \
102 GITWEB_LOGO="/gitweb/gitweb-logo.png" \
103 GITWEB_FAVICON="/gitweb/gitweb-favicon.png" \
104 uname_S="Linux" \
105
106 CONFIGURE_ARGS += \
107 --without-iconv \
108
109 define Build/Configure
110 $(MAKE) -C $(PKG_BUILD_DIR) \
111 configure
112
113 $(call Build/Configure/Default,)
114 endef
115
116 define Build/Compile
117 mkdir -p $(PKG_INSTALL_DIR)/www/cgi-bin $(PKG_INSTALL_DIR)/www/gitweb
118 $(call Build/Compile/Default,DESTDIR=$(PKG_INSTALL_DIR) all install gitweb install-gitweb)
119 endef
120
121 define Package/git/install
122 $(RM) $(PKG_INSTALL_DIR)/usr/bin/git-cvsserver
123 $(RM) $(PKG_INSTALL_DIR)/usr/bin/git-shell
124 $(INSTALL_DIR) $(1)/usr/bin
125 $(CP) $(PKG_INSTALL_DIR)/usr/bin/git-* $(1)/usr/bin
126 $(INSTALL_DIR) $(1)/usr/lib/git-core
127 $(INSTALL_DIR) $(1)/usr/share/git-core/templates
128 ( cd $(PKG_INSTALL_DIR); $(TAR) \
129 --exclude=usr/lib/git-core/git-http-backend \
130 --exclude=usr/lib/git-core/git-http-fetch \
131 --exclude=usr/lib/git-core/git-remote-ftp \
132 --exclude=usr/lib/git-core/git-remote-ftps \
133 --exclude=usr/lib/git-core/git-remote-http \
134 --exclude=usr/lib/git-core/git-remote-https \
135 -cf - \
136 usr/lib/git-core \
137 usr/share/git-core/templates \
138 ) | ( cd $(1); $(TAR) -xf - )
139 ln $(1)/usr/lib/git-core/git $(1)/usr/bin/git
140 ln $(1)/usr/lib/git-core/git-shell $(1)/usr/bin/git-shell
141 endef
142
143 define Package/git-http/install
144 $(INSTALL_DIR) $(1)/usr/lib/git-core
145 $(CP) $(PKG_INSTALL_DIR)/usr/lib/git-core/git-http-backend $(1)/usr/lib/git-core
146 $(CP) $(PKG_INSTALL_DIR)/usr/lib/git-core/git-http-fetch $(1)/usr/lib/git-core
147 $(CP) $(PKG_INSTALL_DIR)/usr/lib/git-core/git-remote-ftp $(1)/usr/lib/git-core
148 $(CP) $(PKG_INSTALL_DIR)/usr/lib/git-core/git-remote-ftps $(1)/usr/lib/git-core
149 $(CP) $(PKG_INSTALL_DIR)/usr/lib/git-core/git-remote-http $(1)/usr/lib/git-core
150 $(CP) $(PKG_INSTALL_DIR)/usr/lib/git-core/git-remote-https $(1)/usr/lib/git-core
151 endef
152
153 define Package/git-gitweb/install
154 $(INSTALL_DIR) $(1)/www/cgi-bin $(1)/www/gitweb
155 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/www/cgi-bin/gitweb.cgi $(1)/www/cgi-bin/
156 $(CP) $(PKG_INSTALL_DIR)/www/cgi-bin/static/* $(1)/www/gitweb/
157 endef
158
159 $(eval $(call BuildPackage,git))
160 $(eval $(call BuildPackage,git-http))
161 $(eval $(call BuildPackage,git-gitweb))