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 | b41f850 | 2013-02-14 14:02:57 -0800 | [diff] [blame] | 6 | |
Alexander Afanasyev | 73e6dcc | 2013-02-19 15:58:49 -0800 | [diff] [blame] | 7 | github.setup cawka ccnx ccnx-0.7.1-ucla-1 |
Alexander Afanasyev | dc05deb | 2013-02-19 18:05:24 -0800 | [diff] [blame^] | 8 | checksums rmd160 4bfb9b0f73b22c651d053ef1ae12409eec11c534 \ |
| 9 | sha256 6da676d089b445831a61200ba1f8e1efd94b95aeba666b617d97c4744f84ba5d |
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 | 73e6dcc | 2013-02-19 15:58:49 -0800 | [diff] [blame] | 14 | version 0.7.1.ucla.1 |
Alexander Afanasyev | 8e85028 | 2012-08-23 10:04:58 -0700 | [diff] [blame] | 15 | |
Alexander Afanasyev | dcb61ae | 2013-02-18 09:22:45 -0800 | [diff] [blame] | 16 | categories net |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame] | 17 | platforms darwin |
| 18 | maintainers ucla.edu:alexander.afanasyev |
Alexander Afanasyev | b41f850 | 2013-02-14 14:02:57 -0800 | [diff] [blame] | 19 | |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame] | 20 | description ProjectCCNx implementation of Content Centric Networking (CCN) / \ |
| 21 | Named Data Networking (NDN) architecture |
Alexander Afanasyev | b41f850 | 2013-02-14 14:02:57 -0800 | [diff] [blame] | 22 | |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame] | 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 \ |
Alexander Afanasyev | b41f850 | 2013-02-14 14:02:57 -0800 | [diff] [blame] | 30 | contributing to its evolution. |
| 31 | |
Alexander Afanasyev | d600ea9 | 2012-09-24 13:39:43 -0700 | [diff] [blame] | 32 | use_parallel_build no |
Alexander Afanasyev | b41f850 | 2013-02-14 14:02:57 -0800 | [diff] [blame] | 33 | |
Alexander Afanasyev | 9291faa | 2012-08-27 15:00:11 -0700 | [diff] [blame] | 34 | depends_lib-append port:openssl \ |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame] | 35 | port:expat \ |
| 36 | port:libpcap \ |
Alexander Afanasyev | d600ea9 | 2012-09-24 13:39:43 -0700 | [diff] [blame] | 37 | port:libxml2 \ |
| 38 | port:asciidoc |
Alexander Afanasyev | b41f850 | 2013-02-14 14:02:57 -0800 | [diff] [blame] | 39 | |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame] | 40 | set ccnxuser ccnx |
| 41 | set ccnxgroup ccnx |
| 42 | set ccnxdir ${prefix}/etc/ccnx |
Alexander Afanasyev | b41f850 | 2013-02-14 14:02:57 -0800 | [diff] [blame] | 43 | |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame] | 44 | add_users ${ccnxuser} shell=/bin/sh group=${ccnxgroup} \ |
| 45 | home=${ccnxdir} \ |
| 46 | realname=CCNx\ Account |
Alexander Afanasyev | b41f850 | 2013-02-14 14:02:57 -0800 | [diff] [blame] | 47 | |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame] | 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 | post-patch { |
Alexander Afanasyev | db1e1b7 | 2013-02-19 15:44:33 -0800 | [diff] [blame] | 59 | reinplace "s|\$HOME/.ccnx/|${ccnxdir}/|g" ${worksrcpath}/csrc/util/ccndstart.sh |
Alexander Afanasyev | 9944ebc | 2012-08-20 18:40:12 -0700 | [diff] [blame] | 60 | } |
| 61 | |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame] | 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 | |
Alexander Afanasyev | df59d20 | 2013-02-19 16:02:42 -0800 | [diff] [blame] | 68 | configure.cflags -DCCNX_DIR=\\\"${ccnxdir}\\\" \ |
| 69 | -O2 |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame] | 70 | |
| 71 | build.env-append OPENSSL_CFLAGS=-I${prefix}/include \ |
| 72 | OPENSSL_LIBS=-L${prefix}/lib \ |
Alexander Afanasyev | d600ea9 | 2012-09-24 13:39:43 -0700 | [diff] [blame] | 73 | INSTALL_BASE=${prefix} \ |
Alexander Afanasyev | b41f850 | 2013-02-14 14:02:57 -0800 | [diff] [blame] | 74 | |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame] | 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} |
Alexander Afanasyev | db1e1b7 | 2013-02-19 15:44:33 -0800 | [diff] [blame] | 78 | xinstall -d -o ${ccnxuser} -g ${ccnxgroup} "${destroot}${ccnxdir}" |
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 |
Alexander Afanasyev | c7660be | 2012-08-27 15:13:36 -0700 | [diff] [blame] | 81 | xinstall -o ${ccnxuser} -g ${ccnxgroup} \ |
| 82 | ${worksrcpath}/csrc/libexec/ccnd.conf.sample \ |
Alexander Afanasyev | db1e1b7 | 2013-02-19 15:44:33 -0800 | [diff] [blame] | 83 | ${destroot}${ccnxdir}/ |
Alexander Afanasyev | c1ec69f | 2012-08-24 18:10:09 -0700 | [diff] [blame] | 84 | |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame] | 85 | # Create a sample ccndrc file |
Alexander Afanasyev | db1e1b7 | 2013-02-19 15:44:33 -0800 | [diff] [blame] | 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\"" |
Alexander Afanasyev | c1ec69f | 2012-08-24 18:10:09 -0700 | [diff] [blame] | 89 | } |
| 90 | |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame] | 91 | post-activate { |
| 92 | # 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] | 93 | file mkdir "${prefix}/var/log" |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame] | 94 | touch "${prefix}/var/log/ccnd.log" |
| 95 | file attributes "${prefix}/var/log/ccnd.log" -owner ${ccnxuser} -group ${ccnxgroup} |
Alexander Afanasyev | dc05deb | 2013-02-19 18:05:24 -0800 | [diff] [blame^] | 96 | file mkdir "${prefix}/var/run/ccnd" |
| 97 | file attributes "${prefix}/var/run/ccnd" -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 } { |
Alexander Afanasyev | db1e1b7 | 2013-02-19 15:44:33 -0800 | [diff] [blame] | 101 | if {![file exists ${ccnxdir}/${f}]} { |
| 102 | file copy ${ccnxdir}/${f}.sample \ |
| 103 | ${ccnxdir}/${f} |
Alexander Afanasyev | c7660be | 2012-08-27 15:13:36 -0700 | [diff] [blame] | 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 | dc05deb | 2013-02-19 18:05:24 -0800 | [diff] [blame^] | 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\"" |
Alexander Afanasyev | db1e1b7 | 2013-02-19 15:44:33 -0800 | [diff] [blame] | 111 | startupitem.restart "su ${ccnxuser} -c \"${prefix}/bin/ccndc -f ${ccnxdir}/ccnd.conf\" && su ${ccnxuser} -c \"${prefix}/bin/ccnd-autoconfig\"" |
Alexander Afanasyev | 9944ebc | 2012-08-20 18:40:12 -0700 | [diff] [blame] | 112 | |
Alexander Afanasyev | db1e1b7 | 2013-02-19 15:44:33 -0800 | [diff] [blame] | 113 | variant no_autoconf description {Disable automatic detection of local ccnx hub} { |
Alexander Afanasyev | 186dd3a | 2012-10-03 18:09:36 -0700 | [diff] [blame] | 114 | startupitem.start "su ${ccnxuser} -c \"${prefix}/bin/ccndstart\"" |
Alexander Afanasyev | db1e1b7 | 2013-02-19 15:44:33 -0800 | [diff] [blame] | 115 | startupitem.restart "su ${ccnxuser} -c \"${prefix}/bin/ccndc -f ${ccnxdir}/ccnd.conf\"" |
Alexander Afanasyev | 186dd3a | 2012-10-03 18:09:36 -0700 | [diff] [blame] | 116 | } |
| 117 | |
Alexander Afanasyev | 9944ebc | 2012-08-20 18:40:12 -0700 | [diff] [blame] | 118 | startupitem.create yes |
Alexander Afanasyev | d9b5aad | 2012-08-27 14:16:37 -0700 | [diff] [blame] | 119 | startupitem.name ${name} |
Alexander Afanasyev | 9944ebc | 2012-08-20 18:40:12 -0700 | [diff] [blame] | 120 | |
| 121 | startupitem.netchange yes |
| 122 | startupitem.logevents yes |
| 123 | startupitem.logfile ${prefix}/var/log/ccnx.log |
| 124 | |
| 125 | notes " |
Alexander Afanasyev | 22bc0ad | 2012-12-08 22:44:21 -0800 | [diff] [blame] | 126 | If you want to run repo, please install and load a separate ccnx-repo package: |
Alexander Afanasyev | 9944ebc | 2012-08-20 18:40:12 -0700 | [diff] [blame] | 127 | |
Alexander Afanasyev | 22bc0ad | 2012-12-08 22:44:21 -0800 | [diff] [blame] | 128 | # port install ccnx-repo |
| 129 | # port load ccnx-repo |
Alexander Afanasyev | eae6936 | 2012-08-27 09:49:56 -0700 | [diff] [blame] | 130 | |
Alexander Afanasyev | db1e1b7 | 2013-02-19 15:44:33 -0800 | [diff] [blame] | 131 | You can add the following line into \"${ccnxdir}/ccndrc\" in order to automatically |
Alexander Afanasyev | b41f850 | 2013-02-14 14:02:57 -0800 | [diff] [blame] | 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 |
Alexander Afanasyev | eae6936 | 2012-08-27 09:49:56 -0700 | [diff] [blame] | 137 | http://www.ccnx.org website. |
Alexander Afanasyev | 9944ebc | 2012-08-20 18:40:12 -0700 | [diff] [blame] | 138 | " |