Alexander Afanasyev | d2006fd | 2013-08-14 18:11:26 -0700 | [diff] [blame] | 1 | # -*- 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 | |
| 4 | PortSystem 1.0 |
| 5 | PortGroup github 1.0 |
| 6 | |
| 7 | github.setup cawka ndn-js 3861414c370cf28b405151fc7e2ab8c8bb56bcf3 |
| 8 | checksums rmd160 dfc49370aff267ded7a46a8ef26f00c6950b4497 \ |
| 9 | sha256 b36d04f974b31895485d895aa44893e2d43f2d96f6443921903304fc6966f79d |
| 10 | |
| 11 | name ndnx-wsproxy |
| 12 | homepage http://github.com/named-data/ndn-js |
| 13 | license Permissive BSD |
| 14 | version 0.1 |
| 15 | revision 3 |
| 16 | |
| 17 | categories net |
| 18 | maintainers ucla.edu:alexander.afanasyev |
| 19 | |
| 20 | description WebSocket proxy server between NDN javascript stack and NDNx daemon |
| 21 | |
| 22 | depends_lib-append port:ndnx \ |
| 23 | port:nodejs \ |
| 24 | port:npm |
| 25 | |
| 26 | set ndnxuser ndnx |
| 27 | |
| 28 | supported_archs noarch |
| 29 | use_configure yes |
| 30 | |
| 31 | configure.cmd ./waf configure |
| 32 | configure.args-append --no-js |
| 33 | |
| 34 | build { } |
| 35 | |
| 36 | destroot.cmd ./waf |
| 37 | destroot.destdir --destdir=${destroot} |
| 38 | |
| 39 | post-destroot { |
| 40 | system "echo \"su ${ndnxuser} -c 'NODE_PATH=${prefix}/lib/node_modules ${prefix}/bin/node ${prefix}/bin/ndnx-wsproxy-tcp.js \\\$0'\" > \"${destroot}${prefix}/bin/ndnx-wsproxy-tcp\"" |
| 41 | file attributes "${destroot}${prefix}/bin/ndnx-wsproxy-tcp" -permissions 0755 |
| 42 | |
| 43 | system "echo \"su ${ndnxuser} -c 'NODE_PATH=${prefix}/lib/node_modules ${prefix}/bin/node ${prefix}/bin/ndnx-wsproxy-udp.js \\\$0'\" > \"${destroot}${prefix}/bin/ndnx-wsproxy-udp\"" |
| 44 | file attributes "${destroot}${prefix}/bin/ndnx-wsproxy-udp" -permissions 0755 |
| 45 | } |
| 46 | |
| 47 | post-activate { |
| 48 | # install ndnx-wsproxy dependencies using npm |
| 49 | system "${prefix}/bin/npm install -g ws" |
| 50 | system "${prefix}/bin/npm install -g node-getopt" |
| 51 | } |
| 52 | |
| 53 | startupitem.executable ${prefix}/bin/ndnx-wsproxy-udp -c 127.0.0.1 -m 40 -L 1 |
| 54 | |
| 55 | startupitem.create yes |
| 56 | startupitem.name ${name} |
| 57 | |
| 58 | startupitem.netchange no |
| 59 | startupitem.logevents yes |
| 60 | startupitem.logfile ${prefix}/var/log/ndnx-wsproxy.log |