summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 8fc649e057254138e43b810c030d0edc1b4939c6 (plain)
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
RPMDEFINES := --define "_sourcedir $(SRCDIR)" \
              --define "_specdir $(SRCDIR)" \
              --define "_srcrpmdir $(SRCDIR)" \
              --define "_rpmdir $(SRCDIR)"

SRCDEFINES := --define "dist .remi" \
              --define "fedora 1" \
              --define "nophptag 1"

arch:
	mv *.src.rpm /data/rpms/SRPMS.remi/ && echo done || echo Nothing to do

clean:
	@echo Clean $(NAME) in $(SRCDIR)
	@rm -rfv *~ noarch x86_64 *.src.rpm

fedsrpm:
	rpmbuild $(RPMDEFINES) --define "dist .fedora" -bs $(NAME).spec

srpm:
	rpmbuild $(RPMDEFINES) $(SRCDEFINES) -bs $(NAME).spec

devsrpm:
	rpmbuild $(RPMDEFINES) $(SRCDEFINES) -bs $(NAME)-dev.spec

build53:
	time rpmbuild $(RPMDEFINES) --define "phpname php53" --define "runselftest 0" -bb $(NAME).spec

bi53:
	time rpmbuild $(RPMDEFINES) --define "phpname php53" --define "runselftest 0"  -bi --short-circuit  $(NAME).spec

srpm53:
	rpmbuild $(RPMDEFINES) $(SRCDEFINES) --define "phpname php53" -bs $(NAME).spec

devsrpm53:
	rpmbuild $(RPMDEFINES) $(SRCDEFINES) --define "phpname php53" -bs $(NAME)-dev.spec

build:
	time rpmbuild $(RPMDEFINES) -bb $(NAME).spec

buildtest:
	time rpmbuild $(RPMDEFINES) -bb --with tests $(NAME).spec

bitest:
	rpmbuild $(RPMDEFINES) --with tests -bi --short-circuit $(NAME).spec

buildmini:
	time rpmbuild $(RPMDEFINES) --define "runselftest 0" --without tests -bb $(NAME).spec

bp:
	rpmbuild $(RPMDEFINES) -bp $(NAME).spec

bc:
	rpmbuild $(RPMDEFINES) -bc --short-circuit $(NAME).spec

bi:
	rpmbuild $(RPMDEFINES) --define "runselftest 0" -bi --short-circuit $(NAME).spec

devbp:
	rpmbuild $(RPMDEFINES)  --define "runselftest 0" -bp $(NAME)-dev.spec

devbi:
	rpmbuild $(RPMDEFINES)  --define "runselftest 0" -bi --short-circuit $(NAME)-dev.spec

devbl:
	rpmbuild $(RPMDEFINES) -bl --short-circuit $(NAME)-dev.spec

bl:
	rpmbuild $(RPMDEFINES) -bl --short-circuit $(NAME).spec

devbuild:
	time rpmbuild $(RPMDEFINES) -bb $(NAME)-dev.spec

devbuildmini:
	time rpmbuild $(RPMDEFINES) --define "runselftest 0" --without tests -bb $(NAME)-dev.spec

devbuildtest:
	time rpmbuild $(RPMDEFINES) --with tests -bb $(NAME)-dev.spec

sign:
	rpmsign --addsign *.src.rpm

/tmp/$(NAME)-filtered.spec: $(NAME).spec
	sed -e "s/%{phpname}/php/g;s/%{phpconfdir}/%{_sysconfdir}/g;s/%{phpbindir}/%{_bindir}/g;s/%{phpincldir}/%{_includedir}/g;s/%{_origsysconfdir}/%{_sysconfdir}/g;s/%{_origincludedir}/%{_includedir}/g" $(NAME).spec >/tmp/$(NAME)-filtered.spec

diff: /tmp/$(NAME)-filtered.spec
	colordiff -u  /tmp/$(NAME)-filtered.spec /home/extras/GIT/$(NAME)/$(NAME).spec 2>/dev/null

devdiff: /tmp/$(NAME)-filtered.spec
	colordiff -u  /tmp/$(NAME)-filtered.spec $(NAME)-dev.spec

rpmdiff:
	rpmdiff -i T -i L $(NAME) */$(NAME)*rpm

devsrc:
	spectool -g -S $(NAME)-dev.spec

php7src:
	spectool -g -S $(NAME)-php7.spec

php5build:
	@if test -f $(NAME)-dev.spec ; then \
		time rpmbuild $(RPMDEFINES) --define "scl php56" --without zts -bb $(NAME)-dev.spec ; \
	else \
		time rpmbuild $(RPMDEFINES) --define "scl php56" --without zts -bb $(NAME).spec ; \
	fi

php7build:
	@if test -f $(NAME)-php7.spec ; then \
		time rpmbuild $(RPMDEFINES) -bb $(NAME)-php7.spec ; \
	elif test -f $(NAME)-dev.spec ; then \
		time rpmbuild $(RPMDEFINES) -bb $(NAME)-dev.spec ; \
	else \
		time rpmbuild $(RPMDEFINES) -bb $(NAME).spec ; \
	fi

php71build:
	@if test -f $(NAME)-php7.spec ; then \
		time rpmbuild $(RPMDEFINES) --define "scl php71" --without zts -bb $(NAME)-php7.spec ; \
	elif test -f $(NAME)-dev.spec ; then \
		time rpmbuild $(RPMDEFINES) --define "scl php71" --without zts -bb $(NAME)-dev.spec ; \
	else \
		time rpmbuild $(RPMDEFINES) --define "scl php71" --without zts -bb $(NAME).spec ; \
	fi

php7test:
	@if test -f $(NAME)-php7.spec ; then \
		time rpmbuild $(RPMDEFINES) --define "scl php70" --without zts -bb --with tests $(NAME)-php7.spec ; \
	elif test -f $(NAME)-dev.spec ; then \
		time rpmbuild $(RPMDEFINES) --define "scl php70" --without zts -bb --with tests $(NAME)-dev.spec ; \
	else \
		time rpmbuild $(RPMDEFINES) --define "scl php70" --without zts -bb --with tests $(NAME).spec ; \
	fi

php7srpm:
	rpmbuild $(RPMDEFINES) $(SRCDEFINES) -bs $(NAME)-php7.spec

src:
	spectool -g -S $(NAME).spec

REFLECTION: $(NAME).spec

	php --re $(shell pwd | sed -e 's/.*-//') >REFLECTION

composer: $(NAME).spec
	tar xf $(shell spectool -l $(NAME).spec | head -n 1 | sed -e 's:.* ::' | sed -e 's:.*/::') --strip-components=1 '*/composer.json'

devcomposer:
	if [ -f composeer.json ]; then mv composer.json old.json; fi && \
	tar xf $(shell spectool -l $(NAME)-dev.spec | head -n 1 | sed -e 's:.*/::') --strip-components=1 '*/composer.json' && \
	mv composer.json composer-dev.json && \
	if [ -f old.json ]; then mv old.json composer.json; fi