forked from neymanna/fusionforge
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.rh
65 lines (54 loc) · 2.38 KB
/
Makefile.rh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#! /usr/bin/make -f
#
# TODO : document the role of this Makefile
#
RPM_TMP=~/rpmbuild
BUILDRESULT=~/fusionforge_repo
VER=$(shell LANG=C grep '>software_version' src/common/include/FusionForge.class.php | cut -d\' -f2)
in_svn_repo:= $(wildcard .svn/)
ifeq ($(strip $(in_svn_repo)),)
ID=unknown
URL=unknown
TAG=unknown
else
ID=$(shell LANG=C svnversion)
URL=$(shell LANG=C svn info | grep 'Root:' | awk '{print $$3}')
TAG=$(shell LANG=C svn log $(URL) -r $(ID) -l 1 2>/dev/null | awk '{ if ($$1=="Tag-Release") print $$1}')
endif
ifeq ($(TAG),)
version=$(VER).$(ID)
else
version=$(VER)
endif
list:
@echo ======================================================================================
@echo '= Available target are listed below ='
@echo '= Today only to build rpm packages and tarballs ='
@echo ======================================================================================
@cat Makefile.rh | grep '^.*:.*#$$' | sed 's/^\(.*:\).*#\(.*\)#$$/\1 \2/'
all: 3rd-party fusionforge dist
rpmprep:
-rm -Rf $(RPM_TMP)/*
-rm -Rf ~/.rpmmacros
sh tools/rpmdev-setuptree
echo '%_tmppath %{_topdir}/TMP' >> ~/.rpmmacros
echo '%_buildroot %{_tmppath}/%{name}-root' >> ~/.rpmmacros
echo '%_sysconfdir /etc' >> ~/.rpmmacros
mkdir $(RPM_TMP)/TMP
dist:
-mkdir -p $(BUILDRESULT)
cp $(RPM_TMP)/RPMS/noarch/*.rpm $(BUILDRESULT)
createrepo $(BUILDRESULT)
clean: # Clean files of fusionforge build #
cd $(RPM_TMP)/SOURCES/; rm -rf fusionforge-$(version).tar.bz2 fusionforge-$(version)
fusionforge: rpmprep # Build rpm fusionforge packages #
cd src; find . -type f -or -type l | grep -v '/.svn/' | grep -v '/debian/' | cpio -pdumB --quiet $(RPM_TMP)/SOURCES/fusionforge-$(version)
cd $(RPM_TMP)/SOURCES/fusionforge-$(version)/; utils/manage-translations.sh build ; utils/manage-apache-config.sh build
rm -f $(RPM_TMP)/SOURCES/fusionforge-$(version)/utils/fusionforge-shell-postgresql.spec
cd $(RPM_TMP)/SOURCES/; cp fusionforge-$(version)/rpm-specific/patches/* .
cd $(RPM_TMP)/SOURCES/; tar cjf fusionforge-$(version).tar.bz2 fusionforge-$(version)
sed -e 's/@@VERSION@@/$(version)/g' < src/fusionforge.spec > $(RPM_TMP)/TMP/fusionforge.spec
rpmbuild -bb $(RPM_TMP)/TMP/fusionforge.spec
3rd-party:
cd 3rd-party; $(MAKE) -f Makefile.rh all
.PHONY : 3rd-party