forked from pool/ghc-rpm-macros
Haskell Platform 2011.4 OBS-URL: https://build.opensuse.org/request/show/99815 OBS-URL: https://build.opensuse.org/package/show/devel:languages:haskell/ghc-rpm-macros?expand=0&rev=1
153 lines
6.0 KiB
Diff
153 lines
6.0 KiB
Diff
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
|
|
@@ -41,10 +41,11 @@
|
|
if [ -d "$PKGCONFDIR" ]; then
|
|
META=""
|
|
SELF=""
|
|
+ POST=""
|
|
case $LIB_FILE in
|
|
- *.so) META=ghc ;;
|
|
- *_p.a) META=ghc-prof SELF=ghc-devel ;;
|
|
- *.a) META=ghc-devel
|
|
+ *.so) META=ghc ;;
|
|
+ *_p.a) META=ghc-prof POST=-prof SELF=ghc-devel ;;
|
|
+ *.a) META=ghc-devel POST=-devel
|
|
if [ "$SHARED" ]; then
|
|
SELF=ghc
|
|
fi
|
|
@@ -52,14 +53,27 @@
|
|
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
|
|
HASHS=$(${GHC_PKG} -f $PKGCONFDIR field $PKGVER $FIELD | sed -e "s/^$FIELD: \+//")
|
|
for i in $HASHS; do
|
|
case $i in
|
|
- *-*) echo $i | sed -e "s/\(.*\)-\(.*\)/$META(\1) = \2/" ;;
|
|
+ *-*) echo $i | sed -e "s/\(.*\)-\(.*\)/$META(\1) = \2/"
|
|
+ echo $i | sed -e "s/\(.*\)-\(.*\)-\(.*\)/ghc-\1$POST = \2/";;
|
|
*) ;;
|
|
esac
|
|
done
|
|
if [ "$MODE" = "--requires" -a "$SELF" ]; then
|
|
+ for i in $PKGVER; do
|
|
+ case $i in
|
|
+ *-*) echo $i | sed -e "s/\(.*\)-\(.*\)/ghc-\1 = \2/" ;;
|
|
+ *) ;;
|
|
+ esac
|
|
+ done
|
|
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 @@
|
|
fi
|
|
elif [ "$MODE" = "--requires" ]; then
|
|
if file $i | grep -q 'executable, .* dynamically linked'; then
|
|
- BIN_DEPS=$(ldd $i | grep libHS | grep -v libHSrts | sed -e "s%^\\tlibHS\(.*\)-ghc${GHCVERSION}.so =.*%\1%")
|
|
+ BIN_DEPS=$(ldd $i | grep libHS | grep -v libHSrts | grep -v libHSffi | sed -e "s%^\\tlibHS\(.*\)-ghc${GHCVERSION}.so =.*%\1%")
|
|
for p in ${BIN_DEPS}; do
|
|
+ # for build-service
|
|
+ case $p in
|
|
+ *-*) echo $p | sed -e "s/\(.*\)-\(.*\)/ghc-\1 = \2/" ;;
|
|
+ *) ;;
|
|
+ esac
|
|
+ # end buildservice
|
|
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 @@
|
|
# configure
|
|
%cabal_configure\
|
|
%ghc_check_bootstrap\
|
|
-%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_docdir}/%{name}-%{version} %{?pkg_name:--htmldir=%{ghclibdocdir}/%{pkg_name}-%{version}} --libsubdir='$compiler/$pkgid' --ghc %{!?ghc_without_shared:--enable-shared} %{!?ghc_without_dynamic:--enable-executable-dynamic} %{?cabal_configure_options}
|
|
+%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_docdir}/%{name} %{?pkg_name:--htmldir=%{ghclibdocdir}/%{pkg_name}-%{version}} --libsubdir='$compiler/$pkgid' --ghc %{!?ghc_without_shared:--enable-shared} %{!?ghc_without_dynamic:--enable-executable-dynamic} %{?cabal_configure_options}
|
|
|
|
# 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 @@
|
|
fi\
|
|
%endif\
|
|
%if 0%{!?1:1} && %{undefined ghc_exclude_docdir}\
|
|
-if [ -d "%{buildroot}%{_docdir}/%{name}-%{version}" ]; then\
|
|
- echo "%{_docdir}/%{name}-%{version}" >> %{basepkg}%{?ghc_without_shared:-devel}.files\
|
|
-elif [ -d "%{buildroot}%{_docdir}/ghc-%{pkgnamever}" ]; then\
|
|
- echo "%{_docdir}/ghc-%{pkgnamever}" >> %{basepkg}%{?ghc_without_shared:-devel}.files\
|
|
+if [ -d "%{buildroot}%{_docdir}/%{name}" ]; then\
|
|
+ echo "%{_docdir}/%{name}" >> %{basepkg}%{?ghc_without_shared:-devel}.files\
|
|
+elif [ -d "%{buildroot}%{_docdir}/ghc-%{pkgname}" ]; then\
|
|
+ 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 %{undefined ghc_without_shared}\
|
|
%files -n %{basepkg} -f %{basepkg}.files\
|
|
+%defattr(-,root,root,-)\
|
|
%endif\
|
|
\
|
|
%ghc_package_devel\
|
|
@@ -110,7 +111,7 @@
|
|
%define basepkg ghc-%{pkgname}\
|
|
%package -n %{basepkg}\
|
|
Summary: %{?common_summary}%{!?common_summary:Haskell %{pkgname} library}\
|
|
-Group: System Environment/Libraries\
|
|
+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 @@
|
|
%define basepkg ghc-%{pkgname}\
|
|
%package -n %{basepkg}-devel\
|
|
Summary: %{?common_summary}%{!?common_summary:Haskell %{pkgname} library} development files\
|
|
-Group: Development/Libraries\
|
|
+Group: Development/Libraries/Other\
|
|
%{?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 @@
|
|
|
|
# ghc_bin_build
|
|
%ghc_bin_build\
|
|
+export SUSE_ASNEEDED=0\
|
|
%global debug_package %{nil}\
|
|
%cabal_configure\
|
|
%cabal build
|
|
|
|
# ghc_lib_build [name] [version]
|
|
%ghc_lib_build()\
|
|
+export SUSE_ASNEEDED=0\
|
|
%global debug_package %{nil}\
|
|
%{?1:cd %1-%2}\
|
|
-%cabal_configure %{!?without_prof:-p} %{?1:--docdir=%{_docdir}/ghc-%1-%2 --htmldir=%{ghclibdocdir}/%1-%2}\
|
|
+%cabal_configure %{!?without_prof:-p} %{?1:--docdir=%{_docdir}/ghc-%1 --htmldir=%{ghclibdocdir}/%1-%2}\
|
|
%cabal build\
|
|
%if %{undefined without_haddock}\
|
|
%cabal haddock %{!?without_hscolour:%(if [ -x %{_bindir}/HsColour ]; then echo --hyperlink-source; fi)}\
|