Ticket #23717: Portfile

File Portfile, 5.1 KB (added by dechaume@…, 14 years ago)
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; truncate-lines: t; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
2# $Id: Portfile 63775 2010-02-14 17:09:55Z rmsfisher@macports.org $
3
4PortSystem        1.0
5
6name              git-core
7version           1.7.0
8revision          1
9description       A fast version control system
10long_description  Git is a fast, scalable, distributed open source version \
11                  control system focusing on speed and efficiency.
12maintainers       larsen.st:bryan \
13                  gmail.com:maccheck \
14                  openmaintainer
15categories        devel
16platforms         darwin
17homepage          http://git-scm.com
18use_bzip2         yes
19master_sites      http://www.kernel.org/pub/software/scm/git/
20distname          git-${version}
21distfiles         git-${version}${extract.suffix} \
22                  git-manpages-${version}${extract.suffix}
23
24checksums    git-${version}${extract.suffix} \
25                    md5     c7553b73e2156d187ece6ba936ae30ab \
26                    sha1    c0b536735a7f593877d61f5a8af72bdad0193d97 \
27                    rmd160  5f37b556845dba23cc3e604e9b503b4ef0a9d3f7 \
28             git-manpages-${version}${extract.suffix} \
29                    md5     1bb3b0ab6c6129d61455b0e2e7104cc8 \
30                    sha1    8d8b149df1a3146c76a41f50c14302e0424a29af \
31                    rmd160  520953c815c821f5350e6bb96f605c2830678ce0 \
32
33depends_run  port:rsync path:bin/perl:perl5 port:p5-error
34depends_lib  port:curl port:zlib port:openssl port:expat port:libiconv
35
36patchfiles   patch-Makefile.diff
37
38extract.only   git-${version}${extract.suffix} \
39               git-manpages-${version}${extract.suffix}
40
41use_configure  no
42
43set CFLAGS     "-Wall -O2 -I${prefix}/include ${configure.cc_archflags}"
44set LDFLAGS    "-L${prefix}/lib"
45
46build.args     CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" \
47               CC=${configure.cc} \
48               prefix=${prefix} CURLDIR=${prefix} OPENSSLDIR=${prefix} ICONVDIR=${prefix} \
49               PERL_PATH="${prefix}/bin/perl" NO_FINK=1 NO_DARWIN_PORTS=1 \
50               NO_R_TO_GCC_LINKER=1 PYTHON_PATH="${prefix}/bin/python"
51
52test.run       yes
53test.cmd       make
54test.target    test
55test.dir       ${worksrcpath}
56test.args      prefix=${prefix} CURLDIR=${prefix} OPENSSLDIR=${prefix} ICONVDIR=${prefix} \
57               PERL_PATH="${prefix}/bin/perl" NO_FINK=1 NO_DARWIN_PORTS=1
58
59destroot.destdir  DESTDIR=${destroot} prefix=${prefix}
60destroot.target   install
61destroot.args     CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" \
62                  prefix=${prefix} CURLDIR=${prefix} OPENSSLDIR=${prefix} ICONVDIR=${prefix} \
63                  PERL_PATH="${prefix}/bin/perl" NO_FINK=1 NO_DARWIN_PORTS=1 \
64                  NO_R_TO_GCC_LINKER=1 PYTHON_PATH="${prefix}/bin/python"
65
66post-destroot {
67    foreach f {1 5 7} {
68        xinstall -d ${destroot}${prefix}/share/man/man${f}
69        foreach m [glob -directory ${workpath} man${f}/*.${f}] {
70            xinstall ${m} ${destroot}${prefix}/share/man/man${f}
71        }
72    }
73    if {![variant_isset svn]} {
74        system "rm ${destroot}${prefix}/libexec/git-core/git-svn*"
75    }
76    set docdestroot ${destroot}${prefix}/share/doc/${name}
77    xinstall -d ${docdestroot}
78    if {[variant_isset doc]} {
79        system "cd ${docdestroot} && ${extract.cmd} ${extract.pre_args} \
80            ${distpath}/git-htmldocs-${version}${extract.suffix} \
81            ${extract.post_args}"
82    }
83
84    file copy ${worksrcpath}/contrib ${docdestroot}
85
86    foreach badfile [exec find ${destroot} -name perllocal.pod] {
87        ui_info "Removing ${badfile}"
88        file delete ${badfile}
89    }
90}
91
92variant doc description {Install HTML and plaintext documentation} {
93    distfiles-append    git-htmldocs-${version}${extract.suffix}
94    checksums-append    git-htmldocs-${version}${extract.suffix} \
95                    md5     9dfbfa8fe5f2a80891de0951435d7dfb \
96                    sha1    efc0f2b5d663e72c8e543f3ea7fd47b98e58b029 \
97                    rmd160  06be1a51168f4b4e522d06ed0edc3437658bd519
98}
99
100variant gitweb description {Install gitweb.cgi} {
101    build.target-append        gitweb/gitweb.cgi
102
103    post-destroot {
104        xinstall -d ${destroot}${prefix}/share/${name}/gitweb
105        xinstall -m 444 -W ${worksrcpath}/gitweb \
106            gitweb.cgi \
107            gitweb.css \
108            git-favicon.png \
109            git-logo.png \
110            ${destroot}${prefix}/share/${name}/gitweb
111        xinstall -d ${destroot}${prefix}/share/doc/${name}/gitweb
112        xinstall -m 444 -W ${worksrcpath}/gitweb README INSTALL \
113            ${destroot}${prefix}/share/doc/${name}/gitweb
114    }
115}
116
117variant svn description {Bi-directional subversion repository support} {
118    depends_run-append  port:subversion port:p5-libwww-perl port:p5-svn-simple port:p5-term-readkey
119}
120
121variant bash_completion {
122    depends_run-append  port:bash-completion
123
124    post-destroot {
125        xinstall -d ${destroot}${prefix}/etc/bash_completion.d
126        xinstall -m 644 ${worksrcpath}/contrib/completion/git-completion.bash \
127            ${destroot}${prefix}/etc/bash_completion.d/git
128    }
129}
130
131default_variants    +doc
132
133livecheck.type          regex
134livecheck.regex         {<div id="ver">v([0-9.]+)}