# HG changeset patch # User Pascal Bellard # Date 1320334396 -3600 # Node ID 7ad949dccd95e496163821c86e5682a8ae973bd0 # Parent e414ce8e07d7d353a5c5d5198f69be0665917608 Add from wok-undigest: sdcc fbvnc novnc diff -r e414ce8e07d7 -r 7ad949dccd95 fbvnc/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fbvnc/receipt Thu Nov 03 16:33:16 2011 +0100 @@ -0,0 +1,32 @@ +# SliTaz package receipt. + +PACKAGE="fbvnc" +VERSION="20110416" +CATEGORY="network" +SHORT_DESC="VNC client in frame buffer." +MAINTAINER="pascal.bellard@slitaz.org" +WEB_SITE="http://repo.or.cz/w/fbvnc.git" +_TARBALL="$PACKAGE-$VERSION.tar.gz" + +# Rules to configure and make the package. +compile_rules() +{ + [ -s $SOURCES_REPOSITORY/$_TARBALL ] || + wget -O $SOURCES_REPOSITORY/$_TARBALL \ + $WEB_SITE/snapshot/e42bc02b14b3331e7c7f45c6b42179d0af99ed7b.tar.gz + mkdir -p $src + cd $src + tar xzf $SOURCES_REPOSITORY/$_TARBALL + mkdir $DESTDIR + cd fbvnc + patch -p0 < $stuff/fbvnc.u && + make && cp fbvnc $DESTDIR +} + + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr/bin + cp $_pkg/fbvnc $fs/usr/bin +} diff -r e414ce8e07d7 -r 7ad949dccd95 fbvnc/stuff/fbvnc.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fbvnc/stuff/fbvnc.u Thu Nov 03 16:33:16 2011 +0100 @@ -0,0 +1,612 @@ +--- draw.h ++++ draw.h +@@ -15,5 +15,11 @@ + void fb_cmap(void); + + /* helper functions */ ++struct rgb_conv { ++ int rshl, gshl; ++ int rskp, gskp, bskp; ++ int rmax, gmax, bmax; ++}; ++void fill_rgb_conv(int mode, struct rgb_conv *s); + void fb_set(int r, int c, void *mem, int len); + unsigned fb_val(int r, int g, int b); +--- draw.c ++++ draw.c +@@ -10,14 +10,13 @@ + + #define MIN(a, b) ((a) < (b) ? (a) : (b)) + #define MAX(a, b) ((a) > (b) ? (a) : (b)) +-#define NLEVELS (1 << 8) ++#define NLEVELS (1 << 16) + + static int fd; + static void *fb; + static struct fb_var_screeninfo vinfo; + static struct fb_fix_screeninfo finfo; +-static int bpp; +-static int nr, ng, nb; ++static int bytes_per_pixel; + + static int fb_len(void) + { +@@ -28,10 +27,12 @@ + { + static unsigned short red[NLEVELS], green[NLEVELS], blue[NLEVELS]; + struct fb_cmap cmap; ++ + if (finfo.visual == FB_VISUAL_TRUECOLOR) + return; ++ + cmap.start = 0; +- cmap.len = MAX(nr, MAX(ng, nb)); ++ cmap.len = NLEVELS; + cmap.red = red; + cmap.green = green; + cmap.blue = blue; +@@ -41,24 +42,39 @@ + + void fb_cmap(void) + { +- unsigned short red[NLEVELS], green[NLEVELS], blue[NLEVELS]; ++ struct fb_bitfield *color[3] = { ++ &vinfo.blue, &vinfo.green, &vinfo.red ++ }; ++ int eye_sensibility[3] = { 2, 0, 1 }; // higher=red, blue, lower=green + struct fb_cmap cmap; +- int i; ++ unsigned short map[3][NLEVELS]; ++ int i, j, n, offset; ++ + if (finfo.visual == FB_VISUAL_TRUECOLOR) + return; + +- for (i = 0; i < nr; i++) +- red[i] = (65535 / (nr - 1)) * i; +- for (i = 0; i < ng; i++) +- green[i] = (65535 / (ng - 1)) * i; +- for (i = 0; i < nb; i++) +- blue[i] = (65535 / (nb - 1)) * i; +- ++ for (i = 0, n = vinfo.bits_per_pixel; i < 3; i++) { ++ n -= color[eye_sensibility[i]]->length = n / (3 - i); ++ } ++ n = (1 << vinfo.bits_per_pixel); ++ if (n > NLEVELS) ++ n = NLEVELS; ++ for (i = offset = 0; i < 3; i++) { ++ int length = color[i]->length; ++ color[i]->offset = offset; ++ for (j = 0; j < n; j++) { ++ int k = (j >> offset) << (16 - length); ++ if (k == (0xFFFF << (16 - length))) ++ k = 0xFFFF; ++ map[i][j] = k; ++ } ++ offset += length; ++ } + cmap.start = 0; +- cmap.len = MAX(nr, MAX(ng, nb)); +- cmap.red = red; +- cmap.green = green; +- cmap.blue = blue; ++ cmap.len = n; ++ cmap.red = map[2]; ++ cmap.green = map[1]; ++ cmap.blue = map[0]; + cmap.transp = NULL; + + ioctl(fd, FBIOPUTCMAP, &cmap); +@@ -66,25 +82,26 @@ + + unsigned fb_mode(void) + { +- return (bpp << 16) | (vinfo.red.length << 8) | ++ return (bytes_per_pixel << 16) | (vinfo.red.length << 8) | + (vinfo.green.length << 4) | (vinfo.blue.length); + } + + int fb_init(void) + { ++ int err = 1; + fd = open(FBDEV_PATH, O_RDWR); + if (fd == -1) + goto failed; ++ err++; + if (ioctl(fd, FBIOGET_VSCREENINFO, &vinfo) == -1) + goto failed; ++ err++; + if (ioctl(fd, FBIOGET_FSCREENINFO, &finfo) == -1) + goto failed; + fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC); +- bpp = (vinfo.bits_per_pixel + 7) >> 3; +- nr = 1 << vinfo.red.length; +- ng = 1 << vinfo.blue.length; +- nb = 1 << vinfo.green.length; ++ bytes_per_pixel = (vinfo.bits_per_pixel + 7) >> 3; + fb = mmap(NULL, fb_len(), PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); ++ err++; + if (fb == MAP_FAILED) + goto failed; + fb_cmap_save(1); +@@ -93,7 +110,7 @@ + failed: + perror("fb_init()"); + close(fd); +- return 1; ++ return err; + } + + void fb_free(void) +@@ -120,19 +137,30 @@ + + void fb_set(int r, int c, void *mem, int len) + { +- memcpy(fb_mem(r) + (c + vinfo.xoffset) * bpp, mem, len * bpp); ++ memcpy(fb_mem(r) + (c + vinfo.xoffset) * bytes_per_pixel, ++ mem, len * bytes_per_pixel); + } + ++void fill_rgb_conv(int mode, struct rgb_conv *s) ++{ ++ int bits; ++ ++ bits = mode & 0xF; mode >>= 4; ++ s->rshl = s->gshl = bits; ++ s->bskp = 8 - bits; s->bmax = (1 << bits) -1; ++ bits = mode & 0xF; mode >>= 4; ++ s->rshl += bits; ++ s->gskp = 8 - bits; s->gmax = (1 << bits) -1; ++ bits = mode & 0xF; ++ s->rskp = 8 - bits; s->rmax = (1 << bits) -1; ++} ++ + unsigned fb_val(int r, int g, int b) + { +- switch (fb_mode() & 0x0fff) { +- default: +- fprintf(stderr, "fb_val: unknown fb_mode()\n"); +- case 0x0888: +- return (r << 16) | (g << 8) | b; +- case 0x0565: +- return ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3); +- case 0x0233: +- return ((r >> 6) << 6) | ((g >> 5) << 3) | (b >> 5); +- } ++ static struct rgb_conv c; ++ ++ if (c.rshl == 0) ++ fill_rgb_conv(fb_mode(), &c); ++ return ((r >> c.rskp) << c.rshl) | ((g >> c.gskp) << c.gshl) ++ | (b >> c.bskp); + } +--- fbvnc.c ++++ fbvnc.c +@@ -36,13 +36,15 @@ + + #define VNC_PORT "5900" + +-#define MAXRES (1 << 21) +-#define MIN(a, b) ((a) < (b) ? (a) : (b)) ++#define MAXRES (1 << 12) + + static int cols, rows; ++static int srv_cols, srv_rows; ++static int or, oc; + static int mr, mc; /* mouse position */ + + static char buf[MAXRES]; ++#define MAXPIX (MAXRES/sizeof(fbval_t)) + + static int vnc_connect(char *addr, char *port) + { +@@ -61,22 +63,26 @@ + + if (connect(fd, addrinfo->ai_addr, addrinfo->ai_addrlen) == -1) { + close(fd); +- freeaddrinfo(addrinfo); +- return -1; ++ fd = -2; + } + freeaddrinfo(addrinfo); + return fd; + } + ++static int bpp, vnc_mode; ++static struct rgb_conv format; + static int vnc_init(int fd) + { +- char vncver[] = "RFB 003.003\n"; ++ static int vncfmt[] = { 0x40888, 0x20565, 0x10233, 0 }; ++ char vncver[12]; ++ int i; ++ + struct vnc_client_init clientinit; + struct vnc_server_init serverinit; + struct vnc_client_pixelfmt pixfmt_cmd; + int connstat = VNC_CONN_FAILED; + +- write(fd, vncver, 12); ++ write(fd, "RFB 003.003\n", 12); + read(fd, vncver, 12); + + read(fd, &connstat, sizeof(connstat)); +@@ -88,68 +94,78 @@ + write(fd, &clientinit, sizeof(clientinit)); + read(fd, &serverinit, sizeof(serverinit)); + +- if (fb_init()) +- return -1; +- if (FBM_BPP(fb_mode()) != sizeof(fbval_t)) { +- fprintf(stderr, "fbvnc: fbval_t doesn't match fb depth\n"); +- exit(1); +- } +- cols = MIN(ntohs(serverinit.w), fb_cols()); +- rows = MIN(ntohs(serverinit.h), fb_rows()); ++ i = fb_init(); ++ if (i) ++ return -1 - i; ++ srv_cols = ntohs(serverinit.w); ++ srv_rows = ntohs(serverinit.h); ++ cols = MIN(srv_cols, fb_cols()); ++ rows = MIN(srv_rows, fb_rows()); + mr = rows / 2; + mc = cols / 2; ++ or = oc = 0; + + read(fd, buf, ntohl(serverinit.len)); + pixfmt_cmd.type = VNC_CLIENT_PIXFMT; +- pixfmt_cmd.format.bpp = 8; +- pixfmt_cmd.format.depth = 8; + pixfmt_cmd.format.bigendian = 0; + pixfmt_cmd.format.truecolor = 1; + +- pixfmt_cmd.format.rmax = htons(3); +- pixfmt_cmd.format.gmax = htons(7); +- pixfmt_cmd.format.bmax = htons(7); +- pixfmt_cmd.format.rshl = 0; +- pixfmt_cmd.format.gshl = 2; +- pixfmt_cmd.format.bshl = 5; ++ if (bpp < 1) ++ bpp = FBM_BPP(fb_mode()); ++ if (bpp >= 3) ++ bpp = 4; ++ for (i = 0; bpp <= FBM_BPP(vncfmt[i]); i++) ++ vnc_mode = vncfmt[i]; ++ bpp = FBM_BPP(vnc_mode); ++ pixfmt_cmd.format.bpp = ++ pixfmt_cmd.format.depth = bpp << 3; + ++ fill_rgb_conv(FBM_COLORS(vnc_mode), &format); ++ pixfmt_cmd.format.rmax = htons(format.rmax); ++ pixfmt_cmd.format.gmax = htons(format.gmax); ++ pixfmt_cmd.format.bmax = htons(format.bmax); ++ pixfmt_cmd.format.rshl = format.rshl; ++ pixfmt_cmd.format.gshl = format.gshl; ++ pixfmt_cmd.format.bshl = 0; + write(fd, &pixfmt_cmd, sizeof(pixfmt_cmd)); + return fd; + } + +-static int vnc_free(void) ++static void vnc_free(void) + { + fb_free(); +- return 0; + } + +-static int vnc_refresh(int fd, int inc) ++static void vnc_refresh(int fd, int inc) + { + struct vnc_client_fbup fbup_req; + fbup_req.type = VNC_CLIENT_FBUP; + fbup_req.inc = inc; +- fbup_req.x = htons(0); +- fbup_req.y = htons(0); +- fbup_req.w = htons(cols); +- fbup_req.h = htons(rows); ++ fbup_req.x = htons(oc); ++ fbup_req.y = htons(or); ++ fbup_req.w = htons(oc + cols); ++ fbup_req.h = htons(or + rows); + write(fd, &fbup_req, sizeof(fbup_req)); +- return 0; + } + +-static void drawfb(char *s, int x, int y, int w, int h) ++static void drawfb(char *s, int x, int y, int w) + { +- fbval_t slice[1 << 14]; +- int i, j; +- for (i = 0; i < h; i++) { +- for (j = 0; j < w; j++) { +- int c = *(unsigned char *) &s[i * w + j]; +- int r = (c & 0x3) << 6; +- int g = ((c >> 2) & 0x7) << 5; +- int b = ((c >> 5) & 0x7) << 5; +- slice[j] = FB_VAL(r, g, b); ++ int mode = fb_mode(); ++ if (mode != vnc_mode) { ++ fbval_t slice[MAXRES]; ++ unsigned char *byte = (unsigned char *) slice; ++ int j; ++ int fb_bpp = FBM_BPP(mode); ++ for (j = 0; j < w; j++, byte += fb_bpp, s += bpp) { ++ fbval_t c = * (fbval_t *) s; ++ int r = ((c >> format.rshl) & format.rmax) << format.rskp; ++ int g = ((c >> format.gshl) & format.gmax) << format.gskp; ++ int b = (c & format.bmax) << format.bskp; ++ * (fbval_t *) byte = FB_VAL(r, g, b); + } +- fb_set(y + i, x, slice, w); ++ s = (void *) slice; + } ++ fb_set(y, x, s, w); + } + + static void xread(int fd, void *buf, int len) +@@ -159,54 +175,84 @@ + while (nr < len && (n = read(fd, buf + nr, len - nr)) > 0) + nr += n; + if (nr < len) { +- printf("partial vnc read!\n"); +- exit(1); ++ fprintf(stderr,"partial vnc read!\n"); ++ exit(99); + } + } + ++static void skip(int fd, int len) ++{ ++ int n; ++ while (len > 0 && (n = read(fd, buf, MIN(len, sizeof(buf)))) > 0) ++ len -= n; ++} ++ + static int vnc_event(int fd) + { + struct vnc_rect uprect; +- char msg[1 << 12]; +- struct vnc_server_fbup *fbup = (void *) msg; +- struct vnc_server_cuttext *cuttext = (void *) msg; +- struct vnc_server_colormap *colormap = (void *) msg; +- int j; +- int n; ++ union { ++ struct vnc_server_fbup fbup; ++ struct vnc_server_cuttext cuttext; ++ struct vnc_server_colormap colormap; ++ } msg; ++ int j, n; + +- if (read(fd, msg, 1) != 1) ++ if (read(fd, &msg.fbup.type, 1) != 1) + return -1; +- switch (msg[0]) { ++ switch (msg.fbup.type) { + case VNC_SERVER_FBUP: +- xread(fd, msg + 1, sizeof(*fbup) - 1); +- n = ntohs(fbup->n); ++ xread(fd, &msg.fbup.pad, sizeof(msg.fbup) - 1); ++ n = ntohs(msg.fbup.n); + for (j = 0; j < n; j++) { +- int x, y, w, h; ++ int x, y, w, h, l, i; + xread(fd, &uprect, sizeof(uprect)); ++ if (uprect.enc != 0) { ++ fprintf(stderr,"Encoding not RAW: %d\n", ++ ntohl(uprect.enc)); ++ return -1; ++ } + x = ntohs(uprect.x); + y = ntohs(uprect.y); + w = ntohs(uprect.w); + h = ntohs(uprect.h); +- if (x >= cols || x + w > cols) +- return -1; +- if (y >= rows || y + h > rows) +- return -1; +- xread(fd, buf, w * h); +- drawfb(buf, x, y, w, h); ++ x -= oc; ++ y -= or; ++ i = 0; ++ l = MIN(w, cols - x); ++ if (x < 0) { ++ l = MIN(w + x, cols); ++ i = MIN(w, -x); ++ x = 0; ++ } ++ if (l < 0) ++ l = 0; ++ for (; h--; y++) { ++ int n = l; ++ int xj = x; ++ skip(fd, i * bpp); ++ while (n > 0) { ++ int j = MIN(n, MAXPIX); ++ xread(fd, buf, j * bpp); ++ if (y >= 0 && y < rows) ++ drawfb(buf, xj, y, j); ++ xj += j; n -= j; ++ } ++ skip(fd, (w - l - i) * bpp); ++ } + } + break; + case VNC_SERVER_BELL: + break; + case VNC_SERVER_CUTTEXT: +- xread(fd, msg + 1, sizeof(*cuttext) - 1); +- xread(fd, buf, ntohl(cuttext->len)); ++ xread(fd, &msg.cuttext.pad1, sizeof(msg.cuttext) - 1); ++ skip(fd, ntohl(msg.cuttext.len)); + break; + case VNC_SERVER_COLORMAP: +- xread(fd, msg + 1, sizeof(*colormap) - 1); +- xread(fd, buf, ntohs(colormap->n) * 3 * 2); ++ xread(fd, &msg.colormap.pad, sizeof(msg.colormap) - 1); ++ skip(fd, ntohs(msg.colormap.n) * 3 * 2); + break; + default: +- fprintf(stderr, "unknown vnc msg: %d\n", msg[0]); ++ fprintf(stderr, "unknown vnc msg: %d\n", msg.fbup.type); + return -1; + } + return 0; +@@ -217,12 +263,31 @@ + char ie[3]; + struct vnc_client_ratevent me = {VNC_CLIENT_RATEVENT}; + int mask = 0; ++ int refresh = 2; + if (read(ratfd, &ie, sizeof(ie)) != 3) + return -1; + mc += ie[1]; + mr -= ie[2]; +- mc = MAX(0, MIN(cols - 1, mc)); +- mr = MAX(0, MIN(rows - 1, mr)); ++ if (mc < oc) { ++ if ((oc -= cols / 5) < 0) ++ oc = 0; ++ } ++ else if (mc >= oc + cols && oc + cols < srv_cols) { ++ if ((oc += cols / 5) > srv_cols - cols) ++ oc = srv_cols - cols; ++ } ++ else refresh--; ++ if (mr < or) { ++ if ((or -= rows / 5) < 0) ++ or = 0; ++ } ++ else if (mr >= or + rows && or + rows < srv_rows) { ++ if ((or += rows / 5) > srv_rows - rows) ++ or = srv_rows - rows; ++ } ++ else refresh--; ++ mc = MAX(oc, MIN(oc + cols - 1, mc)); ++ mr = MAX(or, MIN(or + rows - 1, mr)); + if (ie[0] & 0x01) + mask |= VNC_BUTTON1_MASK; + if (ie[0] & 0x04) +@@ -233,6 +298,8 @@ + me.x = htons(mc); + me.mask = mask; + write(fd, &me, sizeof(me)); ++ if (refresh) ++ vnc_refresh(fd, 0); + return 0; + } + +@@ -292,12 +359,11 @@ + k = 0xff0d; + break; + case 0x0c: /* ^L: redraw */ +- if (vnc_refresh(fd, 0)) +- return -1; ++ vnc_refresh(fd, 0); + default: + k = (unsigned char) key[i]; + } +- if (k >= 'A' && k <= 'Z' || strchr(":\"<>?{}|+_()*&^%$#@!~", k)) ++ if ((k >= 'A' && k <= 'Z') || strchr(":\"<>?{}|+_()*&^%$#@!~", k)) + mod[nmod++] = 0xffe1; + if (k >= 1 && k <= 26) { + k = 'a' + k - 1; +@@ -339,40 +405,42 @@ + write(STDIN_FILENO, show, strlen(show)); + } + +-static void mainloop(int vnc_fd, int kbd_fd, int rat_fd) ++static int mainloop(int vnc_fd, int kbd_fd, int rat_fd) + { + struct pollfd ufds[3]; + int pending = 0; + int err; + ufds[0].fd = kbd_fd; +- ufds[0].events = POLLIN; + ufds[1].fd = vnc_fd; +- ufds[1].events = POLLIN; + ufds[2].fd = rat_fd; ++ ufds[0].events = ++ ufds[1].events = + ufds[2].events = POLLIN; +- if (vnc_refresh(vnc_fd, 0)) +- return; ++ vnc_refresh(vnc_fd, 0); + while (1) { + err = poll(ufds, 3, 500); + if (err == -1 && errno != EINTR) + break; + if (!err) + continue; ++ err = -2; + if (ufds[0].revents & POLLIN) + if (kbd_event(vnc_fd, kbd_fd) == -1) + break; ++ err--; + if (ufds[1].revents & POLLIN) { + if (vnc_event(vnc_fd) == -1) + break; + pending = 0; + } ++ err--; + if (ufds[2].revents & POLLIN) + if (rat_event(vnc_fd, rat_fd) == -1) + break; + if (!pending++) +- if (vnc_refresh(vnc_fd, 1)) +- break; ++ vnc_refresh(vnc_fd, 1); + } ++ return err; + } + + int main(int argc, char * argv[]) +@@ -380,27 +448,38 @@ + char *port = VNC_PORT; + char *host = "127.0.0.1"; + struct termios ti; +- int vnc_fd, rat_fd; ++ int vnc_fd, rat_fd, status; ++ ++ if (argc < 2) { ++ fprintf(stderr, "Usage : fbvnc [-bpp bits] server [port]\n"); ++ return 0; ++ } ++ if (*argv[1] == '-' && argc >= 3) { ++ argc -= 2; argv += 2; ++ bpp = atoi(argv[0]) >> 3; ++ } + if (argc >= 2) + host = argv[1]; + if (argc >= 3) + port = argv[2]; +- if ((vnc_fd = vnc_connect(host, port)) == -1) { +- fprintf(stderr, "could not connect!\n"); ++ if ((vnc_fd = vnc_connect(host, port)) < 0) { ++ fprintf(stderr, "could not connect! %s %s : %d\n", ++ host,port,vnc_fd); + return 1; + } +- if (vnc_init(vnc_fd) == -1) { +- fprintf(stderr, "vnc init failed!\n"); +- return 1; ++ status = vnc_init(vnc_fd); ++ if (status < 0) { ++ fprintf(stderr, "vnc init failed! %d\n", status); ++ return 2; + } + term_setup(&ti); + rat_fd = open("/dev/input/mice", O_RDONLY); + +- mainloop(vnc_fd, 0, rat_fd); ++ status = mainloop(vnc_fd, 0, rat_fd); + + term_cleanup(&ti); + vnc_free(); + close(vnc_fd); + close(rat_fd); +- return 0; ++ return 2 - status; + } diff -r e414ce8e07d7 -r 7ad949dccd95 novnc/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/novnc/receipt Thu Nov 03 16:33:16 2011 +0100 @@ -0,0 +1,52 @@ +# SliTaz package receipt. + +PACKAGE="novnc" +VERSION="20110901" +CATEGORY="network" +SHORT_DESC="VNC client in javascript." +MAINTAINER="pascal.bellard@slitaz.org" +WEB_SITE="http://github.com/kanaka/noVNC" +_TARBALL="$PACKAGE-$VERSION.tgz" + +DEPENDS="python python-numpy" +BUILD_DEPENDS="wget python python-pil openssl" +SUGGESTED="pyopenssl openssl" + +# Rules to configure and make the package. +compile_rules() +{ + [ -s $SOURCES_REPOSITORY/$_TARBALL ] || + wget -O $SOURCES_REPOSITORY/$_TARBALL \ + $WEB_SITE/tarball/7b10dc8a485079fdc34847140fb0c993265e3a1e + mkdir -p $src + cd $src + tar xzf $SOURCES_REPOSITORY/$_TARBALL + mkdir -p $DESTDIR + cd kanaka* + sed -i 's/bash/sh/;s/ps -p \([^ ]*\)/ps | grep "^ *\1 "/' utils/launch.sh + IMAGE=/usr/share/images/slitaz-background.jpg + [ -s $IMAGE ] && utils/img2js.py $IMAGE noVNC_logo > include/logo.js + cp -a *.html images/favicon.ico utils include $DESTDIR +} + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr/share/novnc + cp -a $_pkg/* $fs/usr/share/novnc +} + +port_install() +{ + which openssl > /dev/null && + openssl req -new -x509 -keyout $1/usr/share/novnc/self.pem \ + -out $1/usr/share/novnc/self.pem -days 3650 -nodes < /dev/null + cd $src + sed -i 's/all %/%/' device/lib/pic/Makefile.in + find -name getline.h | xargs sed -i \ + 's/char.*getline/#define getline sdcc_getline\nchar *sdcc_getline/' + ./configure --prefix=/usr --infodir=/usr/share/info \ + --mandir=/usr/share/man \ + $CONFIGURE_ARGS && + make && + make DESTDIR=$PWD/_pkg install +} + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + cp -a $_pkg/usr $fs +} +