From ca6db7290cacee0d3b5ba836e6acea76ea314e50 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 26 May 2013 22:11:51 -0400 Subject: redo the library system; avoid hard-coded paths * install all library files to $(libexecdir)/libretools, instead of - $(bindir) - $(datadir)/libretools - $(datadir)/devtools * symlink the executable library files into $(bindir) * add the tool `librelib` * instead of ". /path/to/lib.sh", use ". $(librelib lib.sh)" * mark all libraries with shebangs of what options they support * move blacklist.sh to libreblacklist --- src/devtools/Makefile | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'src/devtools') diff --git a/src/devtools/Makefile b/src/devtools/Makefile index e357675..18f1518 100644 --- a/src/devtools/Makefile +++ b/src/devtools/Makefile @@ -4,13 +4,21 @@ DESTDIR= #prefix=/usr/local prefix=/usr exec_prefix=$(prefix) -datarootdir=$(prefix)/share - bindir=$(exec_prefix)/bin sbindir=$(exec_prefix)/sbin +#libexecdir=$(exec_prefix)/libexec +libexecdir=$(exec_prefix)/lib + +datarootdir=$(prefix)/share datadir=$(datarootdir) +#sysconfdir=$(prefix)/etc +sysconfdir=/etc + +docdir=$(datarootdir)/doc + +################################################################################ -pkgdatadir=$(datadir)/devtools +pkglibexecdir=$(libexecdir)/libretools devtoolsdir=../../../devtools-par @@ -47,7 +55,7 @@ build: \ lib/common.sh \ lib/makechrootpkg.sh -edit = sed -e 's|m4_include(lib/\(.*\))|. @pkgdatadir@/\1|' -e "s|@pkgdatadir[@]|$(pkgdatadir)|g" +edit = sed -e 's|m4_include(lib/\(.*\))|. $$(librelib \1)|' indent = emacs --batch $1 \ --eval '(setq sh-basic-offset 8)' \ @@ -62,6 +70,8 @@ indent = emacs --batch $1 \ lib/common.sh: %: %.in Makefile @echo "GEN $@" @{ \ + echo '#!/bin/bash -euE' && \ + echo '#!/bin/bash' && \ echo 'if [[ -z $${_INCLUDE_COMMON_SH:-} ]]; then' && \ echo '_INCLUDE_COMMON_SH=true' && \ cat "$<" && \ @@ -86,8 +96,8 @@ install: \ $(DESTDIR)$(bindir)/find-libprovides \ $(DESTDIR)$(bindir)/finddeps \ $(DESTDIR)$(bindir)/lddd \ - $(DESTDIR)$(pkgdatadir)/common.sh \ - $(DESTDIR)$(pkgdatadir)/makechrootpkg.sh + $(DESTDIR)$(pkglibexecdir)/common.sh \ + $(DESTDIR)$(pkglibexecdir)/makechrootpkg.sh $(DESTDIR)$(sbindir)/%: % install -Dm755 $< $@ @@ -95,7 +105,7 @@ $(DESTDIR)$(sbindir)/%: % $(DESTDIR)$(bindir)/%: % install -Dm755 $< $@ -$(DESTDIR)$(pkgdatadir)/%: lib/% +$(DESTDIR)$(pkglibexecdir)/%: lib/% install -Dm644 $< $@ $(DESTDIR)$(bindir)/find-libprovides: -- cgit v1.2.2