forked from statsite/statsite
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
52 lines (40 loc) · 1.25 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
RPMBUILDROOT=$(shell pwd)/rpm-build
NAME=$(shell rpm -q --qf '%{name}\n' --specfile rpm/*.spec | head -1)
VERSION=$(shell rpm -q --qf '%{version}\n' --specfile rpm/*.spec | head -1)
#### Installation options.
DESTDIR =
PREFIX = /usr/local
BINDIR = $(PREFIX)/bin
build:
scons -j4 statsite
clean:
scons --clean test_runner
scons --clean
rm -rfv ./dist ./statsite ./rpm-build ./.sconsign.dblite ./.sconf_temp ./statsite.tar.gz
test:
scons test_runner
./test_runner
install-bin: statsite
install -d "$(DESTDIR)$(BINDIR)"
install statsite "$(DESTDIR)$(BINDIR)"
install: install-bin
integ: build test
py.test integ/
sdist:
mkdir -vp ./dist
tar --exclude statsite.tar.gz -czvf ./dist/statsite.tar.gz .
sources: sdist
cp dist/statsite.tar.gz .
rpms: sdist build
mkdir -vp $(RPMBUILDROOT)
cp -v dist/*.tar.gz $(RPMBUILDROOT)
cp -v statsite.spec $(RPMBUILDROOT)
rpmbuild --define "_topdir $(RPMBUILDROOT)" \
--define "_builddir %{_topdir}" \
--define "_rpmdir %{_topdir}" \
--define "_srcrpmdir %{_topdir}" \
--define "_specdir %{_topdir}" \
--define '_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm' \
--define "_sourcedir %{_topdir}" \
-ba $(RPMBUILDROOT)/statsite.spec
.PHONY: build test