ghc-deps.sh: split off buildroot from the ghclibdir arg for more precise paths
This allows using the ghclibdir for checking for prof libs, avoiding collisions with other ghcX.Y-*-prof files: Processing files: ghc-doctemplates-prof-0.9-7.fc37.x86_64 /usr/lib/rpm/ghc-deps.sh: line 60: [: too many arguments /usr/lib/rpm/ghc-deps.sh: line 60: [: too many arguments /usr/lib/rpm/ghc-deps.sh: line 60: [: too many arguments
This commit is contained in:
parent
bb41ad6f7b
commit
f6aa817b92
18
ghc-deps.sh
18
ghc-deps.sh
@ -1,24 +1,24 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# find rpm provides and requires for Haskell GHC libraries
|
# find rpm provides and requires for Haskell GHC libraries
|
||||||
|
|
||||||
[ $# -lt 2 ] && echo "Usage: $(basename $0) [--provides|--requires] %{buildroot}%{ghclibdir} [%{?ghc_name}]" && exit 1
|
[ $# -lt 2 ] && echo "Usage: $(basename $0) [--provides|--requires] %{buildroot} %{ghclibdir} [%{?ghc_name}]" && exit 1
|
||||||
|
|
||||||
set +x
|
set +x
|
||||||
|
|
||||||
MODE=$1
|
MODE=$1
|
||||||
PKGBASEDIR=$2
|
BUILDROOT=$2
|
||||||
if [ -z "$3" ];
|
PKGBASEDIR=$3
|
||||||
|
if [ -z "$4" ];
|
||||||
then GHCPREFIX=ghc
|
then GHCPREFIX=ghc
|
||||||
else GHCPREFIX=$3
|
else GHCPREFIX=$4
|
||||||
fi
|
fi
|
||||||
if [ -d $PKGBASEDIR/lib ];
|
if [ -d $BUILDROOT$PKGBASEDIR/lib ];
|
||||||
then PKGBASELIB=$PKGBASEDIR/lib
|
then PKGBASELIB=$PKGBASEDIR/lib
|
||||||
LIB=lib/
|
|
||||||
else PKGBASELIB=$PKGBASEDIR
|
else PKGBASELIB=$PKGBASEDIR
|
||||||
fi
|
fi
|
||||||
PKGCONFDIR=$PKGBASELIB/package.conf.d
|
PKGCONFDIR=$PKGBASELIB/package.conf.d
|
||||||
|
|
||||||
GHC_PKG="/usr/lib/rpm/ghc-pkg-wrapper $PKGBASEDIR"
|
GHC_PKG="/usr/lib/rpm/ghc-pkg-wrapper $BUILDROOT$PKGBASEDIR"
|
||||||
|
|
||||||
case $MODE in
|
case $MODE in
|
||||||
--provides) field=id ;;
|
--provides) field=id ;;
|
||||||
@ -34,7 +34,7 @@ for i in $files; do
|
|||||||
meta=""
|
meta=""
|
||||||
case $i in
|
case $i in
|
||||||
# exclude rts.conf
|
# exclude rts.conf
|
||||||
$PKGCONFDIR/*-*.conf)
|
$BUILDROOT$PKGCONFDIR/*-*.conf)
|
||||||
name=$(grep "^name: " $i | sed -e "s/name: //")
|
name=$(grep "^name: " $i | sed -e "s/name: //")
|
||||||
ids=$($GHC_PKG field $name $field | sed -e "s/\(^\| \)rts\( \|$\)/ /")
|
ids=$($GHC_PKG field $name $field | sed -e "s/\(^\| \)rts\( \|$\)/ /")
|
||||||
for d in $ids; do
|
for d in $ids; do
|
||||||
@ -57,7 +57,7 @@ for i in $files; do
|
|||||||
echo "$GHCPREFIX-prof($d)"
|
echo "$GHCPREFIX-prof($d)"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
if [ -f /usr/lib*/ghc-*/$LIB*/libHS${d}_p.a -o -f $PKGBASELIB/*/libHS${d}_p.a ]; then
|
if [ -f $PKGBASELIB/*/libHS${d}_p.a -o -f $BUILDROOT$PKGBASELIB/*/libHS${d}_p.a ]; then
|
||||||
echo "$GHCPREFIX-prof($d)"
|
echo "$GHCPREFIX-prof($d)"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
Name: ghc-rpm-macros
|
Name: ghc-rpm-macros
|
||||||
Version: 2.3.16
|
Version: 2.4.0
|
||||||
Release: 1%{?dist}
|
Release: 1%{?dist}
|
||||||
Summary: RPM macros for building Haskell packages for GHC
|
Summary: RPM macros for building Haskell packages for GHC
|
||||||
|
|
||||||
@ -183,6 +183,10 @@ EOF
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Jun 10 2022 Jens Petersen <petersen@redhat.com> - 2.4.0-1
|
||||||
|
- change ghc-deps.sh, splitting buildroot path from ghclibdir
|
||||||
|
so that the ghc version can be used more precisely
|
||||||
|
|
||||||
* Wed Jun 8 2022 Jens Petersen <petersen@redhat.com> - 2.3.16-1
|
* Wed Jun 8 2022 Jens Petersen <petersen@redhat.com> - 2.3.16-1
|
||||||
- define ghc_prefix (used for ghcX.Y packaging)
|
- define ghc_prefix (used for ghcX.Y packaging)
|
||||||
- add _ghc_doc_dir
|
- add _ghc_doc_dir
|
||||||
|
4
ghc.attr
4
ghc.attr
@ -1,3 +1,3 @@
|
|||||||
%__ghc_provides %{_rpmconfigdir}/ghc-deps.sh --provides %{buildroot}%{ghclibdir} %{?ghc_name:ghc-%{ghc_version}}
|
%__ghc_provides %{_rpmconfigdir}/ghc-deps.sh --provides %{buildroot} %{ghclibdir} %{?ghc_name:ghc-%{ghc_version}}
|
||||||
%__ghc_requires %{_rpmconfigdir}/ghc-deps.sh --requires %{buildroot}%{ghclibdir} %{?ghc_name:ghc-%{ghc_version}}
|
%__ghc_requires %{_rpmconfigdir}/ghc-deps.sh --requires %{buildroot} %{ghclibdir} %{?ghc_name:ghc-%{ghc_version}}
|
||||||
%__ghc_path ^(%{ghcliblib}/package.conf.d/.*\.conf|%{ghclibplatform}/.*/libHS.*_p\.a)$
|
%__ghc_path ^(%{ghcliblib}/package.conf.d/.*\.conf|%{ghclibplatform}/.*/libHS.*_p\.a)$
|
||||||
|
Loading…
Reference in New Issue
Block a user