From 2df70001a83aedfc0cf57e8e3f0572f6be40f7d530994a73e8a168f9f87f7967 Mon Sep 17 00:00:00 2001 From: Peter Trommler Date: Mon, 23 Jan 2012 08:36:22 +0000 Subject: [PATCH] Accepting request 101085 from home:ptrommler:devel:languages:haskell:platform-2011.4 Fixed documentation directory. OBS-URL: https://build.opensuse.org/request/show/101085 OBS-URL: https://build.opensuse.org/package/show/devel:languages:haskell/ghc-rpm-macros?expand=0&rev=2 --- buildService.patch | 92 +++++++++++++++++++----------------- ghc-rpm-macros.changes | 17 +++++++ ghc-rpm-macros.ghc | 104 +++++++++++++++++++++++++++++++---------- ghc-rpm-macros.spec | 4 +- 4 files changed, 149 insertions(+), 68 deletions(-) diff --git a/buildService.patch b/buildService.patch index e2e6748..f5bfe6f 100644 --- a/buildService.patch +++ b/buildService.patch @@ -1,6 +1,6 @@ -diff -Nur 0.14.3.orig/ghc-deps.sh 0.14.3/ghc-deps.sh ---- 0.14.3.orig/ghc-deps.sh 2011-12-03 11:42:11.000000000 +0100 -+++ 0.14.3/ghc-deps.sh 2011-12-22 10:46:31.000000000 +0100 +diff -Nur 0.15.2.orig/ghc-deps.sh 0.15.2/ghc-deps.sh +--- 0.15.2.orig/ghc-deps.sh 2012-01-05 10:48:24.000000000 +0100 ++++ 0.15.2/ghc-deps.sh 2012-01-05 11:08:11.000000000 +0100 @@ -41,10 +41,11 @@ if [ -d "$PKGCONFDIR" ]; then META="" @@ -16,16 +16,18 @@ diff -Nur 0.14.3.orig/ghc-deps.sh 0.14.3/ghc-deps.sh if [ "$SHARED" ]; then SELF=ghc fi -@@ -52,14 +53,27 @@ +@@ -52,14 +53,29 @@ esac if [ "$META" ]; then PKGVER=$(echo $LIB_FILE | sed -e "s%$PKGBASEDIR/\([^/]\+\)/libHS.*%\1%") -+ for i in $PKGVER; do -+ case $i in -+ *-*) echo $i | sed -e "s/\(.*\)-\(.*\)/ghc-\1$POST = \2/" ;; -+ *) ;; -+ esac -+ done ++ if [ "$POST" ]; then ++ for i in $PKGVER; do ++ case $i in ++ *-*) echo $i | sed -e "s/\(.*\)-\(.*\)/ghc-\1$POST = \2/" ;; ++ *) ;; ++ esac ++ done ++ fi HASHS=$(${GHC_PKG} -f $PKGCONFDIR field $PKGVER $FIELD | sed -e "s/^$FIELD: \+//") for i in $HASHS; do case $i in @@ -45,7 +47,7 @@ diff -Nur 0.14.3.orig/ghc-deps.sh 0.14.3/ghc-deps.sh HASHS=$(${GHC_PKG} -f $PKGCONFDIR field $PKGVER id | sed -e "s/^id: \+//") for i in $HASHS; do echo $i | sed -e "s/\(.*\)-\(.*\)/$SELF(\1) = \2/" -@@ -69,8 +83,14 @@ +@@ -69,8 +85,14 @@ fi elif [ "$MODE" = "--requires" ]; then if file $i | grep -q 'executable, .* dynamically linked'; then @@ -61,10 +63,10 @@ diff -Nur 0.14.3.orig/ghc-deps.sh 0.14.3/ghc-deps.sh HASH=$(${GHC_PKG} --global field $p id | sed -e "s/^id: \+//") echo $HASH | sed -e "s/\(.*\)-\(.*\)/ghc(\1) = \2/" done -diff -Nur 0.14.3.orig/ghc-rpm-macros.ghc 0.14.3/ghc-rpm-macros.ghc ---- 0.14.3.orig/ghc-rpm-macros.ghc 2011-12-03 11:40:57.000000000 +0100 -+++ 0.14.3/ghc-rpm-macros.ghc 2011-12-25 16:46:52.000000000 +0100 -@@ -21,7 +21,7 @@ +diff -Nur 0.15.2.orig/ghc-rpm-macros.ghc 0.15.2/ghc-rpm-macros.ghc +--- 0.15.2.orig/ghc-rpm-macros.ghc 2012-01-05 10:48:24.000000000 +0100 ++++ 0.15.2/ghc-rpm-macros.ghc 2012-01-22 16:10:31.000000000 +0100 +@@ -21,13 +21,13 @@ # configure %cabal_configure\ %ghc_check_bootstrap\ @@ -73,16 +75,14 @@ diff -Nur 0.14.3.orig/ghc-rpm-macros.ghc 0.14.3/ghc-rpm-macros.ghc # install %cabal_install %cabal copy --destdir=%{buildroot} -v -@@ -40,7 +40,7 @@ - %define pkgnamever %{pkgname}-%{pkgver}\ - %define basepkg ghc-%{pkgname}\ - %define pkgdir %{ghclibdir}/%{pkgnamever}\ --%define docdir %{ghclibdocdir}/%{pkgnamever}\ -+%define docdir %{ghclibdocdir}/%{pkgname}-%{version}\ - rm -f %{basepkg}.files %{basepkg}-devel.files\ - %if %{undefined ghc_without_shared}\ - if [ -d "%{buildroot}%{pkgdir}" ]; then\ -@@ -49,10 +49,10 @@ + + # root dir for ghc docs +-%ghcdocbasedir %{_docdir}/ghc/html ++%ghcdocbasedir %{_docdir}/ghc-docs/html + # libraries doc dir + %ghclibdocdir %{ghcdocbasedir}/libraries + # top library dir +@@ -49,16 +49,16 @@ fi\ %endif\ %if 0%{!?1:1} && %{undefined ghc_exclude_docdir}\ @@ -96,16 +96,24 @@ diff -Nur 0.14.3.orig/ghc-rpm-macros.ghc 0.14.3/ghc-rpm-macros.ghc + echo "%{_docdir}/ghc-%{pkgname}" >> %{basepkg}%{?ghc_without_shared:-devel}.files\ fi\ %endif\ - echo "%{ghclibdir}/package.conf.d/%{pkgnamever}*.conf" >> %{basepkg}-devel.files\ -@@ -96,6 +96,7 @@ - %define basepkg ghc-%{pkgname}\ + %if 0%{!?1:1} && %{defined ghc_without_shared}\ + if [ "%{name}" = "ghc-%{pkg_name}" ]; then\ +- if [ -d "%{buildroot}%{_docdir}/%{name}-%{version}" ]; then\ +- mv %{buildroot}%{_docdir}/%{name}-%{version} %{buildroot}%{_docdir}/%{name}-devel-%{version}\ ++ if [ -d "%{buildroot}%{_docdir}/%{name}" ]; then\ ++ mv %{buildroot}%{_docdir}/%{name} %{buildroot}%{_docdir}/%{name}-devel\ + fi\ + fi\ + %endif\ +@@ -98,6 +98,7 @@ + %ghc_shared_files\ %if %{undefined ghc_without_shared}\ %files -n %{basepkg} -f %{basepkg}.files\ +%defattr(-,root,root,-)\ + %{?base_doc_files:%doc %base_doc_files}\ %endif\ - \ - %ghc_package_devel\ -@@ -110,7 +111,7 @@ + %{nil} +@@ -118,7 +119,7 @@ %define basepkg ghc-%{pkgname}\ %package -n %{basepkg}\ Summary: %{?common_summary}%{!?common_summary:Haskell %{pkgname} library}\ @@ -113,8 +121,16 @@ diff -Nur 0.14.3.orig/ghc-rpm-macros.ghc 0.14.3/ghc-rpm-macros.ghc +Group: Development/Libraries/Other\ %{?1:Version: %{pkgver}}\ %{-l:License: %{-l*}}\ - %{?ghc_pkg_obsoletes:Obsoletes: %(echo "%{ghc_pkg_obsoletes}" | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1/g")}\ -@@ -137,7 +138,7 @@ + %{?ghc_pkg_obsoletes:Obsoletes: %(echo "%{ghc_pkg_obsoletes}" | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1/g")} +@@ -154,6 +155,7 @@ + + %ghc_devel_files\ + %files -n %{basepkg}-devel -f %{basepkg}-devel.files\ ++%defattr(-,root,root,-)\ + %if %{defined ghc_without_shared}\ + %{?base_doc_files:%doc %base_doc_files}\ + %endif\ +@@ -175,7 +177,7 @@ %define basepkg ghc-%{pkgname}\ %package -n %{basepkg}-devel\ Summary: %{?common_summary}%{!?common_summary:Haskell %{pkgname} library} development files\ @@ -123,15 +139,7 @@ diff -Nur 0.14.3.orig/ghc-rpm-macros.ghc 0.14.3/ghc-rpm-macros.ghc %{?1:Version: %{pkgver}}\ %{-l:License: %{-l*}}\ %{?ghc_devel_requires}\ -@@ -163,6 +164,7 @@ - %ghc_pkg_recache\ - \ - %files -n %{basepkg}-devel -f %{basepkg}-devel.files\ -+%defattr(-,root,root,-)\ - %{nil} - - # ghc_strip_dynlinked -@@ -173,15 +175,17 @@ +@@ -229,15 +231,17 @@ # ghc_bin_build %ghc_bin_build\ diff --git a/ghc-rpm-macros.changes b/ghc-rpm-macros.changes index 6f3e224..c171900 100644 --- a/ghc-rpm-macros.changes +++ b/ghc-rpm-macros.changes @@ -1,3 +1,20 @@ +------------------------------------------------------------------- +Sun Jan 22 15:28:04 UTC 2012 - peter.trommler@ohm-hochschule.de + +- Fix license tag + +------------------------------------------------------------------- +Sun Jan 22 15:12:34 UTC 2012 - peter.trommler@ohm-hochschule.de + +- remove version numbers again +- move documentation to ghc-docs + +------------------------------------------------------------------- +Sat Jan 21 11:06:27 UTC 2012 - peter.trommler@ohm-hochschule.de + +- update to version 0.15.2 from upstream +- put version numbers in packages back in + ------------------------------------------------------------------- Mon Dec 26 10:57:44 UTC 2011 - peter.trommler@ohm-hochschule.de diff --git a/ghc-rpm-macros.ghc b/ghc-rpm-macros.ghc index 4e2d840..a34e4da 100644 --- a/ghc-rpm-macros.ghc +++ b/ghc-rpm-macros.ghc @@ -55,6 +55,13 @@ elif [ -d "%{buildroot}%{_docdir}/ghc-%{pkgnamever}" ]; then\ echo "%{_docdir}/ghc-%{pkgnamever}" >> %{basepkg}%{?ghc_without_shared:-devel}.files\ fi\ %endif\ +%if 0%{!?1:1} && %{defined ghc_without_shared}\ +if [ "%{name}" = "ghc-%{pkg_name}" ]; then\ + if [ -d "%{buildroot}%{_docdir}/%{name}-%{version}" ]; then\ + mv %{buildroot}%{_docdir}/%{name}-%{version} %{buildroot}%{_docdir}/%{name}-devel-%{version}\ + fi\ +fi\ +%endif\ echo "%{ghclibdir}/package.conf.d/%{pkgnamever}*.conf" >> %{basepkg}-devel.files\ if [ -d "%{buildroot}%{pkgdir}" ]; then\ find %{buildroot}%{pkgdir} -type d | sed "s/^/%dir /" >> %{basepkg}-devel.files\ @@ -88,19 +95,44 @@ Requires(postun): ghc-compiler = %{ghc_version}\ Requires: ghc-%{?pkg_name}%{!?pkg_name:%{pkgname}} = %{?pkgver}%{!?pkgver:%{version}}-%{release}\ %endif +%ghc_shared_files\ +%if %{undefined ghc_without_shared}\ +%files -n %{basepkg} -f %{basepkg}.files\ +%{?base_doc_files:%doc %base_doc_files}\ +%endif\ +%{nil} + # ghc_lib_package [-c cdepslist] [-h pkgdepslist] %ghc_lib_package(c:h:)\ %define pkgname %{?1}%{!?1:%{pkg_name}}\ -%define pkgver %{?2}%{!?2:%{version}}\ -%define pkgnamever %{pkgname}-%{pkgver}\ %define basepkg ghc-%{pkgname}\ -%if %{undefined ghc_without_shared}\ -%files -n %{basepkg} -f %{basepkg}.files\ -%endif\ +%ghc_shared_files\ \ %ghc_package_devel\ %{nil} +# ghc_package [-l licensetag] [name] [version] +%ghc_package(l:)\ +%define pkgname %{?1}%{!?1:%{pkg_name}}\ +%define pkgver %{?2}%{!?2:%{version}}\ +%define basepkg ghc-%{pkgname}\ +%package -n %{basepkg}\ +Summary: %{?common_summary}%{!?common_summary:Haskell %{pkgname} library}\ +Group: System Environment/Libraries\ +%{?1:Version: %{pkgver}}\ +%{-l:License: %{-l*}}\ +%{?ghc_pkg_obsoletes:Obsoletes: %(echo "%{ghc_pkg_obsoletes}" | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1/g")} + +# ghc_description [name] [version] +%ghc_description\ +%define pkgname %{?1}%{!?1:%{pkg_name}}\ +%define basepkg ghc-%{pkgname}\ +%description -n %{basepkg}\ +%{?common_description}%{!?common_description:Haskell %{pkgname} library.}\ +%if %{defined ghc_version} && %{undefined ghc_without_shared}\ +This package provides the shared library.\ +%endif + # ghc_binlib_package [-c cdepslist] [-h pkgdepslist] [-l licensetag] [-x] [name] [version] %ghc_binlib_package(c:h:l:x)\ %define pkgname %{?1}%{!?1:%{pkg_name}}\ @@ -108,18 +140,9 @@ Requires: ghc-%{?pkg_name}%{!?pkg_name:%{pkgname}} = %{?pkgver}%{!?pkgver: %define pkgnamever %{pkgname}-%{pkgver}\ %{!-x:%{?1:%global ghc_packages_list %{?ghc_packages_list} %{pkgnamever}}}\ %define basepkg ghc-%{pkgname}\ -%package -n %{basepkg}\ -Summary: %{?common_summary}%{!?common_summary:Haskell %{pkgname} library}\ -Group: System Environment/Libraries\ -%{?1:Version: %{pkgver}}\ -%{-l:License: %{-l*}}\ -%{?ghc_pkg_obsoletes:Obsoletes: %(echo "%{ghc_pkg_obsoletes}" | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1/g")}\ +%ghc_package\ \ -%description -n %{basepkg}\ -%{?common_description}%{!?common_description:Haskell %{pkgname} library.}\ -%if %{defined ghc_version} && %{undefined ghc_without_shared}\ -This package provides the shared library.\ -%endif\ +%ghc_description\ \ %ghc_lib_package\ %{nil} @@ -129,11 +152,26 @@ This package provides the shared library.\ # (deprecated) for docs post and postun %ghc_reindex_haddock : -# ghc_package_devel [-c cdepslist] [-h pkgdepslist] [-l licensetag] [name] [version] -%ghc_package_devel(c:h:l:)\ +%ghc_devel_files\ +%files -n %{basepkg}-devel -f %{basepkg}-devel.files\ +%if %{defined ghc_without_shared}\ +%{?base_doc_files:%doc %base_doc_files}\ +%endif\ +%{?devel_doc_files:%doc %devel_doc_files}\ +%{nil} + +%ghc_files()\ +%{?1:%define base_doc_files %*}\ +%define basepkg ghc-%{pkg_name}\ +%ghc_shared_files\ +\ +%ghc_devel_files\ +%{nil} + +# ghc_devel_package [-c cdepslist] [-h pkgdepslist] [-l licensetag] [name] [version] +%ghc_devel_package(c:h:l:)\ %define pkgname %{?1}%{!?1:%{pkg_name}}\ %define pkgver %{?2}%{!?2:%{version}}\ -%define pkgnamever %{pkgname}-%{pkgver}\ %define basepkg ghc-%{pkgname}\ %package -n %{basepkg}-devel\ Summary: %{?common_summary}%{!?common_summary:Haskell %{pkgname} library} development files\ @@ -150,19 +188,37 @@ Obsoletes: %{basepkg}-doc < %{pkgver}-%{release}\ Provides: %{basepkg}-doc = %{pkgver}-%{release}\ Obsoletes: %{basepkg}-prof < %{pkgver}-%{release}\ Provides: %{basepkg}-prof = %{pkgver}-%{release}\ -\ + +# ghc_devel_description +%ghc_devel_description\ +%define pkgname %{?1}%{!?1:%{pkg_name}}\ +%define basepkg ghc-%{pkgname}\ %description -n %{basepkg}-devel\ %{?common_description}%{!?common_description:Haskell %{pkgname} library.}\ \ -This package contains the development files.\ -\ +This package contains the development files. + +# ghc_devel_post_postun +%ghc_devel_post_postun\ +%define pkgname %{?1}%{!?1:%{pkg_name}}\ +%define basepkg ghc-%{pkgname}\ %post -n %{basepkg}-devel\ %ghc_pkg_recache\ \ %postun -n %{basepkg}-devel\ -%ghc_pkg_recache\ +%ghc_pkg_recache + +# ghc_package_devel [-c cdepslist] [-h pkgdepslist] [-l licensetag] [name] [version] +%ghc_package_devel(c:h:l:)\ +%define pkgname %{?1}%{!?1:%{pkg_name}}\ +%define basepkg ghc-%{pkgname}\ +%ghc_devel_package\ \ -%files -n %{basepkg}-devel -f %{basepkg}-devel.files\ +%ghc_devel_description\ +\ +%ghc_devel_post_postun\ +\ +%ghc_devel_files\ %{nil} # ghc_strip_dynlinked diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec index 0aaed37..b070b07 100644 --- a/ghc-rpm-macros.spec +++ b/ghc-rpm-macros.spec @@ -16,12 +16,12 @@ %global macros_file %{_sysconfdir}/rpm/macros.ghc Name: ghc-rpm-macros -Version: 0.14.3 +Version: 0.15.2 Release: 1 Summary: Macros for building packages for GHC Group: Development/Libraries/Other -License: GPLv3 +License: GPL-3.0 URL: https://fedoraproject.org/wiki/Haskell_SIG # This is a Fedora maintained package which is specific to