Create a debian package with dh_make and dpkg-buildpackage
Par Ludovic Francois, mercredi 9 août 2006 à 00:34 :: debian :: #22 :: rss
Create a debian package with dh_make and dpkg-buildpackage
- generate a debian template directory
- editing configuration files
- create a debian apt repository
dh_make to run only once
This command will allow us to generate the debian directory, and a tree with all useful example files.
command
ludo@idefix:~/s2a-0.0.1 % cp /ddn/common/s2a/api_tools/s2a_bin/s2a-0.0.1b16_27M.tar.gz .. ludo@idefix:~/s2a-0.0.1 % dh_make -e lfrancois@datadirectnet.com -f ../s2a-0.0.1b16_27M.tar.gz ldap_sasl_interactive_bind_s: Can't contact LDAP server (-1) Type of package: single binary, multiple binary, library, kernel module or cdbs? [s/m/l/k/b] s Maintainer name : Ludovic Francois Email-Address : lfrancois@datadirectnet.com Date : Fri, 23 Jun 2006 11:39:13 +0200 Package Name : s2a Version : 0.0.1 License : blank Type of Package : Single Hit <enter> to confirm: Done. Please edit the files in the debian/ subdirectory now. s2a uses a configure script, so you probably don't have to edit the Makefiles. ludo@idefix:~/s2a-0.0.1 %
Files generated
ludo@idefix:~/s2a-0.0.1/debian % ls -l total 104 -rw--- 1 ludo ludo 197 2006-06-23 11:39 changelog -rw--- 1 ludo ludo 2 2006-06-23 11:39 compat -rw--- 1 ludo ludo 353 2006-06-23 11:39 control -rw--- 1 ludo ludo 651 2006-06-23 11:39 copyright -rw--- 1 ludo ludo 75 2006-06-23 11:39 cron.d.ex -rw--- 1 ludo ludo 17 2006-06-23 11:39 dirs -rw--- 1 ludo ludo 17 2006-06-23 11:39 docs -rw--- 1 ludo ludo 1222 2006-06-23 11:39 emacsen-install.ex -rw--- 1 ludo ludo 453 2006-06-23 11:39 emacsen-remove.ex -rw--- 1 ludo ludo 1101 2006-06-23 11:39 emacsen-startup.ex -rw--- 1 ludo ludo 1854 2006-06-23 11:39 init.d.ex -rw--- 1 ludo ludo 1736 2006-06-23 11:39 manpage.1.ex -rw--- 1 ludo ludo 4649 2006-06-23 11:39 manpage.sgml.ex -rw--- 1 ludo ludo 4606 2006-06-23 11:39 manpage.xml.ex -rw--- 1 ludo ludo 106 2006-06-23 11:39 menu.ex -rw--- 1 ludo ludo 921 2006-06-23 11:39 postinst.ex -rw--- 1 ludo ludo 913 2006-06-23 11:39 postrm.ex -rw--- 1 ludo ludo 690 2006-06-23 11:39 preinst.ex -rw--- 1 ludo ludo 881 2006-06-23 11:39 prerm.ex -rw--- 1 ludo ludo 184 2006-06-23 11:39 README.Debian -rwxr-xr-x 1 ludo ludo 2511 2006-06-23 11:39 rules -rw--- 1 ludo ludo 223 2006-06-23 11:39 s2a-default.ex -rw--- 1 ludo ludo 475 2006-06-23 11:39 s2a.doc-base.EX -rw--- 1 ludo ludo 654 2006-06-23 11:39 watch.ex ludo@idefix:~/s2a-0.0.1/debian %
Files editing
debian/control file
edit the control file to finalize the work of dh_make on the proprietary of your package
Source: s2a
Section: admin
Priority: optional
Maintainer: Ludovic Francois <lfrancois@datadirectnet.com>
Build-Depends: debhelper (>= 5), autotools-dev
Standards-Version: 3.7.2
Package: s2a
Architecture: i386
Depends: ${shlibs:Depends}
Description: Monitoring and administration tools for DataDirect Networks s2a
Monitoring and administration tools for DataDirect Networks s2a appliances.
This tools supports:
- s2a6000
- s2a3000
- s2a8500
- s2a9500
You will find the main binary named s2a, with this binary you could
get a remote access on the storage system and make all cli monitoring
and administration tasks from your unix command line.
debian/rules file
This makefile indicates us about the install of our files. In our case it's pretty easy because we are using autotools so we need just to let the autotools process to go through with the command ./configure.
I just needed to setup fine configure.in and Makefile.am, and now they write all files, man with man_MANS, /etc conf file with sysconfdir and scripts with bin_SCRIPTS to install files at the good place.
dch
You need also to edit your debian changelog file. To do it run dch (debian changelog), the first time that will help you in writing a small notice about your first release.
But the very good thing with this tool is that you have a very simple way with debian to increment the version of the package and add a comment about this upgrade:
$ dch -i "cleaning update for integration in directMONITOR"
dpkg-buildpackage -rfakeroot
package checking
$ lintian -i s2a_0.0.1-1_i386.changes $ lintian -i s2a_0.0.1-1_i386.changes
Build your own apt repository
Server side
The first time:
# mkdir /var/www/apt
After each dupload:
ludo@obelix:/var/www/apt % apt-ftparchive release . > Release ludo@obelix:/var/www/apt % gpg -abs -o Release.gpg Release
Client side (debian developer)
# aptitude install dupload
/etc/dupload.conf
$default_host = "zoxx";
$cfg{'zoxx'} = {
fqdn => "obelix.zoxx.net",
method => "scpb",
incoming => "/var/www/apt/",
dinstall_runs => 1,
};
$cfg{'zoxx'}{postupload}{'changes'} = "
echo 'cd /var/www/apt ;
dpkg-scanpackages . /dev/null >Packages || true ;
dpkg-scansources . /dev/null >Sources || true ;
gzip -c Packages >Packages.gz ;
gzip -c Sources >Sources.gz' | ssh obelix.zoxx.net 2>/dev/null ;
echo 'Package archive created!'";
dupload
ludo@idefix:~ % dupload s2a_0.0.1-1_i386.changes dupload note: no announcement will be sent. Uploading (scpb) to obelix.zoxx.net:/var/www/apt/ [ job s2a_0.0.1-1_i386 from s2a_0.0.1-1_i386.changes s2a_0.0.1-1_i386.deb, md5sum ok s2a_0.0.1-1.diff.gz, md5sum ok s2a_0.0.1.orig.tar.gz, md5sum ok s2a_0.0.1-1.dsc, md5sum ok s2a_0.0.1-1_i386.changes ok ] Uploading (scp) to zoxx (obelix.zoxx.net) [ Uploading job s2a_0.0.1-1_i386 s2a_0.0.1-1_i386.deb 16.6 kB, ok s2a_0.0.1-1.diff.gz 7.5 kB, ok s2a_0.0.1.orig.tar.gz 116.2 kB, ok s2a_0.0.1-1.dsc 0.3 kB, ok s2a_0.0.1-1_i386.changes 0.7 kB, ok s2a_0.0.1-1_i386.deb 100% 17KB 16.6KB/s 00:00 s2a_0.0.1-1.diff.gz 100% 7730 7.6KB/s 00:00 s2a_0.0.1.orig.tar.gz 100% 116KB 116.2KB/s 00:00 s2a_0.0.1-1.dsc 100% 333 0.3KB/s 00:00 s2a_0.0.1-1_i386.changes 100% 711 0.7KB/s 00:00 ] Package archive created! ludo@idefix:~ %
Client side (debian user)
# echo "deb http://www.zoxx.net/apt ./" >> /etc/apt/sources.list # GET http://www.zoxx.net/ludo_gpg.asc | apt-key add - OK # aptitude update # aptitude show s2a Package: s2a New: yes State: installed Automatically installed: no Version: 0.0.1-2 Priority: optional Section: admin Maintainer: Ludovic Francois <lfrancois@datadirectnet.com> Uncompressed Size: 442k Depends: libc6 (>= 2.3.6-6) Description: Monitoring and administration tools for DataDirect Networks s2a Monitoring and administration tools for DataDirect Networks s2a appliances. This tools supports: * s2a6000 * s2a3000 * s2a8500 * s2a9500 You will find the main binary named s2a, with this binary you could get a remote access on the storage system and make all cli monitoring and administration tasks from your unix command line. # aptitude install s2a
Commentaires
Aucun commentaire pour le moment.
Ajouter un commentaire