-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
57 lines (45 loc) · 1.11 KB
/
Makefile
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
#
# Build mock and local RPM versions of tools for Samba
#
# Assure that sorting is case sensitive
LANG=C
MOCKS+=fedora-30-x86_64
MOCKS+=epel-8-x86_64
MOCKS+=epel-7-x86_64
MOCKS+=epel-6-x86_64
SPEC := `ls *.spec`
all:: $(MOCKS)
getsrc:: FORCE
spectool -g $(SPEC)
src.rpm:: Makefile openssh.spec
@echo "Building SRC.RPM with $(SPEC)"
rm -rf rpmbuild
rpmbuild --define '_topdir $(PWD)/rpmbuild' \
--define '_sourcedir $(PWD)' \
-bs $(SPEC) --nodeps
ln -f $(PWD)/rpmbuild/SRPMS/*.src.rpm $@
build:: src.rpm FORCE
rpmbuild --define '_topdir $(PWD)/rpmbuild' \
--rebuild rpmbuild/SRPMS/*.src.rpm
$(MOCKS):: src.rpm FORCE
@if [ -e $@ -a -n "`find $@ -name \*.rpm`" ]; then \
echo " Skipping RPM populated $@"; \
else \
echo " Building $@ RPMS with $(SPEC)"; \
rm -rf $@; \
echo "Storing $@/*.src.rpm in [email protected]"; \
/bin/mv $@/*.src.rpm [email protected]; \
echo "Actally building RPMS in $@"; \
rm -rf $@; \
mock -q -r /etc/mock/[email protected] \
--resultdir=$(PWD)/$@ \
src.rpm; \
fi
mock:: $(MOCKS)
clean::
rm -rf */
rm -rf rpmbuild
rm -f *.out
realclean distclean:: clean
rm -f *.rpm
FORCE: