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 | 1598262 | 2015-05-12 23:24:09 -0700 | [diff] [blame^] | 7 | github.setup named-data NFD NFD-0.3.2 |
| 8 | checksums rmd160 3e6890104286046251f08a818493228cdef851a2 \ |
| 9 | sha256 5633a84f97ad293dedd1ded3a87554826c8f7be206a5de03860da3c66768c487 |
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 | 1598262 | 2015-05-12 23:24:09 -0700 | [diff] [blame^] | 14 | version 0.3.2 |
Alexander Afanasyev | 51ba740 | 2015-02-03 00:22:43 -0800 | [diff] [blame] | 15 | epoch 3 |
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} && \ |
Alexander Afanasyev | 1598262 | 2015-05-12 23:24:09 -0700 | [diff] [blame^] | 45 | curl -L https://github.com/zaphoyd/websocketpp/tarball/ac5d7ea5af9734de965688b54a7860259887b537 > websocket.tar.gz && \ |
Alexander Afanasyev | 2dfea93 | 2014-07-02 12:05:30 -0700 | [diff] [blame] | 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 |
Alexander Afanasyev | e1a35c3 | 2015-02-20 14:12:38 -0800 | [diff] [blame] | 50 | configure.env-append PKG_CONFIG_PATH=${prefix}/lib/pkgconfig |
Alexander Afanasyev | f9312c3 | 2014-12-18 14:23:41 -0800 | [diff] [blame] | 51 | configure.cxxflags-append -std=c++11 |
Alexander Afanasyev | 20cc34e | 2014-05-07 01:28:34 -0700 | [diff] [blame] | 52 | configure.cmd ./waf configure |
| 53 | |
| 54 | build.cmd ./waf |
| 55 | build.target build |
| 56 | |
| 57 | destroot.cmd ./waf |
| 58 | destroot.target install |
| 59 | destroot.destdir --destdir=${destroot} |
| 60 | |
| 61 | set ndn_user ndn |
| 62 | set ndn_group ndn |
| 63 | |
| 64 | add_users ${ndn_user} shell=/bin/sh group=${ndn_group} \ |
| 65 | realname=NDN\ User |
| 66 | |
| 67 | post-destroot { |
| 68 | # Install plists |
| 69 | xinstall -m 755 -d ${destroot}${prefix}/etc/LaunchDaemons/net.named-data.nfd/ |
| 70 | xinstall -m 755 ${filespath}/net.named-data.nfd.plist \ |
| 71 | ${destroot}${prefix}/etc/LaunchDaemons/net.named-data.nfd/ |
Alexander Afanasyev | 20cc34e | 2014-05-07 01:28:34 -0700 | [diff] [blame] | 72 | |
| 73 | reinplace "s|/usr/local|${prefix}|g" \ |
| 74 | ${destroot}${prefix}/etc/LaunchDaemons/net.named-data.nfd/net.named-data.nfd.plist |
Alexander Afanasyev | 20cc34e | 2014-05-07 01:28:34 -0700 | [diff] [blame] | 75 | |
| 76 | # Install replacement for nfd-start/stop scripts |
| 77 | xinstall -m 755 ${filespath}/nfd-start "${destroot}${prefix}/bin/" |
| 78 | xinstall -m 755 ${filespath}/nfd-stop "${destroot}${prefix}/bin/" |
| 79 | } |
| 80 | |
| 81 | post-activate { |
| 82 | |
| 83 | # Create log dir |
| 84 | xinstall -m 755 -d -o ${ndn_user} -g ${ndn_group} \ |
| 85 | ${prefix}/var/log/ndn |
| 86 | |
| 87 | system "cd /Library/LaunchDaemons && sudo ln -sf \ |
| 88 | ${prefix}/etc/LaunchDaemons/net.named-data.nfd/net.named-data.nfd.plist" |
Alexander Afanasyev | 20cc34e | 2014-05-07 01:28:34 -0700 | [diff] [blame] | 89 | |
| 90 | if {![file exists ${prefix}/etc/ndn/nfd.conf]} { |
| 91 | |
| 92 | file copy ${prefix}/etc/ndn/nfd.conf.sample \ |
| 93 | ${prefix}/etc/ndn/nfd.conf |
| 94 | |
| 95 | # Generate self-signed NDN certificate for nfd (owned by root) |
| 96 | xinstall -m 755 -d ${prefix}/var/lib/ndn/nfd/.ndn |
| 97 | system "echo tpm=file > ${prefix}/var/lib/ndn/nfd/.ndn/client.conf" |
| 98 | system "HOME=${prefix}/var/lib/ndn/nfd ndnsec-keygen /localhost/daemons/nfd | \ |
| 99 | HOME=${prefix}/var/lib/ndn/nfd ndnsec-install-cert -" |
| 100 | |
Alexander Afanasyev | 20cc34e | 2014-05-07 01:28:34 -0700 | [diff] [blame] | 101 | # Dump RIB Management daemon's certificate |
| 102 | xinstall -m 755 -d ${prefix}/etc/ndn/certs |
Alexander Afanasyev | 1598262 | 2015-05-12 23:24:09 -0700 | [diff] [blame^] | 103 | system "sudo sh -c 'sudo -u ${ndn_user} -g ${ndn_group} HOME=${prefix}/var/lib/ndn/nfd \ |
| 104 | ndnsec-dump-certificate -i /localhost/daemons/nfd \ |
| 105 | > ${prefix}/etc/ndn/certs/localhost_daemons_nfd.ndncert'" |
Alexander Afanasyev | 20cc34e | 2014-05-07 01:28:34 -0700 | [diff] [blame] | 106 | |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | pre-deactivate { |
| 111 | system "${prefix}/bin/nfd-stop" |
| 112 | |
| 113 | system "rm ${prefix}/etc/LaunchDaemons/net.named-data.nfd/net.named-data.nfd.plist" |
Alexander Afanasyev | 20cc34e | 2014-05-07 01:28:34 -0700 | [diff] [blame] | 114 | } |
| 115 | |
| 116 | notes " |
| 117 | |
| 118 | To start NFD and ensure it is started when system boots: |
| 119 | |
| 120 | nfd-start |
| 121 | |
| 122 | To stop NFD and disable auto-start when system boots: |
| 123 | |
| 124 | nfd-stop |
| 125 | |
| 126 | NFD log files are located in ${prefix}/var/log/ndn/ |
| 127 | |
| 128 | Configuration file is in ${prefix}/var/etc/ndn/ |
| 129 | |
| 130 | " |