Accepting request 283466 from shells

- Enable tcsh checks but be aware that this can not be done in parallel
- Backup tcsh-6.15.00-blanks.dif away before update a working copy

- 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/283466
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/tcsh?expand=0&rev=53
This commit is contained in:
Dominique Leuenberger 2015-02-01 11:29:49 +00:00 committed by Git OBS Bridge
commit 7a6afea8ae
3 changed files with 89 additions and 94 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,18 @@
-------------------------------------------------------------------
Fri Jan 30 13:15:39 UTC 2015 - werner@suse.de
- Enable tcsh checks but be aware that this can not be done in parallel
- Backup tcsh-6.15.00-blanks.dif away before update a working copy
-------------------------------------------------------------------
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

145
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,12 @@ 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: autoconf
BuildRequires: ncurses-devel
BuildRequires: screen
Requires: gawk
Requires: textutils
Recommends: tcsh-lang = %{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@ -53,36 +52,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 +95,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 +111,42 @@ 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
#
# requires a working terminal on stdin
# make check
make %{?_smp_mflags}
%check
SCREENDIR=$(mktemp -d ${PWD}/screen.XXXXXXXXXX) || exit 1
SCREENRC=${SCREENDIR}/tcsh
TMPDIR=$(mktemp -d /tmp/tcsh.XXXXXXXXXX) || exit 1
export SCREENRC SCREENDIR TMPDIR
exec 0< /dev/null
SCREENLOG=${SCREENDIR}/log
cat > $SCREENRC<<-EOF
deflogin off
logfile $SCREENLOG
logfile flush 1
logtstamp off
log on
setsid on
scrollback 0
silence on
utf8 on
EOF
> $SCREENLOG
tail -q -s 0.5 -f $SCREENLOG & pid=$!
env -i HOME=$HOME TERM=$TERM TMPDIR=$TMPDIR \
SCREENRC=$SCREENRC SCREENDIR=$SCREENDIR \
screen -L -D -m make check
sleep 1
kill -TERM $pid
rm -rf $SCREENDIR $TMPDIR
%install
rm -rf $RPM_BUILD_ROOT
for nls in nls/*.cat ; do
msg=$nls
nls=${nls##*/}
@ -156,41 +162,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