Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (48 loc) · 1.49 KB
/
Copy pathMakefile
File metadata and controls
63 lines (48 loc) · 1.49 KB
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
# $Id$
# Makefile pour construire le RPM de git-store
SHELL := /bin/bash
NAME := git-store
VERSION := $(shell ./$(NAME) --version | sed -nE 's/^.*\s+//p')
TEMPDIR := $(shell mktemp -d -u)
BINS = git-store
SPEC = git-store.spec
DIST_ARCHIVE = $(distdir).tar.gz
GZIP_ENV = --best
distdir = $(NAME)-$(VERSION)
am__tar = /bin/tar chof - $(distdir)
am__remove_distdir = \
{ test ! -d "$(distdir)" \
|| { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -fr "$(distdir)"; }; }
$(DIST_ARCHIVE): dist
.PHONY: spec clean distclean dist distdir sources install srpm
%: %.in
sed 's/@VERSION@/$(VERSION)/g' $< > $@
spec: $(SPEC)
distdir:
$(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)"
cp Makefile $(BINS) "$(distdir)"
dist: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(DIST_ARCHIVE)
$(am__remove_distdir)
# Nettoyage
clean:
@$(am__remove_distdir)
@rm -f $(DIST_ARCHIVE) $(NAME)-*.src.rpm *~
distclean: clean
@rm -f $(SPEC)
# Cible 'sources' utilisée par Koji dans le cadre de la construction du RPM source
# Création du tar.gz des sources
sources: clean $(SPEC) dist
if groups | grep -q -E '\bmockbuild\b'; then cp $(SPEC) bootstrap.spec; fi
install: $(BINS)
@install -m 0755 $(BINS) "$${PREFIX:-/usr}"/bin
# Cible 'srpm'
srpm: sources
rpmbuild --define "_topdir $(TEMPDIR)" \
--define "_sourcedir ." \
--define "_specdir ." \
--define "_srcrpmdir ." \
--nodeps -bs $(NAME).spec
@rm -rf "$(TEMPDIR)"