blob: b1af60ef425395a0de1d4bb406e3d137e82b230e [file] [log] [blame]
Alexander Afanasyev20cc34e2014-05-07 01:28:34 -07001# -*- 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
4PortSystem 1.0
5PortGroup github 1.0
6
Alexander Afanasyev15982622015-05-12 23:24:09 -07007github.setup named-data NFD NFD-0.3.2
8checksums rmd160 3e6890104286046251f08a818493228cdef851a2 \
9 sha256 5633a84f97ad293dedd1ded3a87554826c8f7be206a5de03860da3c66768c487
Alexander Afanasyev20cc34e2014-05-07 01:28:34 -070010
11name nfd
12homepage http://named-data.net/doc/NFD/
13license GPL3+
Alexander Afanasyev15982622015-05-12 23:24:09 -070014version 0.3.2
Alexander Afanasyev51ba7402015-02-03 00:22:43 -080015epoch 3
Alexander Afanasyev20cc34e2014-05-07 01:28:34 -070016
17categories net
18platforms darwin
19maintainers ucla.edu:alexander.afanasyev
20
21description Named Data Networking Forwarding Daemon
22
23long_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
35depends_lib-append port:ndn-cxx \
36 port:libpcap
37
38depends_build-append port:pkgconfig \
39 port:py27-sphinx
40
41use_configure yes
42
Alexander Afanasyev2dfea932014-07-02 12:05:30 -070043pre-configure {
44 system "cd ${worksrcpath} && \
Alexander Afanasyev15982622015-05-12 23:24:09 -070045 curl -L https://github.com/zaphoyd/websocketpp/tarball/ac5d7ea5af9734de965688b54a7860259887b537 > websocket.tar.gz && \
Alexander Afanasyev2dfea932014-07-02 12:05:30 -070046 tar zxf websocket.tar.gz -C websocketpp/ --strip 1"
47}
48
Alexander Afanasyev20cc34e2014-05-07 01:28:34 -070049configure.env-append SPHINX_BUILD=${prefix}/bin/sphinx-build-2.7
Alexander Afanasyeve1a35c32015-02-20 14:12:38 -080050configure.env-append PKG_CONFIG_PATH=${prefix}/lib/pkgconfig
Alexander Afanasyevf9312c32014-12-18 14:23:41 -080051configure.cxxflags-append -std=c++11
Alexander Afanasyev20cc34e2014-05-07 01:28:34 -070052configure.cmd ./waf configure
53
54build.cmd ./waf
55build.target build
56
57destroot.cmd ./waf
58destroot.target install
59destroot.destdir --destdir=${destroot}
60
61set ndn_user ndn
62set ndn_group ndn
63
64add_users ${ndn_user} shell=/bin/sh group=${ndn_group} \
65 realname=NDN\ User
66
67post-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 Afanasyev20cc34e2014-05-07 01:28:34 -070072
73 reinplace "s|/usr/local|${prefix}|g" \
74 ${destroot}${prefix}/etc/LaunchDaemons/net.named-data.nfd/net.named-data.nfd.plist
Alexander Afanasyev20cc34e2014-05-07 01:28:34 -070075
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
81post-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 Afanasyev20cc34e2014-05-07 01:28:34 -070089
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 Afanasyev20cc34e2014-05-07 01:28:34 -0700101 # Dump RIB Management daemon's certificate
102 xinstall -m 755 -d ${prefix}/etc/ndn/certs
Alexander Afanasyev15982622015-05-12 23:24:09 -0700103 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 Afanasyev20cc34e2014-05-07 01:28:34 -0700106
107 }
108}
109
110pre-deactivate {
111 system "${prefix}/bin/nfd-stop"
112
113 system "rm ${prefix}/etc/LaunchDaemons/net.named-data.nfd/net.named-data.nfd.plist"
Alexander Afanasyev20cc34e2014-05-07 01:28:34 -0700114}
115
116notes "
117
118To start NFD and ensure it is started when system boots:
119
120 nfd-start
121
122To stop NFD and disable auto-start when system boots:
123
124 nfd-stop
125
126NFD log files are located in ${prefix}/var/log/ndn/
127
128Configuration file is in ${prefix}/var/etc/ndn/
129
130"