diff --git a/fix-gen-filelists.patch b/fix-gen-filelists.patch new file mode 100644 index 0000000..bcb4aca --- /dev/null +++ b/fix-gen-filelists.patch @@ -0,0 +1,13 @@ +Index: ghc-rpm-macros-1.4.93/macros.ghc +=================================================================== +--- ghc-rpm-macros-1.4.93.orig/macros.ghc ++++ ghc-rpm-macros-1.4.93/macros.ghc +@@ -77,7 +77,7 @@ fi\ + rm -f %{basepkg}.files %{basepkg}-devel.files\ + touch %{basepkg}.files %{basepkg}-devel.files\ + if [ -d "%{buildroot}${pkgdir}" ]; then\ +-echo "%dir ${pkgdir}" >> %{basepkg}.files\ ++echo "%%dir ${pkgdir}" >> %{basepkg}.files\ + %if %{undefined ghc_without_shared}\ + echo "%attr(755,root,root) ${pkgdir}/libHS*-ghc%{ghc_version}.so" >> %{basepkg}.files\ + %endif\ diff --git a/fix-library-dir.patch b/fix-library-dir.patch new file mode 100644 index 0000000..bc3c9b9 --- /dev/null +++ b/fix-library-dir.patch @@ -0,0 +1,13 @@ +Index: ghc-rpm-macros-1.4.93/macros.ghc +=================================================================== +--- ghc-rpm-macros-1.4.93.orig/macros.ghc ++++ ghc-rpm-macros-1.4.93/macros.ghc +@@ -26,7 +26,7 @@ fi + %cabal_configure\ + %ghc_check_bootstrap\ + %global _hardened_ldflags %{nil}\ +-%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}} --libsubdir='$compiler/$pkgid' --datasubdir='$pkgid' --ghc %{!?ghc_without_dynamic:--enable-executable-dynamic} %{?with_tests:--enable-tests} %{?cabal_configure_options} $cabal_configure_extra_options ++%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}} --libsubdir='$compiler/$pkgkey' --datasubdir='$pkgid' --ghc %{!?ghc_without_dynamic:--enable-executable-dynamic} %{?with_tests:--enable-tests} %{?cabal_configure_options} $cabal_configure_extra_options + + # install + %cabal_install %cabal copy --destdir=%{buildroot} -v diff --git a/ghc-rpm-macros-1.4.94.tar.xz b/ghc-rpm-macros-1.4.94.tar.xz new file mode 100644 index 0000000..95387f1 --- /dev/null +++ b/ghc-rpm-macros-1.4.94.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0af90cfccc0d1dd472aa72163dd9dae42b08809d5340e6da98e83912dda4465c +size 23076 diff --git a/ghc-rpm-macros-1.4.98.tar.bz2 b/ghc-rpm-macros-1.4.98.tar.bz2 deleted file mode 100644 index f3e441f..0000000 --- a/ghc-rpm-macros-1.4.98.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0b59b1f1f14e90876ce6a28c747295d73da2c82acfada66d2163a6262e0b1578 -size 15537 diff --git a/ghc-rpm-macros.changes b/ghc-rpm-macros.changes index bc8b1da..50c4180 100644 --- a/ghc-rpm-macros.changes +++ b/ghc-rpm-macros.changes @@ -1,16 +1,3 @@ -------------------------------------------------------------------- -Mon Oct 26 14:26:32 UTC 2015 - mimi.vx@gmail.com - -- update to 1.4.98 -- dropped: fix-library-dir.patch - suse-disable-debug-packages.patch - suse-docdir.patch - remove-flags.patch - fix-gen-filelists.patch -* fix some missing quoting for deps generation -* add and use ghc-pkg-wrapper script -* use ghc-pkg key field - ------------------------------------------------------------------- Wed Sep 16 09:26:31 UTC 2015 - mimi.vx@gmail.com diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec index 0623031..7b74d74 100644 --- a/ghc-rpm-macros.spec +++ b/ghc-rpm-macros.spec @@ -17,10 +17,11 @@ %global macros_dir %{_sysconfdir}/rpm + %global without_hscolour 1 Name: ghc-rpm-macros -Version: 1.4.98 +Version: 1.4.94 Release: 0 BuildArch: noarch Summary: RPM Macros for building packages for GHC @@ -29,10 +30,20 @@ Group: Development/Libraries/Other Url: https://fedoraproject.org/wiki/Haskell_SIG -# source prepared manually from github.com/opensuse-haskell/ghc-rpm-macros -Source0: %{name}-%{version}.tar.bz2 +# source prepared manually from github.com/fedora-haskell/ghc-rpm-macros +Source0: %{name}-%{version}.tar.xz +# PATCH-FIX-OPENSUSE suse-disable-debug-packages.patch peter.trommler@ohm-hochschule.de -- openSUSE way to disable debug packages +Patch1: suse-disable-debug-packages.patch +# PATCH-FIX-OPENSUSE suse-docdir.patch peter.trommler@ohm-hochschule.de -- fix location of docdir +Patch4: suse-docdir.patch +# PATCH-FIX_UPSTREAM fix-gen-filelists.patch +Patch5: fix-gen-filelists.patch +# PATCH-FIX-OPENSUSE remove-flags.patch peter.trommler@ohm-hochschule.de -- Do not pass CFLAGS and LDFLAGS to ghc. openSUSE is missing a RPM macro %%__global_ldflags. +Patch8: remove-flags.patch +# PATCH-FIX-UPSTREAM fix-library-dir.patch peter.trommler@ohm-hochschule.de -- Fix ghc-rpm-macros and ghc build system installing into different library directories (package version vs package key). +Patch9: fix-library-dir.patch -BuildRequires: bzip2 +BuildRequires: xz Requires: rpm %if %{undefined without_hscolour} Requires: hscolour @@ -57,13 +68,20 @@ for example in ghc and haskell-platform. %package -n ghc-srpm-macros Summary: RPM macros for building Haskell source packages Group: Development/Libraries/Other +%if 0%{?suse_version} > 1110 BuildArch: noarch +%endif %description -n ghc-srpm-macros Macros used when generating source Haskell rpm packages. %prep %setup -q -n %{name}-%{version} +%patch1 -p1 -b .debug +%patch4 -p1 +%patch5 -p1 +%patch8 -p1 +%patch9 -p1 %build echo no build stage needed @@ -72,20 +90,22 @@ echo no build stage needed install -p -D -m 0644 macros.ghc %{buildroot}%{macros_dir}/macros.ghc install -p -D -m 0644 macros.ghc-extra %{buildroot}/%{macros_dir}/macros.ghc-extra install -p -D -m 0755 ghc-deps.sh %{buildroot}/%{_prefix}/lib/rpm/ghc-deps.sh +install -p -D -m 0644 ghc.attr %{buildroot}/%{_prefix}/lib/rpm/fileattrs/ghc.attr install -p -D -m 0755 cabal-tweak-dep-ver %{buildroot}/%{_bindir}/cabal-tweak-dep-ver install -p -D -m 0755 cabal-tweak-flag %{buildroot}/%{_bindir}/cabal-tweak-flag -install -p -D -m 0755 ghc-pkg-wrapper %{buildroot}/%{_prefix}/lib/rpm/ghc-pkg-wrapper -install -p -D -m 0644 ghc.attr %{buildroot}/%{_prefix}/lib/rpm/fileattrs/ghc.attr %files %defattr(-,root,root,-) %doc COPYING AUTHORS %config %{macros_dir}/macros.ghc +%if 0%{suse_version} < 1200 +%dir %{_prefix}/lib/rpm +%dir %{_prefix}/lib/rpm/fileattrs +%endif %{_prefix}/lib/rpm/ghc-deps.sh +%{_prefix}/lib/rpm/fileattrs/ghc.attr %{_bindir}/cabal-tweak-dep-ver %{_bindir}/cabal-tweak-flag -%{_prefix}/lib/rpm/ghc-pkg-wrapper -%{_prefix}/lib/rpm/fileattrs/ghc.attr %files extra %defattr(-,root,root,-) diff --git a/remove-flags.patch b/remove-flags.patch new file mode 100644 index 0000000..fcc5168 --- /dev/null +++ b/remove-flags.patch @@ -0,0 +1,15 @@ +Index: ghc-rpm-macros-1.4.94/macros.ghc +=================================================================== +--- ghc-rpm-macros-1.4.94.orig/macros.ghc ++++ ghc-rpm-macros-1.4.94/macros.ghc +@@ -26,9 +26,7 @@ fi + %cabal_configure\ + %ghc_check_bootstrap\ + %global _hardened_ldflags %{nil}\ +-CFLAGS="${CFLAGS:-%optflags}"; export CFLAGS\ +-LDFLAGS="${LDFLAGS:-%__global_ldflags}"; export LDFLAGS\ +-%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{ghc_pkgdocdir} --libsubdir='$compiler/$pkgkey' --datasubdir='$pkgid' --ghc %{!?ghc_without_dynamic:--enable-executable-dynamic} %{?with_tests:--enable-tests} --ghc-options="$(echo ' '$CFLAGS | sed -e 's/ / -optc/g') $(echo ' '$LDFLAGS | sed -e 's/ / -optl/g')" %{?cabal_configure_options} $cabal_configure_extra_options ++%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}} --libsubdir='$compiler/$pkgid' --datasubdir='$pkgid' --ghc %{!?ghc_without_dynamic:--enable-executable-dynamic} %{?with_tests:--enable-tests} %{?cabal_configure_options} $cabal_configure_extra_options + + # install + %cabal_install %cabal copy --destdir=%{buildroot} -v diff --git a/suse-disable-debug-packages.patch b/suse-disable-debug-packages.patch new file mode 100644 index 0000000..7ef9f02 --- /dev/null +++ b/suse-disable-debug-packages.patch @@ -0,0 +1,18 @@ +Index: ghc-rpm-macros-1.4.93/macros.ghc +=================================================================== +--- ghc-rpm-macros-1.4.93.orig/macros.ghc ++++ ghc-rpm-macros-1.4.93/macros.ghc +@@ -186,3 +186,13 @@ done\ + %global without_prof 1\ + %global without_haddock 1\ + %global without_manual 1 ++ ++# ghc_suse_disable_debug_packages ++%ghc_suse_disable_debug_packages\ ++%global debug_package %{nil}\ ++%global __debug_install_post %{nil}\ ++%global suse_insert_debug_package %{nil}\ ++echo "/usr/lib/debug" > debugfiles.list\ ++mkdir -p %{buildroot}/usr/lib/debug\ ++echo "/usr/src/debug" > debugsources.list\ ++mkdir -p %{buildroot}/usr/src/debug diff --git a/suse-docdir.patch b/suse-docdir.patch new file mode 100644 index 0000000..dd65f79 --- /dev/null +++ b/suse-docdir.patch @@ -0,0 +1,26 @@ +Index: ghc-rpm-macros-1.4.93/macros.ghc +=================================================================== +--- ghc-rpm-macros-1.4.93.orig/macros.ghc ++++ ghc-rpm-macros-1.4.93/macros.ghc +@@ -19,6 +19,9 @@ proceeding, to avoid dependency ABI brea + %endif\ + fi + ++# no _pkgdocdir in openSUSE ++%_pkgdocdir %{_docdir}/%{name} ++ + # configure + %cabal_configure\ + %ghc_check_bootstrap\ +@@ -40,9 +43,9 @@ tests + %ghc_pkgdocdir %{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}} + + # root dir for ghc docs (used by ghc.spec) +-%ghc_html_dir %{_docdir}/ghc/html ++%ghc_html_dir %{_datadir}/doc/ghc/html + # deprecates +-%ghcdocbasedir %{_docdir}/ghc/html ++%ghcdocbasedir %{_datadir}/doc/ghc/html + + # libraries doc dir (internal) + %ghc_html_libraries_dir %{ghc_html_dir}/libraries