-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
34 lines (27 loc) · 938 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
27
28
29
30
31
32
33
VERSION=1.7
RELEASE=2
RPMNAME=virtual-java-$(VERSION)-$(RELEASE).noarch.rpm
.PHONY: all
all: dist/$(RPMNAME)
.PHONY: clean
clean:
rm -rf work
rm -rf dist
dist/$(RPMNAME): work/RPMS/noarch/$(RPMNAME) dist
cp work/RPMS/noarch/$(RPMNAME) dist/$(RPMNAME)
work/RPMS/noarch/$(RPMNAME): work/BUILD work/RPMS/noarch work/SPECS/virtual-java.spec
rpmbuild -bb --define="_topdir ${PWD}/work" work/SPECS/virtual-java.spec
work/SPECS/virtual-java.spec: work/SPECS virtual-java.spec
cat virtual-java.spec | sed -e s/%VERSION%/$(VERSION)/g | sed -e s/%RELEASE%/$(RELEASE)/g > work/SPECS/virtual-java.spec
dist:
if [ ! -d dist ]; then mkdir -p dist; fi
touch dist
work/BUILD:
if [ ! -d work/BUILD ]; then mkdir -p work/BUILD; fi
touch work/BUILD
work/RPMS/noarch:
if [ ! -d work/RPMS/noarch ]; then mkdir -p work/RPMS/noarch; fi
touch work/RPMS/noarch
work/SPECS:
if [ ! -d work/SPECS ]; then mkdir -p work/SPECS; fi
touch work/SPECS