Ticket #35852: ccnx-Portfile

File ccnx-Portfile, 5.1 KB (added by anddam (Andrea D'Amore), 12 years ago)

minor changes

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
5PortGroup               github 1.0
6
7github.setup            ProjectCCNx ccnx ccnx-0.7.1
8checksums               rmd160  432b7b94ed786e02e97bc66a719ab0ad833c53c0 \
9                        sha256  ee351efd2ac2200d5a03b16c342b1450c287af681b4f861f4b57dae2c6f2ed98
10
11name                    ccnx
12homepage                http://www.ccnx.org/
13license                 GPL-2+ LGPL-2.1+
14version                 0.7.1
15
16categories              net
17platforms               darwin
18maintainers             ucla.edu:alexander.afanasyev
19
20description             ProjectCCNx implementation of Content Centric Networking (CCN) / \
21                        Named Data Networking (NDN) architecture
22
23long_description        Project CCNx(r) exists to develop, promote, and evaluate a new \
24                        approach to communication architecture we call content-centric \
25                        networking.  We seek to carry out this mission by creating and \
26                        publishing open protocol specifications and an open source \
27                        software reference implementation of those protocols.  We provide \
28                        support for a community of people interested in experimentation, \
29                        research, and building applications with this technology, all \
30                        contributing to its evolution.
31
32use_parallel_build      no
33
34depends_lib-append      port:openssl \
35                        port:expat \
36                        port:libpcap \
37                        port:libxml2 \
38                        port:asciidoc
39
40set ccnxuser            ccnx
41set ccnxgroup           ccnx
42set ccnxdir             ${prefix}/etc/ccnx
43
44add_users               ${ccnxuser} shell=/bin/sh group=${ccnxgroup} \
45                        home=${ccnxdir} \
46                        realname=CCNx\ Account
47
48default_variants        +java +apps
49
50variant java description {Enable Java API build} {
51    configure.env-delete   BUILD_JAVA=false
52}
53
54variant apps requires java description {Enable build of reference applications} {
55    configure.env-delete   BUILD_APPS=false
56}
57
58post-patch {
59    reinplace   "s|\$HOME/.ccnx/|${prefix}/etc/ccnx/|g" ${worksrcpath}/csrc/util/ccndstart.sh
60}
61
62configure.env-append    OPENSSL_CFLAGS=-I${prefix}/include \
63                        OPENSSL_LIBS=-L${prefix}/lib \
64                        INSTALL_BASE=${prefix} \
65                        BUILD_JAVA=false \
66                        BUILD_APPS=false \
67
68configure.cflags        -DCCNX_DIR=\\\"${prefix}/etc/ccnx\\\" -O0 -g
69
70build.env-append        OPENSSL_CFLAGS=-I${prefix}/include \
71                        OPENSSL_LIBS=-L${prefix}/lib \
72                        INSTALL_BASE=${prefix} \
73
74
75post-destroot {
76    # Create a configuration directory, which also a home directory for ${ccnxuser}
77    xinstall -d -o ${ccnxuser} -g ${ccnxgroup} "${destroot}${prefix}/etc/ccnx"
78
79    # Copy a sample ccnd.conf file
80    xinstall -o ${ccnxuser} -g ${ccnxgroup} \
81        ${worksrcpath}/csrc/libexec/ccnd.conf.sample \
82        ${destroot}${prefix}/etc/ccnx/
83
84    # Create a sample ccndrc file
85    system "echo CCNR_GLOBAL_PREFIX=/ndn/keys > \"${destroot}${prefix}/etc/ccnx/ccndrc.sample\""
86    system "echo CCND_LOG=${prefix}/var/log/ccnd.log >> \"${destroot}${prefix}/etc/ccnx/ccndrc.sample\""
87    system "echo CCND_DEBUG=16 >> \"${destroot}${prefix}/etc/ccnx/ccndrc.sample\""
88}
89
90post-activate {
91    # log file needs to be owned by ${ccnxuser}, otherwise ccnd will not be able to write to it
92    file mkdir "${prefix}/var/log"
93    touch "${prefix}/var/log/ccnd.log"
94    file attributes "${prefix}/var/log/ccnd.log" -owner ${ccnxuser} -group ${ccnxgroup}
95
96    # Make sure initial conf files are present and setup correctly
97    foreach f { ccnd.conf ccndrc } {
98        if {![file exists ${prefix}/etc/ccnx/${f}]} {
99            file copy ${prefix}/etc/ccnx/${f}.sample \
100                ${prefix}/etc/ccnx/${f}
101        }
102    }
103}
104
105startupitem.pidfile     none
106startupitem.start       "su ${ccnxuser} -c \"${prefix}/bin/ccndstart\" && sleep 1 && \"${prefix}/bin/ccnd-autoconfig\""
107startupitem.stop        "su ${ccnxuser} -c \"${prefix}/bin/ccndstop\""
108startupitem.restart     "su ${ccnxuser} -c \"${prefix}/bin/ccndc -f ${prefix}/etc/ccnx/ccnd.conf\" && su ${ccnxuser} -c \"${prefix}/bin/ccnd-autoconfig\""
109
110variant no_autoconf {
111    startupitem.start       "su ${ccnxuser} -c \"${prefix}/bin/ccndstart\""
112    startupitem.restart     "su ${ccnxuser} -c \"${prefix}/bin/ccndc -f ${prefix}/etc/ccnx/ccnd.conf\""
113}
114
115startupitem.create      yes
116startupitem.name        ${name}
117
118startupitem.netchange   yes
119startupitem.logevents   yes
120startupitem.logfile     ${prefix}/var/log/ccnx.log
121
122notes "
123If you want to run repo, please install and load a separate ccnx-repo package:
124
125    # port install ccnx-repo
126    # port load ccnx-repo
127
128You can add the following line into \"${prefix}/etc/ccnx/ccndrc\" in order to automatically
129start ccnx repo for the /ndn/keys prefix:
130
131    CCNR_GLOBAL_PREFIX=/ndn/keys
132
133For more information and documentation, refer to man pages and
134http://www.ccnx.org website.
135"