implement doc and prof subpackages

This commit is contained in:
Jens Petersen 2019-07-15 08:40:09 +00:00
parent 6cca56615f
commit 7c7ff554ce
3 changed files with 50 additions and 40 deletions

View File

@ -10,7 +10,7 @@
#%%global without_hscolour 1
Name: ghc-rpm-macros
Version: 1.10.0
Version: 2.0
Release: 1%{?dist}
Summary: RPM macros for building Haskell packages for GHC
@ -203,6 +203,9 @@ EOF
%changelog
* Sun Jul 14 2019 Jens Petersen <petersen@redhat.com> - 2.0-1
- bring back doc and prof subpackages
* Fri Jul 12 2019 Jens Petersen <petersen@redhat.com> - 1.10.0-1
- drop devel subpackage scriplets (replaced by ghc-compiler triggers)
- remove deprecated ghc_fix_dynamic_rpath

View File

@ -69,36 +69,22 @@ fi\
%define pkgver %{?2}%{!?2:%{version}}\
%define pkgnamever %{pkgname}-%{pkgver}\
%define basepkg %{?ghc_name}%{!?ghc_name:ghc}-%{pkgname}\
%define docdir %{ghclibdocdir}/%{pkgnamever}\
if [ -z "$(ls %{buildroot}%{ghclibdir}/package.conf.d/)" ]; then\
echo "%{buildroot}%{ghclibdir}/package.conf.d/*.conf not found"\
if [ -z "$(ls %{buildroot}%{ghclibdir}/package.conf.d/%{pkgnamever}*.conf)" ]; then\
echo '%{buildroot}%{ghclibdir}/package.conf.d/%{pkgnamever}*.conf not found'\
exit 1\
fi\
rm -f %{basepkg}.files %{basepkg}-devel.files\
touch %{basepkg}.files %{basepkg}-devel.files\
ls %{buildroot}%{ghclibdir}/package.conf.d/%{pkgnamever}*.conf >> %{basepkg}-devel.files\
rm -f %{basepkg}.files\
touch %{basepkg}.files\
ls %{buildroot}%{_ghcdynlibdir}/libHS%{pkgnamever}-*ghc%{ghc_version}.so >> %{basepkg}.files\
pkgdir="%{ghclibdir}/%{pkgnamever}"\
if [ -d "%{buildroot}${pkgdir}" ]; then\
%if %{defined _ghcdynlibdir}\
echo "${pkgdir}" >> %{basepkg}-devel.files\
%else\
echo "%%dir ${pkgdir}" >> %{basepkg}.files\
find %{buildroot}${pkgdir} -mindepth 1 -type d | sed "s/^/%dir /" >> %{basepkg}-devel.files\
find %{buildroot}${pkgdir} ! \\( -type d -o -name "libHS*.so" \\) >> %{basepkg}-devel.files\
%endif\
%if %{undefined ghc_without_shared}\
echo "%%attr(755,root,root) %{?_ghcdynlibdir}%{!?_ghcdynlibdir:${pkgdir}}/libHS%{pkgnamever}-*ghc%{ghc_version}.so" >> %{basepkg}.files\
%endif\
find %{buildroot}${pkgdir} -type d -fprintf %{basepkg}-devel.files '%%%%dir %p\\n' -o \\( -name '*.p_hi' -o -name 'libHS*_p.a' \\) -fprint %{basepkg}-prof.files -o -fprint %{basepkg}-devel.files\
else\
rm -f %{basepkg}-devel.files %{basepkg}-prof.files\
touch %{basepkg}-devel.files %{basepkg}-prof.files\
fi\
if [ -d "%{buildroot}%{docdir}" ]; then\
echo "%{docdir}" >> %{basepkg}-devel.files\
fi\
%if 0%{?1:1}\
for i in $(ls %{buildroot}%{_ghclicensedir}/%{!?1:%{name}}%{?1:%{basepkg}}); do\
echo "%%license %{?1:%{pkgnamever}/}$i" >> %{basepkg}.files\
done\
%endif\
for i in %{basepkg}.files %{basepkg}-devel.files; do\
ls %{buildroot}%{ghclibdir}/package.conf.d/%{pkgnamever}*.conf >> %{basepkg}-devel.files\
for i in %{basepkg}.files %{basepkg}-devel.files %{basepkg}-prof.files; do\
if [ -f "$i" ]; then\
sed -i -e "s!%{buildroot}!!g" $i\
fi\
@ -172,7 +158,7 @@ fi\
# ghc_fix_rpath lib-ver ...
%ghc_fix_rpath()\
if ! type chrpath > /dev/null; then exit 1; fi\
for i in $(find %{buildroot} -type f -exec sh -c "file {} | grep -q 'dynamically linked'" \\; -print); do\
for i in $(find %{buildroot} -type f -executable -exec sh -c "file {} | grep -q 'dynamically linked'" \\; -print); do\
for lib in %*; do\
if [ -x "$i" ]; then\
rpath=$(chrpath $i | sed -e "s@^$i: R.*PATH=@@")\
@ -200,6 +186,7 @@ done\
done\
%{nil}
# deprecated for f31
%ghc_pkg_recache %{_bindir}/ghc-pkg-%{ghc_version} recache --no-user-package-db || :
# deprecated

View File

@ -12,14 +12,12 @@ print(name)\
local pv = rpm.expand("%1")\
print(string.sub(pv, string.find(pv, "[%d.]+$")))\
}}\
%define pkgnamever %{pkgname}-%{pkgver}\
%{!-x:%{?1:%global ghc_packages_list %{?ghc_packages_list} %{pkgname}-%{pkgver}}}\
%define ghc_prefix %{?ghc_name}%{!?ghc_name:ghc}\
%define basepkg %{ghc_prefix}-%{pkgname}\
%package -n %{basepkg}\
Summary: Haskell %{pkgname} library\
%if 0%{?rhel} && 0%{?rhel} < 6\
Group: System/Libraries\
%endif\
%{?1:Version: %{pkgver}}\
%{-l:License: %{-l*}}\
Url: http://hackage.haskell.org/package/%{pkgname}\
@ -30,9 +28,6 @@ This package provides the Haskell %{pkgname} library.\
\
%package -n %{basepkg}-devel\
Summary: Haskell %{pkgname} library development files\
%if 0%{?rhel} && 0%{?rhel} < 6\
Group: Development/Languages/Other\
%endif\
%{?1:Version: %{pkgver}}\
%{-l:License: %{-l*}}\
Requires: %{ghc_prefix}-compiler = %{ghc_version}%{?ghc_version_override:-%{release}}\
@ -44,17 +39,42 @@ Requires: %{ghc_prefix}-%{pkgname}%{?_isa} = %{pkgver}-%{release}\
%description -n %{basepkg}-devel\
This package provides the Haskell %{pkgname} library development files.\
\
%files -n %{basepkg} -f %{!-d:%{pkgname}-%{pkgver}/}%{basepkg}.files\
%if 0%{?rhel} && 0%{?rhel} < 6\
%defattr(-,root,root,-)\
%if %{undefined without_haddock}\
%package -n %{basepkg}-doc\
Summary: Haskell %{pkgname} library documentation\
%{?1:Version: %{pkgver}}\
%{-l:License: %{-l*}}\
Supplements: (%{basepkg}-devel and ghc-doc)\
\
%description -n %{basepkg}-doc\
This package provides the Haskell %{pkgname} library documentation.\
%endif\
%{?base_doc_files:%doc %base_doc_files}\
\
%if %{undefined without_prof}\
%package -n %{basepkg}-prof\
Summary: Haskell %{pkgname} profiling library\
%{?1:Version: %{pkgver}}\
%{-l:License: %{-l*}}\
Requires: %{ghc_prefix}-%{pkgname}-devel%{?_isa} = %{pkgver}-%{release}\
Supplements: (%{basepkg}-devel and ghc-prof)\
\
%description -n %{basepkg}-prof\
This package provides the Haskell %{pkgname} profiling library.\
%endif\
\
%files -n %{basepkg} -f %{!-d:%{pkgname}-%{pkgver}/}%{basepkg}.files\
%{_ghclicensedir}/%{basepkg}\
\
%files -n %{basepkg}-devel -f %{!-d:%{pkgname}-%{pkgver}/}%{basepkg}-devel.files\
%if 0%{?rhel} && 0%{?rhel} < 6\
%defattr(-,root,root,-)\
\
%if %{undefined without_haddock}\
%files -n %{basepkg}-doc\
%{ghc_html_libraries_dir}/%{pkgnamever}\
%endif\
\
%if %{undefined without_prof}\
%files -n %{basepkg}-prof -f %{!-d:%{pkgname}-%{pkgver}/}%{basepkg}-prof.files\
%endif\
%{?devel_doc_files:%doc %devel_doc_files}\
%{nil}
# ghc_libs_build [name-version] ...