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 | 41132ef | 2014-05-09 13:46:06 -0700 | [diff] [blame] | 7 | github.setup named-data NFD NFD-0.1.0 |
| 8 | checksums rmd160 857094f20a6444301fd1741e4a20f04bad048787 \ |
| 9 | sha256 b90701bf6300f007ac3690451ab619ba61bdbcb56329390ba14675ac3c4b21d1 |
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 | 41132ef | 2014-05-09 13:46:06 -0700 | [diff] [blame] | 14 | version 0.1.0 |
| 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 | |
| 43 | configure.env-append SPHINX_BUILD=${prefix}/bin/sphinx-build-2.7 |
| 44 | configure.cmd ./waf configure |
| 45 | |
| 46 | build.cmd ./waf |
| 47 | build.target build |
| 48 | |
| 49 | destroot.cmd ./waf |
| 50 | destroot.target install |
| 51 | destroot.destdir --destdir=${destroot} |
| 52 | |
| 53 | set ndn_user ndn |
| 54 | set ndn_group ndn |
| 55 | |
| 56 | add_users ${ndn_user} shell=/bin/sh group=${ndn_group} \ |
| 57 | realname=NDN\ User |
| 58 | |
| 59 | post-destroot { |
| 60 | # Install plists |
| 61 | xinstall -m 755 -d ${destroot}${prefix}/etc/LaunchDaemons/net.named-data.nfd/ |
| 62 | xinstall -m 755 ${filespath}/net.named-data.nfd.plist \ |
| 63 | ${destroot}${prefix}/etc/LaunchDaemons/net.named-data.nfd/ |
| 64 | xinstall -m 755 ${filespath}/net.named-data.nrd.plist \ |
| 65 | ${destroot}${prefix}/etc/LaunchDaemons/net.named-data.nfd/ |
| 66 | |
| 67 | reinplace "s|/usr/local|${prefix}|g" \ |
| 68 | ${destroot}${prefix}/etc/LaunchDaemons/net.named-data.nfd/net.named-data.nfd.plist |
| 69 | reinplace "s|/usr/local|${prefix}|g" \ |
| 70 | ${destroot}${prefix}/etc/LaunchDaemons/net.named-data.nfd/net.named-data.nrd.plist |
| 71 | |
| 72 | # Install replacement for nfd-start/stop scripts |
| 73 | xinstall -m 755 ${filespath}/nfd-start "${destroot}${prefix}/bin/" |
| 74 | xinstall -m 755 ${filespath}/nfd-stop "${destroot}${prefix}/bin/" |
| 75 | } |
| 76 | |
| 77 | post-activate { |
| 78 | |
| 79 | # Create log dir |
| 80 | xinstall -m 755 -d -o ${ndn_user} -g ${ndn_group} \ |
| 81 | ${prefix}/var/log/ndn |
| 82 | |
| 83 | system "cd /Library/LaunchDaemons && sudo ln -sf \ |
| 84 | ${prefix}/etc/LaunchDaemons/net.named-data.nfd/net.named-data.nfd.plist" |
| 85 | system "cd /Library/LaunchDaemons && sudo ln -sf \ |
| 86 | ${prefix}/etc/LaunchDaemons/net.named-data.nfd/net.named-data.nrd.plist" |
| 87 | |
| 88 | if {![file exists ${prefix}/etc/ndn/nfd.conf]} { |
| 89 | |
| 90 | file copy ${prefix}/etc/ndn/nfd.conf.sample \ |
| 91 | ${prefix}/etc/ndn/nfd.conf |
| 92 | |
| 93 | # Generate self-signed NDN certificate for nfd (owned by root) |
| 94 | xinstall -m 755 -d ${prefix}/var/lib/ndn/nfd/.ndn |
| 95 | system "echo tpm=file > ${prefix}/var/lib/ndn/nfd/.ndn/client.conf" |
| 96 | system "HOME=${prefix}/var/lib/ndn/nfd ndnsec-keygen /localhost/daemons/nfd | \ |
| 97 | HOME=${prefix}/var/lib/ndn/nfd ndnsec-install-cert -" |
| 98 | |
| 99 | # Generate self-signed NDN certificate for nrd (owned by ndn) |
| 100 | xinstall -m 755 -d -o ${ndn_user} -g ${ndn_group} ${prefix}/var/lib/ndn/nrd/.ndn |
| 101 | system "sudo -u ${ndn_user} -g ${ndn_group} sh -c 'echo tpm=file \ |
| 102 | > ${prefix}/var/lib/ndn/nrd/.ndn/client.conf'" |
| 103 | system "sudo -u ${ndn_user} -g ${ndn_group} HOME=${prefix}/var/lib/ndn/nrd \ |
| 104 | ndnsec-keygen /localhost/daemons/nrd | \ |
| 105 | sudo -u ${ndn_user} -g ndn HOME=${prefix}/var/lib/ndn/nrd ndnsec-install-cert -" |
| 106 | |
| 107 | # Dump RIB Management daemon's certificate |
| 108 | xinstall -m 755 -d ${prefix}/etc/ndn/certs |
| 109 | system "sudo sh -c 'sudo -u ${ndn_user} -g ${ndn_group} HOME=${prefix}/var/lib/ndn/nrd \ |
| 110 | ndnsec-dump-certificate -i /localhost/daemons/nrd \ |
| 111 | > ${prefix}/etc/ndn/certs/localhost_daemons_nrd.ndncert'" |
| 112 | |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | pre-deactivate { |
| 117 | system "${prefix}/bin/nfd-stop" |
| 118 | |
| 119 | system "rm ${prefix}/etc/LaunchDaemons/net.named-data.nfd/net.named-data.nfd.plist" |
| 120 | system "rm ${prefix}/etc/LaunchDaemons/net.named-data.nfd/net.named-data.nrd.plist" |
| 121 | } |
| 122 | |
| 123 | notes " |
| 124 | |
| 125 | To start NFD and ensure it is started when system boots: |
| 126 | |
| 127 | nfd-start |
| 128 | |
| 129 | To stop NFD and disable auto-start when system boots: |
| 130 | |
| 131 | nfd-stop |
| 132 | |
| 133 | NFD log files are located in ${prefix}/var/log/ndn/ |
| 134 | |
| 135 | Configuration file is in ${prefix}/var/etc/ndn/ |
| 136 | |
| 137 | " |