The basics of maintaining an Ubuntu repository & packages.
Creating a deb
Creating a custom repo
Maintaining a custom repo
Setting a client to use the custom repo
.deb files are very similar to .rpms both are [generally] binary packages that contain requirements & any configuration to install
For this guide we will include all steps to make the .deb suitable for inserting into a repository, however many steps can be skipped for just creating a standalone deb.
You will need:
debian/ debian/debian -> debian/ debian/control * required debian/changelog * required [Can be generated] debian/files * required [Can be generated] debian/rules * required debian/tmp/ debian/tmp/DEBIAN/ debian/tmp/DEBIAN/ debian/tmp/DEBIAN/postinst * required debian/tmp/DEBIAN/prerm * required debian/tmp/DEBIAN/... any other installation related script debian/tmp/usr/ debian/tmp/usr/local/ debian/tmp/usr/local/bin/ debian/tmp/usr/local/bin/vpnclient debian/tmp/.. any other file that should be apart of the installation
# ln -s . debian/debianAll commands should be executed in the parent directory to debian for the rest of this document (except creating the deb by hand).
Source: vpnclient-linux Maintainer: Andrew Muraco,Prerequisites for the deb can be defined by multiple levels, depending the extent the package needs another package. Depends, Enhances, Pre-Depends, Recommends, and Suggests. Other inter-package relationships can be defined: Replaces & Conflicts.Section:net Priority: optional Architecture: all Package: vpnclient-linux Version: 4.8.01.0640 Pre-Depends: linux-headers Description: Cisco VPN Client with necessary pcf's for UB VPN. This Cisco VPN client includes the necessary configuration files to connect to the University at Buffalo's VPN servers.
# debchange --createThe --create is only needed the first time, which will open up the change log file in a text editor so that the package name, version and other details can be initalized. Example: # debchange --create Fixed post installation module buliding Our file looks like this: vpnclient-linux (4.8.01.0640-ub1) gutsy; urgency=low * Initial deb release * Fixed post installation module buliding -- Andrew Muraco Tue, 05 Feb 2008 16:56:24 -0500
#!/bin/bash
VERSION="4.8.01.0640-ub1"
case "$1" in
build)
echo "nothing to do"
;;
clean)
rm vpnclient-linux_${VERSION}_all.deb
;;
binary)
dpkg -b debian/tmp vpnclient-linux_${VERSION}_all.deb
;;
esac
exit 0
# dpkg -b fakeroot/ vpnclient.deb dpkg -b (for --bulid) directory packagename.deb To Test the deb: # dpkg -i vpnclient.deb
[local] fqdn = localhost method = local incoming = /ubitrepo/mini-dinstall/incoming allow_unsigned_uploads = 1 post_upload_command = mini-dinstall --batch
* Create the required directories
$ mkdir -p /ubitrepo/mini-dinstall/incoming
* Create $HOME/.mini-dinstall.conf with the following content:
[DEFAULT] architectures = all, i386 archivedir = /ubitrepo/ use_dnotify = 0 verify_sigs = 0 extra_keyrings = ~/.gnupg/pubring.gpg mail_on_success = 0 archive_style = flat poll_time = 40 mail_log_level = NONE generate_release = 1 release_description = UB's Custom software repository [gutsy]
Distribution Groups
If you plan on maintaining different repositories for different versions of Ubuntu, then add any custom configuration under the code name header, [gutsy]. For example if you set in your /debian/changelog as distribution "gutsy" the package will be moved into the gutsy distribution.
Now your Repo is ready to accept packages!
# dput local vpnclient.changesIf we are maintaining a copy that is hosted on another server, then we should use rsync on our repo to update the remote server after adding the new package.
# scp -r /ubit/. amuraco@ubunix.buffalo.edu:/net/wings/info/www/computing/ublinux/ubuntu/.
$ sudo vi /etc/apt/sources.list and add the following lines to it (please replace $HOME with the correct pathname to your home): deb http://wings.buffalo.edu/computing/ublinux/ubuntu gutsy/ deb-src http://wings.buffalo.edu/computing/ublinux/ubuntu gutsy/ After adding these two lines, update your local apt cache: $ sudo apt-get update
Send Questions and Comments to ublinux-support@buffalo.edu
Last Modified January 16th, 2008