diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a009fb5..67e138d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,28 +2,26 @@ ## Packaging -An unsigned Debian package can be created from the repository in a few steps. +## Source release + +A source tarball can be created from the `Makefile`: + +```bash +git checkout v1.0 +make source-release +``` + +This is suitable as a "pristine" source for downstream packagers. + +## Debian unsigned package + +An unsigned Debian package can also be created from the repository in a few steps. Check out the version you want: ```bash -VERSION=1.0 -git checkout v$VERSION -``` - -Write a 'pristine source' tarball from `git`: - -```bash -git archive --format tar.gz HEAD --prefix mdcheckr-$VERSION/ mdcheckr tests README.md LICENSE.md > mdcheckr_$VERSION.orig.tar.gz -``` - -Extract, add the Debian goodies, compile, and cleanup: - -```bash -tar -xzf mdcheckr_$VERSION.orig.tar.gz -cp -Rf debian/ mdcheckr-$VERSION/ -(cd mdcheckr-$VERSION/ && debuild -us -uc) -rm -Rf mdcheckr-$VERSION/ +git checkout v1.0 +make unsigned-package ``` You will then have source and binary packages in the current directory. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a5b06fe --- /dev/null +++ b/Makefile @@ -0,0 +1,29 @@ +VERSION=1.0 + +.PHONY: default test offline-test source-tarball unsigned-package + +default: test + +test: + (cd tests && ./test.sh) + +source-tarball: mdcheckr_$(VERSION).orig.tar.gz + +mdcheckr_$(VERSION).orig.tar.gz: + tar --transform "s/^/mdcheckr-$(VERSION)\//" -cvzf \ + mdcheckr_$(VERSION).orig.tar.gz \ + LICENSE.md \ + README.md \ + mdcheckr \ + tests + +unsigned-package: mdcheckr_$(VERSION)-1_all.deb + +mdcheckr_$(VERSION)-1_all.deb: mdcheckr_$(VERSION).orig.tar.gz + tar -xzf mdcheckr_$(VERSION).orig.tar.gz + cp -Rf debian/ mdcheckr-$(VERSION)/ + (cd mdcheckr-$(VERSION)/ && debuild -us -uc) + rm -Rf mdcheckr-$(VERSION)/ + +clean: + rm -Rf mdcheckr-$(VERSION)* mdcheckr_$(VERSION)*