Difference between revisions of "Create or Update a Debian package"
(packages are quite easy) |
(integrating with APT) |
||
Line 5: | Line 5: | ||
== General procedure == | == General procedure == | ||
+ | === Working directory structure === | ||
Here's an example directory structure for a package which replaces the apache default config file and sets up default php and html files in ''/var/www''. | Here's an example directory structure for a package which replaces the apache default config file and sets up default php and html files in ''/var/www''. | ||
{{#tree:root=example-package| | {{#tree:root=example-package| | ||
Line 26: | Line 27: | ||
The rest of the directory structure outside the DEBIAN sub-directory define the directory structure which will be merged with the root of the filesystem when the package is installed. | The rest of the directory structure outside the DEBIAN sub-directory define the directory structure which will be merged with the root of the filesystem when the package is installed. | ||
+ | === Building into a package === | ||
To turn the directory structure into a proper ''.deb'' package file, use: | To turn the directory structure into a proper ''.deb'' package file, use: | ||
dpkg -b <package-directory> | dpkg -b <package-directory> | ||
The package will be created with the same name but with the ''.deb'' extension in the same directory as the package directory. | The package will be created with the same name but with the ''.deb'' extension in the same directory as the package directory. | ||
+ | |||
+ | === Adding to a package repository === | ||
+ | All the ''.deb'' package files must be added to the ''main'' repository on the server which is in ''/var/www/packages/main''. Ensure that this repository is included in your ''/etc/apt/sources.list'': | ||
+ | deb http://packages.organicdesign.co.nz main | ||
+ | |||
+ | Whenever any of the packages in the repository change, the ''Packages.gz'' index file must be updated which can be done as follows: | ||
+ | dpkg-scanpackages /var/www/packages/main /dev/null | gzip > /var/www/packages/main/Packages.gz | ||
== Specific OD Packages == | == Specific OD Packages == |
Revision as of 10:29, 25 June 2008
Create or Update a Debian package Organic Design procedure |
General procedure
Working directory structure
Here's an example directory structure for a package which replaces the apache default config file and sets up default php and html files in /var/www.
The control file in the DEBIAN sub-directory is the all the main configuration is done. The other three files in that sub-directory are scripts which execute on installation and removal of the package.
The rest of the directory structure outside the DEBIAN sub-directory define the directory structure which will be merged with the root of the filesystem when the package is installed.
Building into a package
To turn the directory structure into a proper .deb package file, use:
dpkg -b <package-directory>
The package will be created with the same name but with the .deb extension in the same directory as the package directory.
Adding to a package repository
All the .deb package files must be added to the main repository on the server which is in /var/www/packages/main. Ensure that this repository is included in your /etc/apt/sources.list:
deb http://packages.organicdesign.co.nz main
Whenever any of the packages in the repository change, the Packages.gz index file must be updated which can be done as follows:
dpkg-scanpackages /var/www/packages/main /dev/null | gzip > /var/www/packages/main/Packages.gz
Specific OD Packages
organicdesign-server
The ultimate purpose of the organicdesign-server package is to replace the Debian Post Install script.
Package: organicdesign-server Version: 1.0 Section: admin Priority: optional Architecture: all Essential: no Depends: build-essential, p7zip-full, bzip2, rar, htmldoc, subversion, mysql-server-5.0, apache2, libapache2-svn, libapache2-mod-php5, php5-mysql, php5-gd, php5-xsl, php5-curl, php5-sqlite3, imagemagick, perlmagick, librsvg2-bin, libwww-perl, libio-socket-ssl-perl, libtimedate-perl, libnet-scp-expect-perl Maintainer: Aran Dunkley [aran@organicdesign.co.nz] Description: Installs everything required by an Organic Design server.
Need to add this script
ln -s /etc/apache2/mods-available/ssl.conf /etc/apache2/mods-enabled/ssl.conf ln -s /etc/apache2/mods-available/ssl.load /etc/apache2/mods-enabled/ssl.load ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load
organicdesign-workstation
This package will ultimately replace the Ubuntu Post Install so that a freshly installed Ubuntu workstation simply needs to apt-get organicdesign-workstation.
Package: organicdesign-workstation Version: 1.0 Section: admin Priority: optional Architecture: all Essential: no Depends: build-essential, p7zip-full, bzip2, rar, thunderbird, geany, vlc, inkscape, samba, gparted, ntfsprogs, sysinfo Maintainer: Aran Dunkley [aran@organicdesign.co.nz] Description: Installs everything required by an Organic Design workstation.
Still need to include
- Skype
- Wine with IE 6 & 7
- Advanced Desktop Effects Settings
organicdesign-mail
This package will set up IMAP, POP3 and webmail
organicdesign-toshiba-satellite-A210
Packages which are little more than collections of other packages are pretty easy to make, so once we have the procedure clearly documented, we may as well package up other specific things such as the installation of specific drivers and configuration for our laptops. Currently the details are in Toshiba Satellite A210 (701).