Makefile 3.01 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
Lucas Carvalho's avatar
Lucas Carvalho committed
6 7 8
ifndef $(PACKAGE_RELEASE)
PACKAGE_RELEASE="None"
endif
9 10 11 12 13 14
ifndef $(PACKAGE_SOFTWARE_RELEASE)
PACKAGE_SOFTWARE_RELEASE="None"
endif
ifndef $(PACKAGE_APPLICATION_RELEASE)
PACKAGE_APPLICATION_RELEASE="None"
endif
15

Łukasz Nowak's avatar
Łukasz Nowak committed
16
software: bin/buildout
17
	bin/buildout
18

Łukasz Nowak's avatar
Łukasz Nowak committed
19
bin/buildout:
20
	python bootstrap/bootstrap.py
21 22

# run make assert to check that all is working
23 24
assert: bin/python2.4
	bin/python2.4 tests/assertSoftware.py
25 26

debian-appliance:
27
	svn co --ignore-externals https://svn.erp5.org/repos/public/spec/debian-erp5-appliance/ debian-erp5-appliance
28
	sed -i "s,__PACKAGE_NAME__,erp5-`cat VERSION.txt`,g" debian-erp5-appliance/DEBIAN/control
29 30
	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
Lucas Carvalho's avatar
Lucas Carvalho committed
31 32 33
	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
34
	cd $(SOFTWARE_BUILD_PATH); $(MAKE) $(MFLAGS)
35 36
	mkdir -p debian-erp5-appliance/$(PACKAGE_INSTALL_PATH)
	mv $(SOFTWARE_BUILD_PATH)/* debian-erp5-appliance/$(PACKAGE_INSTALL_PATH)
37
	rm -rf debian-erp5-appliance/*.txt
38 39 40
	rm -rf debian-erp5-appliance/*.TXT
	rm -rf `find debian-erp5-appliance/ -type d -name .svn`
	rm -rf `find debian-erp5-appliance/ -name *.pyc`
41
	dpkg-deb -b debian-erp5-appliance/ .
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
	if [ $(PACKAGE_RELEASE) != 'None' ]; then sed -i "s,release = 001,release = $(PACKAGE_RELEASE),g" rpmgen/buildout.cfg; fi
	if [ $(PACKAGE_APPLICATION_RELEASE) != 'None' ]; then sed -i "/release \= 001/{x;/^$$/s//0/;y/012/123/;/2/{x;s/release = 001/release = $(PACKAGE_APPLICATION_RELEASE)/;x;};x;}" rpmgen/buildout.cfg; fi
52
	if [ $(PACKAGE_SOFTWARE_RELEASE) != 'None' ]; then sed -i 's,release = 001,release = $(PACKAGE_SOFTWARE_RELEASE),1' rpmgen/buildout.cfg; fi
53 54 55 56
	# 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...
57
	cd rpmgen; make erp5-software
58
	# now we have the erp5 software rpm and we need it installed to build tiolive application rpm
Lucas Carvalho's avatar
Lucas Carvalho committed
59
	if test -d ~/rpmbuild/RPMS/x86_64; \
60 61
	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 ; \
62 63
 	fi
	# building tiolive appliance
64
	sudo rpmbuild -bb rpmgen/specs/tiolive-application-buildout-mandriva2010.spec