Name:		bash-completion
Version:	2.1
Release:	2%{?_dist_release}
License:	GPLv2+
Group:		System Environment/Shells
URL:            http://bash-completion.alioth.debian.org/
Source0:	%{name}-%{version}.tar.bz2
Source3:	%{name}-2.0-redefine_filedir.bash
Patch0:		%{name}-1.99-noblacklist.patch
BuildRoot:	%{_tmppath}/%{name}-%{version}-root
Distribution:	Vine Linux
Vendor:		Project Vine
Packager:	TANAKA hiroaki<mosaicist@jcom.home.ne.jp

Summary:	Programmable completion for Bash
Summary(ja):	bash のプログラム可能な補完拡張

BuildArch:      noarch

# Dependency

%description
bash-completion is a collection of shell functions that take advantage of
the programmable completion feature of bash.

%description -l ja
bash-completion は bash のプログラム可能な補完機能を利用し、
高機能な補完機能を bash に提供するシェル関数集です。

使用にあたっては ~/.bashrc に以下の行を追加してください。
. /etc/profile.d/bash_completion.sh


%prep
%setup -q
%patch0 -p1


%build
%configure
%{__make} %{?_smp_mflags}


%install
%{__rm} -rf ${RPM_BUILD_ROOT}
%{__make} install DESTDIR=${RPM_BUILD_ROOT}

#remove for vine
rm $RPM_BUILD_ROOT%{_datadir}/bash-completion/completions/{cowsay,cowthink}
%if "%{?_dist_release}" >= "vl7"
rm $RPM_BUILD_ROOT%{_datadir}/bash-completion/completions/nmcli
%endif

install -Dpm 644 %{SOURCE3} \
	$RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d/redefine_filedir

%clean
%{__rm} -rf ${RPM_BUILD_ROOT}


%files
%defattr(-,root,root)
%doc AUTHORS COPYING README
%config %{_sysconfdir}/profile.d/bash_completion.sh
%{_sysconfdir}/bash_completion.d/
%{_datadir}/bash-completion/
%{_datadir}/pkgconfig/bash-completion.pc

%changelog
* Fri Dec 27 2013 TANAKA hiroaki <mosaicist@jcom.home.ne.jp> 2.1-2
- rebuild with gcc-4.8

* Sun May 28 2013 TANAKA hiroaki mosaicist@jcom.home.ne.jp > 2.1-1
- source update
- Don't install nmcli completion >= Vine7

* Wed Jul 25 2012 TANAKA hiroaki mosaicist@jcom.home.ne.jp > 2.0-1
- source update
- merge bash-completion-2.0-redefine_filedir.bash from bash-completion-2.0-1.fc17

* Tue Feb  7 2012 TANAKA hiroaki <mosaicist@par.odn.ne.jp> 1.99-1
- initial build for Vine Linux based on bash-completion-1.99-1.fc17.src.rpm