Alexander Afanasyev | 20cc34e | 2014-05-07 01:28:34 -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 | |
| 4 | PortSystem 1.0 |
| 5 | PortGroup github 1.0 |
| 6 | |
Alexander Afanasyev | 2dfea93 | 2014-07-02 12:05:30 -0700 | [diff] [blame] | 7 | github.setup named-data NFD NFD-0.2.0-rc1 |
| 8 | checksums rmd160 3395d7189952ad9f2d0dbcec0218cb4444fa73f4 \ |
| 9 | sha256 6748eae9643624f63070c557952e5ed04df0f3f019815690c421ebefcc12362a |
Alexander Afanasyev | 20cc34e | 2014-05-07 01:28:34 -0700 | [diff] [blame] | 10 | |
| 11 | name nfd |
| 12 | homepage http://named-data.net/doc/NFD/ |
| 13 | license GPL3+ |
Alexander Afanasyev | 2dfea93 | 2014-07-02 12:05:30 -0700 | [diff] [blame] | 14 | version 0.2.0-rc1 |
Alexander Afanasyev | 41132ef | 2014-05-09 13:46:06 -0700 | [diff] [blame] | 15 | epoch 1 |
Alexander Afanasyev | 20cc34e | 2014-05-07 01:28:34 -0700 | [diff] [blame] | 16 | |
| 17 | categories net |
| 18 | platforms darwin |
| 19 | maintainers ucla.edu:alexander.afanasyev |
| 20 | |
| 21 | description Named Data Networking Forwarding Daemon |
| 22 | |
| 23 | long_description \ |
| 24 | NFD is a network forwarder that implements and evolves together with the \ |
| 25 | Named Data Networking (NDN) protocol. The main design goal of NFD is \ |
| 26 | to support diverse experimentation of NDN technology. \ |
| 27 | The design emphasizes modularity and extensibility to allow easy \ |
| 28 | experiments with new protocol features, algorithms, new \ |
| 29 | applications. We have not fully optimized the code for \ |
| 30 | performance. The intention is that performance optimizations are one \ |
| 31 | type of experiments that developers can conduct by trying out \ |
| 32 | different data structures and different algorithms\; over time, better \ |
| 33 | implementations may emerge within the same design framework. |
| 34 | |
| 35 | depends_lib-append port:ndn-cxx \ |
| 36 | port:libpcap |
| 37 | |
| 38 | depends_build-append port:pkgconfig \ |
| 39 | port:py27-sphinx |
| 40 | |
| 41 | use_configure yes |
| 42 | |
Alexander Afanasyev | 2dfea93 | 2014-07-02 12:05:30 -0700 | [diff] [blame] | 43 | pre-configure { |
| 44 | system "cd ${worksrcpath} && \ |
| 45 | curl -L https://github.com/zaphoyd/websocketpp/tarball/65cc3765a892ee5928160ba478178e747233aa6c > websocket.tar.gz && \ |
| 46 | tar zxf websocket.tar.gz -C websocketpp/ --strip 1" |
| 47 | } |
| 48 | |
Alexander Afanasyev | 20cc34e | 2014-05-07 01:28:34 -0700 | [diff] [blame] | 49 | configure.env-append SPHINX_BUILD=${prefix}/bin/sphinx-build-2.7 |
| 50 | configure.cmd ./waf configure |
| 51 | |
| 52 | build.cmd ./waf |
| 53 | build.target build |
| 54 | |
| 55 | destroot.cmd ./waf |
| 56 | destroot.target install |
| 57 | destroot.destdir --destdir=${destroot} |
| 58 | |
| 59 | set ndn_user ndn |
| 60 | set ndn_group ndn |
| 61 | |
| 62 | add_users ${ndn_user} shell=/bin/sh group=${ndn_group} \ |
| 63 | realname=NDN\ User |
| 64 | |
| 65 | post-destroot { |
| 66 | # Install plists |
| 67 | xinstall -m 755 -d ${destroot}${prefix}/etc/LaunchDaemons/net.named-data.nfd/ |
| 68 | xinstall -m 755 ${filespath}/net.named-data.nfd.plist \ |
| 69 | ${destroot}${prefix}/etc/LaunchDaemons/net.named-data.nfd/ |
| 70 | xinstall -m 755 ${filespath}/net.named-data.nrd.plist \ |
| 71 | ${destroot}${prefix}/etc/LaunchDaemons/net.named-data.nfd/ |
| 72 | |
| 73 | reinplace "s|/usr/local|${prefix}|g" \ |
| 74 | ${destroot}${prefix}/etc/LaunchDaemons/net.named-data.nfd/net.named-data.nfd.plist |
| 75 | reinplace "s|/usr/local|${prefix}|g" \ |
| 76 | ${destroot}${prefix}/etc/LaunchDaemons/net.named-data.nfd/net.named-data.nrd.plist |
| 77 | |
| 78 | # Install replacement for nfd-start/stop scripts |
| 79 | xinstall -m 755 ${filespath}/nfd-start "${destroot}${prefix}/bin/" |
| 80 | xinstall -m 755 ${filespath}/nfd-stop "${destroot}${prefix}/bin/" |
| 81 | } |
| 82 | |
| 83 | post-activate { |
| 84 | |
| 85 | # Create log dir |
| 86 | xinstall -m 755 -d -o ${ndn_user} -g ${ndn_group} \ |
| 87 | ${prefix}/var/log/ndn |
| 88 | |
| 89 | system "cd /Library/LaunchDaemons && sudo ln -sf \ |
| 90 | ${prefix}/etc/LaunchDaemons/net.named-data.nfd/net.named-data.nfd.plist" |
| 91 | system "cd /Library/LaunchDaemons && sudo ln -sf \ |
| 92 | ${prefix}/etc/LaunchDaemons/net.named-data.nfd/net.named-data.nrd.plist" |
| 93 | |
| 94 | if {![file exists ${prefix}/etc/ndn/nfd.conf]} { |
| 95 | |
| 96 | file copy ${prefix}/etc/ndn/nfd.conf.sample \ |
| 97 | ${prefix}/etc/ndn/nfd.conf |
| 98 | |
| 99 | # Generate self-signed NDN certificate for nfd (owned by root) |
| 100 | xinstall -m 755 -d ${prefix}/var/lib/ndn/nfd/.ndn |
| 101 | system "echo tpm=file > ${prefix}/var/lib/ndn/nfd/.ndn/client.conf" |
| 102 | system "HOME=${prefix}/var/lib/ndn/nfd ndnsec-keygen /localhost/daemons/nfd | \ |
| 103 | HOME=${prefix}/var/lib/ndn/nfd ndnsec-install-cert -" |
| 104 | |
| 105 | # Generate self-signed NDN certificate for nrd (owned by ndn) |
| 106 | xinstall -m 755 -d -o ${ndn_user} -g ${ndn_group} ${prefix}/var/lib/ndn/nrd/.ndn |
| 107 | system "sudo -u ${ndn_user} -g ${ndn_group} sh -c 'echo tpm=file \ |
| 108 | > ${prefix}/var/lib/ndn/nrd/.ndn/client.conf'" |
| 109 | system "sudo -u ${ndn_user} -g ${ndn_group} HOME=${prefix}/var/lib/ndn/nrd \ |
| 110 | ndnsec-keygen /localhost/daemons/nrd | \ |
| 111 | sudo -u ${ndn_user} -g ndn HOME=${prefix}/var/lib/ndn/nrd ndnsec-install-cert -" |
| 112 | |
| 113 | # Dump RIB Management daemon's certificate |
| 114 | xinstall -m 755 -d ${prefix}/etc/ndn/certs |
| 115 | system "sudo sh -c 'sudo -u ${ndn_user} -g ${ndn_group} HOME=${prefix}/var/lib/ndn/nrd \ |
| 116 | ndnsec-dump-certificate -i /localhost/daemons/nrd \ |
| 117 | > ${prefix}/etc/ndn/certs/localhost_daemons_nrd.ndncert'" |
| 118 | |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | pre-deactivate { |
| 123 | system "${prefix}/bin/nfd-stop" |
| 124 | |
| 125 | system "rm ${prefix}/etc/LaunchDaemons/net.named-data.nfd/net.named-data.nfd.plist" |
| 126 | system "rm ${prefix}/etc/LaunchDaemons/net.named-data.nfd/net.named-data.nrd.plist" |
| 127 | } |
| 128 | |
| 129 | notes " |
| 130 | |
| 131 | To start NFD and ensure it is started when system boots: |
| 132 | |
| 133 | nfd-start |
| 134 | |
| 135 | To stop NFD and disable auto-start when system boots: |
| 136 | |
| 137 | nfd-stop |
| 138 | |
| 139 | NFD log files are located in ${prefix}/var/log/ndn/ |
| 140 | |
| 141 | Configuration file is in ${prefix}/var/etc/ndn/ |
| 142 | |
| 143 | " |