Makefile 3.22 KB
Newer Older
1 2
SOFTWARE_BUILD_PATH='/opt/erp5/'`cat VERSION.txt`
PACKAGE_INSTALL_PATH='opt/erp5/'`cat VERSION.txt`
3 4 5
ifndef $(PACKAGE_VERSION)
PACKAGE_VERSION=`cat VERSION.txt`
endif
6
ifndef $(PACKAGE_SOFTWARE_RELEASE)
7
PACKAGE_SOFTWARE_RELEASE="001"
8 9
endif
ifndef $(PACKAGE_APPLICATION_RELEASE)
10
PACKAGE_APPLICATION_RELEASE="001"
11
endif
12

Łukasz Nowak's avatar
Łukasz Nowak committed
13
software: bin/buildout
14
	bin/buildout
15

Łukasz Nowak's avatar
Łukasz Nowak committed
16
bin/buildout:
17
	python -S bootstrap/bootstrap.py
18 19

# run make assert to check that all is working
20 21
assert: bin/python2.4
	bin/python2.4 tests/assertSoftware.py
22 23

debian-appliance:
24
	svn co --ignore-externals https://svn.erp5.org/repos/public/spec/debian-erp5-appliance/ debian-erp5-appliance
25 26 27
	sed -i "s,__PACKAGE_NAME__,erp5-$(PACKAGE_VERSION),g" debian-erp5-appliance/debian/control
	sed -i "s,__PACKAGE_VERSION__,$(PACKAGE_VERSION),g" debian-erp5-appliance/debian/changelog
	sed -i "s,__PACKAGE_RELEASE__,$(PACKAGE_SOFTWARE_RELEASE),g" debian-erp5-appliance/debian/changelog
Lucas Carvalho's avatar
Lucas Carvalho committed
28 29 30
	sudo svn co https://svn.erp5.org/repos/public/erp5/trunk/buildout $(SOFTWARE_BUILD_PATH)
	sudo chown -R `whoami` $(SOFTWARE_BUILD_PATH)
	sudo $(SOFTWARE_BUILD_PATH)/helpers/debian.lenny.sh
Lucas Carvalho's avatar
Typo.  
Lucas Carvalho committed
31
	cd $(SOFTWARE_BUILD_PATH); $(MAKE) $(MFLAGS)
32 33
	mkdir -p debian-erp5-appliance/debian/erp5-$(PACKAGE_VERSION)/$(PACKAGE_INSTALL_PATH)
	mv $(SOFTWARE_BUILD_PATH)/* debian-erp5-appliance/debian/erp5-$(PACKAGE_VERSION)/$(PACKAGE_INSTALL_PATH)
34 35
	rm -rf `find debian-erp5-appliance/ -type d -name .svn`
	rm -rf `find debian-erp5-appliance/ -name *.pyc`
36
	cd debian-erp5-appliance/; sudo dpkg-buildpackage -b 
37 38 39 40 41
	svn co  https://svn.erp5.org/repos/public/spec/debian-tiolive-application/ debian-tiolive-application
	sed -i "s,__PACKAGE_VERSION__,$(PACKAGE_VERSION),g" debian-tiolive-application/debian/rules
	sed -i "s,__PACKAGE_VERSION__,$(PACKAGE_VERSION),g" debian-tiolive-application/debian/changelog
	sed -i "s,__PACKAGE_RELEASE__,$(PACKAGE_SOFTWARE_RELEASE),g" debian-tiolive-application/debian/changelog
	cd debian-tiolive-application; sudo dpkg-buildpackage -b
42

43 44
rpm-appliance:
	svn co https://svn.erp5.org/repos/public/erp5/trunk/utils/rpmgen rpmgen
45
	# set the correct name erp5-5.4.6
Lucas Carvalho's avatar
Typo.  
Lucas Carvalho committed
46
	sed -i "s,name = erp5-official-buildout,name = erp5-`cat VERSION.txt`,g" rpmgen/buildout.cfg
47
	# set the correct version defined in the main buildout
Lucas Carvalho's avatar
Lucas Carvalho committed
48
	sed -i "s,\$${checkout:location\}\/VERSION.txt,$(PACKAGE_VERSION),g" rpmgen/buildout.cfg
49
	# set the correct release
50 51
	sed -i "/release \= 001/{x;/^$$/s//0/;y/012/123/;/2/{x;s/release = 001/release = $(PACKAGE_APPLICATION_RELEASE)/;x;};x;}" rpmgen/buildout.cfg
	sed -i 's,release = 001,release = $(PACKAGE_SOFTWARE_RELEASE),1' rpmgen/buildout.cfg
52 53 54 55
	# it must use version defined in the main buildout
	sed -i "s,\$$(shell cat parts/checkout/VERSION.txt), `cat VERSION.txt`,g" rpmgen/Makefile
	sudo helpers/mandriva2010.0.sh
	# just make and wait...
56
	cd rpmgen; make erp5-software
57
	# now we have the erp5 software rpm and we need it installed to build tiolive application rpm
Lucas Carvalho's avatar
Lucas Carvalho committed
58
	if test -d ~/rpmbuild/RPMS/x86_64; \
59 60
	then find ~/rpmbuild/RPMS/x86_64/ -name  erp5-`cat VERSION.txt`*.rpm -print0 | xargs -0 sudo urpmi --auto ; \
	else find ~/rpmbuild/RPMS/i586/ -name  erp5-`cat VERSION.txt`*.rpm -print0 | xargs -0 sudo urpmi --auto ; \
61 62
 	fi
	# building tiolive appliance
63
	sudo rpmbuild -bb rpmgen/specs/tiolive-application-buildout-mandriva2010.spec