Accepting request 396672 from home:sbrabec:branches:shells

- Split doc build into a separate spec file. It makes possible to
  build package in two stages and prevent build loop.

OBS-URL: https://build.opensuse.org/request/show/396672
OBS-URL: https://build.opensuse.org/package/show/shells/bash-completion?expand=0&rev=74
This commit is contained in:
Dr. Werner Fink 2016-08-03 14:01:00 +00:00 committed by Git OBS Bridge
parent 1d0440fe8b
commit a4b7ed9962
5 changed files with 525 additions and 7 deletions

337
bash-completion-doc.changes Normal file
View File

@ -0,0 +1,337 @@
-------------------------------------------------------------------
Wed May 18 18:40:09 CEST 2016 - sbrabec@suse.com
- Split doc build into a separate spec file. It makes possible to
build package in two stages and prevent build loop.
-------------------------------------------------------------------
Wed May 18 13:40:01 UTC 2016 - werner@suse.de
- Split off sub packages devel and doc to avoid dependency cycles
-------------------------------------------------------------------
Wed Apr 27 20:34:12 CEST 2016 - sbrabec@suse.com
- Remove completions conflicting with util-linux (boo#977259#c3).
-------------------------------------------------------------------
Wed Apr 27 12:42:50 UTC 2016 - werner@suse.de
- Add patch sh-script-completion-boo977336.patch to make _filedir
work with COMP_FILEDIR_FALLBACK even if local directries exists
this is for bug boo##977336
-------------------------------------------------------------------
Wed Apr 27 11:54:07 UTC 2016 - werner@suse.de
- Add documentation for this packages below to get the reference
of the e.g. the variable COMP_FILEDIR_FALLBACK (boo#977336)
-------------------------------------------------------------------
Wed Jan 27 15:42:34 UTC 2016 - werner@suse.de
- Add patch backticks-bsc963140.patch to handle sub commands
which will be expanded by backticks (bsc#963140)
-------------------------------------------------------------------
Fri Dec 18 09:33:05 UTC 2015 - werner@suse.de
- Add patch respect-variables-boo940837.patch to avoid completions
which results in e.g. ls \$HO
- Add patch rm-completion-smart-boo958462.patch to allow completions
list e.g. rm prefix*.jpg<TAB><TAB>
- Modify patch LVM-completion-bsc946875.patch that is add the
new patch from Liuhua Wang
-------------------------------------------------------------------
Wed Sep 23 11:58:33 UTC 2015 - werner@suse.de
- Add patch LVM-completion-bsc946875.patch to make LVM comands
work even without any scan happen (bsc#946875)
-------------------------------------------------------------------
Thu Aug 13 06:53:15 UTC 2015 - werner@suse.de
- Add patch backtick-completion-boo940835.patch to allow correct
backtick completion (boo#940835)
-------------------------------------------------------------------
Wed Aug 12 13:17:40 UTC 2015 - werner@suse.de
- Correct typo in patch ls-completion-boo889319.patch
-------------------------------------------------------------------
Mon Jun 15 08:28:30 UTC 2015 - werner@suse.de
- Add patch ls-completion-boo889319.patch to make ls completion
more smart (boo#889319)
-------------------------------------------------------------------
Wed Mar 18 12:45:23 UTC 2015 - werner@suse.de
- Port my dollar completion from /etc/profile.d/completion.bash to
bash_completion which modifies FOO-dir-completion-boo905348.patch
- Avoid negative cword position counter (boo#922758), this adds
the patch init-completion-boo922758.patch
-------------------------------------------------------------------
Mon Nov 17 12:46:11 UTC 2014 - werner@suse.de
- Add patch PS1-completion-boo903362.patch to avoid trouble if
restricted characters of the shell are used in PS1 like
exclamation mark (boo#903362).
- Add patch FOO-dir-completion-boo905348.patch to expand variables
which value is actual a directory to avoid excaped dollar sign
(boo#905348).
-------------------------------------------------------------------
Mon May 13 07:08:49 UTC 2013 - werner@suse.de
- Add patch pushd-completion-bnc818365.patch for bnc#818365 -- bash
completion for builtin command "pushd" is missing
-------------------------------------------------------------------
Tue Apr 23 15:42:50 UTC 2013 - werner@suse.de
- Do not ship NetworManager completion file as it is part of NM
-------------------------------------------------------------------
Tue Apr 23 14:17:43 UTC 2013 - werner@suse.de
- Update to final 2.1 version
+ See CHANGES for the full list of changes
- Add patch bash-completion-2.1.patch to avoid blanks after during
file completion (bnc#717151)
-------------------------------------------------------------------
Fri Apr 19 17:11:24 UTC 2013 - fcrozat@suse.com
- Do no ship udevadm completion file, it is now part of systemd
package.
-------------------------------------------------------------------
Sat Jul 7 12:20:53 UTC 2012 - reddwarf@opensuse.org
- Update to final 2.0 version
+ See CHANGES for the full list of changes
- Add pkg-config file
-------------------------------------------------------------------
Mon Jan 9 10:26:25 UTC 2012 - vuntz@opensuse.org
- Update to version 1.99:
+ New completions: ccache, desktop-file-validate, htop, iperf,
koji, lzip, nethogs, plague-client, udevadm.
+ Fixes for completions: cc, cppcheck, curl, c++, dequote, dict,
dmesg, dpkg, lrzip, make, mount, mutt, pidof, removepkg, rpm,
umount, upgradepkg, vi, wine, xv.
+ See details in CHANGES.
-------------------------------------------------------------------
Wed Nov 30 15:09:57 CET 2011 - tiwai@suse.de
- Update to version 1.90:
- new completions: epdfview, lpr, lpq, mysql, puppet, pkgtool,
makepkg, rmp2tgz, slapt-get, slapt-src, slackpkg, kcov, feh,
xgamma, fbi, fbgs sbopkg, a2x, arping, asciidoc, base64, cal,
chrpath, cppcheck, curl, dmesg, dot, file, gnome-mplayer, gprof,
hddtemp, host, htpasswd, idn, ionice, jps, lbunzip2, lbzip2,
lbzcat, prelink, protoc, pwdx, pwgen, reptyr, sum, watch,
phing, pinfo
- installed location changed to /usr/share/bash-completion/*
- see more changes in CHANGES file
-------------------------------------------------------------------
Sat Sep 17 19:13:18 UTC 2011 - jengelh@medozas.de
- Remove redundant tags/sections from specfile
- Use %_smp_mflags for parallel build
-------------------------------------------------------------------
Fri Feb 25 08:30:09 UTC 2011 - poletti.marco@gmail.com
- Update to version 1.3:
+ Added completions for: badblocks, compgen, crontab, dumpe2fs,
e2freefrag, e2label, ether-wake, filefrag, gendiff, growisofs,
hping{,3} (the previous version already completed hping2),
iftop, ip, iscsiadm, javaws, kid3, lrzip, lsof, mktemp,
perldoc, portecle, POSIX sh, postgresql,
sha{,224,256,384,512}sum, sysbench, tune2fs, xfreerdp, xmodmap,
xm subcommands and xrdb.
+ Improve the completions for: autotools, /etc/init.d/*, ipmitool,
jar, java, javadoc, MAC address, man, mencoder, mkdir, mplayer,
okular, pack200, povray, python, rpm, rpmbuild, sqlite3, tar,
unzip, users/groups (in various contexts), wodim, xine-based
players and xmllint.
+ Fix the completions for: avahi-browse, IPv6 known hosts,
kompare, muttrc, p4, povray and ~username (in various
contexts).
+ Other changes
-------------------------------------------------------------------
Thu Jan 13 10:13:48 CET 2011 - vuntz@opensuse.org
- Add bash-completion-fix-service.patch to fix an error created by
the "service" completion.
-------------------------------------------------------------------
Fri Jan 7 14:06:29 UTC 2011 - poletti.marco@gmail.com
- Update to version 1.2.
* Add new completions.
* Many improvements and fixes to existing completions.
* Completely drop support for bash < 3.
-------------------------------------------------------------------
Tue Oct 20 14:23:47 CEST 2009 - poletti.marco@gmail.com
- Update to version 1.1, that supports bash 4.0 better
* Split many completions in files under contrib/
* Added new completions
* Improved existing completions
-------------------------------------------------------------------
Mon Oct 5 11:32:39 CEST 2009 - vuntz@opensuse.org
- Update to version 1.0 (too many changes to list).
- Remove all our patches except bash-completion-speedup_rpm.patch:
+ bash-completion-bzip2_fix.patch: should be fixed upstream.
+ bash-completion-cd.patch: doesn't seem to be needed.
+ bash-completion-complete_spm.patch: source rpms are now src.rpm
as far as I can tell, so no need to complete on spm.
+ bash-completion-mount_dir_fix.patch: the fix is not correct. It
should not be for root only. bnc#386459 should be forwarded
upstream for a proper fix.
+ bash-completion-no_tilde_expansion.patch: I'm unsure we want
to diverge there. bnc#386844 should be forwarded upstream for a
proper fix.
+ bash-completion-readonly_fix.patch: this is now fixed upstream,
I think.
+ bash-completion-svn_filenames.patch: fixed upstream.
+ bash_completion-rpm_install_complete.patch: I'm really not sure
the fix is right. bnc#242123 should be forwarded upstream.
- Respin bash-completion-speedup_rpm.patch.
- Remove the git completion: it's now in git itself.
-------------------------------------------------------------------
Tue Nov 11 16:25:46 CET 2008 - werner@suse.de
- Make completion for cd command smart (bnc#442827)
-------------------------------------------------------------------
Fri Sep 26 16:29:52 CEST 2008 - mkoenig@suse.de
- fix problem with readonly vars [bnc#383486]
- speed up rpm completion [bnc#402659]
- complete on .spm [bnc#416901]
-------------------------------------------------------------------
Tue May 6 15:37:54 CEST 2008 - mkoenig@suse.de
- remove default tilde expansion, as this should be configurable
by the expand-tilde readline setting, even with bash-completion
installed [bnc#386844]
-------------------------------------------------------------------
Mon May 5 16:12:47 CEST 2008 - mkoenig@suse.de
- fix mount completion for root [bnc#386459]
-------------------------------------------------------------------
Tue Apr 22 16:30:44 CEST 2008 - mkoenig@suse.de
- use -o filenames for svn completion [bnc#382280]
- add empty %build section
-------------------------------------------------------------------
Fri Jun 1 16:38:39 CEST 2007 - mkoenig@suse.de
- fix bzip2 completion to handle filenames with spaces [#278608]
-------------------------------------------------------------------
Thu Mar 8 12:51:15 CET 2007 - mkoenig@suse.de
- enhance rpm completion [#242123]
-------------------------------------------------------------------
Thu Feb 15 11:43:10 CET 2007 - mkoenig@suse.de
- add git-completion
- add %clean target to specfile
- only install really useful completions by default
-------------------------------------------------------------------
Wed Feb 7 13:23:19 CET 2007 - mkoenig@suse.de
- update to version 20060301
* There were probable bash 3.1 POSIX quote problems if
UserKnownHostsFile or GlobalKnownHostsFile keywords were used
inside ssh config files. Fixed.
* Added new subversion completion implementation
* Added minicom completion
* --nodigest and --nosignature options must be set in $nodig and
$nosig within _rpm_installed_packages() itself, not just set
in _rpm() before _rpm_installed_packages() is called. This is
because other completion functions also call
_rpm_installed_packages().
* Minor playmidi and timidity additions for .MID(I)
(capital letters) files.
* Add kdvi, dvipdf and advi to programs that complete on .dvi
files
* iconv completion improvement
* Replace invoke-rc.d completion
- move useful completion files to /etc/bash_completion.d/
-------------------------------------------------------------------
Wed Jan 25 21:45:51 CET 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
-------------------------------------------------------------------
Tue Aug 2 13:35:20 CEST 2005 - cthiel@suse.de
- Update to version 20050721.
-------------------------------------------------------------------
Mon Mar 7 11:46:48 CET 2005 - agruen@suse.de
- Update to version 20050121.
-------------------------------------------------------------------
Tue Sep 21 20:01:03 CEST 2004 - agruen@suse.de
- Update to version 20040711. Drop obsolete patches.
-------------------------------------------------------------------
Mon Feb 23 16:27:44 CET 2004 - hmacht@suse.de
- added option # norootforbuild in specfile
-------------------------------------------------------------------
Thu Sep 18 15:48:32 CEST 2003 - agruen@suse.de
- #30648: fix insmod tab completion regexp quoting bug.
-------------------------------------------------------------------
Wed Sep 3 14:53:08 CEST 2003 - agruen@suse.de
- rschiele@uni-mannheim.de: bash_completion searches lsmod in
/sbin, but it is in /bin now.
-------------------------------------------------------------------
Mon Jul 28 18:26:44 CEST 2003 - agruen@suse.de
- Remove /etc/bash_completion.d/ directory from files list: This
directory is now "owned" by bash. (We still must create an
/etc directory in the build root, though.)
-------------------------------------------------------------------
Fri Jul 25 15:38:35 CEST 2003 - agruen@suse.de
- Mark /usr/share/doc/packages/bash-completion/ as owned by that
package (RPMv4 complained about that).
-------------------------------------------------------------------
Thu Jul 24 15:40:01 CEST 2003 - agruen@suse.de
- Create initial package.

101
bash-completion-doc.spec Normal file
View File

@ -0,0 +1,101 @@
#
# spec file for package bash-completion-doc
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: bash-completion-doc
%define _name bash-completion
# WARNING: Never edit this file!!! Edit bash-completion.spec and call pre_checkin.sh to update bash-completion-doc.spec.
# Always set %%build_doc to 0 before submit to OBS.
Version: 2.1
Release: 0
Summary: The Documentation of Programmable Completion for Bash
License: GPL-2.0+
Group: Development/Libraries/C and C++
Url: http://bash-completion.alioth.debian.org/
Source0: http://bash-completion.alioth.debian.org/files/%{_name}-%{version}.tar.bz2
Source1: bash-completion-rpmlintrc
# PATCH-FIX-UPSTREAM bnc#717151 -- Terminal tab autocompletion error
Patch0: %{_name}-%{version}.patch
# PATCH-PATCH-EXTEND-OPENSUSE bnc#818365 -- bash completion for builtin command "pushd" is missing
Patch1: pushd-completion-bnc818365.patch
# PATCH-FIX-SUSE bnc#903362 -- tab completion for file names prints error
Patch2: PS1-completion-boo903362.patch
# PATCH-FIX-SUSE boo#905348 -- tab completion with shell variable changes command line with backslash
Patch3: FOO-dir-completion-boo905348.patch
# PATCH-FIX-SUSE boo#922758 -- avoid negative cword position counter
Patch4: init-completion-boo922758.patch
# PATCH-FIX-SUSE boo#889319
Patch5: ls-completion-boo889319.patch
# PATCH-FIX-SUSE boo#940835
Patch6: backtick-completion-boo940835.patch
# PATCH-FIX-SUSE bsc#946875
Patch7: LVM-completion-bsc946875.patch
# PATCH-FIX-SUSE boo#940837, bsc#959299
Patch8: respect-variables-boo940837.patch
# PATCH-FIX-SUSE boo#958462
Patch9: rm-completion-smart-boo958462.patch
# PATCH-FIX-SUSE boo#963140
Patch10: backticks-bsc963140.patch
# PATCH-FIX-SUSE boo#977336
Patch11: sh-script-completion-boo977336.patch
BuildRequires: asciidoc
BuildRequires: libxslt-tools
BuildRequires: pkg-config
Provides: bash-completion:%{_defaultdocdir}/%{_name}/AUTHORS
%description
This package contains the package documentation file of the
package bash-completion.
%prep
%setup -q -n %{_name}-%{version}
%patch0 -b .p0
%patch1 -b .p1
%patch2 -b .p2
%patch3 -b .p3
%patch4 -b .p4
%patch5 -b .p5
%patch6 -b .p6
%patch7 -b .p7 -p1
%patch8 -b .p8
%patch9 -b .p9
%patch10 -b .p10 -p1
%patch11 -b .p11 -p0
%build
%configure
pushd doc
mkdir html
a2x -D html -d book -f xhtml --asciidoc-opts="--unsafe" main.txt
popd
%install
pushd doc
mkdir -p %{buildroot}%{_defaultdocdir}/%{_name}/html
install -m 0644 html/* %{buildroot}%{_defaultdocdir}/%{_name}/html/
popd
install -m 0644 AUTHORS %{buildroot}%{_defaultdocdir}/%{_name}/
install -m 0644 README %{buildroot}%{_defaultdocdir}/%{_name}/
%files
%defattr(-,root,root)
%dir %{_defaultdocdir}/%{_name}
%{_defaultdocdir}/%{_name}/AUTHORS
%{_defaultdocdir}/%{_name}/README
%{_defaultdocdir}/%{_name}/html/
%changelog

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed May 18 18:40:09 CEST 2016 - sbrabec@suse.com
- Split doc build into a separate spec file. It makes possible to
build package in two stages and prevent build loop.
-------------------------------------------------------------------
Wed May 18 13:40:01 UTC 2016 - werner@suse.de

View File

@ -17,6 +17,11 @@
Name: bash-completion
# WARNING: After editing this file please call pre_checkin.sh to update bash-completion-doc.spec.
# Do not change %%build_core.
%define build_core 1
# Always set %%build_doc to 0 before submit to OBS.
%define build_doc 0
Version: 2.1
Release: 0
Summary: Programmable Completion for Bash
@ -49,13 +54,18 @@ Patch9: rm-completion-smart-boo958462.patch
Patch10: backticks-bsc963140.patch
# PATCH-FIX-SUSE boo#977336
Patch11: sh-script-completion-boo977336.patch
%if %build_doc
BuildRequires: asciidoc
BuildRequires: libxslt-tools
%endif %build_doc
BuildRequires: pkg-config
%if %build_core
Requires: bash
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%if %build_core
%description
bash-completion is a collection of shell functions that take advantage
of the programmable completion feature of Bash 2.04 and later.
@ -69,6 +79,8 @@ Provides: bash-completion:%{_datadir}/pkgconfig/bash-completion.pc
This package contains the package configuration file of the
package bash-completion.
%endif %build_core
%if %build_doc
%package doc
Summary: The Documentation of Programmable Completion for Bash
Group: Development/Libraries/C and C++
@ -78,6 +90,7 @@ Provides: bash-completion:%{_defaultdocdir}/%{name}/AUTHORS
This package contains the package documentation file of the
package bash-completion.
%endif %build_doc
%prep
%setup -q
%patch0 -b .p0
@ -95,21 +108,19 @@ package bash-completion.
%build
%configure
%if %build_core
make %{?_smp_mflags}
%endif %build_core
%if %build_doc
pushd doc
mkdir html
a2x -D html -d book -f xhtml --asciidoc-opts="--unsafe" main.txt
popd
%endif %build_doc
%install
%if %build_core
%make_install
pushd doc
mkdir -p %{buildroot}%{_defaultdocdir}/%{name}/html
install -m 0644 html/* %{buildroot}%{_defaultdocdir}/%{name}/html/
popd
install -m 0644 AUTHORS %{buildroot}%{_defaultdocdir}/%{name}/
install -m 0644 README %{buildroot}%{_defaultdocdir}/%{name}/
# shipping in latest systemd now
rm -vf %{buildroot}%{_datadir}/bash-completion/completions/udevadm
rm -vf %{buildroot}%{_datadir}/bash-completion/completions/nmcli
@ -128,24 +139,45 @@ rm -vf %{buildroot}%{_datadir}/bash-completion/completions/renice
rm -vf %{buildroot}%{_datadir}/bash-completion/completions/rtcwake
rm -vf %{buildroot}%{_datadir}/bash-completion/completions/su
rm -vf %{buildroot}%{_datadir}/bash-completion/completions/umount
%endif %build_core
%if %build_doc
pushd doc
mkdir -p %{buildroot}%{_defaultdocdir}/%{name}/html
install -m 0644 html/* %{buildroot}%{_defaultdocdir}/%{name}/html/
popd
install -m 0644 AUTHORS %{buildroot}%{_defaultdocdir}/%{name}/
install -m 0644 README %{buildroot}%{_defaultdocdir}/%{name}/
%endif %build_doc
%if %build_core
%files
%defattr(-,root,root)
%doc COPYING
%if %build_doc
%exclude %{_defaultdocdir}/%{name}/AUTHORS
%exclude %{_defaultdocdir}/%{name}/README
%exclude %{_defaultdocdir}/%{name}/html/
%endif %build_doc
%{_datadir}/bash-completion
%config %{_sysconfdir}/profile.d/bash_completion.sh
%files devel
%defattr(-,root,root)
%{_datadir}/pkgconfig/bash-completion.pc
# TRICK: bash-completion-devel does not require bash-completion.
# It would cause failure of directory ownership check.
# Own this directory to prevent it.
%dir %{_datadir}/bash-completion
%endif %build_core
%if %build_doc
%files doc
%defattr(-,root,root)
%dir %{_defaultdocdir}/%{name}
%{_defaultdocdir}/%{name}/AUTHORS
%{_defaultdocdir}/%{name}/README
%{_defaultdocdir}/%{name}/html/
%endif %build_doc
%changelog

42
pre_checkin.sh Normal file
View File

@ -0,0 +1,42 @@
#!/bin/sh
if test bash-completion.spec -ot bash-completion-doc.spec ; then
echo "bash-completion.spec is older than bash-completion-doc.spec. Please merge changes manually and call pre-checkin.sh again."
exit 1
fi
if test bash-completion.changes -ot bash-completion-doc.changes ; then
echo "bash-completion.changes is older than bash-completion-doc.changes. Please merge changes manually and call pre-checkin.sh again."
exit 1
fi
SUMMARY_DOC="$(sed -n '/^%package doc/,/^%description doc/{/^Summary:/p;}' bash-completion.spec)"
GROUP_DOC="$(sed -n '/^%package doc/,/^%description doc/{/^Group:/p;}' bash-completion.spec)"
sed '
s/spec file for package bash-completion/spec file for package bash-completion-doc/;
/^Name:/s/bash-completion/bash-completion-doc/;
s/WARNING: After editing this file please/WARNING: Never edit this file!!! Edit bash-completion.spec and/;
s/%{name}/%{_name}/g;
s@^Summary:.*$@'"$SUMMARY_DOC"'@
s@^Group:.*$@'"$GROUP_DOC"'@
/^%package doc/,/^%description doc/{/^Summary:/d;/^Group:/d;}
s/^%setup -q$/%setup -q -n %{_name}-%{version}/
/^# Do not change %%build_core./d
/## Always set %%build_doc/d
/^Name:/a %define _name bash-completion
/^%define build_core/d
/^%define build_doc/d
/^%if %build_core$/,/^%endif %build_core$/d
/^%if %build_doc$/d
/^%endif %build_doc$/d
/^%package doc$/d
s/^%\(description\|files\) doc$/%\1/
/^$/H
# Delete trailing dual empty line as it causes overwritting by spec formatter:
\:^%{_defaultdocdir}/%{_name}/html/:,/^%changelog/{/^$/H;/^$/D;\:^%{_defaultdocdir}/%{_name}/html/:a
}
' <bash-completion.spec >bash-completion-doc.spec
cp -a bash-completion.changes bash-completion-doc.changes
touch bash-completion.spec bash-completion.changes