diff --git a/less-418-fsync.patch b/less-418-fsync.patch new file mode 100644 index 0000000..5774bb2 --- /dev/null +++ b/less-418-fsync.patch @@ -0,0 +1,38 @@ +diff -ur less-418.orig/configure.ac less-418/configure.ac +--- less-418.orig/configure.ac 2008-12-22 07:10:44.000000000 -0500 ++++ less-418/configure.ac 2008-12-22 07:28:58.000000000 -0500 +@@ -203,6 +203,8 @@ + [Define HAVE_TIME_T if your system supports the "time_t" type.]) + AH_TEMPLATE([HAVE_STRERROR], + [Define HAVE_STRERROR if you have the strerror() function.]) ++AH_TEMPLATE([HAVE_FSYNC], ++ [Define HAVE_FSYNC if fsync() on a tty works.]) + AH_TEMPLATE([HAVE_FILENO], + [Define HAVE_FILENO if you have the fileno() macro.]) + AH_TEMPLATE([HAVE_ERRNO], +@@ -251,7 +253,7 @@ + + # Checks for library functions. + AC_TYPE_SIGNAL +-AC_CHECK_FUNCS([fsync popen _setjmp sigprocmask sigsetmask snprintf stat system fchmod]) ++AC_CHECK_FUNCS([popen _setjmp sigprocmask sigsetmask snprintf stat system fchmod]) + + # AC_CHECK_FUNCS may not work for inline functions, so test these separately. + AC_MSG_CHECKING(for memcpy) +@@ -298,6 +300,16 @@ + #endif], [static char *x; x = strerror(0);], + [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_STRERROR)], [AC_MSG_RESULT(no)]) + ++AC_MSG_CHECKING(for fsync) ++AC_TRY_RUN([ ++#include ++#include ++int main(void) ++{ ++ int fd = open("/dev/tty", O_RDWR); ++ return fsync(fd); ++}], [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FSYNC)], [AC_MSG_RESULT(no)]) ++ + AC_MSG_CHECKING(for sys_errlist) + AC_TRY_LINK(, [extern char *sys_errlist[]; static char **x; x = sys_errlist;], + [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYS_ERRLIST)], [AC_MSG_RESULT(no)]) diff --git a/less.spec b/less.spec index 35ed460..3fd46bd 100644 --- a/less.spec +++ b/less.spec @@ -1,7 +1,7 @@ Summary: A text file browser similar to more, but better Name: less Version: 424 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv3+ Group: Applications/Text Source: http://www.greenwoodsoftware.com/less/%{name}-%{version}.tar.gz @@ -10,11 +10,12 @@ Source2: less.sh Source3: less.csh Patch1: less-406-Foption.patch Patch4: less-394-time.patch +Patch5: less-418-fsync.patch URL: http://www.greenwoodsoftware.com/less/ Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: ncurses-devel BuildRequires: pcre-devel -BuildRequires: autoconf +BuildRequires: autoconf automake libtool %description The less utility is a text file browser that resembles more, but has @@ -30,6 +31,10 @@ files, and you'll use it frequently. %setup -q %patch1 -p1 -b .Foption %patch4 -p1 -b .time +%patch5 -p1 -b .fsync + +autoreconf + chmod -R a+w * chmod 644 lessecho.c lesskey.c version.c LICENSE @@ -58,6 +63,10 @@ ls -la $RPM_BUILD_ROOT/etc/profile.d rm -rf $RPM_BUILD_ROOT %changelog +* Tue Mar 17 2009 Zdenek Prikryl - 424-3 +- Added lzma support +- Added test if fsync produces EIVAL on tty + * Wed Feb 25 2009 Fedora Release Engineering - 424-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild diff --git a/lesspipe.sh b/lesspipe.sh index 0e66c33..a9d6dd0 100755 --- a/lesspipe.sh +++ b/lesspipe.sh @@ -25,6 +25,7 @@ lesspipe() { *.tar.bz2|*.tbz2) bzip2 -dc -- "$1" | tar tvvf - ;; *.[zZ]|*.gz) gzip -dc -- "$1" ;; *.bz2) bzip2 -dc -- "$1" ;; + *.lzma) lzma -c -d -- "$1" ;; *.zip) zipinfo -- "$1" ;; *.rpm) rpm -qpivl --changelog -- "$1" ;; *.cpi|*.cpio) cpio -itv < "$1" ;;