blob: 0382a99ba368a8c42619458dcc194960d1fe5ca2 [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 Afanasyev41132ef2014-05-09 13:46:06 -07007github.setup named-data NFD NFD-0.1.0
8checksums rmd160 857094f20a6444301fd1741e4a20f04bad048787 \
9 sha256 b90701bf6300f007ac3690451ab619ba61bdbcb56329390ba14675ac3c4b21d1
Alexander Afanasyev20cc34e2014-05-07 01:28:34 -070010
11name nfd
12homepage http://named-data.net/doc/NFD/
13license GPL3+
Alexander Afanasyev41132ef2014-05-09 13:46:06 -070014version 0.1.0
15epoch 1
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
43configure.env-append SPHINX_BUILD=${prefix}/bin/sphinx-build-2.7
44configure.cmd ./waf configure
45
46build.cmd ./waf
47build.target build
48
49destroot.cmd ./waf
50destroot.target install
51destroot.destdir --destdir=${destroot}
52
53set ndn_user ndn
54set ndn_group ndn
55
56add_users ${ndn_user} shell=/bin/sh group=${ndn_group} \
57 realname=NDN\ User
58
59post-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
77post-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
116pre-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
123notes "
124
125To start NFD and ensure it is started when system boots:
126
127 nfd-start
128
129To stop NFD and disable auto-start when system boots:
130
131 nfd-stop
132
133NFD log files are located in ${prefix}/var/log/ndn/
134
135Configuration file is in ${prefix}/var/etc/ndn/
136
137"