Difference between revisions of "CleanupDebianPackages"

(initial draft)
 
Ms (talk)
(added file contents)
Zeile 12: Zeile 12:
   
 
Create a meta package (ubuntu-meta is a good start) with a lengthy dependency list.
 
Create a meta package (ubuntu-meta is a good start) with a lengthy dependency list.
  +
./debian/rules binary
Make that package sticky:
 
  +
  +
Install that package and make it sticky:
 
sudo deborphan -A ms-desasterarea
 
sudo deborphan -A ms-desasterarea
   
 
Search for orphaned packages:
 
Search for orphaned packages:
 
deborphan -a | sort -k2,2
 
deborphan -a | sort -k2,2
  +
  +
==Filesystem Layout==
  +
<pre>
  +
./debian
  +
./debian/control
  +
./debian/rules
  +
./debian/copyright
  +
./debian/compat
  +
./debian/changelog
  +
./trillian-i386
  +
./desasterarea-i386
  +
</pre>
  +
  +
==debian/rules==
  +
<pre>
  +
#!/usr/bin/make -f
  +
  +
#export DH_VERBOSE=1
  +
  +
clean:
  +
dh_testdir
  +
dh_clean
  +
  +
rm -rf build-stamp *.old debootstrap-dir
  +
  +
DEB_BUILD_ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
  +
  +
build: build-stamp
  +
build-stamp: desasterarea-$(DEB_BUILD_ARCH) trillian-$(DEB_BUILD_ARCH)
  +
dh_clean
  +
  +
for seed in desasterarea trillian; do \
  +
package=ms-$$seed; \
  +
(printf "$$package:Depends="; grep -Ev '^#' $$seed-$(DEB_BUILD_ARCH) | grep -Ev '^ *$$' | perl -pe 's/\n/, /g'; echo) \
  +
>> debian/$$package.substvars; \
  +
done
  +
touch $@
  +
  +
install: build-stamp
  +
  +
binary-arch: install
  +
dh_testdir -a
  +
dh_testroot -a
  +
dh_installdocs -a
  +
dh_installchangelogs -a
  +
dh_compress -a
  +
dh_fixperms -a
  +
dh_installdeb -a
  +
dh_gencontrol -a
  +
dh_md5sums -a
  +
dh_builddeb -a
  +
  +
binary-indep:
  +
  +
binary: binary-indep binary-arch
  +
  +
.PHONY: binary binary-arch binary-indep clean checkroot build
  +
</pre>
  +
  +
==debian/control==
  +
<pre>
  +
Source: ms-meta
  +
Section: base
  +
Priority: optional
  +
Maintainer: Martin Stechert <Martin.Stechert@web.de>
  +
Standards-Version: 3.6.1
  +
Build-Depends: debhelper (>= 4)
  +
  +
Package: ms-desasterarea
  +
Architecture: any
  +
Depends: ${ms-desasterarea:Depends}
  +
Description: DesasterArea meta package
  +
meta package with dependencies for all DesasterArea packages
  +
DesasterArea is currently Debian SID based
  +
Based on ubuntu meta packages
  +
  +
Package: ms-trillian
  +
Architecture: any
  +
Depends: ${ms-trillian:Depends}
  +
Description: Trillian meta package
  +
meta package with dependencies for all Trillian packages
  +
Trillian is currently (K)Ubuntu Hoary Hedgehog Ubuntu 5.04 based
  +
Based on ubuntu meta packages
  +
</pre>

Version vom 17:07, 5 Februar 2006

The Problem

The number of installed packages tends to grow on a debian system (like with any other distribution and operating system). Packages are installed, dependent packages are installed, too. It becomes difficult to decide, which packages are really wanted.

Some people suggest the usage of aptitude since it keeps the information, if a package was installed on unser request or as a result of a dependency.

Solution

The deborphan tool lists any package that is not required by at least one other package.

So having a private meta package just containing dependencies and running deborphan helps.

Create a meta package (ubuntu-meta is a good start) with a lengthy dependency list.

 ./debian/rules binary

Install that package and make it sticky:

 sudo deborphan -A ms-desasterarea

Search for orphaned packages:

 deborphan -a | sort -k2,2

Filesystem Layout

./debian
./debian/control
./debian/rules
./debian/copyright
./debian/compat
./debian/changelog
./trillian-i386
./desasterarea-i386

debian/rules

#!/usr/bin/make -f

#export DH_VERBOSE=1

clean:
        dh_testdir
        dh_clean

        rm -rf build-stamp *.old debootstrap-dir

DEB_BUILD_ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)

build: build-stamp
build-stamp: desasterarea-$(DEB_BUILD_ARCH) trillian-$(DEB_BUILD_ARCH)
        dh_clean

        for seed in desasterarea trillian; do \
                package=ms-$$seed; \
                (printf "$$package:Depends="; grep -Ev '^#' $$seed-$(DEB_BUILD_ARCH) | grep -Ev '^ *$$' | perl -pe 's/\n/, /g'; echo) \
                        >> debian/$$package.substvars; \
        done
        touch $@

install: build-stamp

binary-arch: install
        dh_testdir -a
        dh_testroot -a
        dh_installdocs -a
        dh_installchangelogs -a
        dh_compress -a
        dh_fixperms -a
        dh_installdeb -a
        dh_gencontrol -a
        dh_md5sums -a
        dh_builddeb -a

binary-indep:

binary: binary-indep binary-arch

.PHONY: binary binary-arch binary-indep clean checkroot build

debian/control

Source: ms-meta
Section: base
Priority: optional
Maintainer: Martin Stechert <Martin.Stechert@web.de>
Standards-Version: 3.6.1
Build-Depends: debhelper (>= 4)

Package: ms-desasterarea
Architecture: any
Depends: ${ms-desasterarea:Depends}
Description: DesasterArea meta package
 meta package with dependencies for all DesasterArea packages
 DesasterArea is currently Debian SID based
 Based on ubuntu meta packages

Package: ms-trillian
Architecture: any
Depends: ${ms-trillian:Depends}
Description: Trillian meta package
 meta package with dependencies for all Trillian packages
 Trillian is currently (K)Ubuntu Hoary Hedgehog Ubuntu 5.04 based
 Based on ubuntu meta packages