Skip to content

Commit

Permalink
Introduce a Makefile that builds the gebuild script from gebuild.m4
Browse files Browse the repository at this point in the history
  • Loading branch information
Doeme committed Oct 6, 2019
1 parent ece9803 commit 424d741
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gentoo/app-misc/gebuilder/gebuilder-99999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ src_unpack() {
src_install() {
insinto /usr/share/gebuilder
doins -r utils config
exeopts "-m0744"
exeinto /usr/bin
doexe gebuild
insopts "-m0755"
Expand Down
23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
INSTALL ?= install
PREFIX ?= /usr
GEBUILDER_ROOT ?=$(PREFIX)/share/gebuilder/
MANDIR ?= $(PREFIX)/share/man
BINDIR ?= $(PREFIX)/bin/
CACHEDIR ?= /var/cache/gebuilder
IMAGESDIR ?= /var/lib/gebuilder

BUILDFILES = gebuilder/gebuild

all: gebuilder/gebuild

gebuilder/gebuild: gebuilder/gebuild.m4 Makefile
m4 -DCACHEDIR=$(CACHEDIR) -DIMAGESDIR=$(IMAGESDIR) -DPREFIX=$(PREFIX) -DGEBUILDER_ROOT=$(GEBUILDER_ROOT) $< > $@
chmod a+x $@

.PHONY: install
install: gebuilder/gebuild doc/
cd gebuilder; find utils config -type f -exec install -D -m 0644 {} $(DESTDIR)$(GEBUILDER_ROOT)/{} \;
cd gebuilder; find example_hooks exec.sh scripts -type f -exec install -D -m 0755 {} $(DESTDIR)$(GEBUILDER_ROOT)/{} \;
$(INSTALL) -D -m 0755 -t $(DESTDIR)$(BINDIR) gebuilder/gebuild
$(INSTALL) -D -m 0644 -t $(DESTDIR)$(MANDIR)/man8/ doc/gebuild.8
$(INSTALL) -D -m 0644 -t $(DESTDIR)$(MANDIR)/man5/ doc/dotgentoo.5
5 changes: 3 additions & 2 deletions gebuilder/gebuild → gebuilder/gebuild.m4
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ then
exit 1
fi

cd /var/lib/gebuilder/
exec /usr/share/gebuilder/exec.sh "$@"
cd "IMAGESDIR"
export CACHE="CACHEDIR"
exec "GEBUILDER_ROOT/exec.sh" "$@"

0 comments on commit 424d741

Please sign in to comment.