Build makepkg to scripts/.lib/makepkg and add a wrapper script to
call it. This is not useful at the moment, but is the first step
to allowing makepkg to be split into smaller pieces.
Signed-off-by: Allan McRae <firstname.lastname@example.org>
This seems somewhat horrid, but I could not find a better way to do this.
Once this splitting is started, it will be easy(er) to overhaul the VCS
PKGBUILD system, and perhaps debugging symbol packages too...
Tested that building and running "makepkg" in the usual way works,
"make install" and "make distcheck" work.
@@ -32,6 +34,9 @@ LIBRARY =
# Files that should be removed, but which Automake does not know.
MOSTLYCLEANFILES = $(bin_SCRIPTS)
+ $(AM_V_at)rm -rf .lib
GIT_VERSION := $(shell sh -c 'git describe --abbrev=4 --dirty | sed s/^v//')
REAL_PACKAGE_VERSION = $(GIT_VERSION)
@@ -69,6 +74,7 @@ $(OURSCRIPTS): Makefile
+ | makepkg
+ $(AM_V_at)$(MKDIR_P) .lib
+ $(AM_V_at)mv -f makepkg .lib
+ $(AM_V_at)$(RM) $@
+ -e "s|@PWD[@]|$$(pwd)|"
+ -e '1s|!/bin/bash|!$(BASH_SHELL)|g'
+ $(srcdir)/$@.sh.in > $@
+ $(AM_V_at)chmod +x,a-w $@
+ $(AM_V_at)$(LN_S) makepkg-wrapper makepkg
cd $(DESTDIR)$(bindir) &&
+ $(RM) makepkg makepkg-wrapper
+ $(INSTALL) .lib/makepkg $(DESTDIR)$(bindir)/makepkg
+ cd $(DESTDIR)$(bindir) &&
$(RM) repo-elephant &&
( $(LN_S) repo-add repo-elephant ||
ln repo-add repo-elephant ||
diff --git a/scripts/makepkg-wrapper.sh.in b/scripts/makepkg-wrapper.sh.in
new file mode 100644
@@ -0,0 +1,23 @@
+# makepkg - a wrapper for running the real makepkg in the source tree
+# Copyright (c) 2012 Pacman Development Team <email@example.com>
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+LIBRARY=$DIR/libmakepkg $DIR/.lib/makepkg "$@"