====== 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 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 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. ==== Links ==== * http://askubuntu.com/questions/90764/how-do-i-create-a-deb-package-for-a-single-python-script * http://stackoverflow.com/questions/7459644/why-is-dh-usrlocal-throwing-a-build-error * http://xmodulo.com/2013/04/how-to-create-deb-debian-package-for-java-web-application.html * http://www.ibm.com/developerworks/linux/library/l-debpkg/index.html ===== 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 ==== * https://medium.com/@kasunmaduraeng/how-to-modify-and-repack-deb-package-436f8351af41