debian/0000755000000000000000000000000011376647017007202 5ustar debian/watch.disable0000644000000000000000000000011011376646126011625 0ustar version=3 http://ftp.ivrix.org.il/pub/ivrix/src/cmdline/bidiv-(.*)\.tgz debian/changelog0000644000000000000000000000623111376647007011055 0ustar bidiv (1.5-4) unstable; urgency=low [ Baruch Even ] * Add Vcs-* fields [ Lior Kaplan ] * Update debian/copyright with some missing details (Closes: #458601) * Switch to dpkg-source 3.0 (quilt) format [ Tzafrir Cohen ] * Patch fribidi_019: Fix bidiv for fribidi 0.19 (Closes: #568130, #571351). * Add myself as uploader. * Standards version 3.8.4 (no change needed). * Correct path to license file in debian/copyright. * Missing ${misc:Depends} debhelper deps. * Patch hyphen_minus: hyphen/minus in man page (originally in diff). * Patch term_size_get: properly check terminal width (originally in diff). * Patch makefile: simple Makefile fixes (originally in diff). * Patch try_utf8_fix: if-def out a variable that is unused if TRY_UTF8 (originally in diff). * Patches cast_fix, type_fix: fix build warnings. -- Tzafrir Cohen Tue, 25 May 2010 07:06:07 +0300 bidiv (1.5-3) unstable; urgency=low * Update to Standards-Version 3.7.3, no changes needed * Switch to compat level 5, updated debhelper dependency as well * Disable the watch file, ivrix.org.il domain is down for an extended period of time (Closes: #449917) -- Baruch Even Sat, 29 Dec 2007 13:36:41 +0200 bidiv (1.5-2) unstable; urgency=low * Adjust makefile due to cdbs changes, cdbs overrides the LDFLAGS of the package thus depriving us from the output of `fribidi-config --libs`. Closes: #376470. * Update Standards-Version to 3.7.2, no changes needed. -- Baruch Even Mon, 3 Jul 2006 08:44:43 +0000 bidiv (1.5-1) unstable; urgency=low * New upstream version -- Baruch Even Sat, 7 Jan 2006 22:21:00 +0000 bidiv (1.4-6) unstable; urgency=medium * Apply patch by Shachar Raindel regarding insufficient memory allocation when handling Unicode strings. (Closes: #346386) * Fix man page error reported by Lintian. -- Lior Kaplan Sat, 7 Jan 2006 17:54:54 +0200 bidiv (1.4-5) unstable; urgency=low * Change maintainership to Debian-Hebrew group. * Add Lior Kaplan as Uploader. * Change standards-version to 3.6.2, no changes needed. -- Baruch Even Sat, 30 Jul 2005 20:57:26 +0100 bidiv (1.4-4) unstable; urgency=low * Rebuild against fribidi 0.10.4-6, 0.10.4-5 had the wrong shlibs file. (Closes: #278790) -- Baruch Even Thu, 28 Oct 2004 13:22:33 +0100 bidiv (1.4-3) unstable; urgency=low * Recompile to build with fixed libfribidi0 to work on 64 bit machines -- Baruch Even Wed, 27 Oct 2004 12:52:36 +0100 bidiv (1.4-2) unstable; urgency=low * Rebuild to have proper dependency on libfribidi0. * Fix some minor warnings in the code. * Update to latest policy version. * Change manpage to use correct escaping of minus-signs -- Baruch Even Mon, 11 Oct 2004 05:28:09 +0100 bidiv (1.4-1) unstable; urgency=low * Initial Release. * Get terminal size instead of using the fixed 80 or COLUMNS we now get the terminal size and fallback to COLUMNS. -- Baruch Even Tue, 31 Dec 2002 11:26:50 +0200 debian/patches/0000755000000000000000000000000011376647017010631 5ustar debian/patches/term_size_get0000644000000000000000000000301011376646117013406 0ustar Description: properly check terminal width Author: Baruch Even --- a/bidiv.c +++ b/bidiv.c @@ -32,6 +32,8 @@ #include #endif +#include "term.h" + char *progname; int width=80; @@ -235,23 +237,15 @@ int main(int argc, char *argv[]) { FILE *fp; - char *s; - int i,c; + int c; int status=0; /* TODO: get width from tty setup, COLUMNS variable, and/or command line option */ progname=argv[0]; - /* The COLUMNS variable (set by zsh and bash, for example) - overrides the default 'width'. - TODO: also try to read the column number directly from the tty. - */ - if((s=getenv("COLUMNS"))){ - i=atoi(s); - if(i>0) - width=i; - } + /* Read the size from the tty or the COLUMNS var, default to 80 otherwise */ + width = term_size_get(); #ifdef HAVE_LOCALE setlocale(LC_CTYPE, ""); --- /dev/null +++ b/term.h @@ -0,0 +1,9 @@ +#ifndef _TERM_H_ +#define _TERM_H_ + +/* Returns terminal size, attempt to get it from tty, COLUMNS or default to 80 + * otherwise + */ +int term_size_get(void); + +#endif --- /dev/null +++ b/term.c @@ -0,0 +1,22 @@ +#include +#include +#include +#include "term.h" + +int term_size_get(void) +{ + struct winsize win; + int cols; + char *col_str; + int err; + + err = ioctl(1, TIOCGWINSZ, (char *)&win); + if (err != -1 && win.ws_col > 0) + return win.ws_col; + + col_str = getenv("COLUMNS"); + if (!col_str || (cols = atoi(col_str)) <= 0 || cols == INT_MAX) + cols = 80; + + return cols; +} debian/patches/series0000644000000000000000000000011711376646117012045 0ustar try_utf8_fix makefile fribidi_019 hyphen_minus term_size_get type_fix cast_fix debian/patches/makefile0000644000000000000000000000227511376646117012337 0ustar Description: simple Makefile fixes Author: Baruch Even Various minor Makefile fixes. Not separating to patches, as to avoid a set of conflicting patches. * Have man pages reside under /usr/*share*/man . * Avoid using the names CFLAGS and LDFLAGS, as cdbs may override them (#376470). * Add the extra object term.c (should be part of patch term_size_get). * No stripping. --- bidiv-1.5.orig/Makefile +++ bidiv-1.5/Makefile @@ -1,28 +1,27 @@ PREFIX=/usr/local BIN_DIR=$(PREFIX)/bin -MAN_PATH=$(PREFIX)/man +MAN_PATH=$(PREFIX)/share/man CC_OPT_FLAGS=-O2 -Wall -CFLAGS= $(CC_OPT_FLAGS) $(DEFS) `fribidi-config --cflags` -LDFLAGS=`fribidi-config --libs` +PKG_CFLAGS= $(CC_OPT_FLAGS) $(DEFS) `fribidi-config --cflags` +PKG_LDFLAGS=`fribidi-config --libs` all: bidiv -bidiv: bidiv.o - $(CC) -o bidiv bidiv.o $(LDFLAGS) +bidiv: bidiv.o term.o + $(CC) -o bidiv bidiv.o term.o $(PKG_LDFLAGS) $(LDFLAGS) clean: - rm -f bidiv.o *~ + rm -f bidiv.o *~ bidiv term.o clobber: clean rm -f bidiv .c.o: - $(CC) -c $(CFLAGS) $< + $(CC) -c $(PKG_CFLAGS) $(CFLAGS) $< install: all - strip bidiv cp bidiv $(BIN_DIR) chmod 755 $(BIN_DIR)/bidiv cp bidiv.1 $(MAN_PATH)/man1/bidiv.1 debian/patches/hyphen_minus0000644000000000000000000000070311376646117013262 0ustar Description: Fix hyphen/minus confusion in man page Author: Baruch Even --- bidiv-1.5.orig/bidiv.1 +++ bidiv-1.5/bidiv.1 @@ -174,7 +174,7 @@ 2. man something | bidiv | less -(or groff -man -Tlatin1 something.1 |sed 's/.^H\\(.\\)/\\1/g' |../bidiv -w 65) +(or groff \-man \-Tlatin1 something.1 |sed 's/.^H\\(.\\)/\\1/g' |../bidiv \-w 65) .TP 3 3. set "bidiv" as a filter for your mail program (mutt, pine, etc.) for viewing debian/patches/fribidi_0190000644000000000000000000000334011376646117012555 0ustar Description: Fix building with fribidi 1.9 Author: أحمد المحمودي Bug-Debian: http://bugs.debian.org/568130 --- a/Makefile +++ b/Makefile @@ -4,8 +4,8 @@ MAN_PATH=$(PREFIX)/share/man CC_OPT_FLAGS=-O2 -Wall -PKG_CFLAGS= $(CC_OPT_FLAGS) $(DEFS) `fribidi-config --cflags` -PKG_LDFLAGS=`fribidi-config --libs` +PKG_CFLAGS= $(CC_OPT_FLAGS) $(DEFS) `pkg-config --cflags fribidi` +PKG_LDFLAGS=`pkg-config --libs fribidi` all: bidiv --- a/bidiv.c +++ b/bidiv.c @@ -141,8 +141,9 @@ bidiv(FILE *fp) */ if(c1<0x80||c1>0xbf){ ungetc(c1, fp); - unicode_in[len]= - fribidi_iso8859_8_to_unicode_c(c); + fribidi_charset_to_unicode( + FRIBIDI_CHAR_SET_ISO8859_8, + &c, 1, &unicode_in[len]); } else unicode_in[len]=((c & 037) << 6) + (c1 & 077); newline=0; @@ -153,8 +154,9 @@ bidiv(FILE *fp) In the future we will have a language option, which will control this (as well as the output encoding). */ - unicode_in[len]= - fribidi_iso8859_8_to_unicode_c(c); + fribidi_charset_to_unicode( + FRIBIDI_CHAR_SET_ISO8859_8, + &c, 1, &unicode_in[len]); #else in[len]=c; #endif @@ -206,11 +208,11 @@ bidiv(FILE *fp) rtl_line=0; if(out_utf8) - fribidi_unicode_to_utf8(unicode_out, len, - out); + fribidi_unicode_to_charset(FRIBIDI_CHAR_SET_UTF8, + unicode_out, len, out); else - fribidi_unicode_to_iso8859_8(unicode_out, len, - out); + fribidi_unicode_to_charset(FRIBIDI_CHAR_SET_ISO8859_8, + unicode_out, len, out); /* if rtl_line (i.e., base_dir is RL), and we didn't fill the entire width, we need to pad with spaces. Maybe in the future this should be an option. debian/patches/try_utf8_fix0000644000000000000000000000221511376646117013206 0ustar Description: if-def out a variable that is unused if TRY_UTF8. Author: Baruch Even --- a/bidiv.c +++ b/bidiv.c @@ -24,6 +24,7 @@ /* In the future, this should be done with autoconf */ #define HAVE_LOCALE +#define TRY_UTF8 #ifdef HAVE_LOCALE #include @@ -47,7 +48,10 @@ int out_utf8=0; void bidiv(FILE *fp) { - char *in, *out; +#ifndef TRY_UTF8 + char *in; +#endif + char *out; FriBidiChar *unicode_in, *unicode_out; int len, i, c; int rtl_line; @@ -62,7 +66,9 @@ bidiv(FILE *fp) */ int newline=1, newpara=1; +#ifndef TRY_UTF8 in=(char *)malloc(width+1); +#endif out=(char *)malloc(width*7+1); /* 7 is the maximum number of bytes in one UTF8 char? */ /* We use (width+1) not just width, to leave place for a double- @@ -101,7 +107,6 @@ bidiv(FILE *fp) option to bidiv. This is enabled when TRY_UTF8 is defined */ -#define TRY_UTF8 if((c=getc(fp))==EOF) break; else if(c=='\r'){ @@ -216,7 +221,9 @@ bidiv(FILE *fp) puts(out); } /* Free the memory we have allocated */ +#ifndef TRY_UTF8 free(in); +#endif free(out); free(unicode_in); free(unicode_out); debian/patches/type_fix0000644000000000000000000000150711376646117012406 0ustar Description: use proper enumerator type Author: Tzafrir Cohen --- a/bidiv.c +++ b/bidiv.c @@ -42,7 +42,7 @@ int width=80; change the base direction on every newline, and =2 means change it every paragraph (where a paragraph starts after a completely empty line. */ -FriBidiCharType base_dir=FRIBIDI_TYPE_N, prev_base_dir=FRIBIDI_TYPE_LTR; +FriBidiParType base_dir=FRIBIDI_TYPE_N, prev_base_dir=FRIBIDI_TYPE_LTR; int auto_basedir=2; int justify=1; int out_utf8=0; @@ -199,7 +199,7 @@ bidiv(FILE *fp) fribidi_log2vis(unicode_in, len, &base_dir, unicode_out, NULL, NULL, NULL); #else - FriBidiCharType tmp_dir=prev_base_dir; + FriBidiParType tmp_dir=prev_base_dir; fribidi_log2vis(unicode_in, len, &tmp_dir, unicode_out, NULL, NULL, NULL); rtl_line= (tmp_dir==FRIBIDI_TYPE_RTL); debian/patches/cast_fix0000644000000000000000000000117411376646117012357 0ustar Description: Hush a warning with a cast. Author: Tzafrir Cohen --- a/bidiv.c +++ b/bidiv.c @@ -145,7 +145,7 @@ bidiv(FILE *fp) ungetc(c1, fp); fribidi_charset_to_unicode( FRIBIDI_CHAR_SET_ISO8859_8, - &c, 1, &unicode_in[len]); + (char *)&c, 1, &unicode_in[len]); } else unicode_in[len]=((c & 037) << 6) + (c1 & 077); newline=0; @@ -158,7 +158,7 @@ bidiv(FILE *fp) as the output encoding). */ fribidi_charset_to_unicode( FRIBIDI_CHAR_SET_ISO8859_8, - &c, 1, &unicode_in[len]); + (char *)&c, 1, &unicode_in[len]); #else in[len]=c; #endif debian/docs0000644000000000000000000000002011376646126010045 0ustar README WHATSNEW debian/source/0000755000000000000000000000000011376647017010502 5ustar debian/source/format0000644000000000000000000000001411376646117011710 0ustar 3.0 (quilt) debian/compat0000644000000000000000000000000211376646126010400 0ustar 5 debian/dirs0000644000000000000000000000003311376646126010062 0ustar usr/bin usr/share/man/man1 debian/control0000644000000000000000000000162411376646126010610 0ustar Source: bidiv Section: text Priority: optional Maintainer: Debian Hebrew Packaging Team Uploaders: Baruch Even , Lior Kaplan , Shachar Shemesh , Tzafrir Cohen Build-Depends: debhelper (>> 5.0.0), cdbs, libfribidi-dev, pkg-config Standards-Version: 3.8.4 Vcs-Svn: svn://svn.debian.org/svn/debian-hebrew/pkg/bidiv Vcs-Browser: http://svn.debian.org/wsvn/debian-hebrew/pkg/bidiv Package: bidiv Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: BiDi viewer - command-line tool displaying logical Hebrew/Arabic bidiv is a simple utility for converting logical-Hebrew input to visual-Hebrew output. This is useful for reading Hebrew mail messages, viewing Hebrew texts, etc. It was written for Hebrew but Arabic (or other BiDi languages) should work equally well. debian/rules0000755000000000000000000000024711376646126010265 0ustar #!/usr/bin/make -f include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/makefile.mk DEB_MAKE_INSTALL_TARGET=install PREFIX=$(DEB_DESTDIR)/usr debian/copyright0000644000000000000000000000216511376646126011141 0ustar This package was debianized by Baruch Even on Tue, 31 Dec 2002 08:13:22 +0200. It was downloaded from ftp://ivrix.org.il/pub/ivrix/src/cmdline/bidiv Upstream Author: Nadav Har'El Copyright: Copyright (c) 2001-2006 Nadav Har'El License: This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA On Debian systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/GPL-3'.