Compare commits
No commits in common. "master" and "ghc-rpm-macros-0_7_0-1_fc14" have entirely different histories.
master
...
ghc-rpm-ma
0
.cvsignore
Normal file
0
.cvsignore
Normal file
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
/ghc-rpm-macros-*/
|
|
8
AUTHORS
8
AUTHORS
@ -1,11 +1,3 @@
|
|||||||
Maintainer:
|
|
||||||
Jens Petersen <petersen@redhat.com>
|
|
||||||
|
|
||||||
Initial implementation:
|
|
||||||
Bryan O'Sullivan
|
Bryan O'Sullivan
|
||||||
Jens Petersen
|
Jens Petersen
|
||||||
Yaakov Nemoy
|
Yaakov Nemoy
|
||||||
|
|
||||||
Contributions from:
|
|
||||||
Peter Trommler
|
|
||||||
Ondřej Súkup
|
|
||||||
|
21
Makefile
Normal file
21
Makefile
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# 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)
|
@ -1,34 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
set -e +x
|
|
||||||
|
|
||||||
USAGE="Usage: $0 dep old new"
|
|
||||||
|
|
||||||
if [ $# -ne 3 ]; then
|
|
||||||
echo "$USAGE"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
DEP=$1
|
|
||||||
OLD=$(echo $2 | sed -e "s/*/\\\\*/g" -e "s/\./\\\\./g")
|
|
||||||
NEW=$3
|
|
||||||
|
|
||||||
CABALFILE=$(ls *.cabal)
|
|
||||||
|
|
||||||
if [ $(echo $CABALFILE | wc -w) -ne 1 ]; then
|
|
||||||
echo "There needs to be one .cabal file in the current dir!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
BREAK=[^[:alnum:]-]
|
|
||||||
|
|
||||||
if ! grep -q "$BREAK$DEP$BREAK[^,]*$OLD" $CABALFILE; then
|
|
||||||
echo "$CABALFILE does not match: $DEP $OLD"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f $CABALFILE.orig ]; then
|
|
||||||
BACKUP=.orig
|
|
||||||
fi
|
|
||||||
|
|
||||||
sed -i$BACKUP -e "s/\($BREAK$DEP$BREAK[^,]*\)$OLD/\1$NEW/g" $CABALFILE
|
|
@ -1,30 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
set -e +x
|
|
||||||
|
|
||||||
USAGE="Usage: $0 dep"
|
|
||||||
|
|
||||||
if [ $# -ne 1 ]; then
|
|
||||||
echo "$USAGE"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
DEP=$1
|
|
||||||
|
|
||||||
CABALFILE=$(ls *.cabal)
|
|
||||||
|
|
||||||
if [ $(echo $CABALFILE | wc -w) -ne 1 ]; then
|
|
||||||
echo "There needs to be one .cabal file in the current dir!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f $CABALFILE.orig ]; then
|
|
||||||
BACKUP=.orig
|
|
||||||
fi
|
|
||||||
|
|
||||||
if grep "$DEP" $CABALFILE | sed -e "s/$DEP//" | grep -q -e "[A-Za-z]"; then
|
|
||||||
echo "$0: deleting whole $DEP lines not safe - try more precise pattern"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
sed -i$BACKUP -e "/$DEP/d" $CABALFILE
|
|
@ -1,50 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# TODO:
|
|
||||||
# support setting flag when no upstream default
|
|
||||||
|
|
||||||
set -e +x
|
|
||||||
|
|
||||||
USAGE="Usage: $0 FLAG [True|False]"
|
|
||||||
|
|
||||||
if [ $# -ne 2 ]; then
|
|
||||||
echo "$USAGE"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
FLAG=$1
|
|
||||||
|
|
||||||
NEW=$2
|
|
||||||
case $NEW in
|
|
||||||
True) OLD=False ;;
|
|
||||||
False) OLD=True ;;
|
|
||||||
*) echo "Flag value can only be set to True or False" ; exit 1 ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
CABALFILE=$(ls *.cabal)
|
|
||||||
|
|
||||||
if [ $(echo $CABALFILE | wc -w) -ne 1 ]; then
|
|
||||||
echo "There needs to be one .cabal file in the current dir!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! grep -q -i "^flag *$FLAG" $CABALFILE; then
|
|
||||||
echo "$CABALFILE does not have flag $FLAG"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! grep -A3 -i "^flag *$FLAG" $CABALFILE | grep -q -i "default:"; then
|
|
||||||
echo "$CABALFILE: $FLAG flag might not have a default"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! grep -A3 -i "^flag *$FLAG" $CABALFILE | grep -q -i "default: *$OLD"; then
|
|
||||||
echo "$CABALFILE: $FLAG flag already defaults to $NEW"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f $CABALFILE.orig ]; then
|
|
||||||
BACKUP=.orig
|
|
||||||
fi
|
|
||||||
|
|
||||||
sed -i$BACKUP -e "/[Ff]lag *$FLAG/,/[Dd]efault: *$OLD/ s/\( \+\)\([Dd]efault:[ \t]*\)$OLD/\1\2$NEW\n\1manual: True/" $CABALFILE
|
|
43
ghc-deps.sh
43
ghc-deps.sh
@ -1,43 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# find rpm provides and requires for Haskell GHC libraries
|
|
||||||
|
|
||||||
[ $# -ne 2 ] && echo "Usage: $(basename $0) [--provides|--requires] %{buildroot}%{ghclibdir}" && exit 1
|
|
||||||
|
|
||||||
set +x
|
|
||||||
|
|
||||||
mode=$1
|
|
||||||
pkgbasedir=$2
|
|
||||||
pkgconfdir=$pkgbasedir/package.conf.d
|
|
||||||
|
|
||||||
ghc_pkg="/usr/lib/rpm/ghc-pkg-wrapper $pkgbasedir"
|
|
||||||
|
|
||||||
case $mode in
|
|
||||||
--provides) field=id ;;
|
|
||||||
--requires) field=depends ;;
|
|
||||||
*) echo "$(basename $0): Need --provides or --requires"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
ghc_ver=$(basename $pkgbasedir | sed -e s/ghc-//)
|
|
||||||
|
|
||||||
files=$(cat)
|
|
||||||
|
|
||||||
for i in $files; do
|
|
||||||
case $i in
|
|
||||||
# exclude builtin_rts.conf
|
|
||||||
$pkgconfdir/*-*.conf)
|
|
||||||
name=$(grep "^name: " $i | sed -e "s/name: //")
|
|
||||||
ids=$($ghc_pkg field $name $field | sed -e "s/rts//" -e "s/bin-package-db-[^ ]\+//")
|
|
||||||
|
|
||||||
for d in $ids; do
|
|
||||||
case $d in
|
|
||||||
*-*) echo "ghc-devel($d)" ;;
|
|
||||||
*) ;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
@ -1,32 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
[ $# -lt 1 ] && echo "Usage: `basename $0` %{buildroot}%{ghclibdir} ..." && exit 1
|
|
||||||
|
|
||||||
set +x
|
|
||||||
|
|
||||||
PKGBASEDIR=$1
|
|
||||||
shift
|
|
||||||
PKGCONFDIR=$PKGBASEDIR/package.conf.d
|
|
||||||
GHC_VER=$(basename $PKGBASEDIR | sed -e s/ghc-//)
|
|
||||||
|
|
||||||
# for a ghc build use the new ghc-pkg
|
|
||||||
INPLACE_GHCPKG=$PKGBASEDIR/../../bin/ghc-pkg-$GHC_VER
|
|
||||||
|
|
||||||
if [ -x "$INPLACE_GHCPKG" ]; then
|
|
||||||
case $GHC_VER in
|
|
||||||
7.4.*)
|
|
||||||
GHC_PKG="$PKGBASEDIR/ghc-pkg --global-conf=$PKGCONFDIR"
|
|
||||||
;;
|
|
||||||
7.6.*)
|
|
||||||
GHC_PKG="$PKGBASEDIR/ghc-pkg --global-package-db=$PKGCONFDIR"
|
|
||||||
;;
|
|
||||||
# 7.8 and 7.10
|
|
||||||
*)
|
|
||||||
GHC_PKG="env LD_LIBRARY_PATH=$(dirname $PKGBASEDIR) $PKGBASEDIR/bin/ghc-pkg --global-package-db=$PKGCONFDIR"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
else
|
|
||||||
GHC_PKG="/usr/bin/ghc-pkg-${GHC_VER} -f $PKGCONFDIR"
|
|
||||||
fi
|
|
||||||
|
|
||||||
$GHC_PKG -v0 --simple-output $* | uniq
|
|
230
ghc-rpm-macros.ghc
Normal file
230
ghc-rpm-macros.ghc
Normal file
@ -0,0 +1,230 @@
|
|||||||
|
# "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}
|
||||||
|
|
||||||
|
# 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 \
|
||||||
|
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}%{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 \
|
||||||
|
fi \
|
||||||
|
echo "%defattr(-,root,root,-)" > ${basefile}-prof.files \
|
||||||
|
if [ -d "${RPM_BUILD_ROOT}%{ghcpkgdir}" ]; then \
|
||||||
|
find ${RPM_BUILD_ROOT}%{ghcpkgdir} \\( -name "*_p.a" -o -name "*.p_hi" \\) >> ${basefile}-prof.files \
|
||||||
|
fi \
|
||||||
|
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 \
|
||||||
|
%{nil}
|
||||||
|
|
||||||
|
# compiler version
|
||||||
|
%ghc_version %{!?ghc_version_override:%(ghc --numeric-version)}%{?ghc_version_override}
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
# devel pkg basic requires
|
||||||
|
%ghc_requires Requires: ghc = %{ghc_version}\
|
||||||
|
Requires(post): ghc = %{ghc_version}\
|
||||||
|
Requires(postun): ghc = %{ghc_version}\
|
||||||
|
%if %{with 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}\
|
||||||
|
%files -n %{ghc_pkg_name} -f %{ghc_pkg_name}.files\
|
||||||
|
%defattr(-,root,root,-)\
|
||||||
|
%endif\
|
||||||
|
\
|
||||||
|
%ghc_package_devel\
|
||||||
|
\
|
||||||
|
%ghc_package_doc\
|
||||||
|
\
|
||||||
|
%ghc_package_prof\
|
||||||
|
%{nil}
|
||||||
|
|
||||||
|
# ghc_binlib_package [-n pkgname] [-c cdepslist] [-h pkgdepslist] [-l licensetag] [-v version]
|
||||||
|
%ghc_binlib_package(n:c:h:l:v:s:d:)\
|
||||||
|
%define local_pkg_name %{-n:%{-n*}}%{!-n:%{pkg_name}}\
|
||||||
|
%define ghc_pkg_name ghc-%{local_pkg_name}\
|
||||||
|
%package -n %{ghc_pkg_name}\
|
||||||
|
Summary: %{?common_summary}%{!?common_summary:%{local_pkg_name} library}\
|
||||||
|
Group: System Environment/Libraries\
|
||||||
|
%{-v:Version: %{-v*}}\
|
||||||
|
%{-l:License: %{-l*}}\
|
||||||
|
\
|
||||||
|
%description -n %{ghc_pkg_name}\
|
||||||
|
%{?common_description}%{!?common_description:Haskell %{local_pkg_name} library.}\
|
||||||
|
\
|
||||||
|
This package provides the shared library.\
|
||||||
|
\
|
||||||
|
%ghc_lib_package\
|
||||||
|
%{nil}
|
||||||
|
|
||||||
|
%ghc_pkg_recache %{_bindir}/ghc-pkg recache --no-user-package-conf || :
|
||||||
|
|
||||||
|
# for docs post and postun
|
||||||
|
%ghc_reindex_haddock ( cd %{ghcdocbasedir}/libraries && [ -x "./gen_contents_index" ] && ./gen_contents_index ) || :
|
||||||
|
|
||||||
|
# ghc_package_devel [-n pkgname] [-c cdepslist] [-h pkgdepslist] [-l licensetag] [-v version]
|
||||||
|
%ghc_package_devel(n:c:h:l:v:s:d:)\
|
||||||
|
%define local_pkg_name %{-n:%{-n*}}%{!-n:%{pkg_name}}\
|
||||||
|
%define ghc_pkg_name ghc-%{local_pkg_name}\
|
||||||
|
%package -n %{ghc_pkg_name}-devel\
|
||||||
|
Summary: %{?common_summary}%{!?common_summary:%{local_pkg_name} library} development files\
|
||||||
|
Group: Development/Libraries\
|
||||||
|
%{-v:Version: %{-v*}}\
|
||||||
|
%{-l:License: %{-l*}}\
|
||||||
|
%{?ghc_requires}\
|
||||||
|
%{!-h:%{?ghc_pkg_deps:Requires: %{ghc_pkg_deps}}}\
|
||||||
|
%{-h:Requires: %{-h*}}\
|
||||||
|
%{!-c:%{?ghc_pkg_c_deps:Requires: %{ghc_pkg_c_deps}}}\
|
||||||
|
%{-c:Requires: %{-c*}}\
|
||||||
|
\
|
||||||
|
%description -n %{ghc_pkg_name}-devel\
|
||||||
|
%{?common_description}%{!?common_description:Haskell %{local_pkg_name} library.}\
|
||||||
|
\
|
||||||
|
This package contains the development files.\
|
||||||
|
\
|
||||||
|
%post -n %{ghc_pkg_name}-devel\
|
||||||
|
%ghc_pkg_recache\
|
||||||
|
\
|
||||||
|
%postun -n %{ghc_pkg_name}-devel\
|
||||||
|
%ghc_pkg_recache\
|
||||||
|
\
|
||||||
|
%files -n %{ghc_pkg_name}-devel -f %{ghc_pkg_name}-devel.files\
|
||||||
|
%defattr(-,root,root,-)\
|
||||||
|
%{nil}
|
||||||
|
|
||||||
|
# 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:s:d:)\
|
||||||
|
%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 %{?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")}\
|
||||||
|
\
|
||||||
|
%description -n %{ghc_pkg_name}-doc\
|
||||||
|
%{?common_description}%{!?common_description:Haskell %{local_pkg_name} library.}\
|
||||||
|
\
|
||||||
|
This package contains development documentation files.\
|
||||||
|
\
|
||||||
|
%post -n %{ghc_pkg_name}-doc\
|
||||||
|
%ghc_reindex_haddock\
|
||||||
|
\
|
||||||
|
%postun -n %{ghc_pkg_name}-doc\
|
||||||
|
if [ "$1" -eq 0 ] ; then\
|
||||||
|
%ghc_reindex_haddock\
|
||||||
|
fi\
|
||||||
|
\
|
||||||
|
%files -n %{ghc_pkg_name}-doc -f %{ghc_pkg_name}-doc.files\
|
||||||
|
%defattr(-,root,root,-)\
|
||||||
|
%{nil}
|
||||||
|
|
||||||
|
# ghc_package_prof [-n pkgname] [-c cdepslist] [-h pkgdepslist] [-l licensetag] [-v version]
|
||||||
|
%ghc_package_prof(n:h:l:v:s:d:)\
|
||||||
|
%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 %{?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")}\
|
||||||
|
\
|
||||||
|
%description -n %{ghc_pkg_name}-prof\
|
||||||
|
%{?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 0%{!?__debug_package:1}\
|
||||||
|
find $RPM_BUILD_ROOT -type f -exec sh -c "file {} | grep -q 'dynamically linked'" \\; -print | xargs strip\
|
||||||
|
%endif
|
||||||
|
|
||||||
|
# ghc_bin_build
|
||||||
|
%ghc_bin_build\
|
||||||
|
%cabal_configure --ghc\
|
||||||
|
%cabal build
|
||||||
|
|
||||||
|
# ghc_lib_build
|
||||||
|
%ghc_lib_build\
|
||||||
|
%cabal_configure --ghc -p\
|
||||||
|
%cabal build\
|
||||||
|
%cabal haddock
|
||||||
|
|
||||||
|
# ghc_bin_install
|
||||||
|
%ghc_bin_install\
|
||||||
|
%cabal_install\
|
||||||
|
%ghc_strip_dynlinked
|
||||||
|
|
||||||
|
# ghc_lib_install
|
||||||
|
%ghc_lib_install\
|
||||||
|
%cabal_install\
|
||||||
|
%cabal_pkg_conf\
|
||||||
|
%ghc_gen_filelists\
|
||||||
|
%ghc_strip_dynlinked
|
1053
ghc-rpm-macros.spec
1053
ghc-rpm-macros.spec
File diff suppressed because it is too large
Load Diff
3
ghc.attr
3
ghc.attr
@ -1,3 +0,0 @@
|
|||||||
%__ghc_provides %{_rpmconfigdir}/ghc-deps.sh --provides %{buildroot}%{ghclibdir}
|
|
||||||
%__ghc_requires %{_rpmconfigdir}/ghc-deps.sh --requires %{buildroot}%{ghclibdir}
|
|
||||||
%__ghc_path ^%{ghclibdir}/package.conf.d/.*\.conf$
|
|
1
import.log
Normal file
1
import.log
Normal file
@ -0,0 +1 @@
|
|||||||
|
ghc-rpm-macros-0_1-6_fc10:HEAD:ghc-rpm-macros-0.1-6.fc10.src.rpm:1242200218
|
241
macros.ghc
241
macros.ghc
@ -1,241 +0,0 @@
|
|||||||
# RPM Macros for packaging Haskell cabalized packages -*-rpm-spec-*-
|
|
||||||
# see https://fedoraproject.org/wiki/Packaging:Haskell for more details
|
|
||||||
|
|
||||||
# "cabal"
|
|
||||||
%cabal [ -x Setup ] || ghc --make %{!?ghc_user_conf:-no-user-package-db} %{!?ghc_static_setup:-dynamic} Setup\
|
|
||||||
LANG=C.utf8\
|
|
||||||
./Setup
|
|
||||||
|
|
||||||
# compiler version
|
|
||||||
%ghc_version %{!?ghc_version_override:%(ghc --numeric-version)}%{?ghc_version_override}
|
|
||||||
|
|
||||||
|
|
||||||
%ghc_set_gcc_flags\
|
|
||||||
# -Wunused-label is extremely noisy\
|
|
||||||
%ifarch s390x\
|
|
||||||
CFLAGS="${CFLAGS:-$(echo %optflags | sed -e 's/-Wall //' -e 's/-Werror=format-security //')}"\
|
|
||||||
%else\
|
|
||||||
CFLAGS="${CFLAGS:-%optflags}"\
|
|
||||||
%endif\
|
|
||||||
export CFLAGS\
|
|
||||||
%global _hardened_ldflags %{nil}\
|
|
||||||
export LDFLAGS="${LDFLAGS:-%{?__global_ldflags}}"\
|
|
||||||
%{nil}
|
|
||||||
|
|
||||||
# configure
|
|
||||||
%cabal_configure\
|
|
||||||
%ghc_set_gcc_flags\
|
|
||||||
if ! [ -f Setup.hs -o -f Setup.lhs ]; then\
|
|
||||||
cp %{_datadir}/ghc-rpm-macros/Setup.hs .\
|
|
||||||
fi\
|
|
||||||
%cabal --version\
|
|
||||||
%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_ghcdocdir} --libsubdir='$compiler/$pkgid' --datasubdir='$pkgid' --libexecsubdir='$pkgid' --ghc %{?_ghcdynlibdir:--dynlibdir=%{_ghcdynlibdir}} %{!?ghc_without_dynamic:--enable-executable-dynamic} %{?with_tests:--enable-tests} %{?ghc_subpackaging:--user}%{!?ghc_subpackaging:--global} --ghc-options="${CFLAGS:+$(echo ' '$CFLAGS | sed -e 's/ / -optc/g')} ${LDFLAGS:+$(echo ' '$LDFLAGS | sed -e 's/ / -optl/g')}" --disable-executable-stripping --disable-library-stripping %{?cabal_configure_options} $cabal_configure_extra_options
|
|
||||||
|
|
||||||
# install
|
|
||||||
%cabal_install %cabal copy --destdir=%{buildroot} %{?cabal_install_options}
|
|
||||||
|
|
||||||
# tests
|
|
||||||
%cabal_test\
|
|
||||||
%if %{with tests}\
|
|
||||||
%cabal test %{?cabal_test_options}\
|
|
||||||
%endif
|
|
||||||
|
|
||||||
# no _pkgdocdir in EPEL <= 7
|
|
||||||
%ghc_pkgdocdir %{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}}
|
|
||||||
|
|
||||||
# root dir for ghc docs (used by ghc.spec)
|
|
||||||
%ghc_html_dir %{_docdir}/ghc/html
|
|
||||||
# deprecates
|
|
||||||
%ghcdocbasedir %ghc_html_dir
|
|
||||||
|
|
||||||
# libraries doc dir (internal)
|
|
||||||
%ghc_html_libraries_dir %{ghc_html_dir}/libraries
|
|
||||||
# deprecates
|
|
||||||
%ghclibdocdir %ghc_html_libraries_dir
|
|
||||||
|
|
||||||
# pkg doc dir
|
|
||||||
%ghc_html_pkg_dir %{ghc_html_libraries_dir}/%{pkg_name}-%{version}
|
|
||||||
# deprecates
|
|
||||||
%ghcpkgdocdir %ghc_html_pkg_dir
|
|
||||||
|
|
||||||
# top library dir
|
|
||||||
%ghclibdir %{_libdir}/ghc-%{ghc_version}
|
|
||||||
|
|
||||||
%_ghclicensedir %{?_defaultlicensedir}%{!?_defaultlicensedir:%_docdir}
|
|
||||||
|
|
||||||
# ghc_gen_filelists [name] [version]
|
|
||||||
%ghc_gen_filelists()\
|
|
||||||
%define pkgname %{?1}%{!?1:%{pkg_name}}\
|
|
||||||
%define pkgver %{?2}%{!?2:%{version}}\
|
|
||||||
%define pkgnamever %{pkgname}-%{pkgver}\
|
|
||||||
%define basepkg %{?ghc_name}%{!?ghc_name:ghc}-%{pkgname}\
|
|
||||||
%define docdir %{ghclibdocdir}/%{pkgnamever}\
|
|
||||||
if [ -z "$(ls %{buildroot}%{ghclibdir}/package.conf.d/)" ]; then\
|
|
||||||
echo "%{buildroot}%{ghclibdir}/package.conf.d/*.conf not found"\
|
|
||||||
exit 1\
|
|
||||||
fi\
|
|
||||||
rm -f %{basepkg}.files %{basepkg}-devel.files\
|
|
||||||
touch %{basepkg}.files %{basepkg}-devel.files\
|
|
||||||
ls %{buildroot}%{ghclibdir}/package.conf.d/%{pkgnamever}*.conf >> %{basepkg}-devel.files\
|
|
||||||
pkgdir="%{ghclibdir}/%{pkgnamever}"\
|
|
||||||
if [ -d "%{buildroot}${pkgdir}" ]; then\
|
|
||||||
%if %{defined _ghcdynlibdir}\
|
|
||||||
echo "${pkgdir}" >> %{basepkg}-devel.files\
|
|
||||||
%else\
|
|
||||||
echo "%%dir ${pkgdir}" >> %{basepkg}.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\
|
|
||||||
echo "%%attr(755,root,root) %{?_ghcdynlibdir}%{!?_ghcdynlibdir:${pkgdir}}/libHS%{pkgnamever}-*ghc%{ghc_version}.so" >> %{basepkg}.files\
|
|
||||||
fi\
|
|
||||||
if [ -d "%{buildroot}%{docdir}" ]; then\
|
|
||||||
echo "%{docdir}" >> %{basepkg}-devel.files\
|
|
||||||
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\
|
|
||||||
sed -i -e "s!%{buildroot}!!g" $i\
|
|
||||||
fi\
|
|
||||||
done\
|
|
||||||
%{nil}
|
|
||||||
|
|
||||||
# create and install package.conf file
|
|
||||||
# cabal_pkg_conf [name] [version]
|
|
||||||
%cabal_pkg_conf()\
|
|
||||||
%define pkgname %{?1}%{!?1:%{pkg_name}}\
|
|
||||||
%define pkgver %{?2}%{!?2:%{version}}\
|
|
||||||
%define pkgnamever %{pkgname}-%{pkgver}\
|
|
||||||
%cabal register --gen-pkg-config\
|
|
||||||
if [ -d %{pkgnamever}.conf ]; then\
|
|
||||||
for i in $(ls "%{pkgnamever}.conf/"); do\
|
|
||||||
sub=$(echo $i | sed -e "s/^[0-9]\\+-//")\
|
|
||||||
install -D --mode=0644 %{pkgnamever}.conf/${i} %{buildroot}%{ghclibdir}/package.conf.d/${sub}.conf\
|
|
||||||
done\
|
|
||||||
else\
|
|
||||||
install -D --mode=0644 %{pkgnamever}.conf %{buildroot}%{ghclibdir}/package.conf.d/%{pkgnamever}.conf\
|
|
||||||
fi\
|
|
||||||
%{nil}
|
|
||||||
|
|
||||||
# ghc_bin_build
|
|
||||||
%ghc_bin_build\
|
|
||||||
%undefine _enable_debug_packages\
|
|
||||||
%cabal_configure\
|
|
||||||
%cabal build %{?ghc_smp_mflags} %{?cabal_build_options}
|
|
||||||
|
|
||||||
# ghc_lib_build_without_haddock [name] [version]
|
|
||||||
%ghc_lib_build_without_haddock()\
|
|
||||||
%undefine _enable_debug_packages\
|
|
||||||
%if 0%{?rhel} && 0%{?rhel} < 8\
|
|
||||||
licensedirversion=%{?2:-%2}\
|
|
||||||
%endif\
|
|
||||||
%cabal_configure %{!?without_prof:-p} --enable-shared %{?pkg_name:--htmldir=%{ghclibdocdir}/%{pkg_name}-%{version}} %{?1:--docdir=%{_ghclicensedir}/ghc-%1${licensedirversion} --htmldir=%{ghclibdocdir}/%1-%2} %{?ghc_subpackaging:--user}%{!?ghc_subpackaging:--global} %{?ghc_with_lib_for_ghci:--enable-library-for-ghci}\
|
|
||||||
%cabal build %{?ghc_smp_mflags} %{?cabal_build_options}\
|
|
||||||
%{nil}
|
|
||||||
|
|
||||||
# ghc_lib_build [name] [version]
|
|
||||||
%ghc_lib_build()\
|
|
||||||
%ghc_lib_build_without_haddock %{?1} %{?2}\
|
|
||||||
%if %{undefined without_haddock}\
|
|
||||||
%define pkgname %{?1}%{!?1:%{pkg_name}}\
|
|
||||||
%define pkgver %{?2}%{!?2:%{version}}\
|
|
||||||
if [ -n dist/build/libHS%{pkgname}-%{pkgver}*.so ]; then\
|
|
||||||
%cabal haddock --html --hyperlink-source --hoogle %{?cabal_haddock_options}\
|
|
||||||
fi\
|
|
||||||
%endif\
|
|
||||||
%{nil}
|
|
||||||
|
|
||||||
# install bin package
|
|
||||||
%ghc_bin_install()\
|
|
||||||
%{!?_fileattrsdir:%global _use_internal_dependency_generator 0}\
|
|
||||||
%{!?_fileattrsdir:%global __find_requires %{_rpmconfigdir}/ghc-deps.sh %{buildroot}%{ghclibdir}}\
|
|
||||||
%cabal_install\
|
|
||||||
%{?ghc_subpackaging:%ghc_fix_rpath %{subpkgs}}\
|
|
||||||
%{nil}
|
|
||||||
|
|
||||||
# ghc_lib_install [name] [version]
|
|
||||||
%ghc_lib_install()\
|
|
||||||
%{!?_fileattrsdir:%global _use_internal_dependency_generator 0}\
|
|
||||||
%{!?_fileattrsdir:%global __find_provides %{_rpmconfigdir}/rpmdeps --provides}\
|
|
||||||
%{!?_fileattrsdir:%global __find_requires %{_rpmconfigdir}/ghc-deps.sh %{buildroot}%{ghclibdir}}\
|
|
||||||
%cabal_install\
|
|
||||||
%cabal_pkg_conf %{?1} %{?2}\
|
|
||||||
%ghc_gen_filelists %{?1} %{?2}\
|
|
||||||
%{?ghc_subpackaging:%ghc_fix_rpath %{subpkgs}}\
|
|
||||||
%{nil}
|
|
||||||
|
|
||||||
# ghc_fix_rpath lib-ver ...
|
|
||||||
%ghc_fix_rpath()\
|
|
||||||
%if %{undefined ghc_without_dynamic}\
|
|
||||||
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 lib in %*; do\
|
|
||||||
if [ -x "$i" ]; then\
|
|
||||||
rpath=$(chrpath $i | sed -e "s@^$i: R.*PATH=@@")\
|
|
||||||
case $rpath in\
|
|
||||||
*$PWD/$lib/dist/build*)\
|
|
||||||
case %{ghc_version} in\
|
|
||||||
7.10.*)\
|
|
||||||
pkgid=$(cd %{buildroot}%{ghclibdir}/package.conf.d; ls ${lib}* | sed -e "s/.conf$//")\
|
|
||||||
syspath=$(%{_rpmconfigdir}/ghc-pkg-wrapper %{buildroot}%{ghclibdir} --global --package-db=%{buildroot}%{ghclibdir}/package.conf.d field $pkgid library-dirs) ;;\
|
|
||||||
8.0)\
|
|
||||||
pkgid=$(cd %{buildroot}%{ghclibdir}; echo ${lib}*)\
|
|
||||||
syspath=$(%{_rpmconfigdir}/ghc-pkg-wrapper %{buildroot}%{ghclibdir} --global --package-db=%{buildroot}%{ghclibdir}/package.conf.d field $lib library-dirs | grep $pkgid) ;;\
|
|
||||||
*)\
|
|
||||||
syspath="" ;;\
|
|
||||||
esac\
|
|
||||||
newrpath=$(echo $rpath | sed -e "s@$PWD/$lib/dist/build@${syspath}@g" -e "s/::/:/" -e "s/^://" -e "s/:$//")\
|
|
||||||
chrpath -r $newrpath $i\
|
|
||||||
;;\
|
|
||||||
esac\
|
|
||||||
else\
|
|
||||||
echo "%%ghc_fix_rpath: no $i executable"\
|
|
||||||
exit 1\
|
|
||||||
fi\
|
|
||||||
done\
|
|
||||||
done\
|
|
||||||
%endif\
|
|
||||||
%{nil}
|
|
||||||
|
|
||||||
# Deprecated by ghc_fix_rpath:
|
|
||||||
# ghc_fix_dynamic_rpath prog ...
|
|
||||||
%ghc_fix_dynamic_rpath()\
|
|
||||||
%if %{undefined ghc_without_dynamic}\
|
|
||||||
if ! type chrpath > /dev/null; then exit 1; fi\
|
|
||||||
pdir=$(pwd)\
|
|
||||||
for i in %*; do\
|
|
||||||
case $i in\
|
|
||||||
/*) prog=%{buildroot}$i ;;\
|
|
||||||
*) prog=%{buildroot}%{_bindir}/$i ;;\
|
|
||||||
esac\
|
|
||||||
if [ -x "$prog" ]; then\
|
|
||||||
rpath=$(chrpath $prog | sed -e "s@^$prog: R.*PATH=@@")\
|
|
||||||
case $rpath in\
|
|
||||||
*$pdir*)\
|
|
||||||
newrpath=$(echo $rpath | sed -e "s@$pdir/dist/build@%{ghclibdir}/%{pkg_name}-%{version}@g")\
|
|
||||||
chrpath -r $newrpath $prog\
|
|
||||||
;;\
|
|
||||||
esac\
|
|
||||||
else\
|
|
||||||
echo "%%ghc_fix_dynamic_rpath: no such file $prog"\
|
|
||||||
exit 1\
|
|
||||||
fi\
|
|
||||||
done\
|
|
||||||
%endif\
|
|
||||||
%{nil}
|
|
||||||
|
|
||||||
%ghc_pkg_recache %{_bindir}/ghc-pkg-%{ghc_version} recache --no-user-package-db || :
|
|
||||||
|
|
||||||
# deprecated
|
|
||||||
%ghc_bootstrap\
|
|
||||||
%global without_prof 1\
|
|
||||||
%global without_haddock 1\
|
|
||||||
%global without_manual 1
|
|
||||||
|
|
||||||
# skip prof libs and documentation
|
|
||||||
%ghc_quick_build\
|
|
||||||
%global without_prof 1\
|
|
||||||
%global without_haddock 1
|
|
100
macros.ghc-extra
100
macros.ghc-extra
@ -1,100 +0,0 @@
|
|||||||
# RPM Macros for packaging Haskell packages with multiple libs -*-rpm-spec-*-
|
|
||||||
|
|
||||||
# ghc_lib_subpackage [-c cdepslist] [-d] [-l licensetag] [-x] [name-version]
|
|
||||||
# for backward compat also support: ghc_lib_subpackage name version
|
|
||||||
%ghc_lib_subpackage(c:dl:x)\
|
|
||||||
%define pkgname %{?2:%{1}}%{!?2:%{lua:\
|
|
||||||
local pv = rpm.expand("%1")\
|
|
||||||
local _, _, name = string.find(pv, "^([%a%d-]+)-")\
|
|
||||||
print(name)\
|
|
||||||
}}\
|
|
||||||
%define pkgver %{?2}%{!?2:%{lua:\
|
|
||||||
local pv = rpm.expand("%1")\
|
|
||||||
print(string.sub(pv, string.find(pv, "[%d.]+$")))\
|
|
||||||
}}\
|
|
||||||
%{!-x:%{?1:%global ghc_packages_list %{?ghc_packages_list} %{pkgname}-%{pkgver}}}\
|
|
||||||
%define ghc_prefix %{?ghc_name}%{!?ghc_name:ghc}\
|
|
||||||
%define basepkg %{ghc_prefix}-%{pkgname}\
|
|
||||||
%package -n %{basepkg}\
|
|
||||||
Summary: Haskell %{pkgname} library\
|
|
||||||
%if 0%{?rhel} && 0%{?rhel} < 6\
|
|
||||||
Group: System/Libraries\
|
|
||||||
%endif\
|
|
||||||
%{?1:Version: %{pkgver}}\
|
|
||||||
%{-l:License: %{-l*}}\
|
|
||||||
Url: http://hackage.haskell.org/package/%{pkgname}\
|
|
||||||
%{?ghc_pkg_obsoletes:Obsoletes: %(echo "%{ghc_pkg_obsoletes}" | sed -e "s/\\(%{ghc_prefix}-[^, ]*\\)-devel/\\1/g")}\
|
|
||||||
\
|
|
||||||
%description -n %{basepkg}\
|
|
||||||
This package provides the Haskell %{pkgname} library.\
|
|
||||||
\
|
|
||||||
%package -n %{basepkg}-devel\
|
|
||||||
Summary: Haskell %{pkgname} library development files\
|
|
||||||
%if 0%{?rhel} && 0%{?rhel} < 6\
|
|
||||||
Group: Development/Languages/Other\
|
|
||||||
%endif\
|
|
||||||
%{?1:Version: %{pkgver}}\
|
|
||||||
%{-l:License: %{-l*}}\
|
|
||||||
Requires(post): %{ghc_prefix}-compiler = %{ghc_version}\
|
|
||||||
Requires(postun): %{ghc_prefix}-compiler = %{ghc_version}\
|
|
||||||
Requires: %{ghc_prefix}-%{pkgname}%{?_isa} = %{pkgver}-%{release}\
|
|
||||||
%{?ghc_pkg_c_deps:Requires: %{ghc_pkg_c_deps}}\
|
|
||||||
%{-c:Requires: %{-c*}}\
|
|
||||||
%{?ghc_pkg_obsoletes:Obsoletes: %{ghc_pkg_obsoletes}}\
|
|
||||||
\
|
|
||||||
%description -n %{basepkg}-devel\
|
|
||||||
This package provides the Haskell %{pkgname} library development files.\
|
|
||||||
\
|
|
||||||
%post -n %{basepkg}-devel\
|
|
||||||
%ghc_pkg_recache\
|
|
||||||
\
|
|
||||||
%postun -n %{basepkg}-devel\
|
|
||||||
%ghc_pkg_recache\
|
|
||||||
\
|
|
||||||
%files -n %{basepkg} -f %{!-d:%{pkgname}-%{pkgver}/}%{basepkg}.files\
|
|
||||||
%if 0%{?rhel} && 0%{?rhel} < 6\
|
|
||||||
%defattr(-,root,root,-)\
|
|
||||||
%endif\
|
|
||||||
%{?base_doc_files:%doc %base_doc_files}\
|
|
||||||
\
|
|
||||||
%files -n %{basepkg}-devel -f %{!-d:%{pkgname}-%{pkgver}/}%{basepkg}-devel.files\
|
|
||||||
%if 0%{?rhel} && 0%{?rhel} < 6\
|
|
||||||
%defattr(-,root,root,-)\
|
|
||||||
%endif\
|
|
||||||
%{?devel_doc_files:%doc %devel_doc_files}\
|
|
||||||
%{nil}
|
|
||||||
|
|
||||||
# ghc_libs_build [name-version] ...
|
|
||||||
%ghc_libs_build()\
|
|
||||||
HOME=$PWD\
|
|
||||||
%global ghc_subpackaging 1\
|
|
||||||
for i in %*; do\
|
|
||||||
name=$(echo $i | sed -e "s/\\(.*\\)-.*/\\1/")\
|
|
||||||
ver=$(echo $i | sed -e "s/.*-\\(.*\\)/\\1/")\
|
|
||||||
cd $name-$ver\
|
|
||||||
case $name in\
|
|
||||||
haskell-platform)\
|
|
||||||
%ghc_lib_build_without_haddock $name $ver\
|
|
||||||
;;\
|
|
||||||
*)\
|
|
||||||
%ghc_lib_build $name $ver\
|
|
||||||
./Setup register --inplace\
|
|
||||||
;;\
|
|
||||||
esac\
|
|
||||||
cd ..\
|
|
||||||
done\
|
|
||||||
%{nil}
|
|
||||||
|
|
||||||
# ghc_libs_install [name-version] ...
|
|
||||||
%ghc_libs_install()\
|
|
||||||
HOME=$PWD\
|
|
||||||
args="%*"\
|
|
||||||
for i in $args; do\
|
|
||||||
cd $i\
|
|
||||||
name=$(echo $i | sed -e "s/\\(.*\\)-.*/\\1/")\
|
|
||||||
ver=$(echo $i | sed -e "s/.*-\\(.*\\)/\\1/")\
|
|
||||||
%ghc_lib_install $name $ver\
|
|
||||||
cd ..\
|
|
||||||
done\
|
|
||||||
%ghc_fix_rpath $args\
|
|
||||||
%{nil}
|
|
@ -1,9 +0,0 @@
|
|||||||
# OS specific settings
|
|
||||||
|
|
||||||
%_ghcdocdir %{_ghclicensedir}/%{name}
|
|
||||||
|
|
||||||
%_ghcdynlibdir %{_libdir}
|
|
||||||
|
|
||||||
%ghc_without_dynamic 1
|
|
||||||
|
|
||||||
%cabal_install_options -v
|
|
@ -1,77 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# for testing updates to ghc-rpm-macros etc
|
|
||||||
# In a pkg dir run
|
|
||||||
# $ ./test-rebuild.sh
|
|
||||||
# or clone a pkg branch:
|
|
||||||
# $ ./test-rebuild.sh [pkg]
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
PKG=${1:-$(fedpkg gimmespec | sed -e "s/.spec//")}
|
|
||||||
|
|
||||||
[ -d "$PKG" -o -f "$PKG.spec" ] || fedpkg clone -a $PKG
|
|
||||||
|
|
||||||
[ -d "$PKG" ] && cd $PKG
|
|
||||||
|
|
||||||
ARCH=$(arch)
|
|
||||||
|
|
||||||
#if [ -d $ARCH ]; then
|
|
||||||
# echo Please move existing $ARCH/
|
|
||||||
# exit 1
|
|
||||||
#fi
|
|
||||||
|
|
||||||
if [ -f /etc/os-release ]; then
|
|
||||||
eval $(grep VERSION_ID /etc/os-release)
|
|
||||||
if git branch -a | grep -q f$VERSION_ID; then
|
|
||||||
BRANCH=f$VERSION_ID
|
|
||||||
else
|
|
||||||
case $VERSION_ID in
|
|
||||||
7.*) BRANCH=epel7 ;;
|
|
||||||
*) BRANCH=master ;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
# assume RHEL6
|
|
||||||
BRANCH=el6
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "* $BRANCH" != "$(git branch | grep '^*')" ]; then
|
|
||||||
fedpkg switch-branch $BRANCH
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "* $BRANCH" != "$(git branch | grep '^*')" ]; then
|
|
||||||
echo "Git branch does not match Fedora installation!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
git pull
|
|
||||||
|
|
||||||
if [ "$UID" != "0" ]; then
|
|
||||||
SUDO="sudo"
|
|
||||||
else
|
|
||||||
SUDO=""
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo Running dnf builddep:
|
|
||||||
$SUDO dnf builddep $PKG.spec
|
|
||||||
|
|
||||||
fedpkg local
|
|
||||||
|
|
||||||
VERREL=$(fedpkg verrel | sed -e "s/^$PKG-//")
|
|
||||||
|
|
||||||
TMP=test-tmp
|
|
||||||
|
|
||||||
mkdir -p $TMP/
|
|
||||||
|
|
||||||
PKGS=$(cd $ARCH; rpm -qp $(ls *-$VERREL*.rpm))
|
|
||||||
|
|
||||||
for i in $PKGS; do
|
|
||||||
# FIXME: should check NVR is same before building
|
|
||||||
rpm -q --quiet $i || $SUDO dnf install -q $i
|
|
||||||
for k in list requires provides scripts; do
|
|
||||||
rpm -qp --$k $ARCH/$i.rpm | grep -v rpmlib > $TMP/$i.$k.test || :
|
|
||||||
rpm -q --$k $i | grep -v rpmlib > $TMP/$i.$k.installed || :
|
|
||||||
diff -u $TMP/$i.$k.installed $TMP/$i.$k.test -I /usr/lib/.build-id || :
|
|
||||||
done
|
|
||||||
done
|
|
Loading…
Reference in New Issue
Block a user