X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=Makefile.debian;h=c4afb771328690bab516f870797f6983fbbb27bf;hb=449e605690a1eda84671ea1f51b2a5a2368a25a0;hp=1c78bf547af31328ac7e5455c69889f37f6c6a75;hpb=de35e18292a261afb4f8d420a3b3c13592d53a99;p=sfa.git diff --git a/Makefile.debian b/Makefile.debian index 1c78bf54..c4afb771 100644 --- a/Makefile.debian +++ b/Makefile.debian @@ -1,39 +1,33 @@ -# $Id: Makefile,v 1.6 2008/10/29 01:01:35 ghantoos Exp $ +# This is called from the build with the following variables set +# (see build/Makefile and target_debian) +# (.) RPMTARBALL +# (.) RPMVERSION +# (.) RPMRELEASE +# (.) RPMNAME # +PROJECT=$(RPMNAME) +#PYVERSION=$(shell python -c "from sfa.util.version import version_tag; print version_tag" | sed -e s,-,.,) +DEBVERSION=$(RPMVERSION).$(RPMRELEASE) +DEBTARBALL=../$(PROJECT)_$(DEBVERSION).orig.tar.bz2 -PYTHON=`which python` -DESTDIR=/ -BUILDIR=$(CURDIR)/debian/sfa -PROJECT=sfa -VERSION=0.2.0 - -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" - -source: - $(PYTHON) setup.py sdist $(COMPILE) - -install: - $(PYTHON) setup.py install --root $(DESTDIR) $(COMPILE) - -buildrpm: - $(PYTHON) setup.py bdist_rpm --post-install=rpm/postinstall --pre-uninstall=rpm/preuninstall - -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 - -clean: - $(PYTHON) setup.py clean - $(MAKE) -f $(CURDIR)/debian/rules clean - rm -rf build/ MANIFEST +DATE=$(shell date -u +"%a, %d %b %Y %T") + +debian: debian/changelog debian.source debian.package + +force: + +debian/changelog: debian/changelog.in + sed -e "s|@VERSION@|$(DEBVERSION)|" -e "s|@DATE@|$(DATE)|" debian/changelog.in > debian/changelog + +# TARBALL is passed from the main build (/build/Makefile) to the 'make debian' call +debian.source: force + rsync -a $(RPMTARBALL) $(DEBTARBALL) + +debian.package: + debuild -uc -us -b + +debian.clean: + $(MAKE) -f debian/rules clean + rm -rf build/ MANIFEST ../*.tar.gz ../*.dsc ../*.build find . -name '*.pyc' -delete +