blob: b8e2041b6b91ff271c2d4449ca4c8b990748b09d [file] [log] [blame]
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -07001# -*- 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
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -07004PortSystem 1.0
5
6name ccnx
7homepage http://www.ccnx.org/
8license GPL-2+ LGPL-2.1+
9version 0.6.1
10revision 0
11epoch 0
Alexander Afanasyev8e850282012-08-23 10:04:58 -070012
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070013categories net ccnx
14platforms darwin
15maintainers ucla.edu:alexander.afanasyev
16
17description ProjectCCNx implementation of Content Centric Networking (CCN) / \
18 Named Data Networking (NDN) architecture
19
20long_description Project CCNx(r) exists to develop, promote, and evaluate a new \
21 approach to communication architecture we call content-centric \
22 networking. We seek to carry out this mission by creating and \
23 publishing open protocol specifications and an open source \
24 software reference implementation of those protocols. We provide \
25 support for a community of people interested in experimentation, \
26 research, and building applications with this technology, all \
27 contributing to its evolution.
28
29master_sites http://www.ccnx.org/releases/
30checksums rmd160 073478f3d5818b0e4fe09e21a727e5f3207e4277 \
31 sha256 bfaae10c2c1a327d77f752737b60243e23fd8f3a7c7025ae92221ba0a700b889
32
33use_parallel_build yes
34
35depends_lib port:openssl \
36 port:expat \
37 port:libpcap \
38 port:libxml2
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
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -070049
50variant java description {Enable Java API build} {
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070051 configure.env-delete BUILD_JAVA=false
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -070052}
53
54variant apps requires java description {Enable build of reference applications} {
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070055 configure.env-delete BUILD_APPS=false
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -070056}
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -070057
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070058patchfiles patch-macports-customizations.diff
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -070059
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070060post-patch {
61 reinplace "s|\$HOME/.ccnx/|${prefix}/etc/ccnx/|g" ${worksrcpath}/csrc/util/ccndstart.sh
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -070062}
63
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070064configure.env-append OPENSSL_CFLAGS=-I${prefix}/include \
65 OPENSSL_LIBS=-L${prefix}/lib \
66 INSTALL_BASE=${prefix} \
67 BUILD_JAVA=false \
68 BUILD_APPS=false \
69
70configure.cflags-append -DCCNX_DIR=\\\"${prefix}/etc/ccnx\\\"
71
72build.env-append OPENSSL_CFLAGS=-I${prefix}/include \
73 OPENSSL_LIBS=-L${prefix}/lib \
74 INSTALL_BASE=${prefix}
75
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -070076post-destroot {
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070077 # Create a configuration directory, which also a home directory for ${ccnxuser}
78 xinstall -d -o ${ccnxuser} -g ${ccnxgroup} "${destroot}${prefix}/etc/ccnx"
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -070079
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070080 # Copy a sample ccnd.conf file
81 xinstall -o ${ccnxuser} -g ${ccnxgroup} ${worksrcpath}/csrc/libexec/ccnd.conf.sample ${destroot}${prefix}/etc/ccnx/
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -070082
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070083 # Create a sample ccndrc file
84 system "echo CCND_LOG=${prefix}/var/log/ccnd.log > \"${destroot}${prefix}/etc/ccnx/ccndrc.sample\""
85 system "echo CCND_DEBUG=16 >> \"${destroot}${prefix}/etc/ccnx/ccndrc.sample\""
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -070086}
87
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070088post-activate {
89 # log file needs to be owned by ${ccnxuser}, otherwise ccnd will not be able to write to it
90 touch "${prefix}/var/log/ccnd.log"
91 file attributes "${prefix}/var/log/ccnd.log" -owner ${ccnxuser} -group ${ccnxgroup}
92}
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -070093
94startupitem.pidfile none
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -070095startupitem.start "su ${ccnxuser} -c \"${prefix}/bin/ccndstart\""
96startupitem.stop "su ${ccnxuser} -c \"${prefix}/bin/ccndstop\""
Alexander Afanasyeveae69362012-08-27 09:49:56 -070097startupitem.restart "su ${ccnxuser} -c \"${prefix}/bin/ccndc -f ${prefix}/etc/ccnx/ccnd.conf\""
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -070098
99startupitem.create yes
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -0700100startupitem.name ${name}
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -0700101
102startupitem.netchange yes
103startupitem.logevents yes
104startupitem.logfile ${prefix}/var/log/ccnx.log
105
106notes "
Alexander Afanasyeveae69362012-08-27 09:49:56 -0700107In order repo to work, you need to add the following lines at the end of your
108\[~/.bash_profile\]:
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -0700109
110 export CCNR_DIRECTORY=${prefix}/etc/ccnx/repo
111
Alexander Afanasyeveae69362012-08-27 09:49:56 -0700112To configure environment variables for ccnd, edit your
113\[${prefix}/etc/ccnx/ccndrc\]. For example,
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -0700114
115 CCND_LOG=${prefix}/var/log/ccnd.log
116 CCND_DEBUG=16
117
Alexander Afanasyeveae69362012-08-27 09:49:56 -0700118To add static FIB entries, edit your \[${prefix}/etc/ccnx/ccnd.conf\].
119For example,
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -0700120
121 add ccnx:/ccnx.org udp 224.0.23.170 59695
122
Alexander Afanasyeveae69362012-08-27 09:49:56 -0700123Upon any networking change event (new connection or awaking from the sleep
124phase), all static FIB entries will be reapplied automatically.
125
126For more information and documentation, refer to man pages and
127http://www.ccnx.org website.
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -0700128"