From 92f911461d73b3962d3d930747524bc0e821c770 Mon Sep 17 00:00:00 2001
From: Lucas Carvalho <lucas@nexedi.com>
Date: Wed, 3 Mar 2010 22:19:17 +0000
Subject: [PATCH] Now the software version is not same of package version. You
 can define package version executing make debian-appliance
 PACKAGE_VERSION=007.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33341 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 buildout/Makefile | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/buildout/Makefile b/buildout/Makefile
index 88d6cb42d1..96a346b858 100644
--- a/buildout/Makefile
+++ b/buildout/Makefile
@@ -1,5 +1,8 @@
 SOFTWARE_BUILD_PATH='/opt/erp5/'`cat VERSION.txt`
 PACKAGE_INSTALL_PATH='opt/erp5/'`cat VERSION.txt`
+ifndef $(PACKAGE_VERSION)
+PACKAGE_VERSION=`cat VERSION.txt`
+endif
 
 software: bin/buildout
 	bin/buildout
@@ -12,14 +15,16 @@ assert: bin/python2.4
 	bin/python2.4 tests/assertSoftware.py
 
 debian-appliance:
-	svn co https://svn.erp5.org/repos/public/erp5/trunk/buildout $(SOFTWARE_BUILD_PATH)
-	cd $(SOFTWARE_BUILD_PATH); $(MAKE) $(MFLAGS)
 	svn co --ignore-externals https://svn.erp5.org/repos/public/spec/debian-erp5-appliance/ debian-erp5-appliance
+	sed -i "s,__VERSION__,$(PACKAGE_VERSION),g" debian-erp5-appliance/DEBIAN/control
+	sed -i "s,__VERSION__,`cat VERSION.txt`,g" debian-erp5-appliance/DEBIAN/prerm
+	svn co https://svn.erp5.org/repos/public/erp5/trunk/buildout $(SOFTWARE_BUILD_PATH)
+	cd $(SOFTWARE_BUILD_PATH); #$(MAKE) $(MFLAGS)
 	mkdir -p debian-erp5-appliance/$(PACKAGE_INSTALL_PATH)
 	mv $(SOFTWARE_BUILD_PATH)/* debian-erp5-appliance/$(PACKAGE_INSTALL_PATH)
 	rm -rf debian-erp5-appliance/*.txt
 	rm -rf debian-erp5-appliance/*.TXT
 	rm -rf `find debian-erp5-appliance/ -type d -name .svn`
 	rm -rf `find debian-erp5-appliance/ -name *.pyc`
-	dpkg-deb -b debian-erp5-appliance/ .
+	dpkg-deb -b debian-erp5-appliance/ erp5-`cat VERSION.txt`.deb
 
-- 
2.30.9