You are not logged in Log in Join
You are here: Home » Members » vernier » Debian » Create_Debian_Package » wikipage_view

Log in
Name

Password

 
 
FrontPage »

Create_Debian_Package

Debian Packaging of Products

There already exists many official packages for zope Products on:

( *thanks Gregor Hoffleit !* )

This HOWTO consists of my notes for creating a quick and dirty debian package of the other useful zope products not in the official distribution for quick distribution to various servers (timesaver with ZEO Clients that all need to have the same Products for example)

  • oct 2000: First version of this HOWTO
  • jan 2002: Second version (updated)

I only package the products that I think are useful for a school server (and not already packaged officially in http://www.debian.org). This is my bias. Here is a recipe (assuming you have a debian system or debian packaging tools on another linux distribution):

Caveat: this is a quick and dirty method of creating debian packages in order to keep the products within the very useful debian management system.

  1. create a directory (anywhere) , ex: /usr/src/zope-products
  2. create therein a subdirectory DEBIAN (all uppercase) and create a file therein called control
  3. you can also optionally create files called preinst and postinst in which you can write scripts that will be activated before and after installation. (for example, I force ownership by root.www-data)
  4. in the control file goes the fields found in all debian packages, just cut, paste and modify from an existing control file in another debian package
  5. back to /usr/src/zope-products directory, and create /usr/src/zope-products/var/lib/zope/Products
  6. move to /usr/src/zope-products/var/lib/zope/Products
  7. tar -xzvof /path-to-downloaded/Some_Zope-Product.tar.gz
  8. move just under the zope-products folder (in this example, to /usr/src and type
    dpkg-deb -b zope-products
  9. this produces zope-products.deb which you can then distribute to your various servers and install with dpkg -i zope-products.deb

    please check www.debian.org for real information on how to create proper debian packages

Issues

  • if creating package modified from main distribution or with same name, edit /etc/apt/preferences to prevent accidently overwriting when upgrading debian:
     Package: zope-whatever
     Pin: version 2.4.3*
    
  • when using a debian package as a base for modifications, this will download the source and build it:
     # in case missing libraries: apt-get build-dep zope-whatever
     apt-get -b source zope-whatever
     # or just to download and later build
     apt-get source zope-whatever
     # make changes
     dpkg-buildpackage -rfakeroot -uc -b
     # in case of missing libraries:  auto-apt run dpkg-buildpackage etc...
    

Alternatives:

  • rsync: You can, of course, avoid all this by using rsync from a model server (which is now my preferred method)
  • 4am's packProduct
  • TheJester's Product Manager
  • Lazy Install Script is for redhat, but can be adapted for debian (to install latest zope 2.5 and cmf 1.2)

Resources

  • the excellent apt-howto package in debian
  • zope-devguide package in debian
  • Memorize the following debian installing incantations:
    • apt-get --reinstall install packagename (to reinstall existing version)
    • apt-cache showpkg packagename (to show dependency information before download)
    • apt-get install packagename -o APT::Force-LoopBreak?=1 (for nasty situations which you know you will get out of once the new version is installed)
    • apt-get install packagename/stable (or testing or unstable)