mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-21 23:38:49 -05:00
Generalise makepkg-wrapper to handle any script using libmakepkg
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
aca153bfa6
commit
dfc78129be
@ -11,9 +11,9 @@ SUBDIRS = po
|
|||||||
bin_SCRIPTS = \
|
bin_SCRIPTS = \
|
||||||
$(OURSCRIPTS) \
|
$(OURSCRIPTS) \
|
||||||
makepkg-template \
|
makepkg-template \
|
||||||
makepkg-wrapper \
|
|
||||||
repo-remove \
|
repo-remove \
|
||||||
repo-elephant
|
repo-elephant \
|
||||||
|
$(WRAPPER)
|
||||||
|
|
||||||
OURSCRIPTS = \
|
OURSCRIPTS = \
|
||||||
makepkg \
|
makepkg \
|
||||||
@ -25,11 +25,11 @@ OURSCRIPTS = \
|
|||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
makepkg.sh.in \
|
makepkg.sh.in \
|
||||||
makepkg-template.pl.in \
|
makepkg-template.pl.in \
|
||||||
makepkg-wrapper.sh.in \
|
|
||||||
pacman-db-upgrade.sh.in \
|
pacman-db-upgrade.sh.in \
|
||||||
pacman-key.sh.in \
|
pacman-key.sh.in \
|
||||||
pkgdelta.sh.in \
|
pkgdelta.sh.in \
|
||||||
repo-add.sh.in \
|
repo-add.sh.in \
|
||||||
|
wrapper.sh.in \
|
||||||
$(COMPLETION_DIST) \
|
$(COMPLETION_DIST) \
|
||||||
$(LIBRARY) \
|
$(LIBRARY) \
|
||||||
$(LIBMAKEPKG_DIST)
|
$(LIBMAKEPKG_DIST)
|
||||||
@ -104,6 +104,9 @@ LIBMAKEPKG_IN = \
|
|||||||
LIBMAKEPKG_DIST = \
|
LIBMAKEPKG_DIST = \
|
||||||
$(addsuffix .in, $(LIBMAKEPKG_IN))
|
$(addsuffix .in, $(LIBMAKEPKG_IN))
|
||||||
|
|
||||||
|
WRAPPER = \
|
||||||
|
makepkg-wrapper
|
||||||
|
|
||||||
COMPLETION_IN = \
|
COMPLETION_IN = \
|
||||||
completion/bash_completion \
|
completion/bash_completion \
|
||||||
completion/zsh_completion
|
completion/zsh_completion
|
||||||
@ -176,7 +179,7 @@ all-am: $(COMPLETION_IN)
|
|||||||
|
|
||||||
makepkg: \
|
makepkg: \
|
||||||
$(srcdir)/makepkg.sh.in \
|
$(srcdir)/makepkg.sh.in \
|
||||||
$(srcdir)/makepkg-wrapper.sh.in \
|
$(srcdir)/wrapper.sh.in \
|
||||||
$(srcdir)/library/parseopts.sh \
|
$(srcdir)/library/parseopts.sh \
|
||||||
$(LIBMAKEPKG_IN)
|
$(LIBMAKEPKG_IN)
|
||||||
|
|
||||||
@ -214,18 +217,20 @@ repo-elephant: $(srcdir)/repo-add.sh.in
|
|||||||
$(AM_V_at)$(RM) repo-elephant
|
$(AM_V_at)$(RM) repo-elephant
|
||||||
$(AM_V_at)$(LN_S) repo-add repo-elephant
|
$(AM_V_at)$(LN_S) repo-add repo-elephant
|
||||||
|
|
||||||
makepkg-wrapper: \
|
.SECONDEXPANSION:
|
||||||
makepkg
|
$(WRAPPER): \
|
||||||
|
$$(subst -wrapper,,$$@)
|
||||||
|
|
||||||
$(AM_V_at)$(MKDIR_P) .lib
|
$(AM_V_at)$(MKDIR_P) .lib
|
||||||
$(AM_V_at)mv -f makepkg .lib
|
$(AM_V_at)mv -f $(subst -wrapper,,$@) .lib
|
||||||
$(AM_V_at)$(RM) $@
|
$(AM_V_at)$(RM) $@
|
||||||
$(AM_V_GEN)sed \
|
$(AM_V_GEN)sed \
|
||||||
-e "s|@PWD[@]|$$(pwd)|" \
|
-e "s|@PWD[@]|$$(pwd)|" \
|
||||||
|
-e "s|@PROGNAME[@]|$(subst -wrapper,,$@)|g" \
|
||||||
-e '1s|!/bin/bash|!$(BASH_SHELL)|g' \
|
-e '1s|!/bin/bash|!$(BASH_SHELL)|g' \
|
||||||
$(srcdir)/$@.sh.in > $@
|
$(srcdir)/wrapper.sh.in > $@
|
||||||
$(AM_V_at)chmod +x,a-w $@
|
$(AM_V_at)chmod +x,a-w $@
|
||||||
$(AM_V_at)$(LN_S) makepkg-wrapper makepkg
|
$(AM_V_at)$(LN_S) $@ $(subst -wrapper,,$@)
|
||||||
|
|
||||||
install-data-local:
|
install-data-local:
|
||||||
$(MKDIR_P) $(DESTDIR)$(sysconfdir)/bash_completion.d/
|
$(MKDIR_P) $(DESTDIR)$(sysconfdir)/bash_completion.d/
|
||||||
@ -238,8 +243,10 @@ uninstall-local:
|
|||||||
$(RM) $(DESTDIR)$(datarootdir)/zsh/site-functions/_pacman
|
$(RM) $(DESTDIR)$(datarootdir)/zsh/site-functions/_pacman
|
||||||
|
|
||||||
install-exec-hook:
|
install-exec-hook:
|
||||||
|
for wrapper in $(WRAPPER); do \
|
||||||
cd $(DESTDIR)$(bindir) && \
|
cd $(DESTDIR)$(bindir) && \
|
||||||
$(RM) makepkg makepkg-wrapper
|
$(RM) $$wrapper; \
|
||||||
|
done
|
||||||
$(INSTALL) .lib/makepkg $(DESTDIR)$(bindir)/makepkg
|
$(INSTALL) .lib/makepkg $(DESTDIR)$(bindir)/makepkg
|
||||||
for dir in $(LIBMAKEPKGDIRS); do \
|
for dir in $(LIBMAKEPKGDIRS); do \
|
||||||
$(MKDIR_P) $(DESTDIR)$(libmakepkgdir)/$$dir; \
|
$(MKDIR_P) $(DESTDIR)$(libmakepkgdir)/$$dir; \
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# makepkg - a wrapper for running the real makepkg in the source tree
|
# @PROGNAME@ - a wrapper for running the real @PROGNAME@ in the source tree
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2016 Pacman Development Team <pacman-dev@archlinux.org>
|
# Copyright (c) 2013-2016 Pacman Development Team <pacman-dev@archlinux.org>
|
||||||
#
|
#
|
||||||
@ -20,4 +20,4 @@
|
|||||||
|
|
||||||
DIR="@PWD@"
|
DIR="@PWD@"
|
||||||
|
|
||||||
LIBRARY="$DIR"/libmakepkg exec "$DIR"/.lib/makepkg "$@"
|
LIBRARY="$DIR"/libmakepkg exec "$DIR"/.lib/@PROGNAME@ "$@"
|
Loading…
Reference in New Issue
Block a user