Alexander Afanasyev | 9944ebc | 2012-08-20 18:40:12 -0700 | [diff] [blame] | 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 | |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame] | 4 | PortSystem 1.0 |
Alexander Afanasyev | d600ea9 | 2012-09-24 13:39:43 -0700 | [diff] [blame] | 5 | PortGroup github 1.0 |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame] | 6 | |
Alexander Afanasyev | 62b16cf | 2012-09-26 11:42:56 -0700 | [diff] [blame^] | 7 | github.setup ProjectCCNx ccnx f0e8a6509d7545db62fdaa14591752c835b46ef8 |
| 8 | checksums rmd160 49ea819c5c84b108e67bf8b45aa02f4caab4cc88 \ |
| 9 | sha256 5f3c96bc47bde66fd8df555f0956a0858eb5dd69878078a5f5a4c6068794ed14 |
Alexander Afanasyev | d600ea9 | 2012-09-24 13:39:43 -0700 | [diff] [blame] | 10 | |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame] | 11 | name ccnx |
| 12 | homepage http://www.ccnx.org/ |
| 13 | license GPL-2+ LGPL-2.1+ |
Alexander Afanasyev | d600ea9 | 2012-09-24 13:39:43 -0700 | [diff] [blame] | 14 | version 0.6.1-dev |
Alexander Afanasyev | 62b16cf | 2012-09-26 11:42:56 -0700 | [diff] [blame^] | 15 | revision 1 |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame] | 16 | epoch 0 |
Alexander Afanasyev | 8e85028 | 2012-08-23 10:04:58 -0700 | [diff] [blame] | 17 | |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame] | 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 | |
Alexander Afanasyev | d600ea9 | 2012-09-24 13:39:43 -0700 | [diff] [blame] | 34 | use_parallel_build no |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame] | 35 | |
Alexander Afanasyev | 9291faa | 2012-08-27 15:00:11 -0700 | [diff] [blame] | 36 | depends_lib-append port:openssl \ |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame] | 37 | port:expat \ |
| 38 | port:libpcap \ |
Alexander Afanasyev | d600ea9 | 2012-09-24 13:39:43 -0700 | [diff] [blame] | 39 | port:libxml2 \ |
| 40 | port:asciidoc |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame] | 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 |
Alexander Afanasyev | c1ec69f | 2012-08-24 18:10:09 -0700 | [diff] [blame] | 51 | |
| 52 | variant java description {Enable Java API build} { |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame] | 53 | configure.env-delete BUILD_JAVA=false |
Alexander Afanasyev | c1ec69f | 2012-08-24 18:10:09 -0700 | [diff] [blame] | 54 | } |
| 55 | |
| 56 | variant apps requires java description {Enable build of reference applications} { |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame] | 57 | configure.env-delete BUILD_APPS=false |
Alexander Afanasyev | c1ec69f | 2012-08-24 18:10:09 -0700 | [diff] [blame] | 58 | } |
Alexander Afanasyev | 9944ebc | 2012-08-20 18:40:12 -0700 | [diff] [blame] | 59 | |
Alexander Afanasyev | d600ea9 | 2012-09-24 13:39:43 -0700 | [diff] [blame] | 60 | # patchfiles patch-macports-customizations.diff |
Alexander Afanasyev | 9944ebc | 2012-08-20 18:40:12 -0700 | [diff] [blame] | 61 | |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame] | 62 | post-patch { |
| 63 | reinplace "s|\$HOME/.ccnx/|${prefix}/etc/ccnx/|g" ${worksrcpath}/csrc/util/ccndstart.sh |
Alexander Afanasyev | 9944ebc | 2012-08-20 18:40:12 -0700 | [diff] [blame] | 64 | } |
| 65 | |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame] | 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 | |
Alexander Afanasyev | d600ea9 | 2012-09-24 13:39:43 -0700 | [diff] [blame] | 72 | configure.cflags -DCCNX_DIR=\\\"${prefix}/etc/ccnx\\\" -O0 -g |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame] | 73 | |
| 74 | build.env-append OPENSSL_CFLAGS=-I${prefix}/include \ |
| 75 | OPENSSL_LIBS=-L${prefix}/lib \ |
Alexander Afanasyev | d600ea9 | 2012-09-24 13:39:43 -0700 | [diff] [blame] | 76 | INSTALL_BASE=${prefix} \ |
| 77 | |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame] | 78 | |
Alexander Afanasyev | c1ec69f | 2012-08-24 18:10:09 -0700 | [diff] [blame] | 79 | post-destroot { |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame] | 80 | # Create a configuration directory, which also a home directory for ${ccnxuser} |
| 81 | xinstall -d -o ${ccnxuser} -g ${ccnxgroup} "${destroot}${prefix}/etc/ccnx" |
Alexander Afanasyev | c1ec69f | 2012-08-24 18:10:09 -0700 | [diff] [blame] | 82 | |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame] | 83 | # Copy a sample ccnd.conf file |
Alexander Afanasyev | c7660be | 2012-08-27 15:13:36 -0700 | [diff] [blame] | 84 | xinstall -o ${ccnxuser} -g ${ccnxgroup} \ |
| 85 | ${worksrcpath}/csrc/libexec/ccnd.conf.sample \ |
| 86 | ${destroot}${prefix}/etc/ccnx/ |
Alexander Afanasyev | c1ec69f | 2012-08-24 18:10:09 -0700 | [diff] [blame] | 87 | |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame] | 88 | # 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 Afanasyev | c1ec69f | 2012-08-24 18:10:09 -0700 | [diff] [blame] | 91 | } |
| 92 | |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame] | 93 | post-activate { |
| 94 | # log file needs to be owned by ${ccnxuser}, otherwise ccnd will not be able to write to it |
Alexander Afanasyev | d600ea9 | 2012-09-24 13:39:43 -0700 | [diff] [blame] | 95 | file mkdir "${prefix}/var/log" |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame] | 96 | touch "${prefix}/var/log/ccnd.log" |
| 97 | file attributes "${prefix}/var/log/ccnd.log" -owner ${ccnxuser} -group ${ccnxgroup} |
Alexander Afanasyev | c7660be | 2012-08-27 15:13:36 -0700 | [diff] [blame] | 98 | |
| 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 Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame] | 106 | } |
Alexander Afanasyev | 9944ebc | 2012-08-20 18:40:12 -0700 | [diff] [blame] | 107 | |
| 108 | startupitem.pidfile none |
Alexander Afanasyev | c1ec69f | 2012-08-24 18:10:09 -0700 | [diff] [blame] | 109 | startupitem.start "su ${ccnxuser} -c \"${prefix}/bin/ccndstart\"" |
| 110 | startupitem.stop "su ${ccnxuser} -c \"${prefix}/bin/ccndstop\"" |
Alexander Afanasyev | eae6936 | 2012-08-27 09:49:56 -0700 | [diff] [blame] | 111 | startupitem.restart "su ${ccnxuser} -c \"${prefix}/bin/ccndc -f ${prefix}/etc/ccnx/ccnd.conf\"" |
Alexander Afanasyev | 9944ebc | 2012-08-20 18:40:12 -0700 | [diff] [blame] | 112 | |
| 113 | startupitem.create yes |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame] | 114 | startupitem.name ${name} |
Alexander Afanasyev | 9944ebc | 2012-08-20 18:40:12 -0700 | [diff] [blame] | 115 | |
| 116 | startupitem.netchange yes |
| 117 | startupitem.logevents yes |
| 118 | startupitem.logfile ${prefix}/var/log/ccnx.log |
| 119 | |
| 120 | notes " |
Alexander Afanasyev | eae6936 | 2012-08-27 09:49:56 -0700 | [diff] [blame] | 121 | In order repo to work, you need to add the following lines at the end of your |
| 122 | \[~/.bash_profile\]: |
Alexander Afanasyev | 9944ebc | 2012-08-20 18:40:12 -0700 | [diff] [blame] | 123 | |
| 124 | export CCNR_DIRECTORY=${prefix}/etc/ccnx/repo |
| 125 | |
Alexander Afanasyev | eae6936 | 2012-08-27 09:49:56 -0700 | [diff] [blame] | 126 | To configure environment variables for ccnd, edit your |
| 127 | \[${prefix}/etc/ccnx/ccndrc\]. For example, |
Alexander Afanasyev | 9944ebc | 2012-08-20 18:40:12 -0700 | [diff] [blame] | 128 | |
| 129 | CCND_LOG=${prefix}/var/log/ccnd.log |
| 130 | CCND_DEBUG=16 |
| 131 | |
Alexander Afanasyev | eae6936 | 2012-08-27 09:49:56 -0700 | [diff] [blame] | 132 | To add static FIB entries, edit your \[${prefix}/etc/ccnx/ccnd.conf\]. |
| 133 | For example, |
Alexander Afanasyev | 9944ebc | 2012-08-20 18:40:12 -0700 | [diff] [blame] | 134 | |
| 135 | add ccnx:/ccnx.org udp 224.0.23.170 59695 |
| 136 | |
Alexander Afanasyev | eae6936 | 2012-08-27 09:49:56 -0700 | [diff] [blame] | 137 | Upon any networking change event (new connection or awaking from the sleep |
| 138 | phase), all static FIB entries will be reapplied automatically. |
| 139 | |
| 140 | For more information and documentation, refer to man pages and |
| 141 | http://www.ccnx.org website. |
Alexander Afanasyev | 9944ebc | 2012-08-20 18:40:12 -0700 | [diff] [blame] | 142 | " |