SHA256
1
0
forked from pool/mono-core

- Add mono-find-provides and mono-find-requires from Fedora and use

it instead. Fixes boo#1152775

OBS-URL: https://build.opensuse.org/package/show/Mono:Factory/mono-core?expand=0&rev=211
This commit is contained in:
Ismail Dönmez 2020-05-27 09:35:59 +00:00 committed by Git OBS Bridge
parent ddb59c9174
commit e8624b5d06
5 changed files with 144 additions and 2 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed May 27 09:35:05 UTC 2020 - Ismail Dönmez <idonmez@suse.com>
- Add mono-find-provides and mono-find-requires from Fedora and use
it instead. Fixes boo#1152775
-------------------------------------------------------------------
Tue May 26 19:57:47 UTC 2020 - Michael Gorse <mgorse@suse.com>

View File

@ -52,6 +52,8 @@ Source0: http://download.mono-project.com/sources/mono/mono-%{version}.%{
Source1: mono-core.rpmlintrc
Source2: gmcs
Source3: mono.attr
Source4: mono-find-provides
Source5: mono-find-requires
# ppc build segfault so exclude it
ExcludeArch: ppc
# PATCH-FIX-OPENSUSE remove checks for libmono in mono-find-provides and mono-find-requires scripts
@ -285,6 +287,10 @@ make
# install the rpm file attributes to arm the dependency scanner
mkdir -p %{buildroot}%{_rpmconfigdir}/fileattrs
install %{SOURCE3} %{buildroot}%{_rpmconfigdir}/fileattrs/mono.attr
# Install custom mono-find-{provides/requires}
install -p -m755 %{SOURCE4} %{SOURCE5} %{buildroot}%{_rpmconfigdir}
%endif
# Remove hardcoded lib directory from the config
@ -1306,6 +1312,8 @@ Mono development tools.
%if 0%{?suse_version} > 1500
%{_rpmconfigdir}/fileattrs/mono.attr
%{_rpmconfigdir}/mono-find-provides
%{_rpmconfigdir}/mono-find-requires
%endif
%{_bindir}/mono-find-provides

42
mono-find-provides Normal file
View File

@ -0,0 +1,42 @@
#!/usr/bin/bash
#
# mono-find-provides
#
# Authors:
# Ben Maurer (bmaurer@ximian.com)
#
# (C) 2005 Novell (http://www.novell.com)
#
# Args: builddir buildroot libdir
IFS=$'\n'
filelist=($(grep -Ev '/usr/doc/|/usr/share/doc/'))
monolist=($(printf "%s\n" "${filelist[@]}" | grep -E "\\.(exe|dll)\$"))
# If monodis is in the package being installed, use that one
# This is to support building mono
build_bindir="$2/usr/bin"
build_libdir="$2$3"
if [ -x $build_bindir/monodis ]; then
monodis="$build_bindir/monodis"
export LD_LIBRARY_PATH=$build_libdir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
elif [ -x /usr/bin/monodis ]; then
monodis="/usr/bin/monodis"
else
exit 0;
fi
export MONO_SHARED_DIR=$1
for i in "${monolist[@]}"; do
($monodis --assembly $i | awk '
BEGIN { LIBNAME=""; VERSION=""; }
/^Version:/ { VERSION=$2 }
/^Name:/ { LIBNAME=$2 }
END {
if (VERSION && LIBNAME)
print "mono(" LIBNAME ") = " VERSION
}
') 2>/dev/null
done

86
mono-find-requires Normal file
View File

@ -0,0 +1,86 @@
#!/usr/bin/bash
#
# mono-find-requires
#
# Authors:
# Ben Maurer (bmaurer@ximian.com)
#
# (C) 2005 Novell (http://www.novell.com)
#
# Args: builddir buildroot libdir
IFS=$'\n'
filelist=($(grep -Ev '/usr/doc/|/usr/share/doc/'))
monolist=($(printf "%s\n" "${filelist[@]}" | grep -E "\\.(exe|dll)\$"))
# If monodis is in the package being installed, use that one
# This is to support building mono
build_bindir="$2/usr/bin"
build_libdir="$2$3"
if [ -x $build_bindir/monodis ]; then
monodis="$build_bindir/monodis"
export LD_LIBRARY_PATH=$build_libdir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
elif [ -x /usr/bin/monodis ]; then
monodis="/usr/bin/monodis"
else
exit 0;
fi
export MONO_SHARED_DIR=$1
REQUIRES=$(
for i in "${monolist[@]}"; do
($monodis --assemblyref $i | awk '
BEGIN { START=0; LIBNAME=""; VERSION=""; }
(START==0) && /^[0-9]+: Version=/ {
START=1;
sub(/Version=/, "", $2);
VERSION=$2
}
(START==1) && /^\tName=/ {
sub(/Name=/, "", $1);
LIBNAME=$1
print "mono(" LIBNAME ") = " VERSION
START=0
}
') 2> /dev/null
done
)
PROVIDES=$(
for i in "${monolist[@]}"; do
($monodis --assembly $i | awk '
BEGIN { LIBNAME=""; VERSION=""; }
/^Version:/ { VERSION=$2 }
/^Name:/ { LIBNAME=$2 }
END {
if (VERSION && LIBNAME)
print "mono(" LIBNAME ") = " VERSION
}
') 2>/dev/null
done
)
#
# This is a little magic trick to get all REQUIRES that are not
# in PROVIDES. While RPM functions correctly when such deps exist,
# they make the metadata a bit bloated.
#
# Filter out dups from both lists
REQUIRES=$(echo "$REQUIRES" | sort | uniq)
PROVIDES=$(echo "$PROVIDES" | sort | uniq)
#
# Get a list of elements that exist in exactly one of PROVIDES or REQUIRES
#
UNIQ=$(echo "$PROVIDES
$REQUIRES" | sort | uniq -u)
#
# Of those, only chose the ones that are in REQUIRES
#
echo "$UNIQ
$REQUIRES" | sort | uniq -d

View File

@ -1,3 +1,3 @@
%__mono_provides %{_bindir}/mono-find-provides %{_builddir}/%{?buildsubdir} %{buildroot} %{_libdir}
%__mono_requires %{_bindir}/mono-find-requires %{_builddir}/%{?buildsubdir} %{buildroot} %{_libdir}
%__mono_provides %{_rpmconfigdir}/mono-find-provides %{_builddir}/%{?buildsubdir} %{buildroot} %{_libdir}
%__mono_requires %{_rpmconfigdir}/mono-find-requires %{_builddir}/%{?buildsubdir} %{buildroot} %{_libdir}
%__mono_magic Mono/.Net assembly