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