From d5c18ba44a4f85c742fc4c0d03914ae52698a2ea Mon Sep 17 00:00:00 2001 From: Viktor Jancik Date: Wed, 2 Sep 2015 14:16:31 +0200 Subject: [PATCH 1/3] Fixed licensing and displaying of nonascii characters #1257516 #1241543 --- less.csh | 7 ++++++- less.sh | 4 +++- less.spec | 40 ++++++++++++++++++++-------------------- lesspipe.sh | 6 ++++-- 4 files changed, 33 insertions(+), 24 deletions(-) diff --git a/less.csh b/less.csh index ba2b82b..13e4f3a 100755 --- a/less.csh +++ b/less.csh @@ -1,4 +1,9 @@ +#!/bin/csh # less initialization script (csh) if ( -x /usr/bin/lesspipe.sh ) then - setenv LESSOPEN "||/usr/bin/lesspipe.sh %s" + if ( $?LESSOPEN && { eval 'test ! -z "$LESSOPEN"' } ) then + : + else + setenv LESSOPEN "|/usr/bin/lesspipe.sh %s" + endif endif diff --git a/less.sh b/less.sh index 14f6fde..9a6d64e 100755 --- a/less.sh +++ b/less.sh @@ -1,2 +1,4 @@ # less initialization script (sh) -[ -x /usr/bin/lesspipe.sh ] && export LESSOPEN="${LESSOPEN-||/usr/bin/lesspipe.sh %s}" +if [ -x /usr/bin/lesspipe.sh ] && [ -z "$LESSOPEN" ]; then + export LESSOPEN="|/usr/bin/lesspipe.sh %s" +fi diff --git a/less.spec b/less.spec index 1a2a19b..e37d20f 100644 --- a/less.spec +++ b/less.spec @@ -1,14 +1,14 @@ Summary: A text file browser similar to more, but better Name: less Version: 479 -Release: 1%{?dist} -License: GPLv3+ +Release: 2%{?dist} +License: GPLv3+ or BSD Group: Applications/Text Source: http://www.greenwoodsoftware.com/less/%{name}-%{version}.tar.gz Source1: lesspipe.sh Source2: less.sh Source3: less.csh -Patch1: less-444-Foption.v2.patch +Patch1: less-444-Foption.v2.patch Patch2: less-394-search.patch Patch4: less-394-time.patch Patch5: less-418-fsync.patch @@ -20,6 +20,7 @@ Patch10: less-458-lesskey-usage.patch Patch11: less-458-old-bot-in-help.patch URL: http://www.greenwoodsoftware.com/less/ Requires: groff-base +Requires: man-db BuildRequires: ncurses-devel BuildRequires: autoconf automake libtool @@ -45,37 +46,36 @@ files, and you'll use it frequently. %patch9 -p1 -b .less-filters-man %patch10 -p1 -b .lesskey-usage %patch11 -p1 -b .old-bot -chmod -R a+w * -chmod 644 *.c *.h LICENSE README -rm -f ./configure -autoreconf -fiv %build +rm -f ./configure +autoreconf -fiv %configure -make CC="gcc $RPM_OPT_FLAGS -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" datadir=%{_docdir} +make %{?_smp_mflags} CFLAGS="%{optflags} -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" %install -rm -rf $RPM_BUILD_ROOT -make DESTDIR=$RPM_BUILD_ROOT install +%make_install mkdir -p $RPM_BUILD_ROOT/etc/profile.d -install -p -c -m 755 %{SOURCE1} $RPM_BUILD_ROOT/%{_bindir} -install -p -c -m 644 %{SOURCE2} $RPM_BUILD_ROOT/etc/profile.d -install -p -c -m 644 %{SOURCE3} $RPM_BUILD_ROOT/etc/profile.d -ls -la $RPM_BUILD_ROOT/etc/profile.d +install -p %{SOURCE1} $RPM_BUILD_ROOT/%{_bindir} +install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT/etc/profile.d +install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT/etc/profile.d +install -p -m 644 %{SOURCE4} $RPM_BUILD_ROOT/etc/profile.d %files -%defattr(-,root,root,-) -%{!?_licensedir:%global license %%doc} -%license LICENSE +%doc README NEWS INSTALL +%license LICENSE COPYING /etc/profile.d/* %{_bindir}/* %{_mandir}/man1/* -%clean -rm -rf $RPM_BUILD_ROOT - %changelog +* Wed Sep 2 2015 Viktor Jancik - 479-2 +- Updated spec file to comply with current Fedora Packaging Guidelines + Added missing documentation files +- Fixed less profile.d scripts (#1254837) +- Fixed preprocessing of man pages with special characters (#1241543) + * Tue Jul 07 2015 Fedora Release Monitoring - 479-1 - Update to 479 (#1240456) diff --git a/lesspipe.sh b/lesspipe.sh index a2c319a..682f09e 100755 --- a/lesspipe.sh +++ b/lesspipe.sh @@ -30,6 +30,8 @@ if [ -x ~/.lessfilter ]; then fi fi +export MAN_KEEP_FORMATTING=1 + case "$1" in *.[1-9n].bz2|*.[1-9]x.bz2|*.man.bz2|*.[1-9n].[gx]z|*.[1-9]x.[gx]z|*.man.[gx]z|*.[1-9n].lzma|*.[1-9]x.lzma|*.man.lzma) case "$1" in @@ -38,12 +40,12 @@ case "$1" in *.xz|*.lzma) DECOMPRESSOR="xz -dc" ;; esac if [ -n "$DECOMPRESSOR" ] && $DECOMPRESSOR -- "$1" | file - | grep -q troff; then - $DECOMPRESSOR -- "$1" | groff -Tascii -mandoc - + $DECOMPRESSOR -- "$1" | man -P cat -l - exit $? fi ;;& *.[1-9n]|*.[1-9]x|*.man) if file "$1" | grep -q troff; then - groff -Tascii -mandoc "$1" | cat -s + man -P cat -l "$1" exit $? fi ;;& *.tar) tar tvvf "$1"; exit $? ;; From 286626f4a6d4b1f493119a78faf2771f43019761 Mon Sep 17 00:00:00 2001 From: Viktor Jancik Date: Wed, 2 Sep 2015 14:25:52 +0200 Subject: [PATCH 2/3] Fixed typo in less.spec --- less.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/less.spec b/less.spec index e37d20f..8b77c2e 100644 --- a/less.spec +++ b/less.spec @@ -60,7 +60,6 @@ mkdir -p $RPM_BUILD_ROOT/etc/profile.d install -p %{SOURCE1} $RPM_BUILD_ROOT/%{_bindir} install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT/etc/profile.d install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT/etc/profile.d -install -p -m 644 %{SOURCE4} $RPM_BUILD_ROOT/etc/profile.d %files %doc README NEWS INSTALL From b97dc37fd18bb60d94140902a8350ff27ef56d98 Mon Sep 17 00:00:00 2001 From: Viktor Jancik Date: Fri, 2 Oct 2015 13:37:02 +0200 Subject: [PATCH 3/3] Update to 481, fixes (#1231493) --- .gitignore | 1 + less-394-search.patch | 32 ---------------------------- less-458-outdated-unicode-data.patch | 12 ----------- less.spec | 9 ++++---- sources | 2 +- 5 files changed, 7 insertions(+), 49 deletions(-) delete mode 100644 less-394-search.patch delete mode 100644 less-458-outdated-unicode-data.patch diff --git a/.gitignore b/.gitignore index 0e8ce99..563e44e 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /less-471.tar.gz /less-478.tar.gz /less-479.tar.gz +/less-481.tar.gz diff --git a/less-394-search.patch b/less-394-search.patch deleted file mode 100644 index 909d1b4..0000000 --- a/less-394-search.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- less-394/line.c.search 2005-12-03 21:20:32.000000000 +0100 -+++ less-394/line.c 2006-02-15 11:23:25.308694376 +0100 -@@ -1125,6 +1125,14 @@ - break; - } - } -+ if (c == '\0') -+ { -+ /* -+ * Pretend the line ended here -+ */ -+ new_pos = ch_tell(); -+ break; -+ } - linebuf[n++] = c; - c = ch_forw_get(); - } -@@ -1198,6 +1206,14 @@ - *to = *fm; - n = size_linebuf - old_size_linebuf; - } -+ if (c == '\0') -+ { -+ /* -+ * Pretend the line ended here -+ */ -+ new_pos = ch_tell() + 1; -+ break; -+ } - linebuf[--n] = c; - } - if (linep != NULL) diff --git a/less-458-outdated-unicode-data.patch b/less-458-outdated-unicode-data.patch deleted file mode 100644 index b0697fa..0000000 --- a/less-458-outdated-unicode-data.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -pruN less-458.orig/charset.c less-458/charset.c ---- less-458.orig/charset.c 2013-04-05 01:55:05.000000000 +0900 -+++ less-458/charset.c 2014-03-10 19:47:09.850026052 +0900 -@@ -970,7 +970,7 @@ static struct wchar_range ubin_table[] = - { 0x2064, 0x2069} /* Cn */, - { 0x206A, 0x206F} /* Cf */, - { 0x2072, 0x2073} /* Cn */, { 0x208F, 0x208F} /* Cn */, -- { 0x2095, 0x209F} /* Cn */, { 0x20B6, 0x20CF} /* Cn */, -+ { 0x2095, 0x209F} /* Cn */, { 0x20BB, 0x20CF} /* Cn */, - { 0x20F0, 0x20FF} /* Cn */, { 0x214F, 0x2152} /* Cn */, - { 0x2185, 0x218F} /* Cn */, { 0x23E8, 0x23FF} /* Cn */, - { 0x2427, 0x243F} /* Cn */, { 0x244B, 0x245F} /* Cn */, diff --git a/less.spec b/less.spec index 8b77c2e..0408c36 100644 --- a/less.spec +++ b/less.spec @@ -1,7 +1,7 @@ Summary: A text file browser similar to more, but better Name: less -Version: 479 -Release: 2%{?dist} +Version: 481 +Release: 1%{?dist} License: GPLv3+ or BSD Group: Applications/Text Source: http://www.greenwoodsoftware.com/less/%{name}-%{version}.tar.gz @@ -9,7 +9,6 @@ Source1: lesspipe.sh Source2: less.sh Source3: less.csh Patch1: less-444-Foption.v2.patch -Patch2: less-394-search.patch Patch4: less-394-time.patch Patch5: less-418-fsync.patch Patch6: less-436-manpage-add-old-bot-option.patch @@ -37,7 +36,6 @@ files, and you'll use it frequently. %prep %setup -q %patch1 -p2 -b .Foption -%patch2 -p1 -b .search %patch4 -p1 -b .time %patch5 -p1 -b .fsync %patch6 -p1 -b .manpage-add-old-bot-option @@ -69,6 +67,9 @@ install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT/etc/profile.d %{_mandir}/man1/* %changelog +* Fri Oct 2 2015 Viktor Jancik - 481-1 +- Update to version 481, fixes #1231493 + * Wed Sep 2 2015 Viktor Jancik - 479-2 - Updated spec file to comply with current Fedora Packaging Guidelines Added missing documentation files diff --git a/sources b/sources index da68519..b9f3fe7 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -049f51ccfe2686009c6ce943eeb4bbaf less-479.tar.gz +50ef46065c65257141a7340123527767 less-481.tar.gz