Skip to content

Instantly share code, notes, and snippets.

@RichardBronosky
Last active June 7, 2022 10:50
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save RichardBronosky/5358867 to your computer and use it in GitHub Desktop.
Save RichardBronosky/5358867 to your computer and use it in GitHub Desktop.
Debian packaging is hard. I learned to create simple packages from http://faceted.wordpress.com/2011/05/18/howto-build-a-trivial-debian-package-with-dh_make/
NAME=hello-world
VERSION=0.1
# Standard setup
mkdir $NAME-$VERSION
cd $NAME-$VERSION
dh_make --createorig --indep --copyright gpl2 --yes
find debian -type f -not -regex 'debian/\(changelog\|compat\|rules\|control\|copyright\)' -exec rm {} \;
echo "./debian/source/* ./" > debian/$NAME.install
# You should check the copyright file and maybe the changelog at this point.
# Create custom stuff
mkdir -p debian/source/bin
echo echo Hello World > debian/source/bin/hello
chmod +x debian/source/bin/hello
# There's a lot of confusion about how to add symbolic links to deb packages. This is how you do it...
echo bin/hello bin/helloworld > debian/$NAME.links
# Standard finish
dpkg-buildpackage -uc -tc -rfakeroot
# Hey look what I made!
dpkg --contents ../${NAME}_$VERSION*.deb
@RichardBronosky
Copy link
Author

Google is littered with examples of people wanting to put symbolic links in their packages and being told that it is not possible. http://comments.gmane.org/gmane.linux.debian.devel.mentors/56819 I figured out how to do it!

@cnzf1
Copy link

cnzf1 commented Nov 8, 2020

Good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment