User Tools

Site Tools


linux:debian:build_package

Building Debian packages

How-to create Debian package for script(s)

Directory structure:

debian/
  |- changelog
  |- compat
  |- control
  |- install
  `- rules
cat debian/changelog 
my-package (1.0) UNRELEASED; urgency=low

  * initial version

 -- Fname Sname <me@example.com>  Mon, 09 Sep 2013 23:59:59 +0000
cat debian/compat
7
cat debian/control
Source: my-uber-package
Section: web
Priority: optional
Maintainer: Fname Sname <me@example.com>
Build-Depends: debhelper (>= 9)
Standards-Version: 3.9.2


Package: my-uber-package
Architecture: all
Section: web
Depends: grep
Description: Short-desc
 Long desc
 over multiple-lines
# real-life example - modify!
cat debian/install 
usr/local/bin/my-script usr/local/bin/
etc/xinet.d/ etc/xinet.d/
cat debian/rules 
#!/usr/bin/make -f

%:
	dh $@

# This is in case you have anything in usr/local
# I presume you may have to over-ride some stuff in similar way
override_dh_usrlocal:
	true

In order to bump-up(update/raise) build version and update debian/changelog, use % dch from devscripts package.

How-to modify and repack Debian package

I don't take credit for this one. This is just a backup in case the original page disappears since this is useful from time to time.

mkdir -p newpack oldpack/DEBIAN
dpkg-deb -x file.deb oldpack/
dpkg-deb -e file.deb oldpack/DEBIAN
# change whatever needs to be changed
dpkg-deb -Z xz -b oldpack/ newpack/

Links

linux/debian/build_package.txt · Last modified: 2022/01/27 02:00 by stybla