Compare commits

...

8 Commits
master ... f13

Author SHA1 Message Date
Jens Petersen 9536f392f2 backport secondary arch support from 0.10.52
- add ghc_pkg_obsoletes to binlib base lib package too
- this package is now arch-dependent
- rename without_shared to ghc_without_shared and without_dynamic
  to ghc_without_dynamic so that they can be globally defined for
  secondary archs without shared libs
- use %%undefined macro
- disable debug_package in ghc_bin_build and ghc_lib_build
- set ghc_without_shared and ghc_without_dynamic on secondary archs
  (ie non main intel archs)
- disable debuginfo for self
- add cabal_configure_options to pass extra options to cabal_configure
- drop with_devhelp since --html-help option gone from haddock-2.8.0
2011-03-17 15:41:21 +09:00
Jens Petersen 6b8936e288 revert disabling debug_package by default 2010-12-29 21:19:00 +09:00
Jens Petersen a5d5e91f4b backport ghc_pkg_obsoletes, without_shared, etc from F14 (0.8 branch)
- add ghc_pkg_obsoletes for obsoleting old packages
- disable debuginfo by default
- make shared default: use without_shared to disable
- fix without_shared build so it actually works
- use ghcpkgbasedir
2010-12-09 12:31:49 +10:00
Jens Petersen 724cc3449e fix ghc_strip_dynlinked when no dynlinked files 2010-07-31 15:38:47 +10:00
Fedora Release Engineering c0cc849b33 dist-git conversion 2010-07-28 15:34:52 +00:00
Jens Petersen 92246276fa backport 0.7.1 from devel:
- support hscolour'ing of src from haddock
- new ghc_bin_build, ghc_bin_install, ghc_lib_build, ghc_lib_install
- a couple more fallback summary tweaks
- drop the summary -s and description -d package options since rpm does not
    seem to allow white\ space in macro option args anyway
- add ghc_strip_dynlinked, conditional on no debug_package
- add comments over macros
- drop unused cabal_makefile
2010-06-28 07:41:52 +00:00
Jens Petersen a8687b4c33 - drop unused ghc_pkg_ver macro
- add ghc_pkg_recache macro
2010-04-15 15:18:07 +00:00
Jesse Keating 3e18b419b9 Initialize branch F-13 for ghc-rpm-macros 2010-02-17 01:25:47 +00:00
5 changed files with 174 additions and 71 deletions

View File

View File

@ -1,21 +0,0 @@
# Makefile for source rpm: ghc-rpm-macros
# $Id: Makefile,v 1.1 2009/05/13 05:10:46 kevin Exp $
NAME := ghc-rpm-macros
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attept a checkout
define checkout-makefile-common
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
endif
include $(MAKEFILE_COMMON)

View File

@ -1,37 +1,43 @@
# RPM Macros for packaging Haskell cabalized packages -*-rpm-spec-*-
# see https://fedoraproject.org/wiki/PackagingDrafts/Haskell for more details
# "cabal"
%cabal %{_bindir}/runghc Setup
# configure
%cabal_configure \
%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_docdir}/%{name}-%{version} --htmldir=%{ghcdocdir} --libsubdir='$compiler/$pkgid' %{?with_shared:--enable-shared} %{?with_dynamic:--ghc-option=-dynamic}
%cabal_makefile \
%cabal makefile -f cabal-rpm.mk \
make -f cabal-rpm.mk %{_smp_mflags} \
%{nil}
%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_docdir}/%{name}-%{version} --htmldir=%{ghcdocdir} --libsubdir='$compiler/$pkgid' --ghc %{!?ghc_without_shared:--enable-shared} %{?cabal_configure_options}
# install
%cabal_install %cabal copy --destdir=${RPM_BUILD_ROOT} -v
# root dir for ghc docs
%ghcdocbasedir %{_docdir}/ghc/html
# ghcdocdir [pkgname]
%ghcdocdir() %{ghcdocbasedir}/libraries/%{?1}%{!?1:%{pkg_name}}-%{version}
# top library dir
%ghcpkgbasedir %{_libdir}/ghc-%{ghc_version}
# ghcpkgdir [pkgname]
%ghcpkgdir() %{ghcpkgbasedir}/%{?1}%{!?1:%{pkg_name}}-%{version}
# ghc_gen_filelists [pkgname]
%ghc_gen_filelists() \
pkgname=%{?1}%{!?1:%{pkg_name}} \
basefile=ghc-${pkgname} \
pkgnamever=${pkgname}-%{version} \
rm -f ${basefile}.files ${basefile}-devel.files ${basefile}-prof.files ${basefile}-doc.files \
%if %{undefined ghc_without_shared}\
echo "%defattr(-,root,root,-)" > ${basefile}.files \
if [ -d "${RPM_BUILD_ROOT}%{_docdir}/%{name}-%{version}" ]; then \
%{!?1:echo "%{_docdir}/%{name}-%{version}" >> ${basefile}%{!?with_shared:-devel}.files} %{?1::} \
fi \
%if %{with shared} \
if [ -d "${RPM_BUILD_ROOT}%{ghcpkgdir}" ]; then \
echo "%dir %{ghcpkgdir}" >> ${basefile}.files \
echo "%attr(755,root,root) %{ghcpkgdir}/libHS${pkgnamever}-ghc%{ghc_version}.so" >> ${basefile}.files \
fi \
%endif \
echo "%defattr(-,root,root,-)" > ${basefile}-devel.files \
echo "%{_libdir}/ghc-%{ghc_version}/package.conf.d/${pkgnamever}*.conf" >> ${basefile}-devel.files \
if [ -d "${RPM_BUILD_ROOT}%{_docdir}/%{name}-%{version}" ]; then \
%{!?1:echo "%{_docdir}/%{name}-%{version}" >> ${basefile}%{?ghc_without_shared:-devel}.files} %{?1::} \
fi \
echo "%{ghcpkgbasedir}/package.conf.d/${pkgnamever}*.conf" >> ${basefile}-devel.files \
if [ -d "${RPM_BUILD_ROOT}%{ghcpkgdir}" ]; then \
find ${RPM_BUILD_ROOT}%{ghcpkgdir} -type d | sed "s/^/%dir /" >> ${basefile}-devel.files \
find ${RPM_BUILD_ROOT}%{ghcpkgdir} ! \\( -type d -o -name "*_p.a" -o -name "*.p_hi" -o -name "libHS*.so" \\) >> ${basefile}-devel.files \
@ -44,37 +50,40 @@ echo "%defattr(-,root,root,-)" > ${basefile}-doc.files \
if [ -d "${RPM_BUILD_ROOT}%{ghcdocdir}" ]; then \
echo "%{ghcdocdir}" >> ${basefile}-doc.files \
fi \
sed -i -e "s!${RPM_BUILD_ROOT}!!g" ${basefile}.files ${basefile}-devel.files ${basefile}-prof.files \
sed -i -e "s!${RPM_BUILD_ROOT}!!g" %{!?ghc_without_shared:${basefile}.files} ${basefile}-devel.files ${basefile}-prof.files \
%{nil}
%ghc_reindex_haddock ( cd %{ghcdocbasedir}/libraries && [ -x "./gen_contents_index" ] && ./gen_contents_index ) || :
# compiler version
%ghc_version %{!?ghc_version_override:%(ghc --numeric-version)}%{?ghc_version_override}
%ghc_pkg_ver() %(ghc-pkg list --global --simple-output %1|sed -e "s/.*%1-//")
# create and install package.conf file
# cabal_pkg_conf [pkgname]
%cabal_pkg_conf \
%cabal register --gen-pkg-config \
mkdir -p $RPM_BUILD_ROOT%{_libdir}/ghc-%{ghc_version}/package.conf.d \
install --mode=0644 %{?1}%{!?1:%{pkg_name}}-%{version}.conf $RPM_BUILD_ROOT%{_libdir}/ghc-%{ghc_version}/package.conf.d
mkdir -p $RPM_BUILD_ROOT%{ghcpkgbasedir}/package.conf.d \
install --mode=0644 %{?1}%{!?1:%{pkg_name}}-%{version}.conf $RPM_BUILD_ROOT%{ghcpkgbasedir}/package.conf.d
# devel pkg basic requires
%ghc_requires Requires: ghc = %{ghc_version}\
Requires(post): ghc = %{ghc_version}\
Requires(postun): ghc = %{ghc_version}\
%if %{with shared}\
%if %{undefined ghc_without_shared}\
Requires: ghc-%{-n:%{-n*}}%{!-n:%{pkg_name}} = %{-v:%{-v*}}%{!-v:%{version}}-%{release}\
%endif
# doc pkg basic requires
%ghc_doc_requires Requires: ghc-doc = %{ghc_version}\
Requires(post): ghc-doc = %{ghc_version}\
Requires(postun): ghc-doc = %{ghc_version}
# prof pkg basic requires
%ghc_prof_requires Requires: ghc-prof = %{ghc_version}\
Requires: ghc-%{-n:%{-n*}}%{!-n:%{pkg_name}}-devel = %{-v:%{-v*}}%{!-v:%{version}}-%{release}
# ghc_lib_package [-n pkgname] [-c cdepslist] [-h pkgdepslist]
%ghc_lib_package(n:c:h:)\
%define ghc_pkg_name %{-n:ghc-%{-n*}}%{!-n:ghc-%{pkg_name}}\
%if %{with shared}\
%define ghc_pkg_name ghc-%{-n:%{-n*}}%{!-n:%{pkg_name}}\
%if %{undefined ghc_without_shared}\
%files -n %{ghc_pkg_name} -f %{ghc_pkg_name}.files\
%defattr(-,root,root,-)\
%endif\
@ -84,30 +93,37 @@ Requires: ghc-%{-n:%{-n*}}%{!-n:%{pkg_name}}-devel = %{-v:%{-v*}}%{!-v:%{v
%ghc_package_doc\
\
%ghc_package_prof\
%{nil}
%ghc_binlib_package(n:c:h:l:v:s:d:)\
# ghc_binlib_package [-n pkgname] [-c cdepslist] [-h pkgdepslist] [-l licensetag] [-v version]
%ghc_binlib_package(n:c:h:l:v:)\
%define local_pkg_name %{-n:%{-n*}}%{!-n:%{pkg_name}}\
%define ghc_pkg_name ghc-%{local_pkg_name}\
%package -n %{ghc_pkg_name}\
Summary: %{-s:%{-s*}}%{!-s:%{?common_summary}%{!?common_summary:%{local_pkg_name}}}\
Summary: %{?common_summary}%{!?common_summary:%{local_pkg_name} library}\
Group: System Environment/Libraries\
%{-v:Version: %{-v*}}\
%{-l:License: %{-l*}}\
%{?ghc_pkg_obsoletes:Obsoletes: %(echo "%{ghc_pkg_obsoletes}" | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1/g")}\
\
%description -n %{ghc_pkg_name}\
%{-d:%{-d*}}%{!-d:%{?common_description}%{!?common_description:Haskell %{local_pkg_name} library.}}\
%{?common_description}%{!?common_description:Haskell %{local_pkg_name} library.}\
\
%if %{defined ghc_version} && %{undefined ghc_without_shared}\
This package provides the shared library.\
%endif\
\
%ghc_lib_package\
%{nil}
%ghc_pkg_recache %{_bindir}/ghc-pkg recache --no-user-package-conf || :
%ghc_package_devel(n:c:h:l:v:s:d:)\
# ghc_package_devel [-n pkgname] [-c cdepslist] [-h pkgdepslist] [-l licensetag] [-v version]
%ghc_package_devel(n:c:h:l:v:)\
%define local_pkg_name %{-n:%{-n*}}%{!-n:%{pkg_name}}\
%define ghc_pkg_name ghc-%{local_pkg_name}\
%package -n %{ghc_pkg_name}-devel\
Summary: %{-s:%{-s*}}%{!-s:%{?common_summary}%{!?common_summary:%{local_pkg_name}}} development files\
Summary: %{?common_summary}%{!?common_summary:%{local_pkg_name} library} development files\
Group: Development/Libraries\
%{-v:Version: %{-v*}}\
%{-l:License: %{-l*}}\
@ -116,35 +132,43 @@ Group: Development/Libraries\
%{-h:Requires: %{-h*}}\
%{!-c:%{?ghc_pkg_c_deps:Requires: %{ghc_pkg_c_deps}}}\
%{-c:Requires: %{-c*}}\
%{?ghc_pkg_obsoletes:Obsoletes: %{ghc_pkg_obsoletes}}\
\
%description -n %{ghc_pkg_name}-devel\
%{-d:%{-d*}}%{!-d:%{?common_description}%{!?common_description:Haskell %{local_pkg_name} library.}}\
%{?common_description}%{!?common_description:Haskell %{local_pkg_name} library.}\
\
This package contains the development files.\
\
%post -n %{ghc_pkg_name}-devel\
ghc-pkg recache\
%ghc_pkg_recache\
\
%postun -n %{ghc_pkg_name}-devel\
ghc-pkg recache\
%ghc_pkg_recache\
\
%files -n %{ghc_pkg_name}-devel -f %{ghc_pkg_name}-devel.files\
%defattr(-,root,root,-)\
%{nil}
%ghc_package_doc(n:h:l:v:s:d:)\
# for docs post and postun
# re-index haddock
%ghc_reindex_haddock ( cd %{ghcdocbasedir}/libraries && [ -x "./gen_contents_index" ] && ./gen_contents_index ) || :
# ghc_package_doc [-n pkgname] [-h pkgdepslist] [-l licensetag] [-v version]
%ghc_package_doc(n:h:l:v:)\
%define local_pkg_name %{-n:%{-n*}}%{!-n:%{pkg_name}}\
%define ghc_pkg_name ghc-%{local_pkg_name}\
%package -n %{ghc_pkg_name}-doc\
Summary: Documentation for %{-s:%{-s*}}%{!-s:%{?common_summary}%{!?common_summary:%{local_pkg_name}}}\
Summary: Documentation for %{?common_summary}%{!?common_summary:%{local_pkg_name} library}\
Group: Development/Libraries\
%{-v:Version: %{-v*}}\
%{-l:License: %{-l*}}\
%{?ghc_doc_requires}\
%{!-h:%{?ghc_pkg_deps:Requires: %(echo %{ghc_pkg_deps} | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1-doc/g")}}\
%{-h:Requires: %(echo %{-h*} | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1-doc/g")}\
%{?ghc_pkg_obsoletes:Obsoletes: %(echo "%{ghc_pkg_obsoletes}" | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1-doc/g")}\
\
%description -n %{ghc_pkg_name}-doc\
%{-d:%{-d*}}%{!-d:%{?common_description}%{!?common_description:Haskell %{local_pkg_name} library.}}\
%{?common_description}%{!?common_description:Haskell %{local_pkg_name} library.}\
\
This package contains development documentation files.\
\
@ -158,24 +182,59 @@ fi\
\
%files -n %{ghc_pkg_name}-doc -f %{ghc_pkg_name}-doc.files\
%defattr(-,root,root,-)\
%{nil}
%ghc_package_prof(n:h:l:v:s:d:)\
# ghc_package_prof [-n pkgname] [-c cdepslist] [-h pkgdepslist] [-l licensetag] [-v version]
%ghc_package_prof(n:h:l:v:)\
%define local_pkg_name %{-n:%{-n*}}%{!-n:%{pkg_name}}\
%define ghc_pkg_name ghc-%{local_pkg_name}\
%package -n %{ghc_pkg_name}-prof\
Summary: Profiling libraries for %{-s:%{-s*}}%{!-s:%{?common_summary}%{!?common_summary:%{local_pkg_name}}}\
Summary: Profiling libraries for %{?common_summary}%{!?common_summary:%{local_pkg_name}}\
Group: Development/Libraries\
%{-v:Version: %{-v*}}\
%{-l:License: %{-l*}}\
%{?ghc_prof_requires}\
%{!-h:%{?ghc_pkg_deps:Requires: %(echo %{ghc_pkg_deps} | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1-prof/g")}}\
%{-h:Requires: %(echo %{-h*} | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1-prof/g")}\
%{!-h:%{?ghc_pkg_deps:Requires: %(echo "%{ghc_pkg_deps}" | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1-prof/g")}}\
%{-h:Requires: %(echo "%{-h*}" | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1-prof/g")}\
%{?ghc_pkg_obsoletes:Obsoletes: %(echo "%{ghc_pkg_obsoletes}" | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1-prof/g")}\
\
%description -n %{ghc_pkg_name}-prof\
%{-d:%{-d*}}%{!-d:%{?common_description}%{!?common_description:Haskell %{local_pkg_name} library.}}\
%{?common_description}%{!?common_description:Haskell %{local_pkg_name} library.}\
\
This package contains the profiling library.\
\
%files -n %{ghc_pkg_name}-prof -f %{ghc_pkg_name}-prof.files\
%defattr(-,root,root,-)\
%{nil}
# ghc_strip_dynlinked
%ghc_strip_dynlinked\
%if %{undefined __debug_package}\
find $RPM_BUILD_ROOT -type f -exec sh -c "file {} | grep -q 'dynamically linked'" \\; -exec strip "{}" \\;\
%endif
# ghc_bin_build
%ghc_bin_build\
%global debug_package %{nil}\
%cabal_configure %{!?ghc_without_dynamic:--ghc-option=-dynamic}\
%cabal build
# ghc_lib_build
%ghc_lib_build\
%global debug_package %{nil}\
%cabal_configure %{!?without_prof:-p}\
%cabal build\
%{!?without_haddock:%cabal haddock %{?with_hscolour:--hyperlink-source}}\
%{nil}
# install bin package
%ghc_bin_install\
%cabal_install\
%ghc_strip_dynlinked
# install lib package
%ghc_lib_install\
%cabal_install\
%cabal_pkg_conf\
%ghc_gen_filelists\
%ghc_strip_dynlinked

View File

@ -1,5 +1,7 @@
%global debug_package %{nil}
Name: ghc-rpm-macros
Version: 0.5.5
Version: 0.7.5
Release: 1%{?dist}
Summary: Macros for building packages for GHC
@ -13,14 +15,11 @@ URL: https://fedoraproject.org/wiki/Haskell_SIG
Source0: ghc-rpm-macros.ghc
Source1: COPYING
Source2: AUTHORS
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
%description
A set of macros for building GHC packages following the Haskell Guidelines
of the Haskell SIG. This package probably shouldn't be installed on its own
as GHC is needed in order to make use of these macros.
of the Fedora Haskell SIG. This package probably shouldn't be installed on
its own as GHC is needed in order to make use of these macros.
%prep
%setup -c -T
@ -32,13 +31,19 @@ echo no build stage needed
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p ${RPM_BUILD_ROOT}/%{_sysconfdir}/rpm
cp -p %{SOURCE0} ${RPM_BUILD_ROOT}/%{_sysconfdir}/rpm/macros.ghc
install -p -m 0644 %{SOURCE0} ${RPM_BUILD_ROOT}/%{_sysconfdir}/rpm/macros.ghc
# this is why this package is now arch-dependent:
# turn off shared libs and dynamic linking on secondary archs
%ifnarch %{ix86} x86_64
cat >> ${RPM_BUILD_ROOT}/%{_sysconfdir}/rpm/macros.ghc <<EOF
%clean
rm -rf $RPM_BUILD_ROOT
# shared libraries are only supported on primary intel archs
%%ghc_without_dynamic 1
%%ghc_without_shared 1
EOF
%endif
%files
@ -48,6 +53,67 @@ rm -rf $RPM_BUILD_ROOT
%changelog
* Thu Mar 17 2011 Jens Petersen <petersen@redhat.com> - 0.7.5-1
- backport secondary arch support from 0.10.52:
- add ghc_pkg_obsoletes to binlib base lib package too
- this package is now arch-dependent
- rename without_shared to ghc_without_shared and without_dynamic
to ghc_without_dynamic so that they can be globally defined for
secondary archs without shared libs
- use %%undefined macro
- disable debug_package in ghc_bin_build and ghc_lib_build
- set ghc_without_shared and ghc_without_dynamic on secondary
(ie non main intel archs)
- disable debuginfo for self
- add cabal_configure_options to pass extra options to cabal_configure
- drop with_devhelp since --html-help option gone from haddock-2.8.0
* Wed Dec 29 2010 Jens Petersen <petersen@redhat.com> - 0.7.4-1
- revert disabling debug_package, since with redhat-rpm-config installed
the behaviour depended on the position of ghc_lib_package in the spec file
(reported by narasim_7)
* Tue Dec 7 2010 Jens Petersen <petersen@redhat.com> - 0.7.3-1
- add ghc_pkg_obsoletes for obsoleting old packages
- disable debuginfo by default
- make shared default: use without_shared to disable
- fix without_shared build so it actually works
- use ghcpkgbasedir
* Sat Jul 31 2010 Jens Petersen <petersen@redhat.com> - 0.7.2-1
- fix ghc_strip_dynlinked when no dynlinked files
* Mon Jun 28 2010 Jens Petersen <petersen@redhat.com> - 0.7.1-1
- support hscolour'ing of src from haddock
- really remove redundant summary and description option flags
* Sat Jun 26 2010 Jens Petersen <petersen@redhat.com> - 0.7.0-1
- new ghc_bin_build, ghc_bin_install, ghc_lib_build, ghc_lib_install
* Thu Jun 24 2010 Jens Petersen <petersen@redhat.com> - 0.6.2-1
- a couple more fallback summary tweaks
* Thu Jun 24 2010 Jens Petersen <petersen@redhat.com> - 0.6.1-1
- drop the summary -s and description -d package options since rpm does not
seem to allow white\ space in macro option args anyway
* Wed Jun 23 2010 Jens Petersen <petersen@redhat.com> - 0.6.0-1
- make ghc_strip_dynlinked conditional on no debug_package
* Wed Jun 23 2010 Jens Petersen <petersen@redhat.com> - 0.5.9-1
- replace ghc_strip_shared with ghc_strip_dynlinked
* Sun Jun 20 2010 Jens Petersen <petersen@redhat.com> - 0.5.8-1
- add ghc_strip_shared to strip shared libraries
* Sun Jun 20 2010 Jens Petersen <petersen@redhat.com> - 0.5.7-1
- add comments over macros
- drop unused cabal_makefile
* Mon Apr 12 2010 Jens Petersen <petersen@redhat.com> - 0.5.6-1
- drop unused ghc_pkg_ver macro
- add ghc_pkg_recache macro
* Fri Jan 15 2010 Jens Petersen <petersen@redhat.com> - 0.5.5-1
- drop optional 2nd version arg from ghcdocdir, ghcpkgdir, and
ghc_gen_filelists: multiversion subpackages are not supported

View File

@ -1 +0,0 @@
ghc-rpm-macros-0_1-6_fc10:HEAD:ghc-rpm-macros-0.1-6.fc10.src.rpm:1242200218