[mpc] Install bash completion in the correct place
Jamie Nguyen
jamielinux at fedoraproject.org
Sun Feb 24 09:41:42 UTC 2013
commit 6f607aad1ff6da083a604fa99f63a25b23e0c9a7
Author: Jamie Nguyen <j at jamielinux.com>
Date: Sun Feb 24 09:41:14 2013 +0000
Install bash completion in the correct place
mpc.spec | 36 ++++++++++++++++++++++++++----------
1 files changed, 26 insertions(+), 10 deletions(-)
---
diff --git a/mpc.spec b/mpc.spec
index c290088..5ca8cf5 100644
--- a/mpc.spec
+++ b/mpc.spec
@@ -1,7 +1,7 @@
Name: mpc
Summary: Command-line client for MPD
Version: 0.22
-Release: 3%{?dist}
+Release: 4%{?dist}
License: GPLv2+
Group: Applications/Multimedia
@@ -22,26 +22,42 @@ make %{?_smp_mflags}
%install
make install DESTDIR=$RPM_BUILD_ROOT
-mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}
-cp -p doc/mpc-completion.bash $RPM_BUILD_ROOT%{_datadir}/%{name}
-rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/%{name}
-
-
-%triggerin -- bash-completion
-ln -sf %{_datadir}/%{name}/mpc-bashrc %{_sysconfdir}/bash_completion.d/mpc
-
-%triggerun -- bash-completion
-[ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/mpc
+mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d
+install -p -D -m0644 doc/mpc-completion.bash \
+ $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d/%{name}
+for i in mpd-m3u-handler.sh mpd-pls-handler.sh mppledit; do
+ install -p -D -m0755 $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/${i} \
+ $RPM_BUILD_ROOT%{_libexecdir}/%{name}/${i}
+done
+rm -rf $RPM_BUILD_ROOT%{_datadir}/doc
+
+
+%post
+# Remove broken link.
+if [ $1 -eq 2 ]; then
+ if [ -h %{_sysconfdir}/bash_completion.d/mpc ]; then
+ rm -f %{_sysconfdir}/bash_completion.d/mpc >/dev/null 2>/dev/null || :
+ if [ -f %{_sysconfdir}/bash_completion.d/mpc.rpmnew ]; then
+ cp -p %{_sysconfdir}/bash_completion.d/mpc{.rpmnew,} >/dev/null 2>/dev/null || :
+ fi
+ fi
+fi
%files
%doc AUTHORS COPYING INSTALL NEWS README
%{_bindir}/%{name}
-%{_datadir}/%{name}
%{_mandir}/man1/%{name}.1*
+%config(noreplace) %{_sysconfdir}/bash_completion.d/%{name}
+%{_libexecdir}/%{name}
%changelog
+* Sun Feb 24 2013 Jamie Nguyen <jamielinux at fedoraproject.org> - 0.22-4
+- install bash completion in the correct place and remove the
+ triggerin/triggerun scriptlets
+- include the example scripts in libexecdir
+
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.22-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
More information about the scm-commits
mailing list