commit d81cc74fc7565f0167a5fb9afeede64ada108145 Author: overweight <5324761+overweight@user.noreply.gitee.com> Date: Mon Sep 30 11:18:48 2019 -0400 Package init diff --git a/0000-tree-preserve-timestamps.patch b/0000-tree-preserve-timestamps.patch new file mode 100644 index 0000000..2e432a5 --- /dev/null +++ b/0000-tree-preserve-timestamps.patch @@ -0,0 +1,15 @@ +diff -up tree-1.6.0/Makefile.preserve-timestamps tree-1.6.0/Makefile +--- tree-1.6.0/Makefile.preserve-timestamps 2011-06-27 16:11:26.000000000 +0100 ++++ tree-1.6.0/Makefile 2011-06-27 16:12:36.394443602 +0100 +@@ -97,9 +97,9 @@ install: tree + install -d $(BINDIR) + install -d $(MANDIR) + if [ -e $(TREE_DEST) ]; then \ +- install $(TREE_DEST) $(BINDIR)/$(TREE_DEST); \ ++ install -p $(TREE_DEST) $(BINDIR)/$(TREE_DEST); \ + fi +- install doc/$(MAN) $(MANDIR)/$(MAN) ++ install -p doc/$(MAN) $(MANDIR)/$(MAN) + + distclean: + if [ -f tree.o ]; then rm *.o; fi diff --git a/0001-tree-args.patch b/0001-tree-args.patch new file mode 100644 index 0000000..5fa5dd2 --- /dev/null +++ b/0001-tree-args.patch @@ -0,0 +1,12 @@ +diff -up tree-1.6.0/tree.c.args tree-1.6.0/tree.c +--- tree-1.6.0/tree.c.args 2013-04-11 11:53:47.676572649 +0100 ++++ tree-1.6.0/tree.c 2013-04-11 11:56:10.962350448 +0100 +@@ -536,6 +536,8 @@ void usage(int n) + " --filelimit # Do not descend dirs with more than # files in them.\n" + " --timefmt Print and format time according to the format .\n" + " -o filename Output to file instead of stdout.\n" ++ " --du Print directory sizes.\n" ++ " --prune Prune empty directories from the output.\n" + " -------- File options ---------\n" + " -q Print non-printable characters as '?'.\n" + " -N Print non-printable characters as is.\n" diff --git a/0002-tree-dircolors-ec.patch b/0002-tree-dircolors-ec.patch new file mode 100644 index 0000000..bc05a9d --- /dev/null +++ b/0002-tree-dircolors-ec.patch @@ -0,0 +1,12 @@ +diff -up tree-1.6.0/color.c.dircolors-ec tree-1.6.0/color.c +--- tree-1.6.0/color.c.dircolors-ec 2013-07-09 13:29:19.431819355 +0100 ++++ tree-1.6.0/color.c 2013-07-09 13:29:48.820987889 +0100 +@@ -190,7 +190,7 @@ void parse_dir_colors() + if (!norm_flgs) norm_flgs = scopy("00"); + + if (!endcode) { +- sprintf(buf,"%s%s%s",leftcode,norm_flgs,rightcode); ++ sprintf(buf,"%s0%s",leftcode,rightcode); + endcode = scopy(buf); + } + diff --git a/0003-tree-size-field-len.patch b/0003-tree-size-field-len.patch new file mode 100644 index 0000000..dff3dcb --- /dev/null +++ b/0003-tree-size-field-len.patch @@ -0,0 +1,14 @@ +diff -up tree-1.7.0/tree.c.size-field-len tree-1.7.0/tree.c +--- tree-1.7.0/tree.c.size-field-len 2014-04-25 16:30:51.539046882 +0100 ++++ tree-1.7.0/tree.c 2014-04-25 16:32:20.098483921 +0100 +@@ -1247,8 +1247,8 @@ int psize(char *buf, off_t size) + + if (hflag || siflag) { + for (idx=size= (usize*usize); idx++,size/=usize); +- if (!idx) return sprintf(buf, " %4d", (int)size); +- else return sprintf(buf, ((size/usize) >= 10)? " %3.0f%c" : " %3.1f%c" , (float)size/(float)usize,unit[idx]); ++ if (!idx) return sprintf(buf, " %5d", (int)size); ++ else return sprintf(buf, ((size/usize) >= 10)? " %4.0f%c" : " %4.1f%c" , (float)size/(float)usize,unit[idx]); + } else return sprintf(buf, sizeof(off_t) == sizeof(long long)? " %11lld" : " %9ld", (long long int)size); + } + diff --git a/tree-1.7.0.tgz b/tree-1.7.0.tgz new file mode 100644 index 0000000..fa20916 Binary files /dev/null and b/tree-1.7.0.tgz differ diff --git a/tree.spec b/tree.spec new file mode 100644 index 0000000..26a7efa --- /dev/null +++ b/tree.spec @@ -0,0 +1,63 @@ +Name: tree +Version: 1.7.0 +Release: 17 +Summary: Tree file viewer tool +License: GPLv2+ +URL: http://mama.indstate.edu/users/ice/tree/ + +Source0: ftp://mama.indstate.edu/linux/tree/%{name}-%{version}.tgz + +Patch0: 0000-tree-preserve-timestamps.patch +Patch1: 0001-tree-args.patch +Patch2: 0002-tree-dircolors-ec.patch +Patch3: 0003-tree-size-field-len.patch + +BuildRequires: gcc git + +%description +Tree is a recursive directory listing command that produces a depth indented +listing of files, which is colorized ala dircolors if the LS_COLORS environment +variable is set and output is to tty. + + +%package help +Summary: Including man files for tree +Requires: man + +%description help +This contains man files for the using of tree. + +%prep +%autosetup -n %{name}-%{version} -p1 -S git + +#fix non-ASCII characters abnormal display +sed -e 's/LINUX/__linux__/' -i tree.c + +%build +%make_build CFLAGS="$RPM_OPT_FLAGS $(getconf LFS_CFLAGS)" LDFLAGS="$RPM_LD_FLAGS" + +%install +install -D -m 755 tree $RPM_BUILD_ROOT%{_bindir}/tree +install -D -m 644 doc/tree.1 $RPM_BUILD_ROOT%{_mandir}/man1/tree.1 + +%files +%license LICENSE +%doc README CHANGES +%{_bindir}/tree + +%files help +%{_mandir}/man1/* + +%changelog +* Wed Aug 21 2019 zhanghaibo - 1.7.0-17 +- Type:enhancemnet +- ID:NA +- SUG:NA +- DESCi:openEuler Debranding + +* Tue Aug 20 2019 huangzheng - 1.7.0-16 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC:rename patches +- Package init