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