aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 21b464ed93d9598557111e27c21f85a0c7cdc46d (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
72
73
74
PACKAGE = spec-helper
VERSION = 0.31.22

SCRIPT_FILES = check_desktop_files \
               check_elf_files \
               clean_files \
               clean_perl \
               compress_files \
               fix_eol \
               fix_mo \
               fix_pamd \
               gprintify \
               lib_symlinks \
               relink_symlinks \
               remove_info_dir \
               restrict_to_cpu0
BIN_FILES    = macroszification
MACROS_FILES = spec-helper.macros
TEST_FILES   = t/*.t
FILES        = Makefile NEWS README \
	       $(SCRIPT_FILES) $(BIN_FILES) $(MACROS_FILES:=.in) \
	       $(TEST_FILES) t/Utils.pm

TEST_VERBOSE = 0

bindir       = /usr/bin
pkgdatadir   = /usr/share/$(PACKAGE)
rpmmacrodir  = /usr/lib/rpm/macros.d

all:
	@echo "use make install or make dist"

install: $(MACROS_FILES)
	install -d -m 755 $(DESTDIR)$(bindir)
	install -p -m 755 $(BIN_FILES) $(DESTDIR)$(bindir)
	install -d -m 755 $(DESTDIR)$(pkgdatadir)
	install -p -m 755 $(SCRIPT_FILES) $(DESTDIR)$(pkgdatadir)
	install -d -m 755 $(DESTDIR)/$(rpmmacrodir)
	install -p -m 644 $(MACROS_FILES) $(DESTDIR)/$(rpmmacrodir)

spec-helper.macros: spec-helper.macros.in
	sed -e 's:@pkgdatadir@:$(pkgdatadir):' < $< > $@

clean:
	rm -f *~

test:
	perl -I t -MExtUtils::Command::MM -e "test_harness($(TEST_VERBOSE))" $(TEST_FILES)

# rules to build a local distribution

localdist: cleandist dir localcopy tar

cleandist: clean
	rm -rf $(PACKAGE)-$(VERSION) $(PACKAGE)-$(VERSION).tar.xz

dir:
	mkdir -p $(PACKAGE)-$(VERSION)

localcopy: dir
	tar cf - $(FILES) | (cd $(PACKAGE)-$(VERSION) ; tar xf -)

tar: dir localcopy
	tar cvf $(PACKAGE)-$(VERSION).tar $(PACKAGE)-$(VERSION)
	xz -vf $(PACKAGE)-$(VERSION).tar
	rm -rf $(PACKAGE)-$(VERSION)

# rules to build a public distribution

dist: tar

tag:
	git tag -a '$(VERSION)' -m '$(VERSION)'
	git push origin $(VERSION)