Makefile 5.74 KB
Newer Older
1
PYTHON=python
2
BUILDOUT_OPT=-U -v
3 4
SOFTWARE_BUILD_PATH='/opt/erp5/'`cat VERSION.txt`
PACKAGE_INSTALL_PATH='opt/erp5/'`cat VERSION.txt`
5 6 7
ifndef $(PACKAGE_VERSION)
PACKAGE_VERSION=`cat VERSION.txt`
endif
8
ifndef $(PACKAGE_SOFTWARE_RELEASE)
9
PACKAGE_SOFTWARE_RELEASE=001
10 11
endif
ifndef $(PACKAGE_APPLICATION_RELEASE)
12
PACKAGE_APPLICATION_RELEASE=001
13
endif
14

Łukasz Nowak's avatar
Łukasz Nowak committed
15
software: bin/buildout
16
	$(PYTHON) -S bin/buildout $(BUILDOUT_OPT)
17

Łukasz Nowak's avatar
Łukasz Nowak committed
18
bin/buildout:
19
	$(PYTHON) -S bootstrap/bootstrap.py -d
20 21

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

debian-appliance:
26
	svn co --ignore-externals https://svn.erp5.org/repos/public/spec/debian-erp5-appliance/ debian-erp5-appliance
27 28 29
	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
30
	sudo svn co https://svn.erp5.org/repos/public/erp5/release/5.4.6/ $(SOFTWARE_BUILD_PATH)
Lucas Carvalho's avatar
Lucas Carvalho committed
31 32
	sudo chown -R `whoami` $(SOFTWARE_BUILD_PATH)
	sudo $(SOFTWARE_BUILD_PATH)/helpers/debian.lenny.sh
Lucas Carvalho's avatar
Typo.  
Lucas Carvalho committed
33
	cd $(SOFTWARE_BUILD_PATH); $(MAKE) $(MFLAGS)
34 35
	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)
36 37 38 39
	find debian-erp5-appliance/debian/erp5-$(PACKAGE_VERSION)/$(PACKAGE_INSTALL_PATH) -type d -name .svn -exec rm -rf {} \;
	find debian-erp5-appliance/debian/erp5-$(PACKAGE_VERSION)/$(PACKAGE_INSTALL_PATH) -name '*.pyc' -delete
	rm -rf debian-erp5-appliance/debian/erp5-$(PACKAGE_VERSION)/$(PACKAGE_INSTALL_PATH)/downloads/* 
	rm -rf debian-erp5-appliance/debian/erp5-$(PACKAGE_VERSION)/$(PACKAGE_INSTALL_PATH)/parts/*__unpack__
40
	cd debian-erp5-appliance/; sudo dpkg-buildpackage -b 
41 42 43
	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
44
	sed -i "s,__PACKAGE_RELEASE__,$(PACKAGE_APPLICATION_RELEASE),g" debian-tiolive-application/debian/changelog
45
	cd debian-tiolive-application; sudo dpkg-buildpackage -b
46

47
checkout-rpmgen:
48
	svn co https://svn.erp5.org/repos/public/erp5/trunk/utils/rpmgen rpmgen
49 50

mandriva-rpm-appliance: checkout-rpmgen
51 52 53 54
	sed -i "s,name = erp5-official-buildout,name = erp5-`cat VERSION.txt`,g" rpmgen/profiles/mandriva.cfg
	sed -i "s,\$${checkout:location\}\/VERSION.txt,$(PACKAGE_VERSION),g" rpmgen/profiles/mandriva.cfg
	sed -i "/release \= 001/{x;/^$$/s//0/;y/012/123/;/2/{x;s/release = 001/release = $(PACKAGE_APPLICATION_RELEASE)/;x;};x;}" rpmgen/profiles/mandriva.cfg
	sed -i 's,release = 001,release = $(PACKAGE_SOFTWARE_RELEASE),1' rpmgen/profiles/mandriva.cfg
55 56
	sed -i "s,\$$(shell cat parts/checkout/VERSION.txt), `cat VERSION.txt`,g" rpmgen/Makefile
	sudo helpers/mandriva2010.0.sh
57 58
	cd rpmgen; make mandriva

59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
opensuse11.2-rpm-appliance: checkout-rpmgen
	sed -i "s,mandriva,opensuse11.2,g" rpmgen/buildout.cfg
	sed -i "s,name = erp5-official-buildout,name = erp5-$(PACKAGE_VERSION),g" rpmgen/profiles/opensuse11.2.cfg
	sed -i "s,\$${checkout:location\}\/VERSION.txt,$(PACKAGE_VERSION),g" rpmgen/profiles/opensuse11.2.cfg
	sed -i "/release \= 001/{x;/^$$/s//0/;y/012/123/;/2/{x;s/release = 001/release = $(PACKAGE_APPLICATION_RELEASE)/;x;};x;}" rpmgen/profiles/opensuse11.2.cfg
	sed -i 's,release = 001,release = $(PACKAGE_SOFTWARE_RELEASE),1' rpmgen/profiles/opensuse11.2.cfg
	sed -i "s,\$$(shell cat parts/checkout/VERSION.txt),$(PACKAGE_VERSION),g" rpmgen/Makefile
	sudo helpers/opensuse.sh
	cd rpmgen; make opensuse

opensuse11.3-rpm-appliance: checkout-rpmgen
	sed -i "s,mandriva,opensuse11.3,g" rpmgen/buildout.cfg
	sed -i "s,name = erp5-official-buildout,name = erp5-$(PACKAGE_VERSION),g" rpmgen/profiles/opensuse11.3.cfg
	sed -i "s,\$${checkout:location\}\/VERSION.txt,$(PACKAGE_VERSION),g" rpmgen/profiles/opensuse11.3.cfg
	sed -i "/release \= 001/{x;/^$$/s//0/;y/012/123/;/2/{x;s/release = 001/release = $(PACKAGE_APPLICATION_RELEASE)/;x;};x;}" rpmgen/profiles/opensuse11.3.cfg
	sed -i 's,release = 001,release = $(PACKAGE_SOFTWARE_RELEASE),1' rpmgen/profiles/opensuse11.3.cfg
Lucas Carvalho's avatar
Typo.  
Lucas Carvalho committed
75
	sed -i "s,\$$(shell cat parts/checkout/VERSION.txt),$(PACKAGE_VERSION),g" rpmgen/Makefile
76 77
	sudo helpers/opensuse.sh
	cd rpmgen; make opensuse
78

79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
fedora12-rpm-appliance: checkout-rpmgen
	sed -i "s,mandriva,fedora12,g" rpmgen/buildout.cfg
	sed -i "s,name = erp5-official-buildout,name = erp5-$(PACKAGE_VERSION),g" rpmgen/profiles/fedora12.cfg
	sed -i "s,\$${checkout:location\}\/VERSION.txt,$(PACKAGE_VERSION),g" rpmgen/profiles/fedora12.cfg
	sed -i "/release \= 001/{x;/^$$/s//0/;y/012/123/;/2/{x;s/release = 001/release = $(PACKAGE_APPLICATION_RELEASE)/;x;};x;}" rpmgen/profiles/fedora12.cfg
	sed -i 's,release = 001,release = $(PACKAGE_SOFTWARE_RELEASE),1' rpmgen/profiles/fedora12.cfg
	sed -i "s,\$$(shell cat parts/checkout/VERSION.txt),$(PACKAGE_VERSION),g" rpmgen/Makefile
	sudo helpers/fedora.sh
	cd rpmgen; make fedora

fedora13-rpm-appliance: checkout-rpmgen
	sed -i "s,mandriva,fedora13,g" rpmgen/buildout.cfg
	sed -i "s,name = erp5-official-buildout,name = erp5-$(PACKAGE_VERSION),g" rpmgen/profiles/fedora13.cfg
	sed -i "s,\$${checkout:location\}\/VERSION.txt,$(PACKAGE_VERSION),g" rpmgen/profiles/fedora13.cfg
	sed -i "/release \= 001/{x;/^$$/s//0/;y/012/123/;/2/{x;s/release = 001/release = $(PACKAGE_APPLICATION_RELEASE)/;x;};x;}" rpmgen/profiles/fedora13.cfg
	sed -i 's,release = 001,release = $(PACKAGE_SOFTWARE_RELEASE),1' rpmgen/profiles/fedora13.cfg
95 96 97 98
	sed -i "s,\$$(shell cat parts/checkout/VERSION.txt),$(PACKAGE_VERSION),g" rpmgen/Makefile
	sudo helpers/fedora.sh
	cd rpmgen; make fedora