| 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 ProjectCCNx ccnx ccnx-0.7.1 |
|---|
| 8 | checksums rmd160 432b7b94ed786e02e97bc66a719ab0ad833c53c0 \ |
|---|
| 9 | sha256 ee351efd2ac2200d5a03b16c342b1450c287af681b4f861f4b57dae2c6f2ed98 |
|---|
| 10 | |
|---|
| 11 | name ccnx |
|---|
| 12 | homepage http://www.ccnx.org/ |
|---|
| 13 | license GPL-2+ LGPL-2.1+ |
|---|
| 14 | version 0.7.1 |
|---|
| 15 | revision 0 |
|---|
| 16 | epoch 0 |
|---|
| 17 | |
|---|
| 18 | categories net ccnx |
|---|
| 19 | platforms darwin |
|---|
| 20 | maintainers ucla.edu:alexander.afanasyev |
|---|
| 21 | |
|---|
| 22 | description ProjectCCNx implementation of Content Centric Networking (CCN) / \ |
|---|
| 23 | Named Data Networking (NDN) architecture |
|---|
| 24 | |
|---|
| 25 | long_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 | |
|---|
| 34 | use_parallel_build no |
|---|
| 35 | |
|---|
| 36 | depends_lib-append port:openssl \ |
|---|
| 37 | port:expat \ |
|---|
| 38 | port:libpcap \ |
|---|
| 39 | port:libxml2 \ |
|---|
| 40 | port:asciidoc |
|---|
| 41 | |
|---|
| 42 | set ccnxuser ccnx |
|---|
| 43 | set ccnxgroup ccnx |
|---|
| 44 | set ccnxdir ${prefix}/etc/ccnx |
|---|
| 45 | |
|---|
| 46 | add_users ${ccnxuser} shell=/bin/sh group=${ccnxgroup} \ |
|---|
| 47 | home=${ccnxdir} \ |
|---|
| 48 | realname=CCNx\ Account |
|---|
| 49 | |
|---|
| 50 | default_variants +java +apps |
|---|
| 51 | |
|---|
| 52 | variant java description {Enable Java API build} { |
|---|
| 53 | configure.env-delete BUILD_JAVA=false |
|---|
| 54 | } |
|---|
| 55 | |
|---|
| 56 | variant apps requires java description {Enable build of reference applications} { |
|---|
| 57 | configure.env-delete BUILD_APPS=false |
|---|
| 58 | } |
|---|
| 59 | |
|---|
| 60 | # patchfiles autoconfig.patch |
|---|
| 61 | |
|---|
| 62 | post-patch { |
|---|
| 63 | reinplace "s|\$HOME/.ccnx/|${prefix}/etc/ccnx/|g" ${worksrcpath}/csrc/util/ccndstart.sh |
|---|
| 64 | } |
|---|
| 65 | |
|---|
| 66 | configure.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 | |
|---|
| 72 | configure.cflags -DCCNX_DIR=\\\"${prefix}/etc/ccnx\\\" -O0 -g |
|---|
| 73 | |
|---|
| 74 | build.env-append OPENSSL_CFLAGS=-I${prefix}/include \ |
|---|
| 75 | OPENSSL_LIBS=-L${prefix}/lib \ |
|---|
| 76 | INSTALL_BASE=${prefix} \ |
|---|
| 77 | |
|---|
| 78 | |
|---|
| 79 | post-destroot { |
|---|
| 80 | # Create a configuration directory, which also a home directory for ${ccnxuser} |
|---|
| 81 | xinstall -d -o ${ccnxuser} -g ${ccnxgroup} "${destroot}${prefix}/etc/ccnx" |
|---|
| 82 | |
|---|
| 83 | # Copy a sample ccnd.conf file |
|---|
| 84 | xinstall -o ${ccnxuser} -g ${ccnxgroup} \ |
|---|
| 85 | ${worksrcpath}/csrc/libexec/ccnd.conf.sample \ |
|---|
| 86 | ${destroot}${prefix}/etc/ccnx/ |
|---|
| 87 | |
|---|
| 88 | # Create a sample ccndrc file |
|---|
| 89 | system "echo CCNR_GLOBAL_PREFIX=/ndn/keys > \"${destroot}${prefix}/etc/ccnx/ccndrc.sample\"" |
|---|
| 90 | system "echo CCND_LOG=${prefix}/var/log/ccnd.log >> \"${destroot}${prefix}/etc/ccnx/ccndrc.sample\"" |
|---|
| 91 | system "echo CCND_DEBUG=16 >> \"${destroot}${prefix}/etc/ccnx/ccndrc.sample\"" |
|---|
| 92 | } |
|---|
| 93 | |
|---|
| 94 | post-activate { |
|---|
| 95 | # log file needs to be owned by ${ccnxuser}, otherwise ccnd will not be able to write to it |
|---|
| 96 | file mkdir "${prefix}/var/log" |
|---|
| 97 | touch "${prefix}/var/log/ccnd.log" |
|---|
| 98 | file attributes "${prefix}/var/log/ccnd.log" -owner ${ccnxuser} -group ${ccnxgroup} |
|---|
| 99 | |
|---|
| 100 | # Make sure initial conf files are present and setup correctly |
|---|
| 101 | foreach f { ccnd.conf ccndrc } { |
|---|
| 102 | if {![file exists ${prefix}/etc/ccnx/${f}]} { |
|---|
| 103 | file copy ${prefix}/etc/ccnx/${f}.sample \ |
|---|
| 104 | ${prefix}/etc/ccnx/${f} |
|---|
| 105 | } |
|---|
| 106 | } |
|---|
| 107 | } |
|---|
| 108 | |
|---|
| 109 | startupitem.pidfile none |
|---|
| 110 | startupitem.start "su ${ccnxuser} -c \"${prefix}/bin/ccndstart\" && sleep 1 && \"${prefix}/bin/ccnd-autoconfig\"" |
|---|
| 111 | startupitem.stop "su ${ccnxuser} -c \"${prefix}/bin/ccndstop\"" |
|---|
| 112 | startupitem.restart "su ${ccnxuser} -c \"${prefix}/bin/ccndc -f ${prefix}/etc/ccnx/ccnd.conf\" && su ${ccnxuser} -c \"${prefix}/bin/ccnd-autoconfig\"" |
|---|
| 113 | |
|---|
| 114 | variant no_autoconf { |
|---|
| 115 | startupitem.start "su ${ccnxuser} -c \"${prefix}/bin/ccndstart\"" |
|---|
| 116 | startupitem.restart "su ${ccnxuser} -c \"${prefix}/bin/ccndc -f ${prefix}/etc/ccnx/ccnd.conf\"" |
|---|
| 117 | } |
|---|
| 118 | |
|---|
| 119 | startupitem.create yes |
|---|
| 120 | startupitem.name ${name} |
|---|
| 121 | |
|---|
| 122 | startupitem.netchange yes |
|---|
| 123 | startupitem.logevents yes |
|---|
| 124 | startupitem.logfile ${prefix}/var/log/ccnx.log |
|---|
| 125 | |
|---|
| 126 | notes " |
|---|
| 127 | |
|---|
| 128 | If you want to run repo, please install and load a separate ccnx-repo package: |
|---|
| 129 | |
|---|
| 130 | # port install ccnx-repo |
|---|
| 131 | # port load ccnx-repo |
|---|
| 132 | |
|---|
| 133 | You can add the following line into \"${prefix}/etc/ccnx/ccndrc\" in order to automatically |
|---|
| 134 | start ccnx repo for the /ndn/keys prefix: |
|---|
| 135 | |
|---|
| 136 | CCNR_GLOBAL_PREFIX=/ndn/keys |
|---|
| 137 | |
|---|
| 138 | For more information and documentation, refer to man pages and |
|---|
| 139 | http://www.ccnx.org website. |
|---|
| 140 | " |
|---|