Accepting request 281409 from home:scarabeus_iv:branches:shells

- Cleanup with spec-cleaner to order header data
- Use %lang_package macro to remove redundant stuff
- Drop unused patch tcsh-6.15.00-blanks.dif
- Run make with more threads
- Move the commented check to check section to silence rpmlint

OBS-URL: https://build.opensuse.org/request/show/281409
OBS-URL: https://build.opensuse.org/package/show/shells/tcsh?expand=0&rev=50
This commit is contained in:
Tomáš Chvátal 2015-01-30 12:43:05 +00:00 committed by Git OBS Bridge
parent 0bfdc5aa3e
commit 1c6ef5d8be
3 changed files with 57 additions and 93 deletions

View File

@ -1,23 +0,0 @@
--- sh.misc.c
+++ sh.misc.c 2008-10-06 13:58:56.389867280 +0000
@@ -185,8 +185,18 @@ saveblk(Char **v)
onewv = newv = xcalloc(blklen(v) + 1, sizeof(Char **));
- while (*v)
- *newv++ = Strsave(*v++);
+ while (*v) {
+ Char *__restrict__ l = *v;
+ do {
+ int c;
+ if (!l || ((c = TRM(*l)) != ' ' && c != '\t' && c != '\n'))
+ break; /* strip blanks */
+ l++;
+ } while (*l);
+ *newv++ = Strsave(l);
+ v++;
+ }
+
return (onewv);
}

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Thu Jan 15 14:18:41 UTC 2015 - tchvatal@suse.com
- Cleanup with spec-cleaner to order header data
- Use %lang_package macro to remove redundant stuff
- Drop unused patch tcsh-6.15.00-blanks.dif
- Run make with more threads
- Move the commented check to check section to silence rpmlint
-------------------------------------------------------------------
Tue Jan 13 17:03:12 UTC 2015 - werner@suse.de

118
tcsh.spec
View File

@ -17,25 +17,18 @@
Name: tcsh
BuildRequires: ncurses-devel
Url: http://www.tcsh.org/
Requires: gawk
Requires: textutils
%if %suse_version > 1020
Recommends: tcsh-lang = 6.18.00
%endif
Version: 6.18.01
Release: 0
Summary: The C SHell
License: BSD-3-Clause
Group: System/Shells
Url: http://www.tcsh.org/
Source: ftp.astron.com:/pub/tcsh/tcsh-6.18.01.tar.gz
Source2: bindkey.tcsh
Source3: complete.tcsh
Patch: tcsh-6.18.00.dif
Patch0: tcsh-6.18.00.dif
Patch1: tcsh-6.15.00-pipe.dif
Patch2: tcsh-6.16.00-norm-cmd.dif
Patch3: tcsh-6.15.00-blanks.dif
Patch4: tcsh-6.17.03-colorls.dif
Patch5: tcsh-6.17.06-dspmbyte.dif
Patch6: tcsh-6.17.10-catalogs.dif
@ -44,6 +37,10 @@ Patch8: tcsh-6.18.01-metakey.patch
# PATCH-FIX-SUSE add history file locking (bsc#901076)
Patch9: tcsh-6.18.00-history-file-locking.patch
Patch10: tcsh-6.18.01-history-merge.dif
BuildRequires: ncurses-devel
Requires: gawk
Requires: textutils
Recommends: tcsh-lang = %{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@ -53,36 +50,20 @@ interactive login shell and a shell script command processor. It
includes a command-line editor, programmable word completion, spelling
correction, a history mechanism, job control, and a C-like syntax.
Authors:
--------
Christos Zoulas <christos@deshaw.com>
Scott Krotz <krotz@mot.com>
%package -n tcsh-lang
Summary: Languages for package tcsh
Group: System/Localization
Provides: tcsh-lang = %{version}
Requires: tcsh = %{version}
%description -n tcsh-lang
Provides translations to the package tcsh
%lang_package
%prep
%setup
%patch1 -p0 -b .pipe
%patch2 -p0 -b .normcmd
### disabled for know, should work on os11.1 without
### %patch3 -p0 -b .blanks
%patch4 -p0 -b .colorls
%patch5 -p0 -b .dspmbyte
%patch6 -p0 -b .catalogs
%patch7 -p0 -b .blk_buf
%patch8 -p0 -b .metakey
%setup -q
%patch1 -b .pipe
%patch2 -b .normcmd
%patch4 -b .colorls
%patch5 -b .dspmbyte
%patch6 -b .catalogs
%patch7 -b .blk_buf
%patch8 -b .metakey
%patch9 -p1 -b .histlock
%patch10 -p0 -b .histmerg
%patch -b .0
%patch10 -b .histmerg
%patch0 -b .0
%build
cflags ()
@ -112,7 +93,7 @@ Provides translations to the package tcsh
set +o noclobber
}
CC=gcc
CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -DBUFSIZE=8192 -pipe"
CFLAGS="%{optflags} -D_GNU_SOURCE -DBUFSIZE=8192 -pipe"
cflags -ftree-loop-linear CFLAGS
cflags -Wl,-O2 LDFLAGS
cflags -Wl,--as-needed LDFLAGS
@ -128,19 +109,19 @@ Provides translations to the package tcsh
--bindir=/bin \
--sysconfdir=/etc \
--localstatedir=/var \
--sharedstatedir=%_datadir \
--infodir=%_infodir \
--mandir=%_mandir \
--libexecdir=/usr/%{_lib}/tcsh \
--sharedstatedir=%{_datadir} \
--infodir=%{_infodir} \
--mandir=%{_mandir} \
--libexecdir=%{_libdir}/tcsh \
--disable-rpath \
--with-gnu-ld
make
#
make %{?_smp_mflags}
%check
# requires a working terminal on stdin
# make check
#make check %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
for nls in nls/*.cat ; do
msg=$nls
nls=${nls##*/}
@ -156,41 +137,38 @@ Provides translations to the package tcsh
uk*) nls=uk_UA ;;
C) continue ;;
esac
dir=$RPM_BUILD_ROOT/usr/share/locale/${nls}/LC_MESSAGES
dir=%{buildroot}%{_datadir}/locale/${nls}/LC_MESSAGES
test ! -e ${dir}/tcsh || continue
mkdir -p -m 0755 $dir
install -m 0444 ${msg} ${dir}/tcsh
done
make DESTDIR=$RPM_BUILD_ROOT GENCAT='/usr/bin/gencat --new' install
make DESTDIR=$RPM_BUILD_ROOT GENCAT='/usr/bin/gencat --new' install.man
mkdir -p $RPM_BUILD_ROOT%{_docdir}/tcsh
install -m 0444 FAQ $RPM_BUILD_ROOT%{_docdir}/tcsh/FAQ.tcsh
mkdir -p $RPM_BUILD_ROOT/etc/profile.d/
mkdir -p $RPM_BUILD_ROOT/usr/bin
install -m 644 $RPM_SOURCE_DIR/bindkey.tcsh $RPM_BUILD_ROOT/etc/profile.d/
install -m 644 $RPM_SOURCE_DIR/complete.tcsh $RPM_BUILD_ROOT/etc/profile.d/
rm -f $RPM_BUILD_ROOT/bin/csh
rm -f $RPM_BUILD_ROOT/usr/bin/csh
rm -f $RPM_BUILD_ROOT/usr/bin/tcsh
rm -f $RPM_BUILD_ROOT%{_mandir}/man1/csh.*
rm -rf $RPM_BUILD_ROOT%{_datadir}/locale/C
ln -sf tcsh $RPM_BUILD_ROOT/bin/csh
ln -sf tcsh.1.gz $RPM_BUILD_ROOT%{_mandir}/man1/csh.1.gz
ln -sf ../../bin/tcsh $RPM_BUILD_ROOT/usr/bin/csh
ln -sf ../../bin/tcsh $RPM_BUILD_ROOT/usr/bin/tcsh
%clean
rm -rf $RPM_BUILD_ROOT
make DESTDIR=%{buildroot} GENCAT='%{_bindir}/gencat --new' install
make DESTDIR=%{buildroot} GENCAT='%{_bindir}/gencat --new' install.man
mkdir -p %{buildroot}%{_docdir}/tcsh
install -m 0444 FAQ %{buildroot}%{_docdir}/tcsh/FAQ.tcsh
mkdir -p %{buildroot}%{_sysconfdir}/profile.d/
mkdir -p %{buildroot}%{_prefix}/bin
install -m 644 $RPM_SOURCE_DIR/bindkey.tcsh %{buildroot}%{_sysconfdir}/profile.d/
install -m 644 $RPM_SOURCE_DIR/complete.tcsh %{buildroot}%{_sysconfdir}/profile.d/
rm -f %{buildroot}/bin/csh
rm -f %{buildroot}%{_bindir}/csh
rm -f %{buildroot}%{_bindir}/tcsh
rm -f %{buildroot}%{_mandir}/man1/csh.*
rm -rf %{buildroot}%{_datadir}/locale/C
ln -sf tcsh %{buildroot}/bin/csh
ln -sf tcsh.1.gz %{buildroot}%{_mandir}/man1/csh.1.gz
ln -sf ../../bin/tcsh %{buildroot}%{_bindir}/csh
ln -sf ../../bin/tcsh %{buildroot}%{_bindir}/tcsh
%files
%defattr(-,root,root)
%dir %{_docdir}/tcsh
/bin/csh
/bin/tcsh
%config /etc/profile.d/bindkey.tcsh
%config /etc/profile.d/complete.tcsh
/usr/bin/csh
/usr/bin/tcsh
%config %{_sysconfdir}/profile.d/bindkey.tcsh
%config %{_sysconfdir}/profile.d/complete.tcsh
%{_bindir}/csh
%{_bindir}/tcsh
%doc %{_docdir}/tcsh/FAQ.tcsh
%doc %{_mandir}/man1/csh.1.gz
%doc %{_mandir}/man1/tcsh.1.gz