Skip to content

Commit

Permalink
Makefile: move Debian package related rules to contrib
Browse files Browse the repository at this point in the history
The support for Debian packages have already been moved to a contrib
dir, their Makefile rules were kept but not even updated.  Let's
move those to the contrib dir.

Notice: the status of these rules are equal to the other Debian package
files, that is, they're unsupported and we do not guarantee they're
actually working.

Signed-off-by: Cleber Rosa <[email protected]>
  • Loading branch information
clebergnu committed Aug 31, 2016
1 parent 6b224a9 commit a504e52
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 27 deletions.
27 changes: 0 additions & 27 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,10 @@ PYTHON=$(shell which python)
PYTHON26=$(shell $(PYTHON) -V 2>&1 | grep 2.6 -q && echo true || echo false)
VERSION=$(shell $(PYTHON) setup.py --version 2>/dev/null)
DESTDIR=/
BUILDIR=$(CURDIR)/debian/avocado
PROJECT=avocado
AVOCADO_DIRNAME=$(shell echo $${PWD\#\#*/})
AVOCADO_PLUGINS=$(filter-out ../$(AVOCADO_DIRNAME), $(wildcard ../*))
RELEASE_COMMIT=$(shell git log --pretty=format:'%H' -n 1 $(VERSION))
RELEASE_SHORT_COMMIT=$(shell git log --pretty=format:'%h' -n 1 $(VERSION))

COMMIT=$(shell git log --pretty=format:'%H' -n 1)
SHORT_COMMIT=$(shell git log --pretty=format:'%h' -n 1)

Expand Down Expand Up @@ -49,11 +46,6 @@ all:
@echo "srpm: Generate a source RPM package (.srpm)"
@echo "rpm: Generate binary RPMs"
@echo
@echo "Debian related targets:"
@echo "deb: Generate both source and binary debian packages"
@echo "deb-src: Generate a source debian package"
@echo "deb-bin: Generate a binary debian package"
@echo
@echo "Release related targets:"
@echo "source-release: Create source package for the latest tagged release"
@echo "srpm-release: Generate a source RPM package (.srpm) for the latest tagged release"
Expand Down Expand Up @@ -83,25 +75,6 @@ pypi: source-pypi develop
install:
$(PYTHON) setup.py install --root $(DESTDIR) $(COMPILE)

deb-prepare-source:
# build the source package in the parent directory
# then rename it to project_version.orig.tar.gz
dch -D "vivid" -M -v "$(VERSION)" "Automated (make builddeb) build."
$(PYTHON) setup.py sdist $(COMPILE) --dist-dir=../
rename -f 's/$(PROJECT)-(.*)\.tar\.gz/$(PROJECT)_$$1\.orig\.tar\.gz/' ../*

deb-src: deb-prepare-source
# build the source package
dpkg-buildpackage -S [email protected] -rfakeroot

deb-bin: deb-prepare-source
# build binary package
dpkg-buildpackage -b -rfakeroot

deb: deb-prepare-source
# build both source and binary packages
dpkg-buildpackage -i -I -rfakeroot

srpm: source
if test ! -d BUILD/SRPM; then mkdir -p BUILD/SRPM; fi
mock --resultdir BUILD/SRPM -D "commit $(COMMIT)" --buildsrpm --spec avocado.spec --sources SOURCES
Expand Down
29 changes: 29 additions & 0 deletions contrib/packages/debian/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BUILDIR=$(CURDIR)/debian/avocado
PROJECT=avocado

all:
@echo
@echo "Debian related targets:"
@echo "deb: Generate both source and binary debian packages"
@echo "deb-src: Generate a source debian package"
@echo "deb-bin: Generate a binary debian package"
@echo

deb-prepare-source:
# build the source package in the parent directory
# then rename it to project_version.orig.tar.gz
dch -D "vivid" -M -v "$(VERSION)" "Automated (make builddeb) build."
$(PYTHON) setup.py sdist $(COMPILE) --dist-dir=../
rename -f 's/$(PROJECT)-(.*)\.tar\.gz/$(PROJECT)_$$1\.orig\.tar\.gz/' ../*

deb-src: deb-prepare-source
# build the source package
dpkg-buildpackage -S [email protected] -rfakeroot

deb-bin: deb-prepare-source
# build binary package
dpkg-buildpackage -b -rfakeroot

deb: deb-prepare-source
# build both source and binary packages
dpkg-buildpackage -i -I -rfakeroot
10 changes: 10 additions & 0 deletions contrib/packages/debian/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
This is a collection of files that are useful to generate packages for
Debian(-like) systems. Their "contrib" status mean that they should
work, but there's no support for them.

If there are users out there interested in keeping Debian(-like)
packages update, please step up.

The basic usage is to run the various targets defined in the Makefile,
such as running `make deb` to have both source and binary packages
generated.

0 comments on commit a504e52

Please sign in to comment.