-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.epel8
97 lines (82 loc) · 2.66 KB
/
Makefile.epel8
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
#
# Build mock and local RPM versions of tools for ansible
#
# Assure that sorting is case sensitive
LANG=C
# Requires compat-nettle32
MOCKS+=centos-stream+epel-8-x86_64
#MOCKS+=centos-stream+epel-9-x86_64
###MOCKS+=centos-stream+epel-10-x86_64
#MOCKS+=fedora-40-x86_64
#MOCKS+=amazonlinux-2023-x86_64
#MOCKCFGS+=ansiblerepo-7-x86_64
MOCKCFGS+=ansiblerepo-8-x86_64
#MOCKCFGS+=ansiblerepo-9-x86_64
###MOCKCFGS+=ansiblerepo-10-x86_64
#MOCKCFGS+=ansiblerepo-f40-x86_64
#MOCKCFGS+=ansiblerepo-amz2023-x86_64
#REPOBASEDIR=/var/www/linux/ansiblerepo
REPOBASEDIR:=`/bin/pwd`/../ansiblerepo
SPEC := `ls *.spec`
all:: $(MOCKS)
.PHONY: getsrc
getsrc::
spectool -g $(SPEC)
srpm:: src.rpm
#.PHONY:: src.rpm
src.rpm:: Makefile
@rm -rf rpmbuild
@rm -f $@
@echo "Building SRPM with $(SPEC)"
rpmbuild --define '_topdir $(PWD)/rpmbuild' \
--define '_sourcedir $(PWD)' \
-bs $(SPEC) --nodeps
mv rpmbuild/SRPMS/*.src.rpm src.rpm
.PHONY: build
build:: src.rpm
rpmbuild --define '_topdir $(PWD)/rpmbuild' \
--rebuild $?
.PHONY: $(MOCKS)
$(MOCKS)::
@if [ -e $@ -a -n "`find $@ -name '*.rpm' ! -name '*.src.rpm' 2>/dev/null`" ]; then \
echo " Skipping RPM populated $@"; \
else \
echo "Building $(SPEC) in $@"; \
rm -rf $@; \
mock -q -r $(PWD)/../[email protected] \
--sources $(PWD) --spec $(SPEC) \
--resultdir=$(PWD)/$@; \
fi
mock:: $(MOCKS)
install:: $(MOCKS)
@for repo in $(MOCKS); do \
echo Installing $$repo; \
case $$repo in \
amazonlinux-2-x86_64) yumrelease=amazon/2023; yumarch=x86_64; ;; \
*-amz2023-x86_64) yumrelease=amazon/2023; yumarch=x86_64; ;; \
*-7-x86_64) yumrelease=el/7; yumarch=x86_64; ;; \
*-8-x86_64) yumrelease=el/8; yumarch=x86_64; ;; \
*-9-x86_64) yumrelease=el/9; yumarch=x86_64; ;; \
*-40-x86_64) yumrelease=fedora/40; yumarch=x86_64; ;; \
*-f40-x86_64) yumrelease=fedora/40; yumarch=x86_64; ;; \
*-rawhide-x86_64) yumrelease=fedora/rawhide; yumarch=x86_64; ;; \
*) echo "Unrecognized release for $$repo, exiting" >&2; exit 1; ;; \
esac; \
rpmdir=$(REPOBASEDIR)/$$yumrelease/$$yumarch; \
srpmdir=$(REPOBASEDIR)/$$yumrelease/SRPMS; \
echo "Pushing SRPMS to $$srpmdir"; \
rsync -av $$repo/*.src.rpm --no-owner --no-group $$repo/*.src.rpm $$srpmdir/. || exit 1; \
createrepo_c -q $$srpmdir/.; \
echo "Pushing RPMS to $$rpmdir"; \
rsync -av $$repo/*.rpm --exclude=*.src.rpm --exclude=*debuginfo*.rpm --no-owner --no-group $$repo/*.rpm $$rpmdir/. || exit 1; \
createrepo_c -q $$rpmdir/.; \
done
@for repo in $(MOCKCFGS); do \
echo "Touching $(PWD)/../$$repo.cfg"; \
/bin/touch --no-dereference $(PWD)/../$$repo.cfg; \
done
clean::
rm -rf */
rm -f *.out
rm -f *.rpm
realclean distclean:: clean