[build] fix typo in qemu-reg
[opensuse: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             debtransformbz2 \
48             debtransformzip \
49             mkbaselibs \
50             mkdrpms \
51             createrepomddeps \
52             createyastdeps \
53             changelog2spec \
54             spec2changelog \
55             download \
56             spec_add_patch \
57             spectool \
58             signdummy \
59             unrpm \
60             $(DESTDIR)$(pkglibdir)
61         install -m644 Build/*.pm $(DESTDIR)$(pkglibdir)/Build
62         install -m644 qemu-reg $(DESTDIR)$(pkglibdir)
63         install -m644 *.pm baselibs_global*.conf lxc.conf $(DESTDIR)$(pkglibdir)
64         install -m644 configs/* $(DESTDIR)$(pkglibdir)/configs
65         install -m644 build.1 $(DESTDIR)$(man1dir)
66         ln -sf $(pkglibdir)/build $(DESTDIR)$(bindir)/build
67         ln -sf $(pkglibdir)/vc    $(DESTDIR)$(bindir)/buildvc
68         ln -sf $(pkglibdir)/unrpm $(DESTDIR)$(bindir)/unrpm
69
70 # Allow initvm to be packaged seperately from the rest of build.  This
71 # is useful because it is distributed as a static binary package (e.g.
72 # build-initvm-static) whereas the build scripts package is noarch.
73
74 initvm: initvm.c
75         $(CC) -o $@ -static $(CFLAGS) initvm.c
76
77 initvm-all: initvm
78
79 initvm-build: initvm
80
81 initvm-install: initvm
82         install -m755 -d $(DESTDIR)$(pkglibdir)
83         install -m755 initvm $(DESTDIR)$(pkglibdir)/initvm
84
85
86 dist:
87 ifeq ($(SCM),svn)
88         rm -rf $(BUILD)-$(VERSION)$(SVNVER)
89         svn export . $(BUILD)-$(VERSION)$(SVNVER)
90         tar --force-local -cjf $(BUILD)-$(VERSION)$(SVNVER).tar.bz2 $(BUILD)-$(VERSION)$(SVNVER)
91         rm -rf $(BUILD)-$(VERSION)$(SVNVER)
92 else
93 ifeq ($(SCM),git)
94         git archive --prefix=$(BUILD)-$(VERSION)_git$(DATE)/ HEAD| bzip2 > $(BUILD)-$(VERSION)_git$(DATE).tar.bz2
95 endif
96 endif