Created
June 22, 2022 20:26
-
-
Save yvesf/e99e5719c244bc4f3b75b006be5efdc0 to your computer and use it in GitHub Desktop.
very simple way to create a working debian package
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PACKAGE_NAME=git-repo | |
PACKAGE_VERSION=0.1+git-$(shell git describe --always HEAD) | |
PREFIX=/usr/local/bin | |
include Makefile.package | |
work/data: work work/data/$(PREFIX) | |
work/data/$(PREFIX): | |
mkdir -p "$@" | |
cp git-repo "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PACKAGE_DESCRIPTION ?= "Quick packaging for $(PACKAGE_NAME)" | |
PACKAGE_MAINTAINER ?= "$(shell echo $USER)@$(shell hostname)" | |
OUT_DEB=$(PACKAGE_NAME)-$(PACKAGE_VERSION).deb | |
all: $(OUT_DEB) | |
clean: | |
rm -rvf target work $(OUT_DEB) | |
target: | |
mkdir $@ | |
target/debian-binary: | target | |
echo 2.0 > $@ | |
target/control.tar.gz: work/control/control | |
tar cvzf $@ -C work/control . | |
target/data.tar.gz: work/data | |
tar cvzf $@ -C work/data . | |
work: | |
mkdir $@ | |
work/control: work | |
mkdir $@ | |
work/data: work | |
mkdir -p $@ | |
work/control/control: work/control | |
echo "Package: $(PACKAGE_NAME)" >$@ | |
echo "Version: $(PACKAGE_VERSION)" >>$@ | |
echo "Architecture: amd64" >>$@ | |
echo "Maintainer: $(PACKAGE_MAINTAINER)" >>$@ | |
echo "Description: $(PACKAGE_DESCRIPTION)" >>$@ | |
$(OUT_DEB): target/debian-binary target/control.tar.gz target/data.tar.gz | |
ar q $@ $^ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment