Creating Debian Packages: Difference between revisions

From IHRIS Wiki
Line 65: Line 65:


The third line (<tt>export-upstream = …</tt>) gives the location of the original source in Bazaar to check out.
The third line (<tt>export-upstream = …</tt>) gives the location of the original source in Bazaar to check out.
Of course, since
Running <tt>bzr builddeb</tt> will

Revision as of 22:05, 6 October 2007

On this page I've listed two ways of installing the iHRIS Debian packages. The first is easiest if you have Debian/Ubuntu system already running and just want to install the packages. The second is a fairly straight-forward way of building the binary packages from scratch. This is useful if you want to change something with the packaging.

Finally, I describe the reasons for the decisions made in creating the packaging. If you want to modify the packaging, read over this section.

Before Installation

If you don't have the mysql-server package installed, you'll want to install it. Alternatively, you can use mysql on another host (though this is not yet tested). This package uses the dbconfig-common package to take care of database setup.

After Installation

  • Visit http://localhost/iHRIS/Manage
  • You should have the bare-bones installation running. If you want to modify the apache setup, change /etc/apache2/conf.d/ihris-mananage.conf.

Super Simple

deb http://www.intrahealth.org/debian ./
  • Run “aptitude install ihris-manage”.

Easily Build Your Own

  • Install Bazaar and bzr-builddeb as well as the build dependencies dpatch and debhelper. (“apt-get install bzr-builddeb dpatch debhelper”)
  • Check out my debian build scripts. I suggest doing this in a separate directory. For example:
$ mkdir build
$ cd build
$ bzr co http://bazaar.launchpad.net/~hexmode/i2ce/debian-dev i2ce
$ bzr co http://bazaar.launchpad.net/~hexmode/ihris-common/debian-dev ihris-common
$ bzr co http://bazaar.launchpad.net/~hexmode/ihris-manage/debian-dev ihris-manage
  • In each directory, run “bzr builddeb”.
$ (cd i2ce; bzr builddeb)
$ (cd ihris-common; bzr builddeb)
$ (cd ihris-manage; bzr builddeb)
  • You should now have a subdirectory named build-area with three .deb files in it. Before installing them, you'll need to install the runtime dependencies: aptitude install dbcommon-config ucf libapache2-mod-php5 php-i18nv2 php-mdb2-driver-mysql php-text-password. At this time, some are only available from the IntraHealth Debian repository above.
  • Install the Debian packages you created: sudo dpkg -i build-area/*.deb

From Scratch

This part of the document, describes the decisions made in packaging and descrbes the steps taken.

For the purpose of this discussion, we'll consider the build directory to be at ~/build.

bzr-builddeb

The build scripts are kept separate repository and kept under version control. To enable this (and keep the number of revision control systems in use to a minimum), I use bzr-builddeb to build packages directly from the bzr repository.

This package generation tool can keep the debian directory under revision control. If you look at my debian repositories, you'll see that the repositories are the contents of the debian directory. During the build process, bzr-builddeb merges the directory with the pristine source tree and performs all build operations there.

bzr-builddeb uses several configuration files to control its operation. The only one we're concerned with here is the default.conf file under the .bzr-builddeb directory. This stores the defaults for this package. This contents of ~/build/ihris-common/.bzr-debbuild/default.conf:

[BUILDDEB]
merge = True
export-upstream = http://bazaar.launchpad.net/%7Eintrahealth%2Binformatics/ihris-common/main/

The first line just confirms that this is a bzr-builddeb configuration package.

The second line (merge = True) tells bzr-builddeb to merge this directory (in this case, ~/build/ihris-common with the the upstream source.

The third line (export-upstream = …) gives the location of the original source in Bazaar to check out.

Of course, since

Running bzr builddeb will