# HG changeset patch # User Aleksej Bobylev # Date 1403477431 -10800 # Node ID 250bddc4f896d49133dbc775bca7cf01be706467 # Parent 346b104468cc64ef92ceb30084c89d79294000c9# Parent 08fef135770ff21b6a41d8b47bf3a2d9988ffc9d Merge branches. diff -r 346b104468cc -r 250bddc4f896 ruby-ncurses/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ruby-ncurses/receipt Mon Jun 23 01:50:31 2014 +0300 @@ -0,0 +1,33 @@ +# SliTaz package receipt. + +PACKAGE="ruby-ncurses" +VERSION="1.3.1" +CATEGORY="development" +SHORT_DESC="Ruby extension for the ncurses C library." +MAINTAINER="paul@slitaz.org" +DEPENDS="ruby ncurses" +BUILD_DEPENDS="ruby-dev ncurses-dev" +TARBALL="$PACKAGE-$VERSION.tar.bz2" +SOURCE="ncurses-ruby" +WEB_SITE="http://pkgs.fedoraproject.org/repo/pkgs/ruby-ncurses/" +WGET_URL="http://pkgs.fedoraproject.org/repo/pkgs/ruby-ncurses/ncurses-ruby-1.3.1.tar.bz2/63fd3d09a51cdd745e1ed37f85621ea2/ncurses-ruby-1.3.1.tar.bz2" + +# Rules to configure and make the package. +compile_rules() +{ + cd $src + # use fedora patches + patch -i ../../stuff/STR2CSTR-deprecated.patch + patch -i ../../stuff/ruby-ncurses-fix-missing-tz-prototypes.patch + ruby extconf.rb + make + make DESTDIR=$DESTDIR install +} + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr + cp -a $install/usr/lib $fs/usr +} + diff -r 346b104468cc -r 250bddc4f896 ruby-ncurses/stuff/STR2CSTR-deprecated.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ruby-ncurses/stuff/STR2CSTR-deprecated.patch Mon Jun 23 01:50:31 2014 +0300 @@ -0,0 +1,320 @@ +diff -Naur ncurses-ruby-1.3.1/form_wrap.c ncurses-ruby-1.3.1.p/form_wrap.c +--- ncurses-ruby-1.3.1/form_wrap.c 2011-05-31 01:41:46.000000000 +0200 ++++ ncurses-ruby-1.3.1.p/form_wrap.c 2013-03-14 14:38:21.097682379 +0100 +@@ -625,7 +625,8 @@ + char** list = ALLOC_N(char*, n+1); + int i; + for (i = 0; i < n; i++) { +- list[i] = STR2CSTR(rb_ary_entry(arg3, (long)i)); ++ VALUE tmp = rb_ary_entry(arg3, (long)i); ++ list[i] = StringValuePtr(tmp); + } + list[n] = NULL; + return INT2NUM(set_field_type(field, ftype, +@@ -654,7 +655,7 @@ + if (argc != 2) + rb_raise(rb_eArgError, "TYPE_REGEXP requires one additional argument"); + return INT2NUM(set_field_type(field, ftype, +- STR2CSTR(arg3))); ++ StringValuePtr(arg3))); + } + else if (ftype == TYPE_IPV4){ + if (argc != 1) +@@ -742,7 +743,7 @@ + */ + static VALUE rbncurs_c_set_field_buffer(VALUE rb_field, VALUE buf, VALUE value) { + FIELD* field = get_field(rb_field); +- return INT2NUM(set_field_buffer(field, NUM2INT(buf), STR2CSTR(value))); ++ return INT2NUM(set_field_buffer(field, NUM2INT(buf), StringValuePtr(value))); + } + static VALUE rbncurs_m_set_field_buffer(VALUE dummy, VALUE rb_field, VALUE buf, VALUE value) + { return rbncurs_c_set_field_buffer(rb_field, buf, value); } +@@ -1052,7 +1053,7 @@ + { return rbncurs_c_form_request_name(request); } + + static VALUE rbncurs_c_form_request_by_name(VALUE name) { +- return INT2NUM(form_request_by_name(STR2CSTR(name))); ++ return INT2NUM(form_request_by_name(StringValuePtr(name))); + } + static VALUE rbncurs_m_form_request_by_name(VALUE dummy, VALUE name) + { return rbncurs_c_form_request_by_name(name); } +diff -Naur ncurses-ruby-1.3.1/menu_wrap.c ncurses-ruby-1.3.1.p/menu_wrap.c +--- ncurses-ruby-1.3.1/menu_wrap.c 2011-05-31 01:41:46.000000000 +0200 ++++ ncurses-ruby-1.3.1.p/menu_wrap.c 2013-03-14 14:39:37.016571464 +0100 +@@ -372,7 +372,7 @@ + * Item creation/destruction functions - mitem_new(3X) man page + */ + static VALUE rbncurs_m_new_item(VALUE dummy, VALUE name, VALUE description) +-{ return wrap_item(new_item(STR2CSTR(name), STR2CSTR(description))); } ++{ return wrap_item(new_item(StringValuePtr(name), StringValuePtr(description))); } + + static VALUE rbncurs_c_free_item(VALUE rb_item) + { +@@ -670,7 +670,7 @@ + + static VALUE rbncurs_c_menu_request_by_name(VALUE name) + { +- return INT2NUM(menu_request_by_name(STR2CSTR(name))); ++ return INT2NUM(menu_request_by_name(StringValuePtr(name))); + } + static VALUE rbncurs_m_menu_request_by_name(VALUE dummy, VALUE name) + { return rbncurs_c_menu_request_by_name(name); } +@@ -909,7 +909,7 @@ + static VALUE rbncurs_c_set_menu_mark(VALUE rb_menu, VALUE value) + { + MENU *menu = get_menu(rb_menu); +- return INT2NUM(set_menu_mark(menu, STR2CSTR(value))); ++ return INT2NUM(set_menu_mark(menu, StringValuePtr(value))); + } + static VALUE rbncurs_m_set_menu_mark(VALUE dummy, VALUE rb_field, VALUE value) + { return rbncurs_c_set_menu_mark(rb_field, value); } +@@ -929,7 +929,7 @@ + static VALUE rbncurs_c_set_menu_pattern(VALUE rb_menu, VALUE pattern) + { + MENU *menu = get_menu(rb_menu); +- return INT2NUM(set_menu_pattern(menu, STR2CSTR(pattern))); ++ return INT2NUM(set_menu_pattern(menu, StringValuePtr(pattern))); + } + static VALUE rbncurs_m_set_menu_pattern(VALUE dummy, VALUE rb_menu, VALUE pattern) + { return rbncurs_c_set_menu_pattern(rb_menu, pattern); } +diff -Naur ncurses-ruby-1.3.1/ncurses_wrap.c ncurses-ruby-1.3.1.p/ncurses_wrap.c +--- ncurses-ruby-1.3.1/ncurses_wrap.c 2011-05-31 01:41:46.000000000 +0200 ++++ ncurses-ruby-1.3.1.p/ncurses_wrap.c 2013-03-14 15:09:59.535783327 +0100 +@@ -475,7 +475,7 @@ + static VALUE rbncurs_define_key(VALUE dummy, VALUE definition, VALUE keycode) + { + return INT2NUM(define_key((definition != Qnil) +- ? STR2CSTR(definition) ++ ? StringValuePtr(definition) + : (char*)(NULL), + NUM2INT(keycode))); + } +@@ -580,10 +580,10 @@ + return return_value; + } + static VALUE rbncurs_addnstr(VALUE dummy, VALUE arg1, VALUE arg2) { +- return INT2NUM(addnstr(STR2CSTR(arg1), NUM2INT(arg2))); ++ return INT2NUM(addnstr(StringValuePtr(arg1), NUM2INT(arg2))); + } + static VALUE rbncurs_addstr(VALUE dummy, VALUE arg1) { +- return INT2NUM(addstr(STR2CSTR(arg1))); ++ return INT2NUM(addstr(StringValuePtr(arg1))); + } + static VALUE rbncurs_attroff(VALUE dummy, VALUE arg1) { + return INT2NUM(attroff(NUM2ULONG(arg1))); +@@ -1011,10 +1011,10 @@ + return INT2NUM(insertln()); + } + static VALUE rbncurs_insnstr(VALUE dummy, VALUE arg1, VALUE arg2) { +- return INT2NUM(insnstr(STR2CSTR(arg1), NUM2INT(arg2))); ++ return INT2NUM(insnstr(StringValuePtr(arg1), NUM2INT(arg2))); + } + static VALUE rbncurs_insstr(VALUE dummy, VALUE arg1) { +- return INT2NUM(insstr(STR2CSTR(arg1))); ++ return INT2NUM(insstr(StringValuePtr(arg1))); + } + #ifdef HAVE_INTRFLUSH + static VALUE rbncurs_intrflush(VALUE dummy, VALUE arg1, VALUE arg2) { +@@ -1070,10 +1070,10 @@ + return return_value; + } + static VALUE rbncurs_mvaddnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4) { +- return INT2NUM(mvaddnstr(NUM2INT(arg1), NUM2INT(arg2), STR2CSTR(arg3), NUM2INT(arg4))); ++ return INT2NUM(mvaddnstr(NUM2INT(arg1), NUM2INT(arg2), StringValuePtr(arg3), NUM2INT(arg4))); + } + static VALUE rbncurs_mvaddstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) { +- return INT2NUM(mvaddstr(NUM2INT(arg1), NUM2INT(arg2), STR2CSTR(arg3))); ++ return INT2NUM(mvaddstr(NUM2INT(arg1), NUM2INT(arg2), StringValuePtr(arg3))); + } + #ifdef HAVE_MVCHGAT + static VALUE rbncurs_mvchgat(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4, VALUE arg5, VALUE arg6) { +@@ -1106,10 +1106,10 @@ + return INT2NUM(mvinsch(NUM2INT(arg1), NUM2INT(arg2), NUM2ULONG(arg3))); + } + static VALUE rbncurs_mvinsnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4) { +- return INT2NUM(mvinsnstr(NUM2INT(arg1), NUM2INT(arg2), STR2CSTR(arg3), NUM2INT(arg4))); ++ return INT2NUM(mvinsnstr(NUM2INT(arg1), NUM2INT(arg2), StringValuePtr(arg3), NUM2INT(arg4))); + } + static VALUE rbncurs_mvinsstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) { +- return INT2NUM(mvinsstr(NUM2INT(arg1), NUM2INT(arg2), STR2CSTR(arg3))); ++ return INT2NUM(mvinsstr(NUM2INT(arg1), NUM2INT(arg2), StringValuePtr(arg3))); + } + #ifdef HAVE_MVVLINE + static VALUE rbncurs_mvvline(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4) { +@@ -1137,10 +1137,10 @@ + return return_value; + } + static VALUE rbncurs_mvwaddnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4, VALUE arg5) { +- return INT2NUM(mvwaddnstr(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), STR2CSTR(arg4), NUM2INT(arg5))); ++ return INT2NUM(mvwaddnstr(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), StringValuePtr(arg4), NUM2INT(arg5))); + } + static VALUE rbncurs_mvwaddstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4) { +- return INT2NUM(mvwaddstr(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), STR2CSTR(arg4))); ++ return INT2NUM(mvwaddstr(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), StringValuePtr(arg4))); + } + #ifdef HAVE_MVWCHGAT + static VALUE rbncurs_mvwchgat(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4, VALUE arg5, VALUE arg6, VALUE arg7) { +@@ -1171,10 +1171,10 @@ + return INT2NUM(mvwinsch(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), NUM2ULONG(arg4))); + } + static VALUE rbncurs_mvwinsnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4, VALUE arg5) { +- return INT2NUM(mvwinsnstr(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), STR2CSTR(arg4), NUM2INT(arg5))); ++ return INT2NUM(mvwinsnstr(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), StringValuePtr(arg4), NUM2INT(arg5))); + } + static VALUE rbncurs_mvwinsstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4) { +- return INT2NUM(mvwinsstr(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), STR2CSTR(arg4))); ++ return INT2NUM(mvwinsstr(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), StringValuePtr(arg4))); + } + #ifdef HAVE_MVWVLINE + static VALUE rbncurs_mvwvline(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4, VALUE arg5) { +@@ -1238,7 +1238,7 @@ + } + #ifdef HAVE_PUTP + static VALUE rbncurs_putp(VALUE dummy, VALUE arg1) { +- return INT2NUM(putp(STR2CSTR(arg1))); ++ return INT2NUM(putp(StringValuePtr(arg1))); + } + #endif + #ifdef HAVE_QIFLUSH +@@ -1271,12 +1271,12 @@ + } + #ifdef HAVE_SCR_DUMP + static VALUE rbncurs_scr_dump(VALUE dummy, VALUE arg1) { +- return INT2NUM(scr_dump(STR2CSTR(arg1))); ++ return INT2NUM(scr_dump(StringValuePtr(arg1))); + } + #endif + #ifdef HAVE_SCR_INIT + static VALUE rbncurs_scr_init(VALUE dummy, VALUE arg1) { +- return INT2NUM(scr_init(STR2CSTR(arg1))); ++ return INT2NUM(scr_init(StringValuePtr(arg1))); + } + #endif + static VALUE rbncurs_scrl(VALUE dummy, VALUE arg1) { +@@ -1290,12 +1290,12 @@ + } + #ifdef HAVE_SCR_RESTORE + static VALUE rbncurs_scr_restore(VALUE dummy, VALUE arg1) { +- return INT2NUM(scr_restore(STR2CSTR(arg1))); ++ return INT2NUM(scr_restore(StringValuePtr(arg1))); + } + #endif + #ifdef HAVE_SCR_SET + static VALUE rbncurs_scr_set(VALUE dummy, VALUE arg1) { +- return INT2NUM(scr_set(STR2CSTR(arg1))); ++ return INT2NUM(scr_set(StringValuePtr(arg1))); + } + #endif + static VALUE rbncurs_setscrreg(VALUE dummy, VALUE arg1, VALUE arg2) { +@@ -1352,7 +1352,7 @@ + return INT2NUM(slk_restore()); + } + static VALUE rbncurs_slk_set(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) { +- return INT2NUM(slk_set(NUM2INT(arg1), STR2CSTR(arg2), NUM2INT(arg3))); ++ return INT2NUM(slk_set(NUM2INT(arg1), StringValuePtr(arg2), NUM2INT(arg3))); + } + static VALUE rbncurs_slk_touch(VALUE dummy) { + return INT2NUM(slk_touch()); +@@ -1383,17 +1383,17 @@ + } + #ifdef HAVE_TIGETFLAG + static VALUE rbncurs_tigetflag(VALUE dummy, VALUE arg1) { +- return INT2NUM(tigetflag(STR2CSTR(arg1))); ++ return INT2NUM(tigetflag(StringValuePtr(arg1))); + } + #endif + #ifdef HAVE_TIGETNUM + static VALUE rbncurs_tigetnum(VALUE dummy, VALUE arg1) { +- return INT2NUM(tigetnum(STR2CSTR(arg1))); ++ return INT2NUM(tigetnum(StringValuePtr(arg1))); + } + #endif + #ifdef HAVE_TIGETSTR + static VALUE rbncurs_tigetstr(VALUE dummy, VALUE arg1) { +- return rb_str_new2(tigetstr(STR2CSTR(arg1))); ++ return rb_str_new2(tigetstr(StringValuePtr(arg1))); + } + #endif + static VALUE rbncurs_timeout(VALUE dummy, VALUE arg1) { +@@ -1438,10 +1438,10 @@ + return return_value; + } + static VALUE rbncurs_waddnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) { +- return INT2NUM(waddnstr(get_window(arg1), STR2CSTR(arg2), NUM2INT(arg3))); ++ return INT2NUM(waddnstr(get_window(arg1), StringValuePtr(arg2), NUM2INT(arg3))); + } + static VALUE rbncurs_waddstr(VALUE dummy, VALUE arg1, VALUE arg2) { +- return INT2NUM(waddstr(get_window(arg1), STR2CSTR(arg2))); ++ return INT2NUM(waddstr(get_window(arg1), StringValuePtr(arg2))); + } + static VALUE rbncurs_wattron(VALUE dummy, VALUE arg1, VALUE arg2) { + return INT2NUM(wattron(get_window(arg1), NUM2INT(arg2))); +@@ -1514,10 +1514,10 @@ + return INT2NUM(winsertln(get_window(arg1))); + } + static VALUE rbncurs_winsnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) { +- return INT2NUM(winsnstr(get_window(arg1), STR2CSTR(arg2), NUM2INT(arg3))); ++ return INT2NUM(winsnstr(get_window(arg1), StringValuePtr(arg2), NUM2INT(arg3))); + } + static VALUE rbncurs_winsstr(VALUE dummy, VALUE arg1, VALUE arg2) { +- return INT2NUM(winsstr(get_window(arg1), STR2CSTR(arg2))); ++ return INT2NUM(winsstr(get_window(arg1), StringValuePtr(arg2))); + } + static VALUE rbncurs_wmove(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) { + return INT2NUM(wmove(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3))); +@@ -1619,7 +1619,7 @@ + { return rb_str_new2(unctrl(NUM2ULONG(ch))); } + static VALUE rbncurs_newterm(VALUE dummy, VALUE rb_type, VALUE rb_outfd, VALUE rb_infd) + { +- char * type = (rb_type == Qnil) ? (char*)0 : STR2CSTR(rb_type); ++ char * type = (rb_type == Qnil) ? (char*)0 : StringValuePtr(rb_type); + int outfd = NUM2INT(rb_funcall(rb_outfd, rb_intern("to_i"), 0)); + int infd = NUM2INT(rb_funcall(rb_infd, rb_intern("to_i"), 0)); + VALUE rb_screen = +@@ -2277,7 +2277,7 @@ + #ifdef HAVE_MCPRINT + static VALUE rbncurs_mcprint(VALUE dummy, VALUE data, VALUE len) + { +- return INT2NUM(mcprint(STR2CSTR(data), NUM2INT(len))); ++ return INT2NUM(mcprint(StringValuePtr(data), NUM2INT(len))); + } + #endif + #ifdef HAVE_HAS_KEY +@@ -2378,9 +2378,9 @@ + " and a String"); + return Qnil; + } ++ VALUE tmp = rb_funcall3(rb_mKernel, rb_intern("sprintf"), argc-1, argv + 1); + wprintw(get_window(argv[0]), "%s", +- STR2CSTR(rb_funcall3(rb_mKernel, rb_intern("sprintf"), argc-1, +- argv + 1))); ++ StringValuePtr(tmp)); + return Qnil; + } + +@@ -2394,14 +2394,14 @@ + return Qnil; + } + _tracef("%s", +- STR2CSTR(rb_funcall3(rb_mKernel, rb_intern("sprintf"), argc, argv))); ++ StringValuePtr(funcall3(rb_mKernel, rb_intern("sprintf"), argc, argv))); + return Qnil; + } + #endif /* HAVE__TRACEF */ + #ifdef HAVE__TRACEDUMP + static VALUE rbncurs_tracedump(VALUE dummy, VALUE rb_label, VALUE rb_win) + { +- _tracedump(STR2CSTR(rb_label), get_window(rb_win)); ++ _tracedump(StringValuePtr(rb_label), get_window(rb_win)); + } + #endif /* HAVE__TRACEDUMP */ + #ifdef HAVE__TRACEATTR +@@ -2706,7 +2706,7 @@ + + #ifdef HAVE_LOCALE_H + static VALUE rbncurs_setlocale(VALUE dummy, VALUE category, VALUE locale) +-{ return rb_str_new2(setlocale(NUM2INT(category), STR2CSTR(locale)));} ++{ return rb_str_new2(setlocale(NUM2INT(category), StringValuePtr(locale)));} + #endif + + static void init_safe_functions(void) diff -r 346b104468cc -r 250bddc4f896 ruby-ncurses/stuff/Werror-format-security.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ruby-ncurses/stuff/Werror-format-security.patch Mon Jun 23 01:50:31 2014 +0300 @@ -0,0 +1,12 @@ +diff -Naur ncurses-ruby-1.3.1/form_wrap.c ncurses-ruby-1.3.1.format/form_wrap.c +--- ncurses-ruby-1.3.1/form_wrap.c 2014-02-03 11:31:39.049867878 +0100 ++++ ncurses-ruby-1.3.1.format/form_wrap.c 2014-02-03 11:44:37.001008654 +0100 +@@ -1132,7 +1132,7 @@ + char msg[500]; + snprintf(msg, 500, "The validation functions for this field type need %d additional arguments.",(int)(NUM2INT(argc)-1)); + msg[499]=0; +- rb_raise(rb_eArgError, msg); ++ rb_raise(rb_eArgError, "%s", msg); + } + } + } diff -r 346b104468cc -r 250bddc4f896 ruby-ncurses/stuff/ruby-ncurses-fix-missing-tz-prototypes.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ruby-ncurses/stuff/ruby-ncurses-fix-missing-tz-prototypes.patch Mon Jun 23 01:50:31 2014 +0300 @@ -0,0 +1,34 @@ +From d3e59724601b2aabb231f2e12e16ebf00ba79ab1 Mon Sep 17 00:00:00 2001 +From: Caleb Marble +Date: Sun, 2 Mar 2014 13:53:05 -0600 +Subject: [PATCH] modified: ext/ncurses/ncurses_wrap.h +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Fixes the following compiler error: + +ext/ncurses/ncurses_wrap.c: In function ‘rbncurshelper_nonblocking_wgetch’: +ext/ncurses/ncurses_wrap.c:807:12: error: variable ‘tz’ has initializer but incomplete type + struct timezone tz = {0,0}; + +Also closes #6 +--- + ncurses_wrap.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/ncurses_wrap.h b/ncurses_wrap.h +index 85da4f8..92583c0 100644 +--- a/ncurses_wrap.h ++++ b/ncurses_wrap.h +@@ -84,6 +84,7 @@ int close(int); + #endif + + #include ++#include + + extern VALUE mNcurses; /* module Ncurses */ + extern VALUE cWINDOW; /* class Ncurses::WINDOW */ +-- +1.9.1 + diff -r 346b104468cc -r 250bddc4f896 tpp/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tpp/receipt Mon Jun 23 01:50:31 2014 +0300 @@ -0,0 +1,37 @@ +# SliTaz package receipt. + +PACKAGE="tpp" +VERSION="1.3.1" +CATEGORY="utilities" +SHORT_DESC="Text presentation program." +MAINTAINER="paul@slitaz.org" +DEPENDS="ruby ruby-ncurses ncurses" +TARBALL="$PACKAGE-$VERSION.tar.gz" +WEB_SITE="http://www.ngolde.de/tpp.html" +WGET_URL="http://www.ngolde.de/download/$TARBALL" + +# Rules to configure and make the package. +compile_rules() +{ + cd $src + # use debian patches and fixes + patch -i ../../stuff/ruby19.patch + patch -i ../../stuff/optional-x.patch + cd examples + for tppfile in *.tpp; do + iconv -f ISO-8859-1 -t UTF-8 -o $tppfile.new $tppfile && \ + touch -r $tppfile $tppfile.new && \ + mv $tppfile.new $tppfile + done + cd .. + # make DESTDIR=$DESTDIR install +} + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr/bin $fs/usr/share/doc/tpp/examples + install $src/tpp.rb $fs/usr/bin/tpp + install -m644 $src/examples/* $fs/usr/share/doc/tpp/examples +} + diff -r 346b104468cc -r 250bddc4f896 tpp/stuff/optional-x.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tpp/stuff/optional-x.patch Mon Jun 23 01:50:31 2014 +0300 @@ -0,0 +1,51 @@ +Description: Don't execute commands with --exec by default +Author: Axel Beckert +Debian-Bug: 706644 + +Index: tpp/tpp.rb +=================================================================== +--- tpp.orig/tpp.rb 2013-06-12 22:13:55.000000000 +0200 ++++ tpp/tpp.rb 2013-06-12 22:15:08.000000000 +0200 +@@ -725,9 +725,13 @@ + end + + def do_exec(cmdline) +- rc = Kernel.system(cmdline) +- if not rc then +- # @todo: add error message ++ if $execok then ++ rc = Kernel.system(cmdline) ++ if not rc then ++ # @todo: add error message ++ end ++ else ++ @screen.addstr("--exec disabled by default for security reasons. Use option -x to enable it.") + end + end + +@@ -1683,6 +1687,7 @@ + $stderr.puts "\t -t \tset filetype as output format" + $stderr.puts "\t -o \twrite output to file " + $stderr.puts "\t -s \twait seconds between slides (with -t autoplay)" ++ $stderr.puts "\t -x\t\tallow parsing of --exec in input files" + $stderr.puts "\t --version\tprint the version" + $stderr.puts "\t --help\t\tprint this help" + $stderr.puts "\n\t currently available types: ncurses (default), autoplay, latex, txt" +@@ -1699,6 +1704,7 @@ + output = nil + type = "ncurses" + time = 1 ++$execok = nil + + skip_next = false + +@@ -1720,6 +1726,8 @@ + elsif ARGV[i] == "-s" then + time = ARGV[i+1].to_i + skip_next = true ++ elsif ARGV[i] == "-x" then ++ $execok = 1 + elsif input == nil then + input = ARGV[i] + end + diff -r 346b104468cc -r 250bddc4f896 tpp/stuff/ruby19.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tpp/stuff/ruby19.patch Mon Jun 23 01:50:31 2014 +0300 @@ -0,0 +1,294 @@ +Description: make key events work on ruby 1.9 +Author: Chad Fowler +Debian-Bug: 671530 + +Index: tpp/tpp.rb +=================================================================== +--- tpp.orig/tpp.rb 2013-06-12 18:13:40.000000000 +0200 ++++ tpp/tpp.rb 2013-06-12 21:05:55.000000000 +0200 +@@ -44,7 +44,7 @@ + "blue" => 5, + "cyan" => 6, + "magenta" => 7, +- "black" => 8, ++ "black" => 8, + "default" =>-1} + colors[color] + end +@@ -95,7 +95,7 @@ + end # class FileParser + + +-# Represents a page (aka `slide') in TPP. A page consists of a title and one or ++# Represents a page (aka `slide') in TPP. A page consists of a title and one or + # more lines. + class Page + +@@ -145,8 +145,8 @@ + + + +-# Implements a generic visualizer from which all other visualizers need to be +-# derived. If Ruby supported abstract methods, all the do_* methods would be ++# Implements a generic visualizer from which all other visualizers need to be ++# derived. If Ruby supported abstract methods, all the do_* methods would be + # abstract. + class TppVisualizer + +@@ -154,8 +154,8 @@ + # nothing + end + +- # Splits a line into several lines, where each of the result lines is at most +- # _width_ characters long, caring about word boundaries, and returns an array ++ # Splits a line into several lines, where each of the result lines is at most ++ # _width_ characters long, caring about word boundaries, and returns an array + # of strings. + def split_lines(text,width) + lines = [] +@@ -190,13 +190,13 @@ + $stderr.puts "Error: TppVisualizer#do_footer has been called directly." + Kernel.exit(1) + end +- ++ + def do_header(header_text) + $stderr.puts "Error: TppVisualizer#do_header has been called directly." + Kernel.exit(1) + end + +- ++ + def do_refresh + $stderr.puts "Error: TppVisualizer#do_refresh has been called directly." + Kernel.exit(1) +@@ -316,7 +316,7 @@ + $stderr.puts "Error: TppVisualizer#do_command_prompt has been called directly." + Kernel.exit(1) + end +- ++ + def do_beginslideright + $stderr.puts "Error: TppVisualizer#do_beginslideright has been called directly." + Kernel.exit(1) +@@ -377,7 +377,7 @@ + Kernel.exit(1) + end + +- # Receives a _line_, parses it if necessary, and dispatches it ++ # Receives a _line_, parses it if necessary, and dispatches it + # to the correct method which then does the correct processing. + # It returns whether the controller shall wait for input. + def visualize(line,eop) +@@ -446,10 +446,10 @@ + do_huge(figlet_text) + when /^--footer / + @footer_txt = line.sub(/^--footer /,"") +- do_footer(@footer_txt) ++ do_footer(@footer_txt) + when /^--header / + @header_txt = line.sub(/^--header /,"") +- do_header(@header_txt) ++ do_header(@header_txt) + when /^--title / + title = line.sub(/^--title /,"") + do_title(title) +@@ -547,7 +547,7 @@ + @withborder = true + draw_border + end +- ++ + def do_command_prompt() + message = "Press any key to continue :)" + cursor_pos = 0 +@@ -614,11 +614,11 @@ + (@termwidth-2).times { @screen.addstr("-") }; @screen.addstr("'") + 1.upto(@termheight-3) do |y| + @screen.move(y,0) +- @screen.addstr("|") ++ @screen.addstr("|") + end + 1.upto(@termheight-3) do |y| + @screen.move(y,@termwidth-1) +- @screen.addstr("|") ++ @screen.addstr("|") + end + end + +@@ -700,7 +700,7 @@ + end + + def show_help_page +- help_text = [ "tpp help", ++ help_text = [ "tpp help", + "", + "space bar ............................... display next entry within page", + "space bar, cursor-down, cursor-right .... display next page", +@@ -775,7 +775,7 @@ + @screen.move(@termheight - 3, (@termwidth - footer_txt.length)/2) + @screen.addstr(footer_txt) + end +- ++ + def do_header(header_txt) + @screen.move(@termheight - @termheight+1, (@termwidth - header_txt.length)/2) + @screen.addstr(header_txt) +@@ -918,7 +918,7 @@ + time_to_sleep = 1.to_f / 20 + Kernel.sleep(time_to_sleep) + xcount -= 1 +- end ++ end + when "right" + (@termwidth - @indent).times do |pos| + @screen.move(@cur_line,@termwidth - pos - 1) +@@ -991,7 +991,7 @@ + @screen.move(line,col*15 + 2) + if current_page == i then + @screen.printw("%2d %s <=",i+1,pages[i].title[0..80]) +- else ++ else + @screen.printw("%2d %s",i+1,pages[i].title[0..80]) + end + line += 1 +@@ -1092,7 +1092,7 @@ + + def do_footer(footer_text) + end +- ++ + def do_header(header_text) + end + +@@ -1166,7 +1166,7 @@ + + def do_revon + end +- ++ + def do_command_prompt + end + def do_revoff +@@ -1183,7 +1183,7 @@ + + def do_endslide + end +- ++ + def do_beginslideright + end + +@@ -1349,7 +1349,7 @@ + + end + +-# Implements an interactive controller which feeds the visualizer until it is ++# Implements an interactive controller which feeds the visualizer until it is + # told to stop, and then reads a key press and executes the appropiate action. + class InteractiveController < TppController + +@@ -1396,17 +1396,17 @@ + loop do + ch = @vis.get_key + case ch +- when 'q'[0], 'Q'[0] # 'Q'uit ++ when ?q.ord, ?Q.ord # 'Q'uit + return +- when 'r'[0], 'R'[0] # 'R'edraw slide ++ when ?r.ord, ?R.ord # 'R'edraw slide + changed_page = true # @todo: actually implement redraw +- when 'e'[0], 'E'[0] ++ when ?e.ord, ?E.ord + @cur_page = @pages.size - 1 + break +- when 's'[0], 'S'[0] ++ when ?s.ord, ?S.ord + @cur_page = 0 + break +- when 'j'[0], 'J'[0] # 'J'ump to slide ++ when ?j.ord, ?J.ord # 'J'ump to slide + screen = @vis.store_screen + p = @vis.read_newpage(@pages,@cur_page) + if p >= 0 and p < @pages.size +@@ -1417,28 +1417,28 @@ + @vis.restore_screen(screen) + end + break +- when 'l'[0], 'L'[0] # re'l'oad current file ++ when ?l.ord, ?L.ord # re'l'oad current file + @reload_file = true + return +- when 'c'[0], 'C'[0] # command prompt ++ when ?c.ord, ?C.ord # command prompt + screen = @vis.store_screen + @vis.do_command_prompt + @vis.clear + @vis.restore_screen(screen) +- when '?'[0], 'h'[0] ++ when ??.ord, ?h.ord + screen = @vis.store_screen + @vis.show_help_page + ch = @vis.get_key + @vis.clear + @vis.restore_screen(screen) +- when :keyright, :keydown, ' '[0] ++ when :keyright, :keydown, ' '.ord + if @cur_page + 1 < @pages.size and eop then + @cur_page += 1 + @pages[@cur_page].reset_eop + @vis.new_page + end + break +- when 'b'[0], 'B'[0], :keyleft, :keyup ++ when ?b.ord, ?B.ord, :keyleft, :keyup + if @cur_page > 0 then + @cur_page -= 1 + @pages[@cur_page].reset_eop +@@ -1455,7 +1455,7 @@ + end + + +-# Implements a visualizer which converts TPP source to a nicely formatted text ++# Implements a visualizer which converts TPP source to a nicely formatted text + # file which can e.g. be used as handout. + class TextVisualizer < TppVisualizer + +@@ -1475,7 +1475,7 @@ + + def do_footer(footer_text) + end +- ++ + def do_header(header_text) + end + +@@ -1539,7 +1539,7 @@ + + def do_revon + end +- ++ + def do_command_prompt + end + def do_revoff +@@ -1556,7 +1556,7 @@ + + def do_endslide + end +- ++ + def do_beginslideright + end + +@@ -1650,8 +1650,8 @@ + + end + +-# Implements a non-interactive controller to control non-interactive +-# visualizers (i.e. those that are used for converting TPP source code into ++# Implements a non-interactive controller to control non-interactive ++# visualizers (i.e. those that are used for converting TPP source code into + # another format) + class ConversionController < TppController +