ALT Linux Team development discussions
 help / color / mirror / Atom feed
* [devel] rpm-build-mono configlist
@ 2007-08-03  9:34 Alexey Tourbin
  2007-08-04 21:29 ` Alexey Tourbin
  0 siblings, 1 reply; 2+ messages in thread
From: Alexey Tourbin @ 2007-08-03  9:34 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 2670 bytes --]

Господа, вот этот кусок кода я не понял и собираюсь его убить.
По-моему, он просто не работает, а добавлять 2>/dev/null дело не хитрое.

$ rpm -ql mono |fgrep .config |xargs monodis --assemblyref
Error while trying to process /etc/mono/1.0/machine.config
Error while trying to process /etc/mono/2.0/machine.config
Error while trying to process /etc/mono/2.0/web.config
$ 

Тем более в changelog'е это изменение не отражено.
Если кто-то знает, в чем здесь дело, прошу мне сообщить.


commit 6eb70398d8ba1426b8d878e798477449728d2fa1
Author: Ildar Mulyukov <ildar@altlinux>
Date:   Mon Oct 9 05:31:51 2006 +0000

    1.0-alt2
    
    - fixed rpm-build-mono.macros

diff --git a/mono.req b/mono.req
index 71b245f..4814c31 100644
--- a/mono.req
+++ b/mono.req
@@ -14,6 +14,7 @@
 IFS=$'\n'
 filelist=($(grep -Ev '/usr/doc/|/usr/share/doc/'))
 monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)\$"))
+configlist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.config\$"))
 
 # If monodis is in the package being installed, use that one
 # This is to support building mono
@@ -54,6 +55,28 @@ REQUIRES=$(
 			}
 		    ') 2> /dev/null
 	done
+	for i in "${configlist[@]}"; do
+		($monodis --assemblyref $i | awk '
+			BEGIN { START=0; LIBNAME=""; }
+			(START==0) && /^[0-9]+: Version=/ {
+				START=1;
+				sub(/Version=/, "", $2);
+				VERSION=$2
+			}
+
+			(START==1) && /^\tName=/ {
+				sub(/Name=/, "", $1);
+				LIBNAME=$1
+				# Allow rpm deps to be resolved for 1.0 profile version
+				if (VERSION=="1.0.3300.0")
+					OP=">="
+				else
+					OP="="
+				print "mono(" LIBNAME ") " OP " " VERSION
+				START=0
+			}
+		    ') 2> /dev/null
+	done
 )
 
 PROVIDES=$(
diff --git a/rpm-build-mono.macros b/rpm-build-mono.macros
index 86a43c2..7ad9972 100644
--- a/rpm-build-mono.macros
+++ b/rpm-build-mono.macros
@@ -1,2 +1,2 @@
-%_monodir       %_libdir/mono
+%_monodir       %_prefix/lib/mono
 %_monogacdir    %_monodir/gac
diff --git a/rpm-build-mono.spec b/rpm-build-mono.spec
index 7957cfb..91d98ed 100644
--- a/rpm-build-mono.spec
+++ b/rpm-build-mono.spec
@@ -1,6 +1,8 @@
+# TODO mono.req detect *so* deps from *.config
+
 Name: rpm-build-mono
 Version: 1.0
-Release: alt1
+Release: alt2
 
 Summary: RPM helper macros and dependency utils to build Mono packages
 Group: Development/Other
@@ -31,5 +33,8 @@ RPM packages containing Mono bytecode archives etc.
 %_libdir/rpm/*
 
 %changelog
+* Mon Oct 09 2006 Ildar Mulyukov <ildar@altlinux> 1.0-alt2
+- fixed rpm-build-mono.macros
+
 * Thu Oct 05 2006 Ildar Mulyukov <ildar@altlinux> 1.0-alt1
 - Initial release

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [devel] rpm-build-mono configlist
  2007-08-03  9:34 [devel] rpm-build-mono configlist Alexey Tourbin
@ 2007-08-04 21:29 ` Alexey Tourbin
  0 siblings, 0 replies; 2+ messages in thread
From: Alexey Tourbin @ 2007-08-04 21:29 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 2260 bytes --]

On Fri, Aug 03, 2007 at 01:34:25PM +0400, Alexey Tourbin wrote:
> Господа, вот этот кусок кода я не понял и собираюсь его убить.
> По-моему, он просто не работает, а добавлять 2>/dev/null дело не хитрое.

Я разобрался, для чего нужны *.dll.config файлы, и реализовал поиск
soname-зависимостей в *.dll байткоде mono.  Это, в частности, означает,
что теперь mono пакеты, как правило, не могут быть noarch.

Если кто-то разбирается в том, как работает mono на уровне загрузки
разделяемых библиотек, прошу посмотреть нижеследующее и высказаться.


commit 5c616477a2f2fe314d7e684c0e1b75bb85b8f227
Author: Alexey Tourbin <at@altlinux>
Date:   Sun Aug 5 00:40:15 2007 +0400

    mono.req: implemented MonoLibReq() to grab sonames from *.dll.config files
    
    The idea is that, since Mono bytecode must be portable, it cannot contain
    soname references, only "module references".  Module to soname mapping is
    done with system-dependent *.dll.config xml file.
    
    I grab module references from dll and try to resolve them into sonames.
    
    See also
    http://www.mail-archive.com/pld-devel-en@lists.pld-linux.org/msg03358.html

diff --git a/mono.req b/mono.req
index 1d8e911..eff48d4 100755
--- a/mono.req
+++ b/mono.req
@@ -27,6 +27,32 @@ Monodis()
 	fi
 }
 
+MonoLibReq()
+{
+	local f="$1" out=; shift
+	out=$(Monodis --moduleref "$f")
+	local refs=
+	refs=$(echo "$out" |sed -n 's/^[1-9][0-9]*: *//p')
+
+	[ -n "${RPM_LIB-}" ] || RPM_LIB=`rpm --eval %_lib`
+	local suffix; [ "$RPM_LIB" = lib64 ] && suffix='()(64bit)' || suffix=
+
+	local ref
+	for ref in $refs; do
+		local target="$(fgrep "dll=\"$ref\"" "$f".config 2>/dev/null |
+			sed -n 's/.*target="\(lib[^"]*[.]so[.][^"]*\)".*/\1/p' |head -1)"
+		if [ -n "$target" ]; then
+			Verbose "$f: $ref -> $target"
+			echo "$target$suffix"
+		elif [ -z "${ref##lib*.so.*}" ]; then
+			Verbose "$f: $ref = $ref"
+			echo "$ref$suffix"
+		else
+			Info "$f: cannot resolve module reference $ref"
+		fi
+	done
+}
+
 MonoReq()
 {
 	local f="$1" out=; shift
@@ -50,6 +76,9 @@ MonoReq()
 				print "mono(" LIBNAME ") " OP " " VERSION
 				START=0
 			}'
+	if [ -f "$f".config ]; then
+		MonoLibReq "$f"
+	fi
 }
 
 MonoProv()

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-08-04 21:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-03  9:34 [devel] rpm-build-mono configlist Alexey Tourbin
2007-08-04 21:29 ` Alexey Tourbin

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git