build: add Makefile with install target
authorLudwig Nussel <ludwig.nussel@suse.de>
Wed, 4 Feb 2009 15:12:34 +0000 (15:12 +0000)
committerLudwig Nussel <ludwig.nussel@suse.de>
Wed, 4 Feb 2009 15:12:34 +0000 (15:12 +0000)
Makefile [new file with mode: 0644]

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..2ac06e8
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,63 @@
+VERSION=0.1
+SCM=$(shell if test -d .svn; then echo svn; elif test -d .git; then echo git; fi)
+DATE=$(shell date +%Y%m%d%H%M)
+BUILD=build
+
+ifeq ($(SCM),svn)
+SVNVER=_SVN$(shell LANG=C svnversion .)
+endif
+
+prefix=/usr
+bindir=$(prefix)/bin
+datadir=$(prefix)/share
+libdir=$(prefix)/lib
+pkglibdir=$(libdir)/$(BUILD)
+mandir=$(datadir)/man
+man1dir=$(mandir)/man1
+sysconfdir=/etc
+DESTDIR=
+
+all:
+
+install:
+       install -m755 -d \
+           $(DESTDIR)$(pkglibdir)/{configs,Build} \
+           $(DESTDIR)$(bindir) \
+           $(DESTDIR)$(man1dir)
+       install -m755 \
+           build \
+           createrpmdeps \
+           order \
+           expanddeps \
+           extractbuild \
+           xen.conf \
+           getmacros \
+           getoptflags \
+           init_buildsystem \
+           substitutedeps \
+           debtransform \
+           mkbaselibs \
+           createrepomddeps \
+           createyastdeps \
+           changelog2spec \
+           $(DESTDIR)$(pkglibdir)
+       install -m644 Build/*.pm $(DESTDIR)$(pkglibdir)/Build
+       install -m644 *.pm baselibs_global.conf $(DESTDIR)$(pkglibdir)
+       install -m644 configs/* $(DESTDIR)$(pkglibdir)/configs
+       rm -f $(DESTDIR)$(pkglibdir)/configs/default.conf
+       cp -a configs/default.conf $(DESTDIR)$(pkglibdir)/configs/default.conf
+       install -m644 build.1 $(DESTDIR)$(man1dir)
+       install -m755 unrpm $(DESTDIR)$(bindir)
+       ln -sf $(pkglibdir)/build $(DESTDIR)$(bindir)/build
+
+dist:
+ifeq ($(SCM),svn)
+       rm -rf $(BUILD)-$(VERSION)$(SVNVER)
+       svn export . $(BUILD)-$(VERSION)$(SVNVER)
+       tar --force-local -cjf $(BUILD)-$(VERSION)$(SVNVER).tar.bz2 $(BUILD)-$(VERSION)$(SVNVER)
+       rm -rf $(BUILD)-$(VERSION)$(SVNVER)
+else
+ifeq ($(SCM),git)
+       git archive --prefix=$(BUILD)-$(VERSION)_git$(DATE)/ HEAD| bzip2 > $(BUILD)-$(VERSION)_git$(DATE).tar.bz2
+endif
+endif