| # -*- 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 |
| # $Id$ |
| |
| PortSystem 1.0 |
| PortGroup github 1.0 |
| |
| github.setup ProjectCCNx ccnx ccnx-0.6.2 |
| checksums rmd160 c0bb4963ff95a4b9b0211502715d3cda40300fbf \ |
| sha256 5ae09e02fd89b2d25f1f22bf3c0536636962c853f21e791b0ddf4aa9bba5c73d |
| |
| name ccnx |
| homepage http://www.ccnx.org/ |
| license GPL-2+ LGPL-2.1+ |
| version 0.6.2 |
| revision 6 |
| epoch 0 |
| |
| categories net ccnx |
| platforms darwin |
| maintainers ucla.edu:alexander.afanasyev |
| |
| description ProjectCCNx implementation of Content Centric Networking (CCN) / \ |
| Named Data Networking (NDN) architecture |
| |
| long_description Project CCNx(r) exists to develop, promote, and evaluate a new \ |
| approach to communication architecture we call content-centric \ |
| networking. We seek to carry out this mission by creating and \ |
| publishing open protocol specifications and an open source \ |
| software reference implementation of those protocols. We provide \ |
| support for a community of people interested in experimentation, \ |
| research, and building applications with this technology, all \ |
| contributing to its evolution. |
| |
| use_parallel_build no |
| |
| depends_lib-append port:openssl \ |
| port:expat \ |
| port:libpcap \ |
| port:libxml2 \ |
| port:asciidoc |
| |
| set ccnxuser ccnx |
| set ccnxgroup ccnx |
| set ccnxdir ${prefix}/etc/ccnx |
| |
| add_users ${ccnxuser} shell=/bin/sh group=${ccnxgroup} \ |
| home=${ccnxdir} \ |
| realname=CCNx\ Account |
| |
| default_variants +java +apps |
| |
| variant java description {Enable Java API build} { |
| configure.env-delete BUILD_JAVA=false |
| } |
| |
| variant apps requires java description {Enable build of reference applications} { |
| configure.env-delete BUILD_APPS=false |
| } |
| |
| patchfiles autoconfig.patch |
| |
| post-patch { |
| reinplace "s|\$HOME/.ccnx/|${prefix}/etc/ccnx/|g" ${worksrcpath}/csrc/util/ccndstart.sh |
| } |
| |
| configure.env-append OPENSSL_CFLAGS=-I${prefix}/include \ |
| OPENSSL_LIBS=-L${prefix}/lib \ |
| INSTALL_BASE=${prefix} \ |
| BUILD_JAVA=false \ |
| BUILD_APPS=false \ |
| |
| configure.cflags -DCCNX_DIR=\\\"${prefix}/etc/ccnx\\\" -O0 -g |
| |
| build.env-append OPENSSL_CFLAGS=-I${prefix}/include \ |
| OPENSSL_LIBS=-L${prefix}/lib \ |
| INSTALL_BASE=${prefix} \ |
| |
| |
| post-destroot { |
| # Create a configuration directory, which also a home directory for ${ccnxuser} |
| xinstall -d -o ${ccnxuser} -g ${ccnxgroup} "${destroot}${prefix}/etc/ccnx" |
| |
| # Copy a sample ccnd.conf file |
| xinstall -o ${ccnxuser} -g ${ccnxgroup} \ |
| ${worksrcpath}/csrc/libexec/ccnd.conf.sample \ |
| ${destroot}${prefix}/etc/ccnx/ |
| |
| # Create a sample ccndrc file |
| system "echo CCND_LOG=${prefix}/var/log/ccnd.log > \"${destroot}${prefix}/etc/ccnx/ccndrc.sample\"" |
| system "echo CCND_DEBUG=16 >> \"${destroot}${prefix}/etc/ccnx/ccndrc.sample\"" |
| } |
| |
| post-activate { |
| # log file needs to be owned by ${ccnxuser}, otherwise ccnd will not be able to write to it |
| file mkdir "${prefix}/var/log" |
| touch "${prefix}/var/log/ccnd.log" |
| file attributes "${prefix}/var/log/ccnd.log" -owner ${ccnxuser} -group ${ccnxgroup} |
| |
| # Make sure initial conf files are present and setup correctly |
| foreach f { ccnd.conf ccndrc } { |
| if {![file exists ${prefix}/etc/ccnx/${f}]} { |
| file copy ${prefix}/etc/ccnx/${f}.sample \ |
| ${prefix}/etc/ccnx/${f} |
| } |
| } |
| } |
| |
| startupitem.pidfile none |
| startupitem.start "su ${ccnxuser} -c \"${prefix}/bin/ccndstart\" && sleep 1 && \"${prefix}/bin/ccnd-autoconfig\"" |
| startupitem.stop "su ${ccnxuser} -c \"${prefix}/bin/ccndstop\"" |
| startupitem.restart "su ${ccnxuser} -c \"${prefix}/bin/ccndc -f ${prefix}/etc/ccnx/ccnd.conf\" && su ${ccnxuser} -c \"${prefix}/bin/ccnd-autoconfig\"" |
| |
| variant no_autoconf { |
| startupitem.start "su ${ccnxuser} -c \"${prefix}/bin/ccndstart\"" |
| startupitem.restart "su ${ccnxuser} -c \"${prefix}/bin/ccndc -f ${prefix}/etc/ccnx/ccnd.conf\"" |
| } |
| |
| startupitem.create yes |
| startupitem.name ${name} |
| |
| startupitem.netchange yes |
| startupitem.logevents yes |
| startupitem.logfile ${prefix}/var/log/ccnx.log |
| |
| notes " |
| In order repo to work, you need to add the following lines at the end of your |
| \[~/.bash_profile\]: |
| |
| export CCNR_DIRECTORY=${prefix}/etc/ccnx/repo |
| |
| To configure environment variables for ccnd, edit your |
| \[${prefix}/etc/ccnx/ccndrc\]. For example, |
| |
| CCND_LOG=${prefix}/var/log/ccnd.log |
| CCND_DEBUG=16 |
| |
| To add static FIB entries, edit your \[${prefix}/etc/ccnx/ccnd.conf\]. |
| For example, |
| |
| add ccnx:/ccnx.org udp 224.0.23.170 59695 |
| |
| Upon any networking change event (new connection or awaking from the sleep |
| phase), all static FIB entries will be reapplied automatically. |
| |
| For more information and documentation, refer to man pages and |
| http://www.ccnx.org website. |
| " |