Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/scripts/Makefile.am
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2015-01-27 00:45:47 +1000
committerAllan McRae <allan@archlinux.org>2015-02-01 21:20:08 +1000
commit7885931c969e781b732dfaea32e1fd166a3eb420 (patch)
tree906e7d0f2c7c3c91a5da070cd20bc0adc6c5de2f /scripts/Makefile.am
parent9917930ae1f02fdf85c1ca2a35ee039f1a17368f (diff)
makepkg: split message functions into libmakepkg
This performs all the needed work for libmakepkg to be included in tarballs, installed into the correct place, and read into makepkg. Also change the install root for libmakepkg to an architecture independant location. Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'scripts/Makefile.am')
-rw-r--r--scripts/Makefile.am47
1 files changed, 42 insertions, 5 deletions
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 4ef3ce0e..5b61a6d8 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -28,7 +28,8 @@ EXTRA_DIST = \
pacman-optimize.sh.in \
pkgdelta.sh.in \
repo-add.sh.in \
- $(LIBRARY)
+ $(LIBRARY) \
+ $(LIBMAKEPKG_DIST)
LIBRARY = \
library/output_format.sh \
@@ -37,10 +38,23 @@ LIBRARY = \
library/size_to_human.sh \
library/term_colors.sh
-# Files that should be removed, but which Automake does not know.
-MOSTLYCLEANFILES = $(bin_SCRIPTS)
+libmakepkgdir = $(datarootdir)/makepkg
+
+LIBMAKEPKGDIRS = \
+ util
+
+LIBMAKEPKG = \
+ libmakepkg/util/message.sh
-libmakepkgdir = $(libdir)/makepkg
+LIBMAKEPKG_IN = \
+ libmakepkg/util.sh
+
+LIBMAKEPKG_DIST = \
+ $(LIBMAKEPKG) \
+ $(addsuffix .in, $(LIBMAKEPKG_IN))
+
+# Files that should be removed, but which Automake does not know.
+MOSTLYCLEANFILES = $(bin_SCRIPTS) $(LIBMAKEPKG_IN)
clean-local:
$(AM_V_at)$(RM) -r .lib
@@ -87,10 +101,18 @@ $(OURSCRIPTS): Makefile
$(AM_V_at)chmod +x,a-w $@
@$(BASH_SHELL) -O extglob -n $@
+$(LIBMAKEPKG_IN): %: %.in Makefile
+ $(AM_V_at)$(RM) $@
+ $(AM_V_at)$(MKDIR_P) $(dir $@)
+ $(AM_V_GEN)test -f $(srcdir)/$@.in && $(edit) $(srcdir)/$@.in >$@
+ $(AM_V_at)chmod a-w $@
+ @$(BASH_SHELL) -O extglob -n $@
+
makepkg: \
$(srcdir)/makepkg.sh.in \
$(srcdir)/makepkg-wrapper.sh.in \
- $(srcdir)/library/parseopts.sh
+ $(srcdir)/library/parseopts.sh \
+ $(LIBMAKEPKG_IN)
makepkg-template: \
$(srcdir)/makepkg-template.pl.in \
@@ -150,6 +172,15 @@ install-exec-hook:
cd $(DESTDIR)$(bindir) && \
$(RM) makepkg makepkg-wrapper
$(INSTALL) .lib/makepkg $(DESTDIR)$(bindir)/makepkg
+ for dir in $(LIBMAKEPKGDIRS); do \
+ $(MKDIR_P) $(DESTDIR)$(libmakepkgdir)/$$dir; \
+ done
+ for lib in $(LIBMAKEPKG); do \
+ $(INSTALL) $(srcdir)/$$lib $(DESTDIR)$(libmakepkgdir)/$${lib#libmakepkg}; \
+ done
+ for lib in $(LIBMAKEPKG_IN); do \
+ $(INSTALL) $$lib $(DESTDIR)$(libmakepkgdir)/$${lib#libmakepkg}; \
+ done
cd $(DESTDIR)$(bindir) && \
$(RM) repo-elephant && \
( $(LN_S) repo-add repo-elephant || \
@@ -164,5 +195,11 @@ install-exec-hook:
uninstall-hook:
cd $(DESTDIR)$(bindir) && \
$(RM) repo-remove repo-elephant
+ for lib in $(LIBMAKEPKG) $(LIBMAKEPKG_IN); do \
+ $(RM) $(DESTDIR)$(libmakepkgdir)/$${lib#libmakepkg}; \
+ done
+ for dir in $(LIBMAKEPKGDIRS); do \
+ $(RM) -r $(DESTDIR)$(libmakepkgdir)/$$dir; \
+ done
# vim:set noet: