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