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

Log in
Name

Password

 
 

History for Create_Debian_Package

??changed:
-
<h1>Debian Packaging of Products</h1>
<i>There already exists many official packages for zope Products on:

- "unstable debian":http://packages.debian.org/unstable/web/zope.html 

- "testing debian":http://packages.debian.org/testing/web/zope.html

- "stable debian":http://packages.debian.org/stable/web/zope.html

( *thanks "Gregor Hoffleit":http://www.zope.org//Members/flight/PythonPolicy/FrontPage !* )

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)</i>

<ul>
<li>oct 2000: First version of this HOWTO 
<li>jan 2002: Second version (updated)
</ul>

<h2Quick and Dirty Solution</h2>
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):
<P>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.
</P>
<ol>
<li> create a directory (anywhere)  , ex: <i>/usr/src/zope-products</i>
<li> create therein a subdirectory <b>DEBIAN</b>
(all uppercase) and create a file therein called <i>control</i>
<li> you can also optionally create files called
<b>preinst</b> and <b>postinst</b> in which you can
write scripts that will be activated before and after
installation. (for example, I force ownership
by root.www-data)
<li> in the <i>control</i> file goes the fields found
in all debian packages, just cut, paste and modify from
an existing control file in another debian package
<li> back to <i>/usr/src/zope-products</i> directory, and 
create <b>/usr/src/zope-products/var/lib/zope/Products</b>
<li>move to <i>/usr/src/zope-products/var/lib/zope/Products</i>
<li> tar -xzvof /path-to-downloaded/Some_Zope-Product.tar.gz
<li> move just under the <i>zope-products</i> folder (in this example, to <i>/usr/src</i>
and type<br> <b>dpkg-deb -b zope-products</b>
<li> this produces <b>zope-products.deb</b> which you can then distribute to your various servers and install with <b> dpkg -i zope-products.deb</b>
<hr>
<h3>please check <a href=http://www.debian.org>www.debian.org</a> for real information 
on how to create proper debian packages</h3>
</ol>

**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":http://www.zope.org/Members/4am/packProduct

- !TheJester's "Product Manager":http://www.zope.org/Members/TheJester/ProductManager 

- "Lazy Install Script":http://www.zope.org/Members/acki/lazyInstall/usage-0.0.2 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)