blob: ecc2e65964a05b4e244db6fe00f6b0228dc535c6 [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 Afanasyevb41f8502013-02-14 14:02:57 -08006
Alexander Afanasyev3d7b19d2013-05-20 11:28:37 -07007github.setup named-data ccnx ccnx-0.7.2-ndn-1
8checksums rmd160 0e1bc288f326f99a8a28d189cb51c1a4c278ae98 \
9 sha256 0b6b0a6ef64d3762053a77f75bb4dafb289339a6468ab3c24964c3ad2d9cf19c
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 Afanasyev3d7b19d2013-05-20 11:28:37 -070014version 0.7.2.ndn.1
15epoch 4
Alexander Afanasyev8e850282012-08-23 10:04:58 -070016
Alexander Afanasyevdcb61ae2013-02-18 09:22:45 -080017categories net
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070018platforms darwin
19maintainers ucla.edu:alexander.afanasyev
Alexander Afanasyevb41f8502013-02-14 14:02:57 -080020
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070021description ProjectCCNx implementation of Content Centric Networking (CCN) / \
22 Named Data Networking (NDN) architecture
Alexander Afanasyevb41f8502013-02-14 14:02:57 -080023
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070024long_description Project CCNx(r) exists to develop, promote, and evaluate a new \
25 approach to communication architecture we call content-centric \
26 networking. We seek to carry out this mission by creating and \
27 publishing open protocol specifications and an open source \
28 software reference implementation of those protocols. We provide \
29 support for a community of people interested in experimentation, \
30 research, and building applications with this technology, all \
Alexander Afanasyevb41f8502013-02-14 14:02:57 -080031 contributing to its evolution.
32
Alexander Afanasyev9291faa2012-08-27 15:00:11 -070033depends_lib-append port:openssl \
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070034 port:expat \
35 port:libpcap \
Alexander Afanasyevd600ea92012-09-24 13:39:43 -070036 port:libxml2 \
37 port:asciidoc
Alexander Afanasyevb41f8502013-02-14 14:02:57 -080038
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070039set ccnxuser ccnx
40set ccnxgroup ccnx
41set ccnxdir ${prefix}/etc/ccnx
Alexander Afanasyevb41f8502013-02-14 14:02:57 -080042
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070043add_users ${ccnxuser} shell=/bin/sh group=${ccnxgroup} \
44 home=${ccnxdir} \
45 realname=CCNx\ Account
Alexander Afanasyevb41f8502013-02-14 14:02:57 -080046
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070047default_variants +java +apps
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -070048
49variant java description {Enable Java API build} {
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070050 configure.env-delete BUILD_JAVA=false
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -070051}
52
53variant apps requires java description {Enable build of reference applications} {
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070054 configure.env-delete BUILD_APPS=false
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -070055}
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -070056
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070057post-patch {
Alexander Afanasyevdb1e1b72013-02-19 15:44:33 -080058 reinplace "s|\$HOME/.ccnx/|${ccnxdir}/|g" ${worksrcpath}/csrc/util/ccndstart.sh
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -070059}
60
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070061configure.env-append OPENSSL_CFLAGS=-I${prefix}/include \
62 OPENSSL_LIBS=-L${prefix}/lib \
63 INSTALL_BASE=${prefix} \
Alexander Afanasyev4ca899a2013-03-12 10:48:16 -070064 INSTALL_MAN=${prefix}/share/man \
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070065 BUILD_JAVA=false \
66 BUILD_APPS=false \
67
Alexander Afanasyevdf59d202013-02-19 16:02:42 -080068configure.cflags -DCCNX_DIR=\\\"${ccnxdir}\\\" \
Alexander Afanasyev654f4d62013-03-17 10:53:29 -070069 -O2 -std=gnu99
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070070
71build.env-append OPENSSL_CFLAGS=-I${prefix}/include \
72 OPENSSL_LIBS=-L${prefix}/lib \
Alexander Afanasyevd600ea92012-09-24 13:39:43 -070073 INSTALL_BASE=${prefix} \
Alexander Afanasyevb41f8502013-02-14 14:02:57 -080074
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070075
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}
Alexander Afanasyevdb1e1b72013-02-19 15:44:33 -080078 xinstall -d -o ${ccnxuser} -g ${ccnxgroup} "${destroot}${ccnxdir}"
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 \
Alexander Afanasyevdb1e1b72013-02-19 15:44:33 -080083 ${destroot}${ccnxdir}/
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -070084
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070085 # Create a sample ccndrc file
Alexander Afanasyevdb1e1b72013-02-19 15:44:33 -080086 system "echo CCNR_GLOBAL_PREFIX=/ndn/keys > \"${destroot}${ccnxdir}/ccndrc.sample\""
87 system "echo CCND_LOG=${prefix}/var/log/ccnd.log >> \"${destroot}${ccnxdir}/ccndrc.sample\""
88 system "echo CCND_DEBUG=16 >> \"${destroot}${ccnxdir}/ccndrc.sample\""
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -070089}
90
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070091post-activate {
92 # 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 -070093 file mkdir "${prefix}/var/log"
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070094 touch "${prefix}/var/log/ccnd.log"
95 file attributes "${prefix}/var/log/ccnd.log" -owner ${ccnxuser} -group ${ccnxgroup}
Alexander Afanasyevdc05deb2013-02-19 18:05:24 -080096 file mkdir "${prefix}/var/run/ccnd"
97 file attributes "${prefix}/var/run/ccnd" -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 } {
Alexander Afanasyevdb1e1b72013-02-19 15:44:33 -0800101 if {![file exists ${ccnxdir}/${f}]} {
102 file copy ${ccnxdir}/${f}.sample \
103 ${ccnxdir}/${f}
Alexander Afanasyevc7660be2012-08-27 15:13:36 -0700104 }
105 }
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -0700106}
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -0700107
108startupitem.pidfile none
Alexander Afanasyevdc05deb2013-02-19 18:05:24 -0800109startupitem.start "su ${ccnxuser} -c \"${prefix}/bin/ccndstart\" && sleep 5 && su ${ccnxuser} -c \"${prefix}/bin/ccnd-autoconfig -d ${prefix}/var/run/ccnd/autoconfig.pid &\""
110startupitem.stop "su ${ccnxuser} -c \"kill `cat ${prefix}/var/run/ccnd/autoconfig.pid`\" ; su ${ccnxuser} -c \"${prefix}/bin/ccndstop\""
Alexander Afanasyevdb1e1b72013-02-19 15:44:33 -0800111startupitem.restart "su ${ccnxuser} -c \"${prefix}/bin/ccndc -f ${ccnxdir}/ccnd.conf\" && su ${ccnxuser} -c \"${prefix}/bin/ccnd-autoconfig\""
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -0700112
Alexander Afanasyevdb1e1b72013-02-19 15:44:33 -0800113variant no_autoconf description {Disable automatic detection of local ccnx hub} {
Alexander Afanasyev186dd3a2012-10-03 18:09:36 -0700114 startupitem.start "su ${ccnxuser} -c \"${prefix}/bin/ccndstart\""
Alexander Afanasyevdb1e1b72013-02-19 15:44:33 -0800115 startupitem.restart "su ${ccnxuser} -c \"${prefix}/bin/ccndc -f ${ccnxdir}/ccnd.conf\""
Alexander Afanasyev186dd3a2012-10-03 18:09:36 -0700116}
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 -0700126
Alexander Afanasyevdb1e1b72013-02-19 15:44:33 -0800127You can add the following line into \"${ccnxdir}/ccndrc\" in order to automatically
Alexander Afanasyevb41f8502013-02-14 14:02:57 -0800128start ccnx repo for the /ndn/keys prefix:
129
130 CCNR_GLOBAL_PREFIX=/ndn/keys
131
Alexander Afanasyev4ca899a2013-03-12 10:48:16 -0700132For more information and documentation, refer to man pages and http://www.ccnx.org website.
133
134If you have your public key signed by NDN testbed operators and you installed the certificate
135\(using ndn-install-pubcert command\), you can enable automatic configuration of the default
136route using your key. To do so, you need to run the following commands once:
137
138 # extract public key from ccnx user
139 sudo HOME=${ccnxdir} ndn-extract-public-key > /tmp/ccnx.pem
140
141 # sign public key of the ccnx user
142 ndn-sign-key -i \"ccnx-autoconfig\" /tmp/ccnx.pem
143
144 # install certification of the public key
145 sudo HOME=${ccnxdir} ndn-install-pubcert /tmp/ccnx.pubcert
146
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -0700147"