build: add vc command
[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,Build} \
25             $(DESTDIR)$(bindir) \
26             $(DESTDIR)$(man1dir)
27         install -m755 \
28             build \
29             vc \
30             createrpmdeps \
31             order \
32             expanddeps \
33             extractbuild \
34             xen.conf \
35             getmacros \
36             getoptflags \
37             init_buildsystem \
38             substitutedeps \
39             debtransform \
40             mkbaselibs \
41             createrepomddeps \
42             createyastdeps \
43             changelog2spec \
44             $(DESTDIR)$(pkglibdir)
45         install -m644 Build/*.pm $(DESTDIR)$(pkglibdir)/Build
46         install -m644 *.pm baselibs_global.conf $(DESTDIR)$(pkglibdir)
47         install -m644 configs/* $(DESTDIR)$(pkglibdir)/configs
48         rm -f $(DESTDIR)$(pkglibdir)/configs/default.conf
49         cp -a configs/default.conf $(DESTDIR)$(pkglibdir)/configs/default.conf
50         install -m644 build.1 $(DESTDIR)$(man1dir)
51         install -m755 unrpm $(DESTDIR)$(bindir)
52         ln -sf $(pkglibdir)/build $(DESTDIR)$(bindir)/build
53         ln -sf $(pkglibdir)/build $(DESTDIR)$(bindir)/buildvc
54
55 dist:
56 ifeq ($(SCM),svn)
57         rm -rf $(BUILD)-$(VERSION)$(SVNVER)
58         svn export . $(BUILD)-$(VERSION)$(SVNVER)
59         tar --force-local -cjf $(BUILD)-$(VERSION)$(SVNVER).tar.bz2 $(BUILD)-$(VERSION)$(SVNVER)
60         rm -rf $(BUILD)-$(VERSION)$(SVNVER)
61 else
62 ifeq ($(SCM),git)
63         git archive --prefix=$(BUILD)-$(VERSION)_git$(DATE)/ HEAD| bzip2 > $(BUILD)-$(VERSION)_git$(DATE).tar.bz2
64 endif
65 endif