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)
6 INITVM_ARCH=$(shell bash -c '. common_functions ; build_host_arch; echo $$BUILD_INITVM_ARCH')
9 SVNVER=_SVN$(shell LANG=C svnversion .)
14 datadir=$(prefix)/share
16 pkglibdir=$(libdir)/$(BUILD)
18 man1dir=$(mandir)/man1
26 $(DESTDIR)$(pkglibdir)/configs \
27 $(DESTDIR)$(pkglibdir)/Build \
28 $(DESTDIR)$(pkglibdir)/emulator \
63 $(DESTDIR)$(pkglibdir)
64 install -m755 emulator/emulator.sh $(DESTDIR)$(pkglibdir)/emulator/
65 install -m644 Build/*.pm $(DESTDIR)$(pkglibdir)/Build
66 install -m644 qemu-reg $(DESTDIR)$(pkglibdir)
67 install -m644 build-vm build-vm-* $(DESTDIR)$(pkglibdir)
68 install -m644 build-recipe build-recipe-* $(DESTDIR)$(pkglibdir)
69 install -m644 build-pkg build-pkg-* $(DESTDIR)$(pkglibdir)
70 install -m644 *.pm baselibs_global*.conf lxc.conf $(DESTDIR)$(pkglibdir)
71 install -m644 configs/* $(DESTDIR)$(pkglibdir)/configs
72 install -m644 build.1 $(DESTDIR)$(man1dir)
73 install -m644 vc.1 $(DESTDIR)$(man1dir)
74 install -m644 unrpm.1 $(DESTDIR)$(man1dir)
75 ln -sf $(pkglibdir)/build $(DESTDIR)$(bindir)/build
76 ln -sf $(pkglibdir)/vc $(DESTDIR)$(bindir)/buildvc
77 ln -sf $(pkglibdir)/unrpm $(DESTDIR)$(bindir)/unrpm
79 # Allow initvm to be packaged seperately from the rest of build. This
80 # is useful because it is distributed as a static binary package (e.g.
81 # build-initvm-static) whereas the build scripts package is noarch.
84 $(CC) -o $@.$(INITVM_ARCH) -static $(CFLAGS) initvm.c
90 initvm-install: initvm
91 install -m755 -d $(DESTDIR)$(pkglibdir)
92 install -m755 initvm.$(INITVM_ARCH) $(DESTDIR)$(pkglibdir)/initvm.$(INITVM_ARCH)
97 rm -rf $(BUILD)-$(VERSION)$(SVNVER)
98 svn export . $(BUILD)-$(VERSION)$(SVNVER)
99 tar --force-local -cjf $(BUILD)-$(VERSION)$(SVNVER).tar.bz2 $(BUILD)-$(VERSION)$(SVNVER)
100 rm -rf $(BUILD)-$(VERSION)$(SVNVER)
103 git archive --prefix=$(BUILD)-$(VERSION)_git$(DATE)/ HEAD| bzip2 > $(BUILD)-$(VERSION)_git$(DATE).tar.bz2