aboutsummaryrefslogtreecommitdiff
blob: 0de1edb51fd285b26843f2bda4ec285e8a36d887 (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
CFLAGS += -Wall

VER ?= `date +%Y.%m.%d`
PV = $(VER)
P = rpm2targz-$(PV)

DESTDIR =
prefix = /usr
bindir = $(prefix)/bin
dodir = install -m 755 -d
dobin = install -m 755
dosym = ln -sf

all: rpmoffset rpm2tar
rpm2tar: rpm2targz
	$(dosym) $< $@

clean:
	rm -f *.o rpmoffset rpm2tar $(LINKS)

dist:
	git archive --prefix=$(P)/ HEAD | xz > $(P).tar.xz

dist-live: clean
	rm -rf $(P)
	mkdir $(P)
	cp `find . -maxdepth 1 -type f '!' -name .gitignore` $(P)

LINKS = $(patsubst %,rpm2%,tar tarbz2 tbz2 tarlzma tgz tarxz txz tarzst)
links:
	set -e; for t in $(LINKS) ; do $(dosym) rpm2targz $$t ; done

install: rpmoffset
	$(dodir) $(DESTDIR)$(bindir)
	$(dobin) rpm2targz rpmoffset $(DESTDIR)$(bindir)
	set -e ; \
	for t in $(LINKS) ; do \
		$(dosym) rpm2targz $(DESTDIR)$(bindir)/$$t ; \
	done
	$(dosym) rpm2targz $(DESTDIR)$(bindir)/rpmunpack

check test:
	./test.sh

.PHONY: all clean install