- http://www.debian.org/doc/manuals/packaging-tutorial/packaging-tutorial.en.pdf
- http://tldp.org/HOWTO/html_single/Debian-Binary-Package-Building-HOWTO/ from top to bottom :D
aptitude install build-essential devscripts dpkg-dev
if the package is using dh
as packaging helper, then additional packages will be needed, such as
aptitude install dh-autoreconf # ...
- is a
ar
archive file.ar tv grep-2.14-4_amd64.deb
- consists of
debina-binary
: versionof the deb file formatcontrol.tar.gz
: metadata about the packagecontrol
,md5sums
(pre|post)(rm|inst)
,triggers
,shlibs
data.tar.gz
: data files of the package
- two kinds of packages,
native
andnon-native
, if unsure, usnon-native
- main file
*.dsc
(meta-data) - other files
pkg_ver.orig.tar.gz
: upstream sourcepkg_debver.debian.tar.gz
: tarball with the debian changes
- download the upstream source
- rename to
<source_package>_<upstream_version>.orig.tar.gz
- untar it
- rename the directory
<source_package>-<upstream_version>
cd <source_package>-<upstream_version> && dh_make
debian/
created
- main files
control
: meta-data about the packagerules
: specifies how to build the package (a plain Makefile!)copyright
: copyright infochangelog
: history of the debian package
- other files
compat
watch
dh_install*
targets*.dirs
,*.docs
,*.manpages
...
maintainer scripts
*.postinst
,*.prerm
...
source/format
patches/
- if you need to modify the upstream source
- gives the current version of the package
1.2.1.1-5
1.2.1.1
=> upstream version5
after hyphen => debian revision
- create a changelog entry for a new release
dch -i
- or by hand!
- meta-data
- package name, build-dependencies ...
- packages with different contents on each Debian architechture
- ex: C program
Architecture: any
orArchitecture: amd64 i386
- named
package_version_architecture.deb
- packages with same contents on all architechtures
- ex: Perl lib
Architecture: all
- named
package_version_all.deb
Makefile
!!!- deciding how to build the packages
- required targets
build
,build-arch
,build-indep
: should perform all the configuration and compilationbinary
,binary-arch
,binary-indep
: build the binary packagesdpkg-buildpackage
will callbinary
to build all the packagesbinary-arch
to build only theArchitecture: any
packages
clean
- debhelper
- CDBS
- dh for new package, use this !!
aptitude build-dep foo
: install the build-dependencies
- or
mk-build-deps -ir
for package not uploaded yet (which depends onequivs
)
debuild
: build, test withlintain
, sign with GPG
- or
dpkg-buildpackage -us -uc
directly
- more clean && minimal environment ?
pbuilder
,schroot
+sbuild
** for some reason, you don't want to make test
or make check
, you can specify export DEB_BUILD_OPTIONS=nocheck
in rules
file, reference 1 2**
this will generates .deb
files and a .changes
file.
- upload with
dput
- manage a private debian archive with
reprepro