summaryrefslogtreecommitdiff
blob: 8c73e0eb7821de9e2636f77663e254cb9d1c0732 (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 ?= 9999
PV = 9.0.0.$(VER)g
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)/ master | 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)
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