blob: 24264142822dcd16be1462923fc989fb2f57caaf [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 Afanasyevbd25f542015-03-03 22:15:44 -08007github.setup named-data NFD NFD-0.3.1
8checksums rmd160 5971a2be0cc4f734947a011a31259fea4ddbe5df \
9 sha256 a45a1196ac1929cc71b10ff279d56aebb1b07f7505787999af5b2dd36c321620
Alexander Afanasyev20cc34e2014-05-07 01:28:34 -070010
11name nfd
12homepage http://named-data.net/doc/NFD/
13license GPL3+
Alexander Afanasyevbd25f542015-03-03 22:15:44 -080014version 0.3.1
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 Afanasyevf9312c32014-12-18 14:23:41 -080045 curl -L https://github.com/zaphoyd/websocketpp/tarball/4309749dd98937b8a7be5dc0bfe679ba201c5512 > 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/
72 xinstall -m 755 ${filespath}/net.named-data.nrd.plist \
73 ${destroot}${prefix}/etc/LaunchDaemons/net.named-data.nfd/
74
75 reinplace "s|/usr/local|${prefix}|g" \
76 ${destroot}${prefix}/etc/LaunchDaemons/net.named-data.nfd/net.named-data.nfd.plist
77 reinplace "s|/usr/local|${prefix}|g" \
78 ${destroot}${prefix}/etc/LaunchDaemons/net.named-data.nfd/net.named-data.nrd.plist
79
80 # Install replacement for nfd-start/stop scripts
81 xinstall -m 755 ${filespath}/nfd-start "${destroot}${prefix}/bin/"
82 xinstall -m 755 ${filespath}/nfd-stop "${destroot}${prefix}/bin/"
83}
84
85post-activate {
86
87 # Create log dir
88 xinstall -m 755 -d -o ${ndn_user} -g ${ndn_group} \
89 ${prefix}/var/log/ndn
90
91 system "cd /Library/LaunchDaemons && sudo ln -sf \
92 ${prefix}/etc/LaunchDaemons/net.named-data.nfd/net.named-data.nfd.plist"
93 system "cd /Library/LaunchDaemons && sudo ln -sf \
94 ${prefix}/etc/LaunchDaemons/net.named-data.nfd/net.named-data.nrd.plist"
95
96 if {![file exists ${prefix}/etc/ndn/nfd.conf]} {
97
98 file copy ${prefix}/etc/ndn/nfd.conf.sample \
99 ${prefix}/etc/ndn/nfd.conf
100
101 # Generate self-signed NDN certificate for nfd (owned by root)
102 xinstall -m 755 -d ${prefix}/var/lib/ndn/nfd/.ndn
103 system "echo tpm=file > ${prefix}/var/lib/ndn/nfd/.ndn/client.conf"
104 system "HOME=${prefix}/var/lib/ndn/nfd ndnsec-keygen /localhost/daemons/nfd | \
105 HOME=${prefix}/var/lib/ndn/nfd ndnsec-install-cert -"
106
107 # Generate self-signed NDN certificate for nrd (owned by ndn)
108 xinstall -m 755 -d -o ${ndn_user} -g ${ndn_group} ${prefix}/var/lib/ndn/nrd/.ndn
109 system "sudo -u ${ndn_user} -g ${ndn_group} sh -c 'echo tpm=file \
110 > ${prefix}/var/lib/ndn/nrd/.ndn/client.conf'"
111 system "sudo -u ${ndn_user} -g ${ndn_group} HOME=${prefix}/var/lib/ndn/nrd \
112 ndnsec-keygen /localhost/daemons/nrd | \
113 sudo -u ${ndn_user} -g ndn HOME=${prefix}/var/lib/ndn/nrd ndnsec-install-cert -"
114
115 # Dump RIB Management daemon's certificate
116 xinstall -m 755 -d ${prefix}/etc/ndn/certs
117 system "sudo sh -c 'sudo -u ${ndn_user} -g ${ndn_group} HOME=${prefix}/var/lib/ndn/nrd \
118 ndnsec-dump-certificate -i /localhost/daemons/nrd \
119 > ${prefix}/etc/ndn/certs/localhost_daemons_nrd.ndncert'"
120
121 }
122}
123
124pre-deactivate {
125 system "${prefix}/bin/nfd-stop"
126
127 system "rm ${prefix}/etc/LaunchDaemons/net.named-data.nfd/net.named-data.nfd.plist"
128 system "rm ${prefix}/etc/LaunchDaemons/net.named-data.nfd/net.named-data.nrd.plist"
129}
130
131notes "
132
133To start NFD and ensure it is started when system boots:
134
135 nfd-start
136
137To stop NFD and disable auto-start when system boots:
138
139 nfd-stop
140
141NFD log files are located in ${prefix}/var/log/ndn/
142
143Configuration file is in ${prefix}/var/etc/ndn/
144
145"