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 |
| 5 | |
| 6 | name ccnx |
| 7 | homepage http://www.ccnx.org/ |
| 8 | license GPL-2+ LGPL-2.1+ |
| 9 | version 0.6.1 |
| 10 | revision 0 |
| 11 | epoch 0 |
Alexander Afanasyev | 8e85028 | 2012-08-23 10:04:58 -0700 | [diff] [blame] | 12 | |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame^] | 13 | categories net ccnx |
| 14 | platforms darwin |
| 15 | maintainers ucla.edu:alexander.afanasyev |
| 16 | |
| 17 | description ProjectCCNx implementation of Content Centric Networking (CCN) / \ |
| 18 | Named Data Networking (NDN) architecture |
| 19 | |
| 20 | long_description Project CCNx(r) exists to develop, promote, and evaluate a new \ |
| 21 | approach to communication architecture we call content-centric \ |
| 22 | networking. We seek to carry out this mission by creating and \ |
| 23 | publishing open protocol specifications and an open source \ |
| 24 | software reference implementation of those protocols. We provide \ |
| 25 | support for a community of people interested in experimentation, \ |
| 26 | research, and building applications with this technology, all \ |
| 27 | contributing to its evolution. |
| 28 | |
| 29 | master_sites http://www.ccnx.org/releases/ |
| 30 | checksums rmd160 073478f3d5818b0e4fe09e21a727e5f3207e4277 \ |
| 31 | sha256 bfaae10c2c1a327d77f752737b60243e23fd8f3a7c7025ae92221ba0a700b889 |
| 32 | |
| 33 | use_parallel_build yes |
| 34 | |
| 35 | depends_lib port:openssl \ |
| 36 | port:expat \ |
| 37 | port:libpcap \ |
| 38 | port:libxml2 |
| 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 |
Alexander Afanasyev | c1ec69f | 2012-08-24 18:10:09 -0700 | [diff] [blame] | 49 | |
| 50 | variant java description {Enable Java API build} { |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame^] | 51 | configure.env-delete BUILD_JAVA=false |
Alexander Afanasyev | c1ec69f | 2012-08-24 18:10:09 -0700 | [diff] [blame] | 52 | } |
| 53 | |
| 54 | variant apps requires java description {Enable build of reference applications} { |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame^] | 55 | configure.env-delete BUILD_APPS=false |
Alexander Afanasyev | c1ec69f | 2012-08-24 18:10:09 -0700 | [diff] [blame] | 56 | } |
Alexander Afanasyev | 9944ebc | 2012-08-20 18:40:12 -0700 | [diff] [blame] | 57 | |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame^] | 58 | patchfiles patch-macports-customizations.diff |
Alexander Afanasyev | 9944ebc | 2012-08-20 18:40:12 -0700 | [diff] [blame] | 59 | |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame^] | 60 | post-patch { |
| 61 | 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] | 62 | } |
| 63 | |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame^] | 64 | configure.env-append OPENSSL_CFLAGS=-I${prefix}/include \ |
| 65 | OPENSSL_LIBS=-L${prefix}/lib \ |
| 66 | INSTALL_BASE=${prefix} \ |
| 67 | BUILD_JAVA=false \ |
| 68 | BUILD_APPS=false \ |
| 69 | |
| 70 | configure.cflags-append -DCCNX_DIR=\\\"${prefix}/etc/ccnx\\\" |
| 71 | |
| 72 | build.env-append OPENSSL_CFLAGS=-I${prefix}/include \ |
| 73 | OPENSSL_LIBS=-L${prefix}/lib \ |
| 74 | INSTALL_BASE=${prefix} |
| 75 | |
Alexander Afanasyev | c1ec69f | 2012-08-24 18:10:09 -0700 | [diff] [blame] | 76 | post-destroot { |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame^] | 77 | # Create a configuration directory, which also a home directory for ${ccnxuser} |
| 78 | xinstall -d -o ${ccnxuser} -g ${ccnxgroup} "${destroot}${prefix}/etc/ccnx" |
Alexander Afanasyev | c1ec69f | 2012-08-24 18:10:09 -0700 | [diff] [blame] | 79 | |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame^] | 80 | # Copy a sample ccnd.conf file |
| 81 | xinstall -o ${ccnxuser} -g ${ccnxgroup} ${worksrcpath}/csrc/libexec/ccnd.conf.sample ${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 | # Create a sample ccndrc file |
| 84 | system "echo CCND_LOG=${prefix}/var/log/ccnd.log > \"${destroot}${prefix}/etc/ccnx/ccndrc.sample\"" |
| 85 | system "echo CCND_DEBUG=16 >> \"${destroot}${prefix}/etc/ccnx/ccndrc.sample\"" |
Alexander Afanasyev | c1ec69f | 2012-08-24 18:10:09 -0700 | [diff] [blame] | 86 | } |
| 87 | |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame^] | 88 | post-activate { |
| 89 | # log file needs to be owned by ${ccnxuser}, otherwise ccnd will not be able to write to it |
| 90 | touch "${prefix}/var/log/ccnd.log" |
| 91 | file attributes "${prefix}/var/log/ccnd.log" -owner ${ccnxuser} -group ${ccnxgroup} |
| 92 | } |
Alexander Afanasyev | 9944ebc | 2012-08-20 18:40:12 -0700 | [diff] [blame] | 93 | |
| 94 | startupitem.pidfile none |
Alexander Afanasyev | c1ec69f | 2012-08-24 18:10:09 -0700 | [diff] [blame] | 95 | startupitem.start "su ${ccnxuser} -c \"${prefix}/bin/ccndstart\"" |
| 96 | startupitem.stop "su ${ccnxuser} -c \"${prefix}/bin/ccndstop\"" |
Alexander Afanasyev | eae6936 | 2012-08-27 09:49:56 -0700 | [diff] [blame] | 97 | 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] | 98 | |
| 99 | startupitem.create yes |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame^] | 100 | startupitem.name ${name} |
Alexander Afanasyev | 9944ebc | 2012-08-20 18:40:12 -0700 | [diff] [blame] | 101 | |
| 102 | startupitem.netchange yes |
| 103 | startupitem.logevents yes |
| 104 | startupitem.logfile ${prefix}/var/log/ccnx.log |
| 105 | |
| 106 | notes " |
Alexander Afanasyev | eae6936 | 2012-08-27 09:49:56 -0700 | [diff] [blame] | 107 | In order repo to work, you need to add the following lines at the end of your |
| 108 | \[~/.bash_profile\]: |
Alexander Afanasyev | 9944ebc | 2012-08-20 18:40:12 -0700 | [diff] [blame] | 109 | |
| 110 | export CCNR_DIRECTORY=${prefix}/etc/ccnx/repo |
| 111 | |
Alexander Afanasyev | eae6936 | 2012-08-27 09:49:56 -0700 | [diff] [blame] | 112 | To configure environment variables for ccnd, edit your |
| 113 | \[${prefix}/etc/ccnx/ccndrc\]. For example, |
Alexander Afanasyev | 9944ebc | 2012-08-20 18:40:12 -0700 | [diff] [blame] | 114 | |
| 115 | CCND_LOG=${prefix}/var/log/ccnd.log |
| 116 | CCND_DEBUG=16 |
| 117 | |
Alexander Afanasyev | eae6936 | 2012-08-27 09:49:56 -0700 | [diff] [blame] | 118 | To add static FIB entries, edit your \[${prefix}/etc/ccnx/ccnd.conf\]. |
| 119 | For example, |
Alexander Afanasyev | 9944ebc | 2012-08-20 18:40:12 -0700 | [diff] [blame] | 120 | |
| 121 | add ccnx:/ccnx.org udp 224.0.23.170 59695 |
| 122 | |
Alexander Afanasyev | eae6936 | 2012-08-27 09:49:56 -0700 | [diff] [blame] | 123 | Upon any networking change event (new connection or awaking from the sleep |
| 124 | phase), all static FIB entries will be reapplied automatically. |
| 125 | |
| 126 | For more information and documentation, refer to man pages and |
| 127 | http://www.ccnx.org website. |
Alexander Afanasyev | 9944ebc | 2012-08-20 18:40:12 -0700 | [diff] [blame] | 128 | " |