blob: 21fb6aeebf023bead0edfd9d6e1e3e9d38f60037 (
plain)
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
|
NAME=libaio
SPECFILE=$(NAME).spec
VERSION=$(shell awk '/Version:/ { print $$2 }' $(SPECFILE))
RELEASE=$(shell awk '/Release:/ { print $$2 }' $(SPECFILE))
CVSTAG = $(NAME)_$(subst .,-,$(VERSION))_$(subst .,-,$(RELEASE))
RPMBUILD=$(shell `which rpmbuild >&/dev/null` && echo "rpmbuild" || echo "rpm")
prefix=/usr
includedir=$(prefix)/include
libdir=$(prefix)/lib
pkgname := libaio
ver := $(shell cat .version)
version_dirty := $(strip $(shell git diff | lsdiff | grep ".version"))
dirty := $(strip $(shell git whatchanged ${pkgname}-${ver}... 2>/dev/null))
new_changes := $(strip $(shell git diff 2>/dev/null))
tag_valid := $(strip $(shell git tag -l ${pkgname}-${ver}))
default: all
all:
@$(MAKE) -C src
install:
@$(MAKE) -C src install prefix=$(prefix) includedir=$(includedir) libdir=$(libdir)
check:
@$(MAKE) -C harness check
partcheck: all
@$(MAKE) -C harness partcheck
clean:
@$(MAKE) -C src clean
@$(MAKE) -C harness clean
tag: tag-checks
git tag ${pkgname}-${ver}
archive: uptodate
@echo "Creating archive from version ${pkgname}-${ver}:"
git archive --format=tar --prefix=${pkgname}-${ver}/ \
${pkgname}-${ver} | gzip > ${pkgname}-${ver}.tar.gz
tag-checks:
ifneq (${version_dirty},)
@echo "Error: .version is not committed to the repository."
@exit 1
endif
ifneq (${new_changes},)
@echo "Error: there are changes in this checkout that have not been"
@echo "committed to the repository."
@exit 1
endif
uptodate: tag-checks
ifneq (${dirty},)
@echo -n "Error: this branch contains changes that are not part of tag "
@echo "${pkgname}-${ver}."
@echo -n "Try running git-whatchanged ${pkgname}-${ver}... to see "
@echo "the changes."
@exit 1
endif
ifeq (${tag_valid},)
@echo "Error: tag ${pkgname}-${ver} does not exist. Run 'make tag'"
@echo "and try again."
@exit 1
endif
srpm: archive
$(RPMBUILD) --define "_sourcedir `pwd`" --define "_srcrpmdir `pwd`" --nodeps -bs $(SPECFILE)
|