-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
26 lines (20 loc) · 912 Bytes
/
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
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
top_dir := $(notdir $(patsubst %/,%,$(dir $(mkfile_path))))
SRPM := $(shell rpmspec --query --srpm --queryformat '%{name}-%{version}-%{release}\n' $(spec)).src.rpm
SOURCES := $(shell spectool --list $(spec)| sed 's|^.*[ \/]||g')
outdir:= output
sources: $(SOURCES)
$(SOURCES): $(spec)
mkdir -p $(outdir)/el8
spectool -A -g -C $(outdir) $(spec)
for item in $(shell spectool -l $(spec) | awk '$$0 !~ /http/ { print $$2}'); do \
cp $(shell dirname $(spec))/$${item} $(outdir); \
done
$(outdir)/$(SRPM): $(SOURCES)
mock --buildsrpm --sources=$(outdir) --spec $(spec) --resultdir=$(outdir)
srpm: $(outdir)/$(SRPM)
rpm: $(outdir)/$(SRPM)
mock -r rock-8-x86_64.cfg --resultdir=$(outdir)/el8 $(outdir)/$(SRPM) --no-cleanup-after
createrepo_c --update $(outdir)/el8
copr: $(outdir)/$(SRPM)
copr-cli build @rocknsm/testing $(outdir)/$(SRPM)