How to build debian package:
I got in to the situation that, i have to build debian package(deb) for perp(http://b0llix.net/perp\ , because perp doesnt have debian package.
My setup:
- Ubuntu 14.04
Tools required:
sudo apt-get install devscripts
Concepts:
The package directory should contain "debian" folder and should have set of files to build the debian package.
debian/
├── changelog
├── compat
├── control
└── rules
Ref: https://feeding.cloud.geek.nz/posts/whats-in-a-debian-directory/
suresh@suresh-Latitude-6430U:/tmp/perp-2.07/debian$ cat compat
9
suresh@suresh-Latitude-6430U:/tmp/perp-2.07/debian$
suresh@suresh-Latitude-6430U:/tmp/perp-2.07$ cat debian/changelog
perp (2.0.7-1) stable; urgency=medium
* Latest stable release
-- Wayne Marshal <[email protected]> Wed, 22 Jan 2013 23:40:39 +0100
suresh@suresh-Latitude-6430U:/tmp/perp-2.07$ vi debian/control
suresh@suresh-Latitude-6430U:/tmp/perp-2.07$ cat debian/control
Source: perp
Section: utils
Priority: optional
Maintainer: Wayne Marshal <[email protected]>
Build-Depends: debhelper (>= 9)
Standards-Version: 2.0.7
Homepage: http://b0llix.net/perp/
#Vcs-Git: git://
#Vcs-Browser: http://anonscm.debian.org/gitweb/?p=users/morph/fdupes.git
Package: perp
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}
Multi-Arch: foreign
Description: The perp package provides a set of daemons and utilities to reliably start,
monitor, log, and control a collection of persistent processes.
suresh@suresh-Latitude-6430U:/tmp/perp-2.07$
The importan file is "rules", which is the one used for building the package.
The binary files needs to be installed inside the debian\pkgname. This can be achieved by the make install with proper destination or prefix or install directory. This depends on the makefile of the package.
suresh@suresh-Latitude-6430U:/tmp/perp-2.07$ cat debian/rules
#!/usr/bin/make -f
# This script uses debhelper by Joey Hess
# export DH_VERBOSE=1
DEB_BUILD_GNU_TYPE = $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_GNU_TYPE = $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
export CC=$(DEB_HOST_GNU_TYPE)-gcc
endif
%:
dh $@
override_dh_auto_install:
$(MAKE) install DESTDIR=$(CURDIR)/debian/perp
After this,
Run the command in the package dir
debuild -b -uc -us
This will generate the debian package .
To check the contents of the debian packaage.
dpkg --contents perp_2.0.7-1_amd64.deb
Thats all.
https://github.com/sureshkvl/perp/commit/3d9ba02fd69e6d884656d65b932d964adadceefe