added Makefile to build debian packages
authorJordan Augé <jordan.auge@lip6.fr>
Wed, 3 Oct 2012 05:31:54 +0000 (07:31 +0200)
committerJordan Augé <jordan.auge@lip6.fr>
Wed, 3 Oct 2012 05:31:54 +0000 (07:31 +0200)
Makefile.debian [new file with mode: 0644]

diff --git a/Makefile.debian b/Makefile.debian
new file mode 100644 (file)
index 0000000..1c78bf5
--- /dev/null
@@ -0,0 +1,39 @@
+# $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
+
+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
+       find . -name '*.pyc' -delete