Ticket #29560: Portfile

File Portfile, 2.4 KB (added by humem (humem), 13 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                mahout
7version             0.4
8
9categories          java science
10platforms           darwin
11maintainers         gamil.com:hiroshi.umemoto openmaintainer
12license             Apache-2.0
13
14description \
15    A scalable machine learning library that supports large data sets
16
17long_description \
18    Mahout is a scalable machine learning library that implements many \
19    different approaches to machine learning. \
20    The project currently contains implementations of algorithms for \
21    classification, clustering, genetic programming and collaborative \
22    filtering, all enabled to scale by leveraging the power of Hadoop's \
23    Map-Reduce (http://hadoop.apache.org) implementation.
24
25homepage            http://mahout.apache.org/
26master_sites        apache:${name}/${version}
27
28distname            ${name}-distribution-${version}
29
30checksums           sha1    d90ae5387d36defb78fc1d22719a80018ac5030a \
31                    rmd160  3831ce991cf17d0c08524bd4a504948e86f1d21d
32
33use_bzip2           yes
34
35depends_lib         port:hadoop
36
37use_configure       no
38supported_archs     noarch
39
40build {}
41
42set mahout_home     ${prefix}/share/java/${distname}
43set mahout_log_dir  ${prefix}/var/hadoop/log
44
45destroot {
46    # Copy the distribution to Mahout home directory.
47    xinstall -m 755 -${destroot}${prefix}/share/java
48    copy ${worksrcpath} ${destroot}${prefix}/share/java/
49
50    # Read the configuration of Hadoop from 'hadoop-bin'.
51    set f [open ${prefix}/bin/hadoop-bin]
52    set string [read $f]
53    close $f
54    regexp {JAVA_HOME=(\S+)}   $string m java_home
55    regexp {HADOOP_HOME=(\S+)} $string m hadoop_home
56    regexp {sudo -E -u (\S+)}  $string m hadoopuser
57
58    # Install an extra script for this port.
59    set mahout_bin ${destroot}${prefix}/bin/mahout-bin
60    xinstall -m 755 ${filespath}/mahout-bin            ${mahout_bin}
61    reinplace "s|@java_home@|${java_home}|g"           ${mahout_bin}
62    reinplace "s|@hadoop_home@|${hadoop_home}|g"       ${mahout_bin}
63    reinplace "s|@mahout_home@|${mahout_home}|g"       ${mahout_bin}
64    reinplace "s|@mahout_log_dir@|${mahout_log_dir}|g" ${mahout_bin}
65    reinplace "s|@hadoopuser@|${hadoopuser}|g"         ${mahout_bin}
66}
67
68livecheck.type      regex
69livecheck.url       ${homepage}
70livecheck.regex     Latest release version: Mahout (\[0-9.\]+)