X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=Makefile.debian;h=24967adab245cea7783d54549c626b14a219c6a4;hb=527f3958dd2c3b65f1ccb68c496656cda3b3b223;hp=1c78bf547af31328ac7e5455c69889f37f6c6a75;hpb=8ece6aaf557800371b7366e22af7a6ab04614d10;p=sfa.git diff --git a/Makefile.debian b/Makefile.debian index 1c78bf54..24967ada 100644 --- a/Makefile.debian +++ b/Makefile.debian @@ -1,39 +1,24 @@ -# $Id: Makefile,v 1.6 2008/10/29 01:01:35 ghantoos Exp $ -# - -PYTHON=`which python` -DESTDIR=/ -BUILDIR=$(CURDIR)/debian/sfa PROJECT=sfa -VERSION=0.2.0 +VERSION=$(shell python -c "from sfa.util.version import version_tag; print version_tag" | sed -e s,-,.,) +DATE=$(shell date -u +"%a, %d %b %Y %T") +DEBIAN_TARBALL=../$(PROJECT)_$(VERSION).orig.tar.bz2 -all: - @echo "make source - Create source package" - @echo "make install - Install on local system" - @echo "make buildrpm - Generate a rpm package" - @echo "make builddeb - Generate a deb package" - @echo "make clean - Get rid of scratch and byte files" +debian: deban/changelog debian.source debian.package -source: - $(PYTHON) setup.py sdist $(COMPILE) +force: -install: - $(PYTHON) setup.py install --root $(DESTDIR) $(COMPILE) +debian/changelog: debian/changelog.in + sed -e "s|@VERSION@|$(VERSION)|" -e "s|@DATE@|$(DATE)|" debian/changelog.in > debian/changelog -buildrpm: - $(PYTHON) setup.py bdist_rpm --post-install=rpm/postinstall --pre-uninstall=rpm/preuninstall +# TARBALL is passed from the main build (/build/Makefile) to the 'make debian' call +debian.source: force + rsync -a $(TARBALL) $(DEBIAN_TARBALL) -builddeb: - rm -f sfaadmin sfascan sfi - # build the source package in the parent directory - # then rename it to project_version.orig.tar.gz - $(PYTHON) setup.py sdist $(COMPILE) --dist-dir=../ --prune - rename -f 's/$(PROJECT)-(.*)\.tar\.gz/$(PROJECT)_$$1\.orig\.tar\.gz/' ../* - # build the package - dpkg-buildpackage -i -I -rfakeroot +debian.package: + debuild -uc -us --source-option=--include-binaries --source-option=-isession -clean: - $(PYTHON) setup.py clean - $(MAKE) -f $(CURDIR)/debian/rules clean - rm -rf build/ MANIFEST +debian.clean: + $(MAKE) -f debian/rules clean + rm -rf build/ MANIFEST ../*.tar.gz ../*.dsc ../*.build find . -name '*.pyc' -delete +