2f2a7d6a8457adf56b219036c5f9a4c7c6e52a28
[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.22.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:=159e4b599f8af4612e70b666600a3139541f8bacc18124daf2cbe8d1b934f29f
17
18 PKG_INSTALL:=1
19 PKG_FIXUP:=autoreconf
20 PKG_BUILD_PARALLEL:=1
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/git/Default
25 SECTION:=net
26 CATEGORY:=Network
27 SUBMENU:=Version Control Systems
28 DEPENDS:=+libopenssl +libpthread +librt +zlib
29 URL:=https://git-scm.com
30 MAINTAINER:=Peter Wagner <tripolar@gmx.at>
31 endef
32
33 define Package/git
34 $(call Package/git/Default)
35 TITLE:=The fast version control system
36 endef
37
38 define Package/git/description
39 Git is a free & open source, distributed version control system
40 designed to handle everything from small to very large projects
41 with speed and efficiency.
42 endef
43
44 define Package/git-http
45 $(call Package/git/Default)
46 DEPENDS+= +git +libcurl
47 TITLE:=Git HTTP commands
48 endef
49
50 define Package/git-http/description
51 $(call Package/git/description)
52
53 This package allows git push/fetch over http(s) and ftp(s)
54 endef
55
56 define Package/git-gitweb
57 $(call Package/git/Default)
58 TITLE:=Git repository web interface
59 DEPENDS+= +git \
60 +perl-cgi \
61 +perlbase-digest \
62 +perlbase-encode \
63 +perlbase-essential \
64 +perlbase-fcntl \
65 +perlbase-file \
66 +perlbase-filetest \
67 +perlbase-storable \
68 +perlbase-time
69 endef
70
71 define Package/git-gitweb/description
72 $(call Package/git/description)
73 This package builds the gitweb web interface for git repositories
74 endef
75
76 define Package/git-gitweb/conffiles
77 /etc/gitweb.conf
78 endef
79
80 MAKE_FLAGS := \
81 CC="$(TARGET_CC)" \
82 CFLAGS="$(TARGET_CFLAGS)" \
83 CPPFLAGS="$(TARGET_CPPFLAGS)" \
84 LDFLAGS="$(TARGET_LDFLAGS)" \
85 NO_EXPAT="YesPlease" \
86 NO_MKSTEMPS="YesPlease" \
87 NO_GETTEXT="YesPlease" \
88 NO_UNIX_SOCKETS="YesPlease" \
89 NO_ICONV="YesPlease" \
90 NO_NSEC="YesPlease" \
91 NO_PERL="YesPlease" \
92 NO_PYTHON="YesPlease" \
93 NO_TCLTK="YesPlease" \
94 NO_INSTALL_HARDLINKS="yes" \
95 gitwebdir="/www/cgi-bin" \
96 GITWEB_JS="/gitweb/gitweb.js" \
97 GITWEB_CSS="/gitweb/gitweb.css" \
98 GITWEB_LOGO="/gitweb/gitweb-logo.png" \
99 GITWEB_FAVICON="/gitweb/gitweb-favicon.png"
100
101 CONFIGURE_ARGS += \
102 --without-iconv \
103
104 define Build/Configure
105 $(MAKE) -C $(PKG_BUILD_DIR) \
106 configure
107
108 $(call Build/Configure/Default,)
109 endef
110
111 define Build/Compile
112 mkdir -p $(PKG_INSTALL_DIR)/www/cgi-bin $(PKG_INSTALL_DIR)/www/gitweb
113 $(call Build/Compile/Default,DESTDIR=$(PKG_INSTALL_DIR) all install gitweb install-gitweb)
114 endef
115
116 define Package/git/install
117 $(RM) $(PKG_INSTALL_DIR)/usr/bin/git-cvsserver
118 $(RM) $(PKG_INSTALL_DIR)/usr/bin/git-shell
119 $(INSTALL_DIR) $(1)/usr/bin
120 $(CP) $(PKG_INSTALL_DIR)/usr/bin/git-* $(1)/usr/bin
121 $(INSTALL_DIR) $(1)/usr/lib/git-core
122 $(INSTALL_DIR) $(1)/usr/share/git-core/templates
123 ( cd $(PKG_INSTALL_DIR); $(TAR) \
124 --exclude=usr/lib/git-core/git-http-backend \
125 --exclude=usr/lib/git-core/git-http-fetch \
126 --exclude=usr/lib/git-core/git-remote-ftp \
127 --exclude=usr/lib/git-core/git-remote-ftps \
128 --exclude=usr/lib/git-core/git-remote-http \
129 --exclude=usr/lib/git-core/git-remote-https \
130 -cf - \
131 usr/lib/git-core \
132 usr/share/git-core/templates \
133 ) | ( cd $(1); $(TAR) -xf - )
134 ln $(1)/usr/lib/git-core/git $(1)/usr/bin/git
135 ln $(1)/usr/lib/git-core/git-shell $(1)/usr/bin/git-shell
136 endef
137
138 define Package/git-http/install
139 $(INSTALL_DIR) $(1)/usr/lib/git-core
140 $(CP) $(PKG_INSTALL_DIR)/usr/lib/git-core/git-http-backend $(1)/usr/lib/git-core
141 $(CP) $(PKG_INSTALL_DIR)/usr/lib/git-core/git-http-fetch $(1)/usr/lib/git-core
142 $(CP) $(PKG_INSTALL_DIR)/usr/lib/git-core/git-remote-ftp $(1)/usr/lib/git-core
143 $(CP) $(PKG_INSTALL_DIR)/usr/lib/git-core/git-remote-ftps $(1)/usr/lib/git-core
144 $(CP) $(PKG_INSTALL_DIR)/usr/lib/git-core/git-remote-http $(1)/usr/lib/git-core
145 $(CP) $(PKG_INSTALL_DIR)/usr/lib/git-core/git-remote-https $(1)/usr/lib/git-core
146 endef
147
148 define Package/git-gitweb/install
149 $(INSTALL_DIR) $(1)/www/cgi-bin $(1)/www/gitweb
150 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/www/cgi-bin/gitweb.cgi $(1)/www/cgi-bin/
151 $(CP) $(PKG_INSTALL_DIR)/www/cgi-bin/static/* $(1)/www/gitweb/
152 endef
153
154 $(eval $(call BuildPackage,git))
155 $(eval $(call BuildPackage,git-http))
156 $(eval $(call BuildPackage,git-gitweb))