| 1 | # -*- 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 | |
|---|
| 4 | PortSystem 1.0 |
|---|
| 5 | PortGroup github 1.0 |
|---|
| 6 | |
|---|
| 7 | github.setup cawka ccnx ccnx-0.7.1-ucla-1 |
|---|
| 8 | checksums rmd160 4bfb9b0f73b22c651d053ef1ae12409eec11c534 \ |
|---|
| 9 | sha256 6da676d089b445831a61200ba1f8e1efd94b95aeba666b617d97c4744f84ba5d |
|---|
| 10 | |
|---|
| 11 | name ccnx |
|---|
| 12 | homepage http://www.ccnx.org/ |
|---|
| 13 | license GPL-2+ LGPL-2.1+ |
|---|
| 14 | version 0.7.1.ucla.1 |
|---|
| 15 | |
|---|
| 16 | categories net |
|---|
| 17 | platforms darwin |
|---|
| 18 | maintainers ucla.edu:alexander.afanasyev |
|---|
| 19 | |
|---|
| 20 | description ProjectCCNx implementation of Content Centric Networking (CCN) / \ |
|---|
| 21 | Named Data Networking (NDN) architecture |
|---|
| 22 | |
|---|
| 23 | long_description Project CCNx(r) exists to develop, promote, and evaluate a new \ |
|---|
| 24 | approach to communication architecture we call content-centric \ |
|---|
| 25 | networking. We seek to carry out this mission by creating and \ |
|---|
| 26 | publishing open protocol specifications and an open source \ |
|---|
| 27 | software reference implementation of those protocols. We provide \ |
|---|
| 28 | support for a community of people interested in experimentation, \ |
|---|
| 29 | research, and building applications with this technology, all \ |
|---|
| 30 | contributing to its evolution. |
|---|
| 31 | |
|---|
| 32 | use_parallel_build no |
|---|
| 33 | |
|---|
| 34 | depends_lib-append port:openssl \ |
|---|
| 35 | port:expat \ |
|---|
| 36 | port:libpcap \ |
|---|
| 37 | port:libxml2 \ |
|---|
| 38 | port:asciidoc |
|---|
| 39 | |
|---|
| 40 | set ccnxuser ccnx |
|---|
| 41 | set ccnxgroup ccnx |
|---|
| 42 | set ccnxdir ${prefix}/etc/ccnx |
|---|
| 43 | |
|---|
| 44 | add_users ${ccnxuser} shell=/bin/sh group=${ccnxgroup} \ |
|---|
| 45 | home=${ccnxdir} \ |
|---|
| 46 | realname=CCNx\ Account |
|---|
| 47 | |
|---|
| 48 | default_variants +java +apps |
|---|
| 49 | |
|---|
| 50 | variant java description {Enable Java API build} { |
|---|
| 51 | configure.env-delete BUILD_JAVA=false |
|---|
| 52 | } |
|---|
| 53 | |
|---|
| 54 | variant apps requires java description {Enable build of reference applications} { |
|---|
| 55 | configure.env-delete BUILD_APPS=false |
|---|
| 56 | } |
|---|
| 57 | |
|---|
| 58 | post-patch { |
|---|
| 59 | reinplace "s|\$HOME/.ccnx/|${ccnxdir}/|g" ${worksrcpath}/csrc/util/ccndstart.sh |
|---|
| 60 | } |
|---|
| 61 | |
|---|
| 62 | configure.env-append OPENSSL_CFLAGS=-I${prefix}/include \ |
|---|
| 63 | OPENSSL_LIBS=-L${prefix}/lib \ |
|---|
| 64 | INSTALL_BASE=${prefix} \ |
|---|
| 65 | BUILD_JAVA=false \ |
|---|
| 66 | BUILD_APPS=false \ |
|---|
| 67 | |
|---|
| 68 | configure.cflags -DCCNX_DIR=\\\"${ccnxdir}\\\" \ |
|---|
| 69 | -O2 |
|---|
| 70 | |
|---|
| 71 | build.env-append OPENSSL_CFLAGS=-I${prefix}/include \ |
|---|
| 72 | OPENSSL_LIBS=-L${prefix}/lib \ |
|---|
| 73 | INSTALL_BASE=${prefix} \ |
|---|
| 74 | |
|---|
| 75 | |
|---|
| 76 | post-destroot { |
|---|
| 77 | # Create a configuration directory, which also a home directory for ${ccnxuser} |
|---|
| 78 | xinstall -d -o ${ccnxuser} -g ${ccnxgroup} "${destroot}${ccnxdir}" |
|---|
| 79 | |
|---|
| 80 | # Copy a sample ccnd.conf file |
|---|
| 81 | xinstall -o ${ccnxuser} -g ${ccnxgroup} \ |
|---|
| 82 | ${worksrcpath}/csrc/libexec/ccnd.conf.sample \ |
|---|
| 83 | ${destroot}${ccnxdir}/ |
|---|
| 84 | |
|---|
| 85 | # Create a sample ccndrc file |
|---|
| 86 | 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\"" |
|---|
| 89 | } |
|---|
| 90 | |
|---|
| 91 | post-activate { |
|---|
| 92 | # log file needs to be owned by ${ccnxuser}, otherwise ccnd will not be able to write to it |
|---|
| 93 | file mkdir "${prefix}/var/log" |
|---|
| 94 | touch "${prefix}/var/log/ccnd.log" |
|---|
| 95 | file attributes "${prefix}/var/log/ccnd.log" -owner ${ccnxuser} -group ${ccnxgroup} |
|---|
| 96 | file mkdir "${prefix}/var/run/ccnd" |
|---|
| 97 | file attributes "${prefix}/var/run/ccnd" -owner ${ccnxuser} -group ${ccnxgroup} |
|---|
| 98 | |
|---|
| 99 | # Make sure initial conf files are present and setup correctly |
|---|
| 100 | foreach f { ccnd.conf ccndrc } { |
|---|
| 101 | if {![file exists ${ccnxdir}/${f}]} { |
|---|
| 102 | file copy ${ccnxdir}/${f}.sample \ |
|---|
| 103 | ${ccnxdir}/${f} |
|---|
| 104 | } |
|---|
| 105 | } |
|---|
| 106 | } |
|---|
| 107 | |
|---|
| 108 | startupitem.pidfile none |
|---|
| 109 | startupitem.start "su ${ccnxuser} -c \"${prefix}/bin/ccndstart\" && sleep 5 && su ${ccnxuser} -c \"${prefix}/bin/ccnd-autoconfig -d ${prefix}/var/run/ccnd/autoconfig.pid &\"" |
|---|
| 110 | startupitem.stop "su ${ccnxuser} -c \"kill `cat ${prefix}/var/run/ccnd/autoconfig.pid`\" ; su ${ccnxuser} -c \"${prefix}/bin/ccndstop\"" |
|---|
| 111 | startupitem.restart "su ${ccnxuser} -c \"${prefix}/bin/ccndc -f ${ccnxdir}/ccnd.conf\" && su ${ccnxuser} -c \"${prefix}/bin/ccnd-autoconfig\"" |
|---|
| 112 | |
|---|
| 113 | variant no_autoconf description {Disable automatic detection of local ccnx hub} { |
|---|
| 114 | startupitem.start "su ${ccnxuser} -c \"${prefix}/bin/ccndstart\"" |
|---|
| 115 | startupitem.restart "su ${ccnxuser} -c \"${prefix}/bin/ccndc -f ${ccnxdir}/ccnd.conf\"" |
|---|
| 116 | } |
|---|
| 117 | |
|---|
| 118 | startupitem.create yes |
|---|
| 119 | startupitem.name ${name} |
|---|
| 120 | |
|---|
| 121 | startupitem.netchange yes |
|---|
| 122 | startupitem.logevents yes |
|---|
| 123 | startupitem.logfile ${prefix}/var/log/ccnx.log |
|---|
| 124 | |
|---|
| 125 | notes " |
|---|
| 126 | If you want to run repo, please install and load a separate ccnx-repo package: |
|---|
| 127 | |
|---|
| 128 | # port install ccnx-repo |
|---|
| 129 | # port load ccnx-repo |
|---|
| 130 | |
|---|
| 131 | You can add the following line into \"${ccnxdir}/ccndrc\" in order to automatically |
|---|
| 132 | start ccnx repo for the /ndn/keys prefix: |
|---|
| 133 | |
|---|
| 134 | CCNR_GLOBAL_PREFIX=/ndn/keys |
|---|
| 135 | |
|---|
| 136 | For more information and documentation, refer to man pages and |
|---|
| 137 | http://www.ccnx.org website. |
|---|
| 138 | " |
|---|