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 | |
---|
4 | PortSystem 1.0 |
---|
5 | PortGroup github 1.0 |
---|
6 | |
---|
7 | github.setup ProjectCCNx ccnx ccnx-0.7.1 |
---|
8 | checksums rmd160 432b7b94ed786e02e97bc66a719ab0ad833c53c0 \ |
---|
9 | sha256 ee351efd2ac2200d5a03b16c342b1450c287af681b4f861f4b57dae2c6f2ed98 |
---|
10 | |
---|
11 | name ccnx |
---|
12 | homepage http://www.ccnx.org/ |
---|
13 | license GPL-2+ LGPL-2.1+ |
---|
14 | version 0.7.1 |
---|
15 | |
---|
16 | categories net |
---|
17 | platforms darwin |
---|
18 | maintainers ucla.edu:alexander.afanasyev |
---|
19 | |
---|
20 | description ProjectCCNx implementation of Content Centric Networking (CCN) / \ |
---|
21 | Named Data Networking (NDN) architecture |
---|
22 | |
---|
23 | long_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 | |
---|
32 | use_parallel_build no |
---|
33 | |
---|
34 | depends_lib-append port:openssl \ |
---|
35 | port:expat \ |
---|
36 | port:libpcap \ |
---|
37 | port:libxml2 \ |
---|
38 | port:asciidoc |
---|
39 | |
---|
40 | set ccnxuser ccnx |
---|
41 | set ccnxgroup ccnx |
---|
42 | set ccnxdir ${prefix}/etc/ccnx |
---|
43 | |
---|
44 | add_users ${ccnxuser} shell=/bin/sh group=${ccnxgroup} \ |
---|
45 | home=${ccnxdir} \ |
---|
46 | realname=CCNx\ Account |
---|
47 | |
---|
48 | default_variants +java +apps |
---|
49 | |
---|
50 | variant java description {Enable Java API build} { |
---|
51 | configure.env-delete BUILD_JAVA=false |
---|
52 | } |
---|
53 | |
---|
54 | variant apps requires java description {Enable build of reference applications} { |
---|
55 | configure.env-delete BUILD_APPS=false |
---|
56 | } |
---|
57 | |
---|
58 | post-patch { |
---|
59 | reinplace "s|\$HOME/.ccnx/|${prefix}/etc/ccnx/|g" ${worksrcpath}/csrc/util/ccndstart.sh |
---|
60 | } |
---|
61 | |
---|
62 | configure.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 | |
---|
68 | configure.cflags -DCCNX_DIR=\\\"${prefix}/etc/ccnx\\\" -O0 -g |
---|
69 | |
---|
70 | build.env-append OPENSSL_CFLAGS=-I${prefix}/include \ |
---|
71 | OPENSSL_LIBS=-L${prefix}/lib \ |
---|
72 | INSTALL_BASE=${prefix} \ |
---|
73 | |
---|
74 | |
---|
75 | post-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 | |
---|
90 | post-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 | |
---|
105 | startupitem.pidfile none |
---|
106 | startupitem.start "su ${ccnxuser} -c \"${prefix}/bin/ccndstart\" && sleep 1 && \"${prefix}/bin/ccnd-autoconfig\"" |
---|
107 | startupitem.stop "su ${ccnxuser} -c \"${prefix}/bin/ccndstop\"" |
---|
108 | startupitem.restart "su ${ccnxuser} -c \"${prefix}/bin/ccndc -f ${prefix}/etc/ccnx/ccnd.conf\" && su ${ccnxuser} -c \"${prefix}/bin/ccnd-autoconfig\"" |
---|
109 | |
---|
110 | variant 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 | |
---|
115 | startupitem.create yes |
---|
116 | startupitem.name ${name} |
---|
117 | |
---|
118 | startupitem.netchange yes |
---|
119 | startupitem.logevents yes |
---|
120 | startupitem.logfile ${prefix}/var/log/ccnx.log |
---|
121 | |
---|
122 | notes " |
---|
123 | If 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 | |
---|
128 | You can add the following line into \"${prefix}/etc/ccnx/ccndrc\" in order to automatically |
---|
129 | start ccnx repo for the /ndn/keys prefix: |
---|
130 | |
---|
131 | CCNR_GLOBAL_PREFIX=/ndn/keys |
---|
132 | |
---|
133 | For more information and documentation, refer to man pages and |
---|
134 | http://www.ccnx.org website. |
---|
135 | " |
---|