fix shellcheck rpath instead of using ld.so.conf.d; simplify doc files list

This commit is contained in:
Jens Petersen 2014-03-18 10:24:09 +09:00
parent 3febe6df6f
commit 9ec2eb0e21

View File

@ -2,7 +2,7 @@
Name: %{pkg_name}
Version: 0.3.1
Release: 5%{?dist}
Release: 6%{?dist}
Summary: Tool for checking common errors in POSIX shell scripts
License: AGPLv3+
@ -13,6 +13,7 @@ Patch0: https://github.com/koalaman/shellcheck/pull/105.diff
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-rpm-macros
# Begin cabal-rpm deps:
BuildRequires: chrpath
BuildRequires: ghc-containers-devel
BuildRequires: ghc-directory-devel
BuildRequires: ghc-json-devel
@ -65,7 +66,9 @@ This package provides the Haskell %{name} library development files.
%autosetup -n shellcheck-%{version} -p 1
# workaround until the tarball root directory becomes %%{name}-%%{version}
if [ ! -d ../%{name}-%{version} ]; then
ln -s shellcheck-%{version} ../%{name}-%{version}
fi
%build
@ -85,8 +88,13 @@ make shellcheck.1
install -Dpm 0644 shellcheck.1 %{buildroot}%{_mandir}/man1/shellcheck.1
%endif
mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d
echo %{ghclibdir}/%{name}-%{version} > %{buildroot}%{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf
## modify:
#%%ghc_fix_dynamic_rpath shellcheck
# since shellcheck-%{version}/ != %{pkg_name}-%{version}/
PDIR=$(cd ..; pwd)
PROG=%{buildroot}%{_bindir}/shellcheck
NEWRPATH=$(chrpath $PROG | sed -e "s@^$PROG: RPATH=@@" | sed -e "s@$PDIR/shellcheck@%{ghclibdir}/%{pkg_name}@" -e "s@/dist/build@@g")
chrpath -r $NEWRPATH $PROG
%check
@ -113,7 +121,6 @@ make .tests
%doc LICENSE
%doc README
%{_bindir}/shellcheck
# currently no pandoc on arm (bug #992430)
%ifnarch %{arm}
%{_mandir}/man1/shellcheck.1*
@ -121,17 +128,18 @@ make .tests
%files -n ghc-%{name} -f ghc-%{name}.files
%{_pkgdocdir}/LICENSE
%{_pkgdocdir}/README
%config %{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf
%doc LICENSE
%files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
%{_pkgdocdir}/LICENSE
%{_pkgdocdir}/README
%doc README
%changelog
* Mon Mar 17 2014 Jens Petersen <petersen@redhat.com> - 0.3.1-6
- fix shellcheck rpath instead of using ld.so.conf.d
- simplify doc files
* Sun Mar 16 2014 Dridi <dridi.boukelmoune@gmail.com> - 0.3.1-5
- added missing ld config