blob: c80432e5121e2f6c2e379af1500e070483970e49 [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
Alexander Afanasyev9291faa2012-08-27 15:00:11 -070035depends_lib-append port:openssl \
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070036 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
Alexander Afanasyevc7660be2012-08-27 15:13:36 -070081 xinstall -o ${ccnxuser} -g ${ccnxgroup} \
82 ${worksrcpath}/csrc/libexec/ccnd.conf.sample \
83 ${destroot}${prefix}/etc/ccnx/
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -070084
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070085 # Create a sample ccndrc file
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\""
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -070088}
89
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070090post-activate {
91 # log file needs to be owned by ${ccnxuser}, otherwise ccnd will not be able to write to it
92 touch "${prefix}/var/log/ccnd.log"
93 file attributes "${prefix}/var/log/ccnd.log" -owner ${ccnxuser} -group ${ccnxgroup}
Alexander Afanasyevc7660be2012-08-27 15:13:36 -070094
95 # Make sure initial conf files are present and setup correctly
96 foreach f { ccnd.conf ccndrc } {
97 if {![file exists ${prefix}/etc/ccnx/${f}]} {
98 file copy ${prefix}/etc/ccnx/${f}.sample \
99 ${prefix}/etc/ccnx/${f}
100 }
101 }
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -0700102}
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -0700103
104startupitem.pidfile none
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -0700105startupitem.start "su ${ccnxuser} -c \"${prefix}/bin/ccndstart\""
106startupitem.stop "su ${ccnxuser} -c \"${prefix}/bin/ccndstop\""
Alexander Afanasyeveae69362012-08-27 09:49:56 -0700107startupitem.restart "su ${ccnxuser} -c \"${prefix}/bin/ccndc -f ${prefix}/etc/ccnx/ccnd.conf\""
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -0700108
109startupitem.create yes
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -0700110startupitem.name ${name}
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -0700111
112startupitem.netchange yes
113startupitem.logevents yes
114startupitem.logfile ${prefix}/var/log/ccnx.log
115
116notes "
Alexander Afanasyeveae69362012-08-27 09:49:56 -0700117In order repo to work, you need to add the following lines at the end of your
118\[~/.bash_profile\]:
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -0700119
120 export CCNR_DIRECTORY=${prefix}/etc/ccnx/repo
121
Alexander Afanasyeveae69362012-08-27 09:49:56 -0700122To configure environment variables for ccnd, edit your
123\[${prefix}/etc/ccnx/ccndrc\]. For example,
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -0700124
125 CCND_LOG=${prefix}/var/log/ccnd.log
126 CCND_DEBUG=16
127
Alexander Afanasyeveae69362012-08-27 09:49:56 -0700128To add static FIB entries, edit your \[${prefix}/etc/ccnx/ccnd.conf\].
129For example,
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -0700130
131 add ccnx:/ccnx.org udp 224.0.23.170 59695
132
Alexander Afanasyeveae69362012-08-27 09:49:56 -0700133Upon any networking change event (new connection or awaking from the sleep
134phase), all static FIB entries will be reapplied automatically.
135
136For more information and documentation, refer to man pages and
137http://www.ccnx.org website.
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -0700138"