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 | |
| 7 | github.setup cawka ndn-js be2e69ba887beda1d03d861b9f8a20e19dc949b8 |
| 8 | checksums rmd160 6268908d006a8d32e02ab06fd5956927049e3c7f \ |
| 9 | sha256 6d3a53bfbf5fde72f441baee610c6f2971937fa0c5d4a0c9806da40d8882b85d |
| 10 | |
| 11 | name ccnx-wsproxy |
| 12 | homepage http://github.com/remap/ndn-js |
| 13 | license Permissive BSD |
| 14 | version 0.1 |
| 15 | |
| 16 | categories net ccnx |
| 17 | maintainers ucla.edu:alexander.afanasyev |
| 18 | |
| 19 | description WebSocket proxy server between NDN javascript stack and ccnx |
| 20 | |
| 21 | depends_lib-append port:ccnx \ |
| 22 | port:nodejs \ |
| 23 | port:npm |
| 24 | |
| 25 | set ccnxuser ccnx |
| 26 | |
| 27 | supported_archs noarch |
| 28 | use_configure yes |
| 29 | |
| 30 | configure.cmd ./waf configure |
| 31 | configure.args-append --no-js |
| 32 | |
| 33 | build { } |
| 34 | |
| 35 | destroot.cmd ./waf |
| 36 | destroot.destdir --destdir=${destroot} |
| 37 | |
| 38 | post-destroot { |
| 39 | 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\"" |
| 40 | file attributes "${destroot}${prefix}/bin/ccnx-wsproxy-tcp" -permissions 0755 |
| 41 | |
| 42 | 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\"" |
| 43 | file attributes "${destroot}${prefix}/bin/ccnx-wsproxy-udp" -permissions 0755 |
| 44 | } |
| 45 | |
| 46 | post-activate { |
| 47 | # install ccnx-wsproxy dependencies using npm |
| 48 | system "${prefix}/bin/npm install -g ws" |
| 49 | system "${prefix}/bin/npm install -g node-getopt" |
| 50 | } |
| 51 | |
| 52 | startupitem.executable ${prefix}/bin/ccnx-wsproxy-udp -c 127.0.0.1 -m 40 -L 1 |
| 53 | |
| 54 | startupitem.create yes |
| 55 | startupitem.name ${name} |
| 56 | |
| 57 | startupitem.netchange no |
| 58 | startupitem.logevents yes |
| 59 | startupitem.logfile ${prefix}/var/log/ccnx-wsproxy.log |