implement doc and prof subpackages
This commit is contained in:
parent
6cca56615f
commit
7c7ff554ce
@ -10,7 +10,7 @@
|
|||||||
#%%global without_hscolour 1
|
#%%global without_hscolour 1
|
||||||
|
|
||||||
Name: ghc-rpm-macros
|
Name: ghc-rpm-macros
|
||||||
Version: 1.10.0
|
Version: 2.0
|
||||||
Release: 1%{?dist}
|
Release: 1%{?dist}
|
||||||
Summary: RPM macros for building Haskell packages for GHC
|
Summary: RPM macros for building Haskell packages for GHC
|
||||||
|
|
||||||
@ -203,6 +203,9 @@ EOF
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%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
|
* Fri Jul 12 2019 Jens Petersen <petersen@redhat.com> - 1.10.0-1
|
||||||
- drop devel subpackage scriplets (replaced by ghc-compiler triggers)
|
- drop devel subpackage scriplets (replaced by ghc-compiler triggers)
|
||||||
- remove deprecated ghc_fix_dynamic_rpath
|
- remove deprecated ghc_fix_dynamic_rpath
|
||||||
|
39
macros.ghc
39
macros.ghc
@ -69,36 +69,22 @@ fi\
|
|||||||
%define pkgver %{?2}%{!?2:%{version}}\
|
%define pkgver %{?2}%{!?2:%{version}}\
|
||||||
%define pkgnamever %{pkgname}-%{pkgver}\
|
%define pkgnamever %{pkgname}-%{pkgver}\
|
||||||
%define basepkg %{?ghc_name}%{!?ghc_name:ghc}-%{pkgname}\
|
%define basepkg %{?ghc_name}%{!?ghc_name:ghc}-%{pkgname}\
|
||||||
%define docdir %{ghclibdocdir}/%{pkgnamever}\
|
if [ -z "$(ls %{buildroot}%{ghclibdir}/package.conf.d/%{pkgnamever}*.conf)" ]; then\
|
||||||
if [ -z "$(ls %{buildroot}%{ghclibdir}/package.conf.d/)" ]; then\
|
echo '%{buildroot}%{ghclibdir}/package.conf.d/%{pkgnamever}*.conf not found'\
|
||||||
echo "%{buildroot}%{ghclibdir}/package.conf.d/*.conf not found"\
|
|
||||||
exit 1\
|
exit 1\
|
||||||
fi\
|
fi\
|
||||||
rm -f %{basepkg}.files %{basepkg}-devel.files\
|
rm -f %{basepkg}.files\
|
||||||
touch %{basepkg}.files %{basepkg}-devel.files\
|
touch %{basepkg}.files\
|
||||||
ls %{buildroot}%{ghclibdir}/package.conf.d/%{pkgnamever}*.conf >> %{basepkg}-devel.files\
|
ls %{buildroot}%{_ghcdynlibdir}/libHS%{pkgnamever}-*ghc%{ghc_version}.so >> %{basepkg}.files\
|
||||||
pkgdir="%{ghclibdir}/%{pkgnamever}"\
|
pkgdir="%{ghclibdir}/%{pkgnamever}"\
|
||||||
if [ -d "%{buildroot}${pkgdir}" ]; then\
|
if [ -d "%{buildroot}${pkgdir}" ]; then\
|
||||||
%if %{defined _ghcdynlibdir}\
|
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\
|
||||||
echo "${pkgdir}" >> %{basepkg}-devel.files\
|
else\
|
||||||
%else\
|
rm -f %{basepkg}-devel.files %{basepkg}-prof.files\
|
||||||
echo "%%dir ${pkgdir}" >> %{basepkg}.files\
|
touch %{basepkg}-devel.files %{basepkg}-prof.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\
|
|
||||||
fi\
|
fi\
|
||||||
if [ -d "%{buildroot}%{docdir}" ]; then\
|
ls %{buildroot}%{ghclibdir}/package.conf.d/%{pkgnamever}*.conf >> %{basepkg}-devel.files\
|
||||||
echo "%{docdir}" >> %{basepkg}-devel.files\
|
for i in %{basepkg}.files %{basepkg}-devel.files %{basepkg}-prof.files; do\
|
||||||
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\
|
|
||||||
if [ -f "$i" ]; then\
|
if [ -f "$i" ]; then\
|
||||||
sed -i -e "s!%{buildroot}!!g" $i\
|
sed -i -e "s!%{buildroot}!!g" $i\
|
||||||
fi\
|
fi\
|
||||||
@ -172,7 +158,7 @@ fi\
|
|||||||
# ghc_fix_rpath lib-ver ...
|
# ghc_fix_rpath lib-ver ...
|
||||||
%ghc_fix_rpath()\
|
%ghc_fix_rpath()\
|
||||||
if ! type chrpath > /dev/null; then exit 1; fi\
|
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\
|
for lib in %*; do\
|
||||||
if [ -x "$i" ]; then\
|
if [ -x "$i" ]; then\
|
||||||
rpath=$(chrpath $i | sed -e "s@^$i: R.*PATH=@@")\
|
rpath=$(chrpath $i | sed -e "s@^$i: R.*PATH=@@")\
|
||||||
@ -200,6 +186,7 @@ done\
|
|||||||
done\
|
done\
|
||||||
%{nil}
|
%{nil}
|
||||||
|
|
||||||
|
# deprecated for f31
|
||||||
%ghc_pkg_recache %{_bindir}/ghc-pkg-%{ghc_version} recache --no-user-package-db || :
|
%ghc_pkg_recache %{_bindir}/ghc-pkg-%{ghc_version} recache --no-user-package-db || :
|
||||||
|
|
||||||
# deprecated
|
# deprecated
|
||||||
|
@ -12,14 +12,12 @@ print(name)\
|
|||||||
local pv = rpm.expand("%1")\
|
local pv = rpm.expand("%1")\
|
||||||
print(string.sub(pv, string.find(pv, "[%d.]+$")))\
|
print(string.sub(pv, string.find(pv, "[%d.]+$")))\
|
||||||
}}\
|
}}\
|
||||||
|
%define pkgnamever %{pkgname}-%{pkgver}\
|
||||||
%{!-x:%{?1:%global ghc_packages_list %{?ghc_packages_list} %{pkgname}-%{pkgver}}}\
|
%{!-x:%{?1:%global ghc_packages_list %{?ghc_packages_list} %{pkgname}-%{pkgver}}}\
|
||||||
%define ghc_prefix %{?ghc_name}%{!?ghc_name:ghc}\
|
%define ghc_prefix %{?ghc_name}%{!?ghc_name:ghc}\
|
||||||
%define basepkg %{ghc_prefix}-%{pkgname}\
|
%define basepkg %{ghc_prefix}-%{pkgname}\
|
||||||
%package -n %{basepkg}\
|
%package -n %{basepkg}\
|
||||||
Summary: Haskell %{pkgname} library\
|
Summary: Haskell %{pkgname} library\
|
||||||
%if 0%{?rhel} && 0%{?rhel} < 6\
|
|
||||||
Group: System/Libraries\
|
|
||||||
%endif\
|
|
||||||
%{?1:Version: %{pkgver}}\
|
%{?1:Version: %{pkgver}}\
|
||||||
%{-l:License: %{-l*}}\
|
%{-l:License: %{-l*}}\
|
||||||
Url: http://hackage.haskell.org/package/%{pkgname}\
|
Url: http://hackage.haskell.org/package/%{pkgname}\
|
||||||
@ -30,9 +28,6 @@ This package provides the Haskell %{pkgname} library.\
|
|||||||
\
|
\
|
||||||
%package -n %{basepkg}-devel\
|
%package -n %{basepkg}-devel\
|
||||||
Summary: Haskell %{pkgname} library development files\
|
Summary: Haskell %{pkgname} library development files\
|
||||||
%if 0%{?rhel} && 0%{?rhel} < 6\
|
|
||||||
Group: Development/Languages/Other\
|
|
||||||
%endif\
|
|
||||||
%{?1:Version: %{pkgver}}\
|
%{?1:Version: %{pkgver}}\
|
||||||
%{-l:License: %{-l*}}\
|
%{-l:License: %{-l*}}\
|
||||||
Requires: %{ghc_prefix}-compiler = %{ghc_version}%{?ghc_version_override:-%{release}}\
|
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\
|
%description -n %{basepkg}-devel\
|
||||||
This package provides the Haskell %{pkgname} library development files.\
|
This package provides the Haskell %{pkgname} library development files.\
|
||||||
\
|
\
|
||||||
%files -n %{basepkg} -f %{!-d:%{pkgname}-%{pkgver}/}%{basepkg}.files\
|
%if %{undefined without_haddock}\
|
||||||
%if 0%{?rhel} && 0%{?rhel} < 6\
|
%package -n %{basepkg}-doc\
|
||||||
%defattr(-,root,root,-)\
|
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\
|
%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\
|
%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\
|
%endif\
|
||||||
%{?devel_doc_files:%doc %devel_doc_files}\
|
|
||||||
%{nil}
|
%{nil}
|
||||||
|
|
||||||
# ghc_libs_build [name-version] ...
|
# ghc_libs_build [name-version] ...
|
||||||
|
Loading…
Reference in New Issue
Block a user