Alexander Afanasyev | 535119a | 2013-02-28 20:32:25 -0800 | [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 | |
Alexander Afanasyev | 937e6d8 | 2013-04-18 12:33:11 -0700 | [diff] [blame] | 7 | github.setup named-data ndn-js aa0b4120afd1d33a87e9003906ecc538a20dbc39 |
| 8 | checksums rmd160 6fe5946e31095d0a700bc9fc9edfad2176591cb9 \ |
| 9 | sha256 4ff92fa6e70964ff651beb54c84c9a694354bcc8018385bb25eea14749d48a79 |
Alexander Afanasyev | 535119a | 2013-02-28 20:32:25 -0800 | [diff] [blame] | 10 | |
| 11 | name ccnx-wsproxy |
Alexander Afanasyev | 937e6d8 | 2013-04-18 12:33:11 -0700 | [diff] [blame] | 12 | homepage http://github.com/named-data/ndn-js |
Alexander Afanasyev | 535119a | 2013-02-28 20:32:25 -0800 | [diff] [blame] | 13 | license Permissive BSD |
| 14 | version 0.1 |
Alexander Afanasyev | 937e6d8 | 2013-04-18 12:33:11 -0700 | [diff] [blame] | 15 | revision 2 |
Alexander Afanasyev | 535119a | 2013-02-28 20:32:25 -0800 | [diff] [blame] | 16 | |
| 17 | categories net ccnx |
| 18 | maintainers ucla.edu:alexander.afanasyev |
| 19 | |
| 20 | description WebSocket proxy server between NDN javascript stack and ccnx |
| 21 | |
| 22 | depends_lib-append port:ccnx \ |
| 23 | port:nodejs \ |
| 24 | port:npm |
| 25 | |
| 26 | set ccnxuser ccnx |
| 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 ${ccnxuser} -c 'NODE_PATH=${prefix}/lib/node_modules ${prefix}/bin/node ${prefix}/bin/ccnx-wsproxy-tcp.js \\\$0'\" > \"${destroot}${prefix}/bin/ccnx-wsproxy-tcp\"" |
| 41 | file attributes "${destroot}${prefix}/bin/ccnx-wsproxy-tcp" -permissions 0755 |
| 42 | |
| 43 | system "echo \"su ${ccnxuser} -c 'NODE_PATH=${prefix}/lib/node_modules ${prefix}/bin/node ${prefix}/bin/ccnx-wsproxy-udp.js \\\$0'\" > \"${destroot}${prefix}/bin/ccnx-wsproxy-udp\"" |
| 44 | file attributes "${destroot}${prefix}/bin/ccnx-wsproxy-udp" -permissions 0755 |
| 45 | } |
| 46 | |
| 47 | post-activate { |
| 48 | # install ccnx-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/ccnx-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/ccnx-wsproxy.log |