summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 67cb70c294fd90361ddd7318e1c61b97852a111f (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
PREFIX = 
BINDIR = $(PREFIX)/usr/bin
MANDIR = $(PREFIX)/usr/man
SBINDIR = $(PREFIX)/usr/sbin
XBINDIR = $(PREFIX)/usr/X11R6/bin
URPMIDIR = $(PREFIX)/var/lib/urpmi
URPMIDIR2 = $(PREFIX)/etc/urpmi
LOCALEDIR = $(PREFIX)/usr/share/locale
CFLAGS = -Wall -g
LIBRPM = -lrpm -ldb1 -lz -lbz2 -I/usr/include/rpm -lpopt

NAME = urpmi
TAR = $(NAME).tar.bz2

.PHONY: install clean rpm

install: autoirpm.update-all
	$(MAKE) -C po $@
	install -d $(BINDIR) $(SBINDIR) $(XBINDIR) $(URPMIDIR) $(URPMIDIR2) $(MANDIR)/man8
	install -m 4755 urpmi $(BINDIR)
	install _irpm rpm-find-leaves urpmf $(BINDIR)
	install -m 644 autoirpm.deny $(URPMIDIR2)
	install -m 644 *.8 $(MANDIR)/man8
	install urpme urpmi.addmedia autoirpm.update autoirpm.uninstall $(SBINDIR)
	install -s autoirpm.update-all $(SBINDIR)
	ln -sf urpmi.addmedia $(SBINDIR)/urpmi.removemedia
	ln -sf urpmi.addmedia $(SBINDIR)/urpmi.update
	install gurpmi $(XBINDIR)

autoirpm.update-all: %: %.cc 
	$(CXX) $(CFLAGS) $< $(LIBRPM) -o $@

tar: clean
	cd .. ; tar cfy $(TAR) urpmi

rpm: tar 
	cp -f ../$(TAR) $(RPM)/SOURCES
	cp -f $(NAME).spec $(RPM)/SPECS/
	-rpm -ba $(NAME).spec
	rm -f ../$(TAR)

po:
	$(MAKE) -C $@

clean:
	$(MAKE) -C po $@
	rm -f *~ autoirpm.update-all