Ticket #40664: Portfile

File Portfile, 6.0 KB (added by petrrr, 11 years ago)
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id$
3
4PortSystem          1.0
5
6name                irods
7version             3.3
8categories          net science
9# disactive universal for now
10# (globus is probably not universal neither)
11universal_variant   no
12platforms           darwin
13maintainers         bo.ingv.it:Peter.Danecek openmaintainer
14
15license             BSD
16
17description         The iRODS data management system (middleware)
18 
19long_description    iRODS, i.e. integrated Rule-Oriented Data System, is a \
20                    distributed data-management system for creating data \
21                    grids, digital libraries, persistent archives, and \
22                    real-time data systems. \
23
24homepage            https://www.irods.org
25
26master_sites        https://www.irods.org/cgi-bin/upload17.cgi/
27distname            ${name}${version}
28extract.suffix      .tgz
29
30checksums           md5     b6d55e56014663a3da042eb02a2d2be0 \
31                    rmd160  b6295054d79cd1919ebb223060cf5136fb235834 \
32                    sha256  47a546222369d3ac9a38c9ed461ca4d5a2ea70f6e041547450b0cd90ed3bc788
33
34worksrcdir          iRODS
35
36patchfiles          patch-config-platform.mk.template
37
38configure.perl      /usr/bin/perl
39configure.cmd       scripts/configure
40
41configure.pre_args-delete \
42    --prefix=${prefix}
43
44
45default_variants    +unicode
46
47if {${subport} ne "irods-doc"} {
48    variant unicode description {Activate Unicore support} {}
49
50    variant gsi description {Activate support for GSI authentification} {
51
52        default_variants-append +ca_bundle        ;# does not work
53
54        # deps GSI, taken from iRODS chat (G.Mariani)
55        depends_lib-append  port:globus-gss-assist
56        depends_run-append  port:globus-proxy-utils
57    }
58
59    variant ca_bundle description {Installs the IGTF CA-certificate bundle} {
60        depends_run-append  \
61            port:fetch-crl \
62            port:igtf-certificates
63    }
64
65    # TODO: Add kerberos variant?
66    # TODO: Add audit variant here?
67}
68
69# meta port: installs the existing clients
70if {${name} eq ${subport}} {
71    depends_run-append  \
72        port:irods-client-icmds \
73        port:irods-client-fuse \
74
75    patchfiles
76    use_configure   no
77    build  {
78        # TODO: Add some content
79        touch ${worksrcpath}/README-MacPorts.txt
80    }
81    destroot  {
82        xinstall -d ${destroot}${dir_doc}
83        copy ${worksrcpath}/README-MacPorts.txt ${destroot}${dir_doc}
84    }
85} else {
86    pre-configure {
87        # replace interactive scripts/irodsprompt
88        #   (0) take irods.config.template as base for replacements
89        copy ${worksrcpath}/config/irods.config.template \
90            ${worksrcpath}/config/irods.config
91        #   (1) Unicode support
92        if {[variant_isset unicore]} {
93            reinplace "s|\$UNICODE = '';|\$UNICODE = '1';|" \
94            ${worksrcpath}/config/irods.config
95        }
96        #   (2) GSI authentification
97        if {[variant_isset gsi]} {
98            reinplace "s|\$GSI_AUTH = '';|\$GSI_AUTH = '1';|" \
99                ${worksrcpath}/config/irods.config
100            reinplace "s|\$GLOBUS_LOCATION = '';|\$GLOBUS_LOCATION = '${prefix}';|" \
101                ${worksrcpath}/config/irods.config
102        }
103
104        # set executables for configure step
105        reinplace "s|\#*\$PERL = '';|\$PERL = '${configure.perl}';|" \
106            ${worksrcpath}/config/irods.config
107
108        # UNCLEAR:
109        # iRods seems to be pure C, but CC compiler is not accepted by config script
110        reinplace "s|\#*\$CC = '';|\$CC = '${configure.cxx}';|" \
111            ${worksrcpath}/config/irods.config
112        reinplace "s|\#*\$CCFLAGS = '';|\$CCFLAGS = '${configure.cxxflags}';|" \
113            ${worksrcpath}/config/irods.config
114
115        reinplace "s|\#*\$AR = '';|\$AR = '/usr/bin/ar';|" \
116            ${worksrcpath}/config/irods.config
117        reinplace "s|\#*\$RANLIB = '';|\$RANLIB = '/usr/bin/ranlib';|" \
118            ${worksrcpath}/config/irods.config
119    }
120}
121
122# Basic documentation stub
123# Maybe add more documentation?
124set dir_doc ${prefix}/share/${name}/doc
125subport irods-doc {
126    build.target    doc
127    destroot {
128        xinstall -d ${destroot}${dir_doc}
129        xinstall -m 644 -W ${worksrcpath} \
130            LICENSE.txt \
131            README.txt  \
132            ${destroot}${dir_doc}
133    }
134}
135
136# This is specific for clients
137configure.args \
138    --disable-properties \
139    --disable-ERA \
140    --disable-msoDrivers \
141    --disable-examples
142
143subport irods-client-icmds {
144
145    description     The icommands client for the iRODS.
146   
147    long_description \
148        This subport provides the i-commands client for iRods. \
149        ${long_description}
150
151    depends_run-append  port:irods-doc
152
153    build.target    clients
154    # TODO: create some sort of manpage
155
156    destroot {
157        eval copy [ glob ${worksrcpath}/clients/icommands/bin/i* ] \
158            ${destroot}${prefix}/bin
159
160        xinstall -d ${destroot}${prefix}/share/${name}
161        xinstall -m 644 -W ${worksrcpath} \
162            irods_completion.bash \
163            irods_completion.tcsh \
164            ${destroot}${prefix}/share/${name}
165
166        set dir_rules ${prefix}/share/${name}/examples/rules
167        xinstall -d ${destroot}${dir_rules}
168        eval copy [ glob ${worksrcpath}/clients/icommands/bin/*.*r ] \
169            ${destroot}${dir_rules}
170    }
171}
172
173subport irods-client-fuse {
174    description     The a fuse client for the iRODS (experimental)
175   
176    long_description \
177        This subport provides the fuse client for iRods. \
178        ${long_description}
179
180    depends_lib-append  port:fuse4x
181
182    depends_run-append  \
183        port:irods-doc \
184        port:irods-client-icmds
185
186    post-configure {
187        reinplace "s|.*IRODS_FS.*|IRODS_FS = 1|" \
188            ${worksrcpath}/config/irods.config
189        reinplace "s|.*fuseHomeDir.*=.*|fuseHomeDir=${prefix}|" \
190            ${worksrcpath}/config/config.mk
191    }
192
193    build.target fuse
194    # TODO: Would be nice to have some minimal man page as well;
195
196    destroot {
197        copy ${worksrcpath}/clients/fuse/bin/irodsFs ${destroot}${prefix}/bin
198    }
199}
200
201###