[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH] apt: Split out the libraries into libapt-pkg4.9 and libapt-inst1.1



Here comes the patch to split out the libraries. Reasons
for doing this are:

  (1) Policy Section 8.1:
      "The run-time shared library needs to be placed in a
       package whose name changes whenever the shared object
       version changes".
  (2) It makes it possible to install apt from experimental
      for testing purposes.
  (3) It makes future ABI breaks easier to handle without
      breaking most unstable machines for a long time.

I have currently added Pre-Depends on apt and apt-utils to
have the libraries always installed before those packages;
in order to not break apt during an interruption.

I CCed debian-devel@l.d.o to get some more opinions on this
topic, but all replies should go to deity@l.d.o.
-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.
=== modified file 'debian/control'
--- debian/control	2010-03-01 12:47:56 +0000
+++ debian/control	2010-03-12 15:59:10 +0000
@@ -13,7 +13,7 @@ Package: apt
 Architecture: any
 Depends: ${shlibs:Depends}, debian-archive-keyring, ${misc:Depends}
 Replaces: libapt-pkg-doc (<< 0.3.7), libapt-pkg-dev (<< 0.3.7)
-Provides: ${libapt-pkg:provides}
+Pre-Depends: ${libapt-pkg} (>= ${binary:Version})
 Conflicts: python-apt (<< 0.7.93.2~)
 Suggests: aptitude | synaptic | wajig, dpkg-dev, apt-doc, bzip2, lzma, python-apt
 Description: Advanced front-end for dpkg
@@ -24,6 +24,26 @@ Description: Advanced front-end for dpkg
  APT features complete installation ordering, multiple source capability
  and several other unique features, see the Users Guide in apt-doc.
 
+Package: libapt-pkg4.9
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Advanced front-end for dpkg (apt-pkg library)
+ This is Debian's next generation front-end for the dpkg package manager.
+ It provides the apt-get utility and APT dselect method that provides a 
+ simpler, safer way to install and upgrade packages.
+ .
+ This package contains the library libapt-pkg used by APT.
+
+Package: libapt-inst1.2
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Advanced front-end for dpkg (apt-inst library)
+ This is Debian's next generation front-end for the dpkg package manager.
+ It provides the apt-get utility and APT dselect method that provides a 
+ simpler, safer way to install and upgrade packages.
+ .
+ This package contains the library libapt-inst used by apt-utils.
+
 Package: apt-doc
 Architecture: all
 Priority: optional
@@ -55,8 +75,8 @@ Description: Documentation for APT devel
 
 Package: apt-utils
 Architecture: any
+Pre-Depends: ${libapt-inst} (>= ${binary:Version}), ${libapt-pkg} (>= ${binary:Version})
 Depends: ${shlibs:Depends}, ${misc:Depends}
-Provides: ${libapt-inst:provides}
 Replaces: apt (<< 0.5.9)
 Description: APT utility programs
  This package contains some APT utility programs such as apt-ftparchive,

=== modified file 'debian/rules'
--- debian/rules	2010-03-12 14:29:07 +0000
+++ debian/rules	2010-03-12 15:55:28 +0000
@@ -81,19 +81,6 @@ include buildlib/libversion.mak
 LIBAPTPKG_PROVIDE=libapt-pkg$(LIBAPTPKG_MAJOR)
 LIBAPTINST_PROVIDE=libapt-inst$(LIBAPTINST_MAJOR)
 
-debian/shlibs.local: apt-pkg/makefile
-	# We have 3 shlibs.local files.. One for 'apt', one for 'apt-utils' and
-	# one for the rest of the packages. This ensures that each package gets
-	# the right overrides.. 
-	rm -rf $@ $@.apt $@.apt-utils
-	echo "libapt-pkg $(LIBAPTPKG_MAJOR)" > $@.apt
-
-	echo "libapt-pkg $(LIBAPTPKG_MAJOR) $(LIBAPTPKG_PROVIDE)" > $@.apt-utils
-	echo "libapt-inst $(LIBAPTINST_MAJOR)" >> $@.apt-utils
-
-	echo "libapt-pkg $(LIBAPTPKG_MAJOR) $(LIBAPTPKG_PROVIDE)" > $@
-	echo "libapt-inst $(LIBAPTINST_MAJOR) $(LIBAPTINST_PROVIDE)" >> $@
-
 build: build/build-stamp	
 build-doc: build/build-doc-stamp	
 
@@ -130,11 +117,11 @@ clean:
 	rm -rf build
 
 	# Add here commands to clean up after the build process.
-	dh_clean debian/copyright debian/shlibs.local debian/shlibs.local.apt debian/shlibs.local.apt-utils
+	dh_clean debian/copyright
 
 binary-indep: apt-doc libapt-pkg-doc
 # Build architecture-independent files here.
-libapt-pkg-doc: build-doc debian/shlibs.local
+libapt-pkg-doc: build-doc
 	dh_testdir -p$@
 	dh_testroot -p$@
 	dh_clean -p$@ -k
@@ -158,7 +145,7 @@ libapt-pkg-doc: build-doc debian/shlibs.
 	dh_fixperms -p$@
 #	dh_suidregister -p$@
 	dh_installdeb -p$@
-	dh_gencontrol -p$@ -u -Vlibapt-pkg:provides=$(LIBAPTPKG_PROVIDE)
+	dh_gencontrol -p$@ -- -Vlibapt-pkg=$(LIBAPTPKG_PROVIDE) -Vlibapt-inst=$(LIBAPTINST_PROVIDE) 
 	dh_md5sums -p$@
 	dh_builddeb -p$@
 
@@ -176,7 +163,7 @@ apt-doc: build-doc
 	dh_compress -p$@
 	dh_fixperms -p$@
 	dh_installdeb -p$@
-	dh_gencontrol -p$@
+	dh_gencontrol -p$@ -- -Vlibapt-pkg=$(LIBAPTPKG_PROVIDE) -Vlibapt-inst=$(LIBAPTINST_PROVIDE) 
 	dh_md5sums -p$@
 	dh_builddeb -p$@
 
@@ -184,9 +171,9 @@ apt-doc: build-doc
 
 # Build architecture-dependent files here.
 
-binary-arch: apt libapt-pkg-dev apt-utils apt-transport-https
+binary-arch: apt libapt-pkg-dev apt-utils apt-transport-https $(LIBAPTINST_PROVIDE) $(LIBAPTPKG_PROVIDE)
 apt_MANPAGES = apt-cache apt-cdrom apt-config apt-get apt-key apt-mark apt-secure apt apt.conf apt_preferences sources.list
-apt: build build-doc debian/shlibs.local
+apt: build build-doc $(LIBAPTPKG_PROVIDE)
 	dh_testdir -p$@
 	dh_testroot -p$@
 	dh_clean -p$@ -k
@@ -199,16 +186,16 @@ apt: build build-doc debian/shlibs.local
 	# Remove the bits that are in apt-utils
 	rm $(addprefix debian/$@/usr/bin/apt-,$(APT_UTILS))
 
-	# install the shared libs
-	find $(BLD)/bin/ -type f -name "libapt-pkg*.so.*" -exec cp -a "{}" debian/$@/usr/lib/ \;
-	find $(BLD)/bin/ -type l -name "libapt-pkg*.so.*" -exec cp -a "{}" debian/$@/usr/lib/ \;
-
 	cp $(BLD)/bin/methods/* debian/$@/usr/lib/apt/methods/
 	# https has its own package
 	rm debian/$@/usr/lib/apt/methods/https
 
 	cp $(BLD)/scripts/dselect/* debian/$@/usr/lib/dpkg/methods/apt/
-	cp -r $(BLD)/locale debian/$@/usr/share/
+
+	set -e; cd $(BLD)/locale; \
+	for file in */LC_MESSAGES/$@.mo; do \
+		install -D $$file $(CURDIR)/debian/$@/usr/share/locale/$$file; \
+	done; \
 
 	cp debian/bugscript debian/$@/usr/share/bug/apt/script
 	cp debian/apt.logrotate debian/$@/etc/logrotate.d/apt
@@ -232,14 +219,42 @@ apt: build build-doc debian/shlibs.local
 	dh_strip -p$@
 	dh_compress -p$@
 	dh_fixperms -p$@
-	dh_makeshlibs -p$@ -m$(LIBAPTPKG_MAJOR) -V '$(LIBAPTPKG_PROVIDE)'
+	dh_makeshlibs -p$@
 	dh_installdeb -p$@
-	dh_shlibdeps -p$@ -l`pwd`/debian/apt/usr/lib:`pwd`/debian/$@/usr/lib -- -Ldebian/shlibs.local.apt
-	dh_gencontrol -p$@ -u -Vlibapt-pkg:provides=$(LIBAPTPKG_PROVIDE)
+	dh_shlibdeps -p$@
+	dh_gencontrol -p$@ -- -Vlibapt-pkg=$(LIBAPTPKG_PROVIDE) -Vlibapt-inst=$(LIBAPTINST_PROVIDE) 
 	dh_md5sums -p$@
 	dh_builddeb -p$@
 
-libapt-pkg-dev: build debian/shlibs.local
+$(LIBAPTPKG_PROVIDE): build
+	dh_testdir -p$@
+	dh_testroot -p$@
+	dh_clean -p$@ -k
+	dh_installdirs -p$@ usr/lib/
+
+	# install the shared libs
+	find $(BLD)/bin/ -type f -name "libapt-pkg*.so.*" -exec cp -a "{}" debian/$@/usr/lib/ \;
+	find $(BLD)/bin/ -type l -name "libapt-pkg*.so.*" -exec cp -a "{}" debian/$@/usr/lib/ \;
+
+	set -e; cd $(BLD)/locale; \
+	for file in */LC_MESSAGES/$@.mo; do \
+		install -D $$file $(CURDIR)/debian/$@/usr/share/locale/$$file; \
+	done; \
+
+	dh_installcron -p$@
+	dh_installdocs -p$@
+	dh_installchangelogs -p$@
+	dh_strip -p$@
+	dh_compress -p$@
+	dh_fixperms -p$@
+	dh_makeshlibs -p$@
+	dh_installdeb -p$@
+	dh_shlibdeps -p$@ 
+	dh_gencontrol -p$@ -- -Vlibapt-pkg=$(LIBAPTPKG_PROVIDE) -Vlibapt-inst=$(LIBAPTINST_PROVIDE) 
+	dh_md5sums -p$@
+	dh_builddeb -p$@
+	
+libapt-pkg-dev: build
 	dh_testdir -p$@
 	dh_testroot -p$@
 	dh_clean -p$@ -k
@@ -264,21 +279,44 @@ libapt-pkg-dev: build debian/shlibs.loca
 	dh_fixperms -p$@
 #	dh_suidregister -p$@
 	dh_installdeb -p$@
-	dh_gencontrol -p$@ -u -Vlibapt-pkg:provides=$(LIBAPTPKG_PROVIDE) -Vlibapt-inst:provides=$(LIBAPTINST_PROVIDE)
+	dh_gencontrol -p$@ -- -Vlibapt-pkg=$(LIBAPTPKG_PROVIDE) -Vlibapt-inst=$(LIBAPTINST_PROVIDE) 
 	dh_md5sums -p$@
 	dh_builddeb -p$@
 
-apt-utils_MANPAGES = apt-sortpkgs apt-ftparchive apt-extracttemplates
-apt-utils: build debian/shlibs.local
+$(LIBAPTINST_PROVIDE): build
 	dh_testdir -p$@
 	dh_testroot -p$@
 	dh_clean -p$@ -k
-	dh_installdirs -p$@
+	dh_installdirs -p$@ usr/lib/
 
 	# install the shared libs
 	find $(BLD)/bin/ -type f -name "libapt-inst*.so.*" -exec cp -a "{}" debian/$@/usr/lib/ \;
 	find $(BLD)/bin/ -type l -name "libapt-inst*.so.*" -exec cp -a "{}" debian/$@/usr/lib/ \;
 
+	set -e; cd $(BLD)/locale; \
+	for file in */LC_MESSAGES/$@.mo; do \
+		install -D $$file $(CURDIR)/debian/$@/usr/share/locale/$$file; \
+	done; \
+	
+	dh_installdocs -p$@ --link-doc=apt
+	dh_installchangelogs -p$@
+	dh_strip -p$@
+	dh_compress -p$@
+	dh_fixperms -p$@
+	dh_makeshlibs -p$@
+	dh_installdeb -p$@
+	dh_shlibdeps -p$@ 
+	dh_gencontrol -p$@ -- -Vlibapt-pkg=$(LIBAPTPKG_PROVIDE) -Vlibapt-inst=$(LIBAPTINST_PROVIDE) 
+	dh_md5sums -p$@
+	dh_builddeb -p$@
+
+apt-utils_MANPAGES = apt-sortpkgs apt-ftparchive apt-extracttemplates
+apt-utils: build $(LIBAPTINST_PROVIDE)
+	dh_testdir -p$@
+	dh_testroot -p$@
+	dh_clean -p$@ -k
+	dh_installdirs -p$@
+	
 	cp $(addprefix $(BLD)/bin/apt-,$(APT_UTILS)) debian/$@/usr/bin/
 	dh_installdocs -p$@
 	dh_installexamples -p$@
@@ -290,14 +328,14 @@ apt-utils: build debian/shlibs.local
 	dh_strip -p$@
 	dh_compress -p$@
 	dh_fixperms -p$@
-	dh_makeshlibs -m$(LIBAPTINST_MAJOR) -V '$(LIBAPTINST_PROVIDE)' -p$@
+	dh_makeshlibs -p$@
 	dh_installdeb -p$@
-	dh_shlibdeps -p$@ -l`pwd`/debian/apt/usr/lib:`pwd`/debian/$@/usr/lib -- -Ldebian/shlibs.local.apt-utils
-	dh_gencontrol -p$@ -u -Vlibapt-inst:provides=$(LIBAPTINST_PROVIDE)
+	dh_shlibdeps -p$@
+	dh_gencontrol -p$@ -- -Vlibapt-pkg=$(LIBAPTPKG_PROVIDE) -Vlibapt-inst=$(LIBAPTINST_PROVIDE) 
 	dh_md5sums -p$@
 	dh_builddeb -p$@
 
-apt-transport-https: build debian/shlibs.local libapt-pkg-dev
+apt-transport-https: build libapt-pkg-dev
 	dh_testdir -p$@
 	dh_testroot -p$@
 	dh_clean -p$@ -k
@@ -318,8 +356,8 @@ apt-transport-https: build debian/shlibs
 	dh_compress -p$@
 	dh_fixperms -p$@
 	dh_installdeb -p$@
-	dh_shlibdeps -p$@ -l`pwd`/debian/apt/usr/lib:`pwd`/debian/$@/usr/lib 
-	dh_gencontrol -p$@
+	dh_shlibdeps -p$@
+	dh_gencontrol -p$@ -- -Vlibapt-pkg=$(LIBAPTPKG_PROVIDE) -Vlibapt-inst=$(LIBAPTINST_PROVIDE) 
 	dh_md5sums -p$@
 	dh_builddeb -p$@
 
@@ -346,7 +384,7 @@ really-clean: clean
 	rm -f l33ch-stamp
 
 binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary debian/shlibs.local
+.PHONY: build clean binary-indep binary-arch binary
 
 
 # Done by the uploader.

Attachment: pgpCxDezQmOUu.pgp
Description: PGP signature


Reply to: