1 |
# $MidnightBSD: mports/devel/git/Makefile,v 1.36 2013/03/02 16:00:39 laffer1 Exp $ |
2 |
|
3 |
PORTNAME= git |
4 |
PORTVERSION= 1.8.1.4 |
5 |
CATEGORIES= devel |
6 |
MASTER_SITES= ${MASTER_SITE_GOOGLE_CODE} |
7 |
DISTFILES= ${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX} \ |
8 |
${PORTNAME}-manpages-${PORTVERSION}${EXTRACT_SUFX} |
9 |
EXTRACT_ONLY= ${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX} \ |
10 |
${PORTNAME}-manpages-${PORTVERSION}${EXTRACT_SUFX} |
11 |
|
12 |
MAINTAINER= ports@MidnightBSD.org |
13 |
COMMENT= Distributed source code management tool |
14 |
LICENSE= gpl2 |
15 |
|
16 |
PROJECTHOST= git-core |
17 |
MAKE_JOBS_SAFE= yes |
18 |
|
19 |
MAN1= git.1 \ |
20 |
git-add.1 \ |
21 |
git-am.1 \ |
22 |
git-annotate.1 \ |
23 |
git-apply.1 \ |
24 |
git-archimport.1 \ |
25 |
git-archive.1 \ |
26 |
git-bisect.1 \ |
27 |
git-blame.1 \ |
28 |
git-branch.1 \ |
29 |
git-bundle.1 \ |
30 |
git-cat-file.1 \ |
31 |
git-check-attr.1 \ |
32 |
git-check-ref-format.1 \ |
33 |
git-checkout-index.1 \ |
34 |
git-checkout.1 \ |
35 |
git-cherry-pick.1 \ |
36 |
git-cherry.1 \ |
37 |
git-clean.1 \ |
38 |
git-clone.1 \ |
39 |
git-column.1 \ |
40 |
git-commit-tree.1 \ |
41 |
git-commit.1 \ |
42 |
git-config.1 \ |
43 |
git-count-objects.1 \ |
44 |
git-credential.1 \ |
45 |
git-credential-cache--daemon.1 \ |
46 |
git-credential-cache.1 \ |
47 |
git-credential-store.1 \ |
48 |
git-daemon.1 \ |
49 |
git-describe.1 \ |
50 |
git-diff-files.1 \ |
51 |
git-diff-index.1 \ |
52 |
git-difftool.1 \ |
53 |
git-diff-tree.1 \ |
54 |
git-diff.1 \ |
55 |
git-fast-export.1 \ |
56 |
git-fast-import.1 \ |
57 |
git-fetch-pack.1 \ |
58 |
git-fetch.1 \ |
59 |
git-filter-branch.1 \ |
60 |
git-fmt-merge-msg.1 \ |
61 |
git-for-each-ref.1 \ |
62 |
git-format-patch.1 \ |
63 |
git-fsck-objects.1 \ |
64 |
git-fsck.1 \ |
65 |
git-gc.1 \ |
66 |
git-get-tar-commit-id.1 \ |
67 |
git-grep.1 \ |
68 |
git-hash-object.1 \ |
69 |
git-help.1 \ |
70 |
git-http-backend.1 \ |
71 |
git-http-fetch.1 \ |
72 |
git-http-push.1 \ |
73 |
git-imap-send.1 \ |
74 |
git-index-pack.1 \ |
75 |
git-init-db.1 \ |
76 |
git-init.1 \ |
77 |
git-instaweb.1 \ |
78 |
git-log.1 \ |
79 |
git-lost-found.1 \ |
80 |
git-ls-files.1 \ |
81 |
git-ls-remote.1 \ |
82 |
git-ls-tree.1 \ |
83 |
git-mailinfo.1 \ |
84 |
git-mailsplit.1 \ |
85 |
git-merge-base.1 \ |
86 |
git-merge-file.1 \ |
87 |
git-merge-index.1 \ |
88 |
git-merge-one-file.1 \ |
89 |
git-mergetool.1 \ |
90 |
git-merge-tree.1 \ |
91 |
git-merge.1 \ |
92 |
git-mergetool--lib.1 \ |
93 |
git-mktag.1 \ |
94 |
git-mktree.1 \ |
95 |
git-mv.1 \ |
96 |
git-name-rev.1 \ |
97 |
git-notes.1 \ |
98 |
git-p4.1 \ |
99 |
git-pack-objects.1 \ |
100 |
git-pack-redundant.1 \ |
101 |
git-pack-refs.1 \ |
102 |
git-parse-remote.1 \ |
103 |
git-patch-id.1 \ |
104 |
git-peek-remote.1 \ |
105 |
git-prune-packed.1 \ |
106 |
git-prune.1 \ |
107 |
git-pull.1 \ |
108 |
git-push.1 \ |
109 |
git-quiltimport.1 \ |
110 |
git-read-tree.1 \ |
111 |
git-rebase.1 \ |
112 |
git-receive-pack.1 \ |
113 |
git-reflog.1 \ |
114 |
git-relink.1 \ |
115 |
git-remote-ext.1 \ |
116 |
git-remote-fd.1 \ |
117 |
git-remote-helpers.1 \ |
118 |
git-remote-testgit.1 \ |
119 |
git-remote.1 \ |
120 |
git-repack.1 \ |
121 |
git-replace.1 \ |
122 |
git-repo-config.1 \ |
123 |
git-request-pull.1 \ |
124 |
git-rerere.1 \ |
125 |
git-reset.1 \ |
126 |
git-rev-list.1 \ |
127 |
git-rev-parse.1 \ |
128 |
git-revert.1 \ |
129 |
git-rm.1 \ |
130 |
git-send-email.1 \ |
131 |
git-send-pack.1 \ |
132 |
git-sh-setup.1 \ |
133 |
git-sh-i18n.1 \ |
134 |
git-sh-i18n--envsubst.1 \ |
135 |
git-shell.1 \ |
136 |
git-shortlog.1 \ |
137 |
git-show-branch.1 \ |
138 |
git-show-index.1 \ |
139 |
git-show-ref.1 \ |
140 |
git-show.1 \ |
141 |
git-stage.1 \ |
142 |
git-stash.1 \ |
143 |
git-status.1 \ |
144 |
git-stripspace.1 \ |
145 |
git-submodule.1 \ |
146 |
git-symbolic-ref.1 \ |
147 |
git-tag.1 \ |
148 |
git-tar-tree.1 \ |
149 |
git-unpack-file.1 \ |
150 |
git-unpack-objects.1 \ |
151 |
git-update-index.1 \ |
152 |
git-update-ref.1 \ |
153 |
git-update-server-info.1 \ |
154 |
git-upload-archive.1 \ |
155 |
git-upload-pack.1 \ |
156 |
git-var.1 \ |
157 |
git-verify-pack.1 \ |
158 |
git-verify-tag.1 \ |
159 |
git-web--browse.1 \ |
160 |
git-whatchanged.1 \ |
161 |
git-write-tree.1 \ |
162 |
gitweb.1 |
163 |
MAN5= gitattributes.5 \ |
164 |
githooks.5 \ |
165 |
gitignore.5 \ |
166 |
gitmodules.5 \ |
167 |
gitrepository-layout.5 \ |
168 |
gitweb.conf.5 |
169 |
MAN7= gitcli.7 \ |
170 |
gitcredentials.7 \ |
171 |
gitglossary.7 \ |
172 |
gittutorial.7 \ |
173 |
gitcore-tutorial.7 \ |
174 |
gitdiffcore.7 \ |
175 |
gittutorial-2.7 \ |
176 |
gitworkflows.7 \ |
177 |
gitrevisions.7 \ |
178 |
gitnamespaces.7 |
179 |
|
180 |
CONFLICTS?= git-subversion-[0-9]* |
181 |
|
182 |
USERS= git_daemon |
183 |
GROUPS= git_daemon |
184 |
|
185 |
SUB_FILES= pkg-message |
186 |
PKGMESSAGE= ${WRKDIR}/pkg-message |
187 |
|
188 |
GNU_CONFIGURE= yes |
189 |
USE_GMAKE= yes |
190 |
EXTENSIONS+= python |
191 |
CFLAGS+= -I${LOCALBASE}/include |
192 |
LDFLAGS+= -L${LOCALBASE}/lib |
193 |
MAKE_ENV+= V=1 |
194 |
MAKE_ARGS+= prefix="${PREFIX}" |
195 |
USE_OPENSSL= yes |
196 |
USE_RC_SUBR= git_daemon |
197 |
WANT_PERL= yes |
198 |
|
199 |
CONFIGURE_ARGS= --enable-pthreads=-pthread |
200 |
|
201 |
OPTIONS= GUI "Enable building of GUI tools" on \ |
202 |
SVN "Enable required dependencies for SVN tools" off \ |
203 |
GITWEB "Install Gitweb" off \ |
204 |
CONTRIB "Install contributed scripts" on \ |
205 |
P4 "Enable Perforce support" off \ |
206 |
CVS "Enable CVS support" on \ |
207 |
HTMLDOCS "Install additional documentation" on \ |
208 |
PERL "Build perl based git tools" on \ |
209 |
ICONV "Support for multiple character encodings" on \ |
210 |
CURL "Support HTTP push and pull" on \ |
211 |
ETCSHELLS "Add entry to /etc/shells" on |
212 |
|
213 |
.include <bsd.mport.options.mk> |
214 |
|
215 |
.if defined(WITH_NLS) |
216 |
USE_GETTEXT= yes |
217 |
PLIST_SUB+= NLS="" |
218 |
.else |
219 |
PLIST_SUB+= NLS="@comment " |
220 |
MAKE_ARGS+= NO_GETTEXT=yes |
221 |
.endif |
222 |
|
223 |
# This is intentionally not exposed as an option. |
224 |
.ifndef (WITH_DEBUG) |
225 |
ALL_TARGET= all strip |
226 |
.endif |
227 |
|
228 |
.if defined(WITH_P4) || defined(WITH_CONTRIB) |
229 |
USE_PYTHON= yes |
230 |
PLIST_SUB+= PYTHON_VER=${PYTHON_VER} PYTHON="" |
231 |
CONFIGURE_ARGS+= --with-python=${LOCALBASE}/bin/python |
232 |
.else |
233 |
CONFIGURE_ARGS+= --without-python |
234 |
PLIST_SUB+= PYTHON="@comment " |
235 |
.endif |
236 |
|
237 |
.ifdef (WITH_PERL) |
238 |
USE_PERL5= yes |
239 |
MAKE_ENV+= PERL_PATH=${PERL} |
240 |
BUILD_DEPENDS+= ${SITE_PERL}/Error.pm:${PORTSDIR}/lang/p5-Error |
241 |
RUN_DEPENDS+= ${SITE_PERL}/Error.pm:${PORTSDIR}/lang/p5-Error \ |
242 |
${SITE_PERL}/Net/SMTP/SSL.pm:${PORTSDIR}/mail/p5-Net-SMTP-SSL |
243 |
MAN3= Git.3 |
244 |
PLIST_SUB+= PERLSUB="" |
245 |
.else |
246 |
MAKE_ENV+= NO_PERL=1 |
247 |
PLIST_SUB+= PERLSUB="@comment " |
248 |
.endif |
249 |
|
250 |
.ifdef (WITH_ICONV) |
251 |
CONFIGURE_ARGS+= --with-iconv=${LOCALBASE} |
252 |
USE_ICONV= yes |
253 |
MAKE_ENV+= NEEDS_LIBICONV=yes \ |
254 |
ICONVDIR=${LOCALBASE} |
255 |
.else |
256 |
MAKE_ENV+= NO_ICONV=1 |
257 |
.endif |
258 |
|
259 |
.ifdef (WITH_CURL) |
260 |
MAKE_ENV+= CURLDIR=${LOCALBASE} |
261 |
BUILD_DEPENDS+= curl:${PORTSDIR}/ftp/curl |
262 |
RUN_DEPENDS+= curl:${PORTSDIR}/ftp/curl |
263 |
LIB_DEPENDS+= expat.6:${PORTSDIR}/textproc/expat2 |
264 |
PLIST_SUB+= CURL="" |
265 |
.else |
266 |
MAKE_ENV+= NO_CURL=1 \ |
267 |
NO_EXPAT=1 |
268 |
PLIST_SUB+= CURL="@comment " |
269 |
.endif |
270 |
|
271 |
.ifdef (WITH_HTMLDOCS) || make(makesum) |
272 |
DISTFILES+= ${PORTNAME}-htmldocs-${PORTVERSION}${EXTRACT_SUFX} |
273 |
BUILD_DEPENDS+= ${LOCALBASE}/bin/asciidoc:${PORTSDIR}/textproc/asciidoc \ |
274 |
${LOCALBASE}/bin/xsltproc:${PORTSDIR}/textproc/libxslt |
275 |
RUN_DEPENDS+= ${LOCALBASE}/bin/asciidoc:${PORTSDIR}/textproc/asciidoc \ |
276 |
${LOCALBASE}/bin/xsltproc:${PORTSDIR}/textproc/libxslt |
277 |
PLIST_SUB+= HTMLDOCS="" |
278 |
.else |
279 |
PLIST_SUB+= HTMLDOCS="@comment " |
280 |
.endif |
281 |
|
282 |
.ifdef (WITH_GUI) |
283 |
USE_TK= 84+ |
284 |
EXTENSIONS+= tcl |
285 |
MAN1+= git-citool.1 \ |
286 |
git-gui.1 \ |
287 |
gitk.1 |
288 |
PLIST_SUB+= GUI="" |
289 |
MAKE_ARGS+= TCL_PATH=${TCLSH} TCLTK_PATH=${WISH} |
290 |
.else |
291 |
RMMAN1+= git-citool.1 \ |
292 |
git-gui.1 \ |
293 |
gitk.1 |
294 |
PLIST_SUB+= GUI="@comment " |
295 |
MAKE_ARGS+= NO_TCLTK=yes |
296 |
.endif |
297 |
|
298 |
# While this port does not explicity honor WITH_SUBVERSION_VER knob it does |
299 |
# depend upon devel/p5-subversion, which does honor that knob. If you want |
300 |
# to have git use devel/subversion16 it will be brought in through |
301 |
# devel/p5-subversion if you set WITH_SUBVERSION_VER=16. Otherwise |
302 |
# devel/subversion will be brought in. |
303 |
.if defined(WITH_SVN) |
304 |
RUN_DEPENDS+= p5-Term-ReadKey>=0:${PORTSDIR}/devel/p5-Term-ReadKey \ |
305 |
p5-subversion>=0:${PORTSDIR}/devel/p5-subversion |
306 |
PLIST_SUB+= SVN="" |
307 |
MAN1+= git-svn.1 |
308 |
.else |
309 |
PLIST_SUB+= SVN="@comment " |
310 |
RMMAN1+= git-svn.1 |
311 |
.endif |
312 |
|
313 |
.ifdef (WITH_GITWEB) |
314 |
PLIST_SUB+= GITWEB="" |
315 |
.else |
316 |
PLIST_SUB+= GITWEB="@comment " |
317 |
.endif |
318 |
|
319 |
.ifdef (WITH_GITWEB) && !defined(WITH_PERL) |
320 |
IGNORE= using GITWEB support requires PERL support |
321 |
.endif |
322 |
|
323 |
.ifdef (WITH_CONTRIB) |
324 |
PLIST_SUB+= CONTRIB="" |
325 |
.else |
326 |
PLIST_SUB+= CONTRIB="@comment " |
327 |
.endif |
328 |
|
329 |
.ifdef (WITH_P4) |
330 |
PLIST_SUB+= P4="" |
331 |
.else |
332 |
PLIST_SUB+= P4="@comment " |
333 |
.endif |
334 |
|
335 |
.ifdef (WITH_CVS) |
336 |
MAN1+= git-cvsimport.1 git-cvsexportcommit.1 git-cvsserver.1 |
337 |
MAN7+= gitcvs-migration.7 |
338 |
PLIST_SUB+= CVS="" |
339 |
RUN_DEPENDS+= cvsps:${PORTSDIR}/devel/cvsps |
340 |
.else |
341 |
PLIST_SUB+= CVS="@comment " |
342 |
RMMAN1+= git-cvsimport.1 git-cvsexportcommit.1 git-cvsserver.1 |
343 |
RMMAN7+= gitcvs-migration.7 |
344 |
.endif |
345 |
|
346 |
.if defined(WITH_ETCSHELLS) |
347 |
SHELLS= /etc/shells |
348 |
PLIST_SUB+= ETCSHELLS="" |
349 |
.else |
350 |
PLIST_SUB+= ETCSHELLS="@comment " |
351 |
.endif |
352 |
|
353 |
post-extract: |
354 |
.if defined(WITH_HTMLDOCS) |
355 |
@${MKDIR} ${WRKDIR}/htmldocs |
356 |
@cd ${WRKDIR}/htmldocs && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} \ |
357 |
${DISTDIR}/${PORTNAME}-htmldocs-${PORTVERSION}${EXTRACT_SUFX} \ |
358 |
${EXTRACT_AFTER_ARGS} |
359 |
.endif |
360 |
|
361 |
post-patch: |
362 |
.for FILE in ${RMMAN1} |
363 |
@${RM} ${WRKDIR}/man1/${FILE} |
364 |
.endfor |
365 |
.for FILE in ${RMMAN7} |
366 |
@${RM} ${WRKDIR}/man7/${FILE} |
367 |
.endfor |
368 |
@${REINPLACE_CMD} -e 's|share/man/man3|man/man3|' ${WRKSRC}/perl/Makefile.PL |
369 |
.ifndef (WITH_CVS) |
370 |
@${REINPLACE_CMD} -e '/git-cvsexportcommit.perl/d; \ |
371 |
/git-cvsimport.perl/d; \ |
372 |
/git-cvsserver.perl/d; \ |
373 |
/documented,gitcvs-migration/d; \ |
374 |
s/git-cvsserver//' \ |
375 |
${WRKSRC}/Makefile |
376 |
.endif |
377 |
|
378 |
.ifndef (WITH_SVN) |
379 |
@${REINPLACE_CMD} -e '/git-svn.perl/d' ${WRKSRC}/Makefile |
380 |
.endif |
381 |
.if defined(WITHOUT_GITWEB) |
382 |
@${REINPLACE_CMD} -e '/$$(MAKE) -C gitweb install/d' ${WRKSRC}/Makefile |
383 |
.endif |
384 |
.if defined(WITHOUT_P4) |
385 |
@${REINPLACE_CMD} -e '/^SCRIPT_PYTHON += git-p4.py$$/d' ${WRKSRC}/Makefile |
386 |
.endif |
387 |
|
388 |
post-build: |
389 |
.ifdef (WITH_P4) || defined (WITH_CONTRIB) |
390 |
@${REINPLACE_CMD} -e '1s|#!/usr/bin/python|#!${PYTHON_CMD}|' \ |
391 |
${WRKSRC}/contrib/p4import/git-p4import.py |
392 |
@${CP} ${WRKSRC}/contrib/p4import/git-p4import.py \ |
393 |
${WRKSRC}/contrib/p4import/git-p4import |
394 |
@${FIND} ${WRKSRC} -name "*.bak" -delete |
395 |
.endif |
396 |
|
397 |
post-install: |
398 |
(cd ${WRKDIR}/man1/ && ${COPYTREE_SHARE} \* ${MANPREFIX}/man/man1) |
399 |
(cd ${WRKDIR}/man5/ && ${COPYTREE_SHARE} \* ${MANPREFIX}/man/man5) |
400 |
(cd ${WRKDIR}/man7/ && ${COPYTREE_SHARE} \* ${MANPREFIX}/man/man7) |
401 |
.if defined(WITH_HTMLDOCS) |
402 |
# Manually remove the index.html symlink before installing, and then |
403 |
# recreate it after. This is necessary because the distfile is |
404 |
# extracted with --no-same-owner. If the distfile is extracted as a |
405 |
# non-root user then the symlink will have the incorrect owner. |
406 |
${RM} -f ${WRKDIR}/htmldocs/index.html |
407 |
${MKDIR} ${DOCSDIR} |
408 |
(cd ${WRKDIR}/htmldocs/ && ${COPYTREE_SHARE} \* ${DOCSDIR}) |
409 |
${LN} -s ${DOCSDIR}/git.html ${DOCSDIR}/index.html |
410 |
.endif |
411 |
-${RM} -f ${PREFIX}/lib/perl5/${PERL_VERSION}/mach/perllocal.pod |
412 |
${MKDIR} ${PREFIX}/share/emacs/site-lisp/git |
413 |
${MKDIR} ${PREFIX}/lib/xemacs/site-lisp/git |
414 |
${INSTALL_DATA} ${WRKSRC}/contrib/emacs/git.el \ |
415 |
${PREFIX}/share/emacs/site-lisp/git/ |
416 |
${INSTALL_DATA} ${WRKSRC}/contrib/emacs/git-blame.el \ |
417 |
${PREFIX}/share/emacs/site-lisp/git/ |
418 |
${LN} -sf ${PREFIX}/share/emacs/site-lisp/git/git.el \ |
419 |
${PREFIX}/lib/xemacs/site-lisp/git/git.el |
420 |
${LN} -sf ${PREFIX}/share/emacs/site-lisp/git/git-blame.el \ |
421 |
${PREFIX}/lib/xemacs/site-lisp/git/git-blame.el |
422 |
|
423 |
.ifdef (WITH_CONTRIB) |
424 |
@${ECHO_MSG} "===> Installing contributed scripts" |
425 |
${MKDIR} ${PREFIX}/share/git-core/contrib |
426 |
${CP} -R ${WRKSRC}/contrib/* ${PREFIX}/share/git-core/contrib |
427 |
.endif |
428 |
.if defined(WITH_P4) |
429 |
${INSTALL_SCRIPT} ${WRKSRC}/contrib/p4import/git-p4import ${PREFIX}/bin/ |
430 |
${INSTALL_SCRIPT} ${WRKSRC}/git-p4 ${PREFIX}/bin/ |
431 |
.endif |
432 |
.if defined(WITH_ETCSHELLS) |
433 |
@${ECHO_MSG} "===> Updating ${SHELLS}" |
434 |
@${CP} ${SHELLS} ${SHELLS}.bak |
435 |
@(${GREP} -v ${PREFIX}/libexec/git-core/git-shell ${SHELLS}.bak; \ |
436 |
${ECHO_CMD} ${PREFIX}/libexec/git-core/git-shell) > ${SHELLS} |
437 |
@${RM} ${SHELLS}.bak |
438 |
.endif |
439 |
|
440 |
.include <bsd.port.mk> |