diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-05-02 15:06:04 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-05-02 15:06:04 -0400 |
commit | 962250da23024224fc9e0be782b16ae08df46671 (patch) | |
tree | 2cc17939d6fc064b65eb3ce20e43ba49565d925c /src/devtools/Makefile | |
parent | bf2e3833c4158c8ec94e6af621f7d50d11353957 (diff) |
Update for the new devtools-par (major)
* `src/devtools`: Redo to get devtools from another location, and patch it
* `src/chroot-tools/{chcleanup,chroot.conf}`: Only install 'base-devel' by
default
* libremkchroot: deprecate in favor of `librechroot make`
* librechroot:
- redo option parsing to be a "sub-command" (git-like) interface,
instead of having esoteric flags (pacman-like).
- add more documentation.
- allow COPY to be an absolute path
- generally clean up and use updated functions from `makechrootpkg.sh`
* libremakepkg:
- allow COPY to be an absolute path
- update to work with the new `makechrootpkg.sh`:
- `makechrootpkg.sh:chroot_exec()` -> `libremakepkg:run()`
- `makechrootpkg.sh:chroot_init()` -> `libremakepkg:chroot_init()`
- All functions from `makechrootpkg.sh` are wrapped, because they
don't work with `set -euE`.
- Other small changes
Diffstat (limited to 'src/devtools/Makefile')
-rw-r--r-- | src/devtools/Makefile | 115 |
1 files changed, 76 insertions, 39 deletions
diff --git a/src/devtools/Makefile b/src/devtools/Makefile index 94f1f6b..d78e5f3 100644 --- a/src/devtools/Makefile +++ b/src/devtools/Makefile @@ -1,57 +1,94 @@ -V=20121128.6 +# Configuration +DESTDIR= -#prefix = /usr/local -prefix = /usr -PREFIX = $(prefix) -pkgdatadir=$(PREFIX)/share/devtools +#prefix=/usr/local +prefix=/usr +exec_prefix=$(prefix) +datarootdir=$(prefix)/share -BINPROGS = \ +bindir=$(exec_prefix)/bin +sbindir=$(exec_prefix)/sbin +datadir=$(datarootdir) + +pkgdatadir=$(datadir)/devtools + +devtoolsdir=../../../devtools-par + +default: all +all: build + +###################################################################### + +copy: \ + archroot.in \ + checkpkg.in \ + find-libdeps.in \ + finddeps.in \ + lddd.in \ + lib/common.sh \ + lib/makechrootpkg.sh.in + +archroot.in: $(devtoolsdir)/mkarchroot.in ; cp $< $@ +checkpkg.in: $(devtoolsdir)/checkpkg.in ; cp $< $@ +find-libdeps.in: $(devtoolsdir)/find-libdeps.in ; cp $< $@ +finddeps.in: $(devtoolsdir)/finddeps.in ; cp $< $@ +lddd.in: $(devtoolsdir)/lddd.in ; cp $< $@ +lib/common.sh: $(devtoolsdir)/lib/common.sh ; cp $< $@ +lib/makechrootpkg.sh.in: $(devtoolsdir)/makechrootpkg.in ; cp $< $@ + +###################################################################### + +build: \ + archroot \ checkpkg \ find-libdeps \ finddeps \ - lddd + lddd \ + lib/common.sh \ + lib/makechrootpkg.sh -SBINPROGS = \ - mkarchroot +edit = sed -e 's|m4_include(lib/\(.*\))|. @pkgdatadir@/\1|' -e "s|@pkgdatadir[@]|$(pkgdatadir)|g" -all: $(BINPROGS) $(SBINPROGS) bash_completion zsh_completion +indent = emacs --batch $1 \ + --eval '(setq sh-basic-offset 8)' \ + --eval '(indent-region (point-min) (point-max) nil)' \ + -f save-buffer &>/dev/null -edit = sed -e "s|@pkgdatadir[@]|$(pkgdatadir)|g" +M4GEN = @echo "M4GEN $2 ($1)"; $(edit) <"$1" >"$2" +INDENT = @echo "INDENT $2 ($1)"; cp "$1" "$2"; $(call indent,$2) %: %.in Makefile - @echo "GEN $@" - @$(RM) "$@" - @m4 -P $@.in | $(edit) >$@ - @chmod a-w "$@" - @chmod +x "$@" - -clean: - rm -f $(BINPROGS) $(SBINPROGS) bash_completion zsh_completion + $(call M4GEN,$<,$@); chmod 755 "$@" -install: all - install -dm0755 $(DESTDIR)$(PREFIX)/bin - install -dm0755 $(DESTDIR)$(PREFIX)/sbin - install -dm0755 $(DESTDIR)$(pkgdatadir) +lib/makechrootpkg.sh.ugly: %.ugly: %.in %.patch Makefile + @echo "PATCH $@" + @cp $*.in $@ + @patch $@ $*.patch - install -m0755 ${BINPROGS} $(DESTDIR)$(PREFIX)/bin -# install -m0755 ${SBINPROGS} $(DESTDIR)$(PREFIX)/sbin - install -m0755 mkarchroot $(DESTDIR)$(PREFIX)/sbin/archroot +lib/makechrootpkg.sh: %: %.ugly Makefile + $(call INDENT,$<,$@) - ln -sf find-libdeps $(DESTDIR)$(PREFIX)/bin/find-libprovides +###################################################################### - install -m0644 lib/common.sh $(DESTDIR)$(pkgdatadir)/common.sh - install -m0644 makechrootpkg.in $(DESTDIR)$(pkgdatadir)/makechrootpkg.sh - install -Dm0644 bash_completion $(DESTDIR)$(PREFIX)/share/bash-completion/completions/devtools - install -Dm0644 zsh_completion $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_devtools +install: \ + $(DESTDIR)$(sbindir)/archroot \ + $(DESTDIR)$(bindir)/checkpkg \ + $(DESTDIR)$(bindir)/find-libdeps \ + $(DESTDIR)$(bindir)/find-libprovides \ + $(DESTDIR)$(bindir)/finddeps \ + $(DESTDIR)$(bindir)/lddd \ + $(DESTDIR)$(pkgdatadir)/common.sh \ + $(DESTDIR)$(pkgdatadir)/makechrootpkg.sh -uninstall: - for f in ${BINPROGS} ; do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done -# for f in ${SBINPROGS} ; do rm -f $(DESTDIR)$(PREFIX)/sbin/$$f; done - rm -f $(DESTDIR)$(PREFIX)/sbin/archroot +$(DESTDIR)$(PREFIX)/sbin/%: % + install -Dm755 $< $@ - rm -f $(DESTDIR)$(PREFIX)/bin/find-libprovides +$(DESTDIR)$(PREFIX)/bin/%: % + install -Dm755 $< $@ - rm -f $(DESTDIR)$(PREFIX)/share/bash-completion/completions/devtools - rm -f $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_devtools +$(DESTDIR)$(pkgdatadir)/%: lib/% + install -Dm644 $< $@ -.PHONY: all clean install uninstall +$(DESTDIR)$(PREFIX)/bin/find-libprovides: + install -d $(@D) + ln -sf find-libdeps $@ |