- also use --numeric-owner in bsdtar case
[platform/upstream/build.git] / Makefile
1 VERSION=0.1
2 SCM=$(shell if test -d .svn; then echo svn; elif test -d .git; then echo git; fi)
3 DATE=$(shell date +%Y%m%d%H%M)
4 BUILD=build
5
6 ifeq ($(SCM),svn)
7 SVNVER=_SVN$(shell LANG=C svnversion .)
8 endif
9
10 prefix=/usr
11 bindir=$(prefix)/bin
12 datadir=$(prefix)/share
13 libdir=$(prefix)/lib
14 pkglibdir=$(libdir)/$(BUILD)
15 mandir=$(datadir)/man
16 man1dir=$(mandir)/man1
17 sysconfdir=/etc
18 DESTDIR=
19
20 all:
21
22 install:
23         install -m755 -d \
24             $(DESTDIR)$(pkglibdir)/configs \
25             $(DESTDIR)$(pkglibdir)/Build \
26             $(DESTDIR)$(bindir) \
27             $(DESTDIR)$(man1dir)
28         install -m755 \
29             build \
30             build_kiwi.sh \
31             vc \
32             createrpmdeps \
33             order \
34             expanddeps \
35             computeblocklists \
36             extractbuild \
37             getbinaryid \
38             killchroot \
39             getmacros \
40             getoptflags \
41             getchangetarget \
42             common_functions \
43             init_buildsystem \
44             initscript_qemu_vm \
45             substitutedeps \
46             debtransform \
47             mkbaselibs \
48             mkdrpms \
49             createrepomddeps \
50             createyastdeps \
51             changelog2spec \
52             spec2changelog \
53             download \
54             spec_add_patch \
55             spectool \
56             signdummy \
57             unrpm \
58             $(DESTDIR)$(pkglibdir)
59         install -m644 Build/*.pm $(DESTDIR)$(pkglibdir)/Build
60         install -m644 *.pm baselibs_global*.conf $(DESTDIR)$(pkglibdir)
61         install -m644 configs/* $(DESTDIR)$(pkglibdir)/configs
62         install -m644 build.1 $(DESTDIR)$(man1dir)
63         ln -sf $(pkglibdir)/build $(DESTDIR)$(bindir)/build
64         ln -sf $(pkglibdir)/vc    $(DESTDIR)$(bindir)/buildvc
65         ln -sf $(pkglibdir)/unrpm $(DESTDIR)$(bindir)/unrpm
66
67 dist:
68 ifeq ($(SCM),svn)
69         rm -rf $(BUILD)-$(VERSION)$(SVNVER)
70         svn export . $(BUILD)-$(VERSION)$(SVNVER)
71         tar --force-local -cjf $(BUILD)-$(VERSION)$(SVNVER).tar.bz2 $(BUILD)-$(VERSION)$(SVNVER)
72         rm -rf $(BUILD)-$(VERSION)$(SVNVER)
73 else
74 ifeq ($(SCM),git)
75         git archive --prefix=$(BUILD)-$(VERSION)_git$(DATE)/ HEAD| bzip2 > $(BUILD)-$(VERSION)_git$(DATE).tar.bz2
76 endif
77 endif