blob: c35c9cac9b52ab8642c003d7b9b9eaa268886cdd [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 Afanasyev011558e2015-01-17 19:54:54 -08007github.setup named-data NFD b283128b6f78b1c00ad9576913dbc4c8df76bf06
8checksums rmd160 98f14fdf35c005101c76360733c95dd174780ffd \
9 sha256 d29d1349cd3799002f3291ea42da2c77d51b61bc9ba2ec5f68efab462ffac0f0
Alexander Afanasyev20cc34e2014-05-07 01:28:34 -070010
11name nfd
12homepage http://named-data.net/doc/NFD/
13license GPL3+
Alexander Afanasyev011558e2015-01-17 19:54:54 -080014version 0.3.0-rc0.1
Alexander Afanasyev3fa99e92014-08-24 22:46:28 -070015epoch 2
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 Afanasyevf9312c32014-12-18 14:23:41 -080050configure.cxxflags-append -std=c++11
Alexander Afanasyev20cc34e2014-05-07 01:28:34 -070051configure.cmd ./waf configure
52
53build.cmd ./waf
54build.target build
55
56destroot.cmd ./waf
57destroot.target install
58destroot.destdir --destdir=${destroot}
59
60set ndn_user ndn
61set ndn_group ndn
62
63add_users ${ndn_user} shell=/bin/sh group=${ndn_group} \
64 realname=NDN\ User
65
66post-destroot {
67 # Install plists
68 xinstall -m 755 -d ${destroot}${prefix}/etc/LaunchDaemons/net.named-data.nfd/
69 xinstall -m 755 ${filespath}/net.named-data.nfd.plist \
70 ${destroot}${prefix}/etc/LaunchDaemons/net.named-data.nfd/
71 xinstall -m 755 ${filespath}/net.named-data.nrd.plist \
72 ${destroot}${prefix}/etc/LaunchDaemons/net.named-data.nfd/
73
74 reinplace "s|/usr/local|${prefix}|g" \
75 ${destroot}${prefix}/etc/LaunchDaemons/net.named-data.nfd/net.named-data.nfd.plist
76 reinplace "s|/usr/local|${prefix}|g" \
77 ${destroot}${prefix}/etc/LaunchDaemons/net.named-data.nfd/net.named-data.nrd.plist
78
79 # Install replacement for nfd-start/stop scripts
80 xinstall -m 755 ${filespath}/nfd-start "${destroot}${prefix}/bin/"
81 xinstall -m 755 ${filespath}/nfd-stop "${destroot}${prefix}/bin/"
82}
83
84post-activate {
85
86 # Create log dir
87 xinstall -m 755 -d -o ${ndn_user} -g ${ndn_group} \
88 ${prefix}/var/log/ndn
89
90 system "cd /Library/LaunchDaemons && sudo ln -sf \
91 ${prefix}/etc/LaunchDaemons/net.named-data.nfd/net.named-data.nfd.plist"
92 system "cd /Library/LaunchDaemons && sudo ln -sf \
93 ${prefix}/etc/LaunchDaemons/net.named-data.nfd/net.named-data.nrd.plist"
94
95 if {![file exists ${prefix}/etc/ndn/nfd.conf]} {
96
97 file copy ${prefix}/etc/ndn/nfd.conf.sample \
98 ${prefix}/etc/ndn/nfd.conf
99
100 # Generate self-signed NDN certificate for nfd (owned by root)
101 xinstall -m 755 -d ${prefix}/var/lib/ndn/nfd/.ndn
102 system "echo tpm=file > ${prefix}/var/lib/ndn/nfd/.ndn/client.conf"
103 system "HOME=${prefix}/var/lib/ndn/nfd ndnsec-keygen /localhost/daemons/nfd | \
104 HOME=${prefix}/var/lib/ndn/nfd ndnsec-install-cert -"
105
106 # Generate self-signed NDN certificate for nrd (owned by ndn)
107 xinstall -m 755 -d -o ${ndn_user} -g ${ndn_group} ${prefix}/var/lib/ndn/nrd/.ndn
108 system "sudo -u ${ndn_user} -g ${ndn_group} sh -c 'echo tpm=file \
109 > ${prefix}/var/lib/ndn/nrd/.ndn/client.conf'"
110 system "sudo -u ${ndn_user} -g ${ndn_group} HOME=${prefix}/var/lib/ndn/nrd \
111 ndnsec-keygen /localhost/daemons/nrd | \
112 sudo -u ${ndn_user} -g ndn HOME=${prefix}/var/lib/ndn/nrd ndnsec-install-cert -"
113
114 # Dump RIB Management daemon's certificate
115 xinstall -m 755 -d ${prefix}/etc/ndn/certs
116 system "sudo sh -c 'sudo -u ${ndn_user} -g ${ndn_group} HOME=${prefix}/var/lib/ndn/nrd \
117 ndnsec-dump-certificate -i /localhost/daemons/nrd \
118 > ${prefix}/etc/ndn/certs/localhost_daemons_nrd.ndncert'"
119
120 }
121}
122
123pre-deactivate {
124 system "${prefix}/bin/nfd-stop"
125
126 system "rm ${prefix}/etc/LaunchDaemons/net.named-data.nfd/net.named-data.nfd.plist"
127 system "rm ${prefix}/etc/LaunchDaemons/net.named-data.nfd/net.named-data.nrd.plist"
128}
129
130notes "
131
132To start NFD and ensure it is started when system boots:
133
134 nfd-start
135
136To stop NFD and disable auto-start when system boots:
137
138 nfd-stop
139
140NFD log files are located in ${prefix}/var/log/ndn/
141
142Configuration file is in ${prefix}/var/etc/ndn/
143
144"