blob: 7b596456a98d107d80d3e4e18d5bb5074f840167 [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
Alexander Afanasyevd600ea92012-09-24 13:39:43 -07005PortGroup github 1.0
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -07006
Alexander Afanasyevf6896e62012-10-03 09:54:46 -07007github.setup ProjectCCNx ccnx ccnx-0.6.2
8checksums rmd160 c0bb4963ff95a4b9b0211502715d3cda40300fbf \
9 sha256 5ae09e02fd89b2d25f1f22bf3c0536636962c853f21e791b0ddf4aa9bba5c73d
Alexander Afanasyevd600ea92012-09-24 13:39:43 -070010
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070011name ccnx
12homepage http://www.ccnx.org/
13license GPL-2+ LGPL-2.1+
Alexander Afanasyevf6896e62012-10-03 09:54:46 -070014version 0.6.2
Alexander Afanasyev6df5ad92012-10-09 10:21:50 -070015revision 6
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070016epoch 0
Alexander Afanasyev8e850282012-08-23 10:04:58 -070017
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070018categories net ccnx
19platforms darwin
20maintainers ucla.edu:alexander.afanasyev
21
22description ProjectCCNx implementation of Content Centric Networking (CCN) / \
23 Named Data Networking (NDN) architecture
24
25long_description Project CCNx(r) exists to develop, promote, and evaluate a new \
26 approach to communication architecture we call content-centric \
27 networking. We seek to carry out this mission by creating and \
28 publishing open protocol specifications and an open source \
29 software reference implementation of those protocols. We provide \
30 support for a community of people interested in experimentation, \
31 research, and building applications with this technology, all \
32 contributing to its evolution.
33
Alexander Afanasyevd600ea92012-09-24 13:39:43 -070034use_parallel_build no
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070035
Alexander Afanasyev9291faa2012-08-27 15:00:11 -070036depends_lib-append port:openssl \
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070037 port:expat \
38 port:libpcap \
Alexander Afanasyevd600ea92012-09-24 13:39:43 -070039 port:libxml2 \
40 port:asciidoc
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070041
42set ccnxuser ccnx
43set ccnxgroup ccnx
44set ccnxdir ${prefix}/etc/ccnx
45
46add_users ${ccnxuser} shell=/bin/sh group=${ccnxgroup} \
47 home=${ccnxdir} \
48 realname=CCNx\ Account
49
50default_variants +java +apps
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -070051
52variant java description {Enable Java API build} {
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070053 configure.env-delete BUILD_JAVA=false
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -070054}
55
56variant apps requires java description {Enable build of reference applications} {
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070057 configure.env-delete BUILD_APPS=false
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -070058}
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -070059
Alexander Afanasyeva556d7e2012-10-03 17:35:08 -070060patchfiles autoconfig.patch
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -070061
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070062post-patch {
63 reinplace "s|\$HOME/.ccnx/|${prefix}/etc/ccnx/|g" ${worksrcpath}/csrc/util/ccndstart.sh
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -070064}
65
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070066configure.env-append OPENSSL_CFLAGS=-I${prefix}/include \
67 OPENSSL_LIBS=-L${prefix}/lib \
68 INSTALL_BASE=${prefix} \
69 BUILD_JAVA=false \
70 BUILD_APPS=false \
71
Alexander Afanasyevd600ea92012-09-24 13:39:43 -070072configure.cflags -DCCNX_DIR=\\\"${prefix}/etc/ccnx\\\" -O0 -g
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070073
74build.env-append OPENSSL_CFLAGS=-I${prefix}/include \
75 OPENSSL_LIBS=-L${prefix}/lib \
Alexander Afanasyevd600ea92012-09-24 13:39:43 -070076 INSTALL_BASE=${prefix} \
77
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070078
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -070079post-destroot {
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070080 # Create a configuration directory, which also a home directory for ${ccnxuser}
81 xinstall -d -o ${ccnxuser} -g ${ccnxgroup} "${destroot}${prefix}/etc/ccnx"
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -070082
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070083 # Copy a sample ccnd.conf file
Alexander Afanasyevc7660be2012-08-27 15:13:36 -070084 xinstall -o ${ccnxuser} -g ${ccnxgroup} \
85 ${worksrcpath}/csrc/libexec/ccnd.conf.sample \
86 ${destroot}${prefix}/etc/ccnx/
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -070087
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070088 # Create a sample ccndrc file
89 system "echo CCND_LOG=${prefix}/var/log/ccnd.log > \"${destroot}${prefix}/etc/ccnx/ccndrc.sample\""
90 system "echo CCND_DEBUG=16 >> \"${destroot}${prefix}/etc/ccnx/ccndrc.sample\""
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -070091}
92
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070093post-activate {
94 # log file needs to be owned by ${ccnxuser}, otherwise ccnd will not be able to write to it
Alexander Afanasyevd600ea92012-09-24 13:39:43 -070095 file mkdir "${prefix}/var/log"
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070096 touch "${prefix}/var/log/ccnd.log"
97 file attributes "${prefix}/var/log/ccnd.log" -owner ${ccnxuser} -group ${ccnxgroup}
Alexander Afanasyevc7660be2012-08-27 15:13:36 -070098
99 # Make sure initial conf files are present and setup correctly
100 foreach f { ccnd.conf ccndrc } {
101 if {![file exists ${prefix}/etc/ccnx/${f}]} {
102 file copy ${prefix}/etc/ccnx/${f}.sample \
103 ${prefix}/etc/ccnx/${f}
104 }
105 }
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -0700106}
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -0700107
108startupitem.pidfile none
Alexander Afanasyeva556d7e2012-10-03 17:35:08 -0700109startupitem.start "su ${ccnxuser} -c \"${prefix}/bin/ccndstart\" && sleep 1 && \"${prefix}/bin/ccnd-autoconfig\""
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -0700110startupitem.stop "su ${ccnxuser} -c \"${prefix}/bin/ccndstop\""
Alexander Afanasyeva556d7e2012-10-03 17:35:08 -0700111startupitem.restart "su ${ccnxuser} -c \"${prefix}/bin/ccndc -f ${prefix}/etc/ccnx/ccnd.conf\" && su ${ccnxuser} -c \"${prefix}/bin/ccnd-autoconfig\""
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -0700112
Alexander Afanasyev186dd3a2012-10-03 18:09:36 -0700113variant no_autoconf {
114 startupitem.start "su ${ccnxuser} -c \"${prefix}/bin/ccndstart\""
115 startupitem.restart "su ${ccnxuser} -c \"${prefix}/bin/ccndc -f ${prefix}/etc/ccnx/ccnd.conf\""
116}
117
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -0700118startupitem.create yes
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -0700119startupitem.name ${name}
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -0700120
121startupitem.netchange yes
122startupitem.logevents yes
123startupitem.logfile ${prefix}/var/log/ccnx.log
124
125notes "
Alexander Afanasyeveae69362012-08-27 09:49:56 -0700126In order repo to work, you need to add the following lines at the end of your
127\[~/.bash_profile\]:
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -0700128
129 export CCNR_DIRECTORY=${prefix}/etc/ccnx/repo
130
Alexander Afanasyeveae69362012-08-27 09:49:56 -0700131To configure environment variables for ccnd, edit your
132\[${prefix}/etc/ccnx/ccndrc\]. For example,
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -0700133
134 CCND_LOG=${prefix}/var/log/ccnd.log
135 CCND_DEBUG=16
136
Alexander Afanasyeveae69362012-08-27 09:49:56 -0700137To add static FIB entries, edit your \[${prefix}/etc/ccnx/ccnd.conf\].
138For example,
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -0700139
140 add ccnx:/ccnx.org udp 224.0.23.170 59695
141
Alexander Afanasyeveae69362012-08-27 09:49:56 -0700142Upon any networking change event (new connection or awaking from the sleep
143phase), all static FIB entries will be reapplied automatically.
144
145For more information and documentation, refer to man pages and
146http://www.ccnx.org website.
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -0700147"