Package: tcl8.5
Version: 8.5.11-2
Severity: normal
Tags: sid patch
User: multiarch-de...@lists.alioth.debian.org
Usertag: multiarch

TCL has not been 'multiarched'. This task has been pending for a
couple of years, ever since I noticed that tclConfig.sh is
arch-specific in #611650. The lack of this bit me today trying to
cross-build sqlite3 which looked for tclConfig.sh in
/usr/lib/$(DEB_HOST_MULTIARCH)/tclConfig.sh which is the right place,
but the script isn't there. So I finally had a go at multiarching the
package.

I don't know if this is sufficient or complete as I'm not familiar
with the internal working of tcl, but it's fairly conservative so
should work. Essentially the .so and .a libs, and the tclConfig.sh
config script are all moved into multiarch directories in the existing
tcl8.5-dev and a new tcl8.5-lib package for the runtime library. Both
these packages are Multi-Arch: same and thus co-installable.

All the other files remain in the tcl8.5 package, although I don't
know if there are arch-specific files in there which should move? That
package is MA: foreign as tcl is able to run scripts in an
arch-independent fashion. 

I left a tight binary-version dependency of tcl8.5 on tcl8.5-lib so
you always get matching versions. I'm not sure if this is necessary -
is a tight version match needed here?

It all seems to build correctly, and cross-build OK too (with the patch
in #631995)

I will test these packages for use in crossbulding, but I would
welcome feedback on whether something more complex is needed to make
this work for all tcl roles (embedded interpreter, etc). 

Whilst testing this I noticed that the unix dir wasn't getting
cleaned, so a second build fell over. I've fixed that too. 

-- System Information:
Debian Release: 6.0.6
  APT prefers stable
  APT policy: (990, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.32.33-kvm-i386-20111128-dirty (SMP w/1 CPU core)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
diff -urN origs/tcl8.5-8.5.11/debian/changelog tcl8.5-8.5.11/debian/changelog
--- origs/tcl8.5-8.5.11/debian/changelog	2012-05-28 14:32:31.000000000 +0100
+++ tcl8.5-8.5.11/debian/changelog	2013-01-22 03:13:53.000000000 +0000
@@ -1,3 +1,11 @@
+tcl8.5 (8.5.11-3) unstable; urgency=low
+
+  * Multiarchify package: split libs and tclConfig.sh into -lib
+      package and use multiarch paths
+  * Fix failure to clean and build twice
+
+ -- Wookey <woo...@wookware.org>  Tue, 22 Jan 2013 03:13:01 +0000
+
 tcl8.5 (8.5.11-2) unstable; urgency=low
 
   * Install library(3tcl), packagens(3tcl), pkgMkIndex(3tcl) and safe(3tcl)
diff -urN origs/tcl8.5-8.5.11/debian/compat tcl8.5-8.5.11/debian/compat
--- origs/tcl8.5-8.5.11/debian/compat	2012-05-28 14:32:31.000000000 +0100
+++ tcl8.5-8.5.11/debian/compat	2013-01-22 03:10:59.000000000 +0000
@@ -1 +1 @@
-8
+9
diff -urN origs/tcl8.5-8.5.11/debian/control tcl8.5-8.5.11/debian/control
--- origs/tcl8.5-8.5.11/debian/control	2012-05-28 14:32:31.000000000 +0100
+++ tcl8.5-8.5.11/debian/control	2013-01-22 03:10:59.000000000 +0000
@@ -3,7 +3,7 @@
 Priority: optional
 Maintainer: Tcl/Tk Debian Packagers <pkg-tcltk-de...@lists.alioth.debian.org>
 Uploaders: Sergei Golovan <sgolo...@debian.org>
-Build-Depends: debhelper (>= 8.0.0), dpkg-dev (>= 1.16.1~)
+Build-Depends: debhelper (>= 9.0.0), dpkg-dev (>= 1.16.1~)
 Standards-Version: 3.9.3
 Homepage: http://www.tcl.tk/
 
@@ -11,15 +11,29 @@
 Section: interpreters
 Priority: optional
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
+Depends: ${misc:Depends}, tcl8.5-lib (= ${binary:Version})
 Conflicts: tcl74 (<= 7.4p3-2)
 Provides: tclsh
 Suggests: tcl-tclreadline
+Multi-Arch: foreign
 Description: Tcl (the Tool Command Language) v8.5 - run-time files
  Tcl is a powerful, easy to use, embeddable, cross-platform interpreted
  scripting language.  This package contains everything you need to run
  Tcl scripts and Tcl-enabled apps.  This version includes thread support.
 
+Package: tcl8.5-lib
+Section: interpreters
+Priority: optional
+Architecture: any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Conflicts: tcl74 (<= 7.4p3-2)
+Multi-Arch: same
+Description: Tcl (the Tool Command Language) v8.5 - run-time library files
+ Tcl is a powerful, easy to use, embeddable, cross-platform interpreted
+ scripting language.  This package contains the tcl library.  This version 
+ includes thread support.
+
 Package: tcl8.5-doc
 Section: doc
 Priority: optional
@@ -28,6 +42,7 @@
 Suggests: tcl8.5
 Conflicts: tcldoc, tcl8.3-doc, tcl8.4-doc
 Provides: tcldoc
+Multi-Arch: foreign
 Description: Tcl (the Tool Command Language) v8.5 - manual pages
  Tcl is a powerful, easy-to-use, embeddable, cross-platform interpreted
  scripting language.  This package contains the man pages for Tcl commands.
@@ -36,8 +51,9 @@
 Section: devel
 Priority: optional
 Architecture: any
-Depends: tcl8.5 (= ${binary:Version}), ${misc:Depends}
+Depends: tcl8.5-lib (= ${binary:Version}), tcl8.5 (= ${binary:Version}), ${misc:Depends}
 Suggests: tcl8.5-doc
+Multi-Arch: same
 Description: Tcl (the Tool Command Language) v8.5 - development files
  Tcl is a powerful, easy-to-use, embeddable, cross-platform interpreted
  scripting language.  This package contains the headers and libraries
diff -urN origs/tcl8.5-8.5.11/debian/rules tcl8.5-8.5.11/debian/rules
--- origs/tcl8.5-8.5.11/debian/rules	2012-05-28 14:32:31.000000000 +0100
+++ tcl8.5-8.5.11/debian/rules	2013-01-22 03:10:59.000000000 +0000
@@ -5,6 +5,7 @@
 
 DPKG_EXPORT_BUILDFLAGS = 1
 include /usr/share/dpkg/buildflags.mk
+include /usr/share/dpkg/architecture.mk
 
 LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS)
 export LDFLAGS
@@ -22,6 +23,12 @@
 %:
 	dh $@
 
+override_dh_auto_clean:
+	dh_testdir
+	-make -C unix distclean
+	dh_clean
+	      
+
 override_dh_auto_configure:
 	# So so ugly but it works...
 	touch generic/tclStubInit.c
@@ -59,11 +66,11 @@
 	install -d -m 755 $(DIR)/usr/share/tcltk/tcl$(v)/tcl8
 	mv $(DIR)/usr/share/tcltk/tcl8/*/* $(DIR)/usr/share/tcltk/tcl$(v)/tcl8
 	# Fix up the libraries.
-	cp unix/libtcl$(v).a $(DIR)/usr/lib
+	cp unix/libtcl$(v).a $(DIR)/usr/lib/$(DEB_HOST_MULTIARCH)
 	#mv $(DIR)/usr/lib/libtcl$(v).so $(DIR)/usr/lib/libtcl$(v).so.0
 	#ln -sf libtcl$(v).so.0 $(DIR)/usr/lib/libtcl$(v).so
-	install -d -m 755 $(DIR)/usr/lib/tcl$(v)
-	mv $(DIR)/usr/lib/*.sh $(DIR)/usr/lib/tcl$(v)
+	install -d -m 755 $(DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/tcl$(v)
+	mv $(DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/*.sh $(DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/tcl$(v)
 	install -d -m 755 $(DIR)/usr/share/aclocal
 	cp unix/tcl.m4 $(DIR)/usr/share/aclocal/tcl$(v).m4
 	rm -f $(DIR)/usr/share/tcltk/tcl$(v)/ldAix
@@ -109,7 +116,7 @@
 	dh_makeshlibs -V 'tcl$(v) (>= 8.5.0)' -XTcltest
 
 override_dh_shlibdeps:
-	dh_shlibdeps -ldebian/tcl$(v)/usr/lib
+	dh_shlibdeps -ldebian/tcl$(v)/usr/lib/$(DEB_HOST_MULTIARCH)
 
 get-orig-source:
 	wget -O tcl8.5_8.5.11.orig.tar.gz \
diff -urN origs/tcl8.5-8.5.11/debian/tcl8.5-dev.dirs tcl8.5-8.5.11/debian/tcl8.5-dev.dirs
--- origs/tcl8.5-8.5.11/debian/tcl8.5-dev.dirs	2007-10-19 13:06:07.000000000 +0100
+++ tcl8.5-8.5.11/debian/tcl8.5-dev.dirs	2013-01-22 03:10:59.000000000 +0000
@@ -1,3 +1,2 @@
-usr/lib/tcl8.5
 usr/share/aclocal
 usr/share/tcltk/tcl8.5
diff -urN origs/tcl8.5-8.5.11/debian/tcl8.5-dev.install tcl8.5-8.5.11/debian/tcl8.5-dev.install
--- origs/tcl8.5-8.5.11/debian/tcl8.5-dev.install	2012-05-28 14:32:31.000000000 +0100
+++ tcl8.5-8.5.11/debian/tcl8.5-dev.install	2013-01-22 03:10:59.000000000 +0000
@@ -1,5 +1,5 @@
 usr/include
-usr/lib/*.a
-usr/lib/*.so
-usr/lib/tcl*
+usr/lib/*/*.a
+usr/lib/*/*.so
+usr/lib/*/tcl*
 usr/share/aclocal/*.m4
diff -urN origs/tcl8.5-8.5.11/debian/tcl8.5.install tcl8.5-8.5.11/debian/tcl8.5.install
--- origs/tcl8.5-8.5.11/debian/tcl8.5.install	2012-05-28 14:32:31.000000000 +0100
+++ tcl8.5-8.5.11/debian/tcl8.5.install	2013-01-22 03:10:59.000000000 +0000
@@ -1,5 +1,4 @@
 usr/bin
 usr/share/tcltk/tcl8
 usr/share/tcltk/tcl8.5
-usr/lib/*.so.*
 usr/share/man/man1
diff -urN origs/tcl8.5-8.5.11/debian/tcl8.5-lib.install tcl8.5-8.5.11/debian/tcl8.5-lib.install
--- origs/tcl8.5-8.5.11/debian/tcl8.5-lib.install	1970-01-01 01:00:00.000000000 +0100
+++ tcl8.5-8.5.11/debian/tcl8.5-lib.install	2013-01-22 03:10:59.000000000 +0000
@@ -0,0 +1 @@
+usr/lib/*/*.so.*
diff -urN origs/tcl8.5-8.5.11/debian/tcl8.5-lib.lintian-overrides tcl8.5-8.5.11/debian/tcl8.5-lib.lintian-overrides
--- origs/tcl8.5-8.5.11/debian/tcl8.5-lib.lintian-overrides	1970-01-01 01:00:00.000000000 +0100
+++ tcl8.5-8.5.11/debian/tcl8.5-lib.lintian-overrides	2013-01-22 03:10:59.000000000 +0000
@@ -0,0 +1 @@
+tcl8.5: package-name-doesnt-match-sonames
diff -urN origs/tcl8.5-8.5.11/debian/tcl8.5.lintian-overrides tcl8.5-8.5.11/debian/tcl8.5.lintian-overrides
--- origs/tcl8.5-8.5.11/debian/tcl8.5.lintian-overrides	2012-05-28 14:32:31.000000000 +0100
+++ tcl8.5-8.5.11/debian/tcl8.5.lintian-overrides	1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-tcl8.5-lib: package-name-doesnt-match-sonames

Reply via email to