aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-30 10:53:37 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-30 10:53:37 +0000
commitda151fef51fb3a6bc2d7154f2ff4b9e384dfe584 (patch)
tree554cfa8bd2f087a6703d4a27e6a183e4932feef9
parente9e18bcecc33e96c15efde540e804eb7d1ef4ced (diff)
downloadpaludis-da151fef51fb3a6bc2d7154f2ff4b9e384dfe584.tar.gz
paludis-da151fef51fb3a6bc2d7154f2ff4b9e384dfe584.tar.xz
Restructure hooks Makefile and dobin tests to avoid breaking distcheck. Fixes Berlios#7328, Berlios#7326.
-rwxr-xr-xautogen.bash1
-rw-r--r--ebuild/utils/dobin_TEST.bash10
-rw-r--r--hooks/Makefile.am51
-rw-r--r--hooks/Makefile.am.m479
4 files changed, 85 insertions, 56 deletions
diff --git a/autogen.bash b/autogen.bash
index 4a8233d..22ed878 100755
--- a/autogen.bash
+++ b/autogen.bash
@@ -33,6 +33,7 @@ misc/do_m4.bash paludis/util/util.hh || exit $?
misc/do_m4.bash paludis/util/Makefile.am || exit $?
misc/do_m4.bash paludis/util/smart_record.hh || exit $?
misc/do_m4.bash paludis/util/comparison_policy.hh || exit $?
+misc/do_m4.bash hooks/Makefile.am || exit $?
run mkdir -p config
run $(get libtoolize 1.5 ) --copy --force --automake
rm -f config.cache
diff --git a/ebuild/utils/dobin_TEST.bash b/ebuild/utils/dobin_TEST.bash
index 1a28950..b9d0d9c 100644
--- a/ebuild/utils/dobin_TEST.bash
+++ b/ebuild/utils/dobin_TEST.bash
@@ -32,8 +32,8 @@ dobin_TEST()
chmod +x dobin_TEST_dir/src/three ; test_return_code
export D=dobin_TEST_dir/dst
- ./dobin dobin_TEST_dir/src/one &>/dev/null ; test_return_code
- ./dobin dobin_TEST_dir/src/two dobin_TEST_dir/src/three &>/dev/null ; test_return_code
+ ${PALUDIS_EBUILD_DIR}/utils/dobin dobin_TEST_dir/src/one &>/dev/null ; test_return_code
+ ${PALUDIS_EBUILD_DIR}/utils/dobin dobin_TEST_dir/src/two dobin_TEST_dir/src/three &>/dev/null ; test_return_code
[[ -f dobin_TEST_dir/dst/usr/bin/one ]] ; test_return_code
[[ -f dobin_TEST_dir/dst/usr/bin/two ]] ; test_return_code
@@ -54,9 +54,9 @@ dobin_fail_TEST()
echo "three contents" > dobin_TEST_dir/src/three ; test_return_code
export D=dobin_TEST_dir/dst
- ! ./dobin dobin_TEST_dir/src/four &>/dev/null ; test_return_code
- ! ./dobin dobin_TEST_dir/src/one dobin_TEST_dir/src/seven &>/dev/null ; test_return_code
- ! ./dobin dobin_TEST_dir/src/eight dobin_TEST_dir/src/one &>/dev/null ; test_return_code
+ ! ${PALUDIS_EBUILD_DIR}/utils/dobin dobin_TEST_dir/src/four &>/dev/null ; test_return_code
+ ! ${PALUDIS_EBUILD_DIR}/utils/dobin dobin_TEST_dir/src/one dobin_TEST_dir/src/seven &>/dev/null ; test_return_code
+ ! ${PALUDIS_EBUILD_DIR}/utils/dobin dobin_TEST_dir/src/eight dobin_TEST_dir/src/one &>/dev/null ; test_return_code
[[ -f dobin_TEST_dir/dst/usr/bin/one ]] ; test_return_code
! [[ -f dobin_TEST_dir/dst/usr/bin/four ]] ; test_return_code
diff --git a/hooks/Makefile.am b/hooks/Makefile.am
deleted file mode 100644
index b067f71..0000000
--- a/hooks/Makefile.am
+++ /dev/null
@@ -1,51 +0,0 @@
-MAINTAINERCLEANFILES = Makefile.in
-CLEANFILES = *~
-SUBDIRS = .
-
-installhookcommonprogdir = $(libexecdir)/paludis/hooks/common
-installhookinstallallpostdir = $(libexecdir)/paludis/hooks/install_all_post
-
-installhookcommonprog_SCRIPTS = \
- gnu_info_index.bash \
- eselect_env_update.bash
-
-installhookinstallallpost_SCRIPTS = \
- find_config_updates.bash
-
-TESTS_ENVIRONMENT = env \
- PALUDIS_EBUILD_DIR="$(srcdir)/ebuild/" \
- TEST_SCRIPT_DIR="$(srcdir)/" \
- $(SHELL) $(top_srcdir)/ebuild/run_test.bash
-
-TESTS =
-EXTRA_DIST = \
- $(installhookcommonprog_SCRIPTS) \
- $(installhookinstallallpost_SCRIPTS) \
- $(TESTS)
-
-check_SCRIPTS = $(TESTS)
-check_PROGRAMS =
-
-install-data-local :
- install -d $(DESTDIR)/$(libexecdir)/paludis/hooks/uninstall_all_post
- ln -sf ../common/gnu_info_index.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/uninstall_all_post/
- ln -sf ../common/eselect_env_update.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/uninstall_all_post/
- install -d $(DESTDIR)/$(libexecdir)/paludis/hooks/install_all_post
- ln -sf ../common/gnu_info_index.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/install_all_post/
- install -d $(DESTDIR)/$(libexecdir)/paludis/hooks/install_post
- ln -sf ../common/eselect_env_update.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/install_post/
- for d in install install_all fetch fetch_all uninstall uninstall_all \
- sync sync_all ; do \
- install -d $(DESTDIR)/$(datadir)/paludis/hooks/$${d}_pre ; \
- touch $(DESTDIR)/$(datadir)/paludis/hooks/$${d}_pre/.keep ; \
- install -d $(DESTDIR)/$(datadir)/paludis/hooks/$${d}_post ; \
- touch $(DESTDIR)/$(datadir)/paludis/hooks/$${d}_post/.keep ; \
- done
- for d in metadata init fetch merge unmerge tidyup strip unpack compile \
- install test setup config nofetch preinst postinst prerm posrtm ; do \
- install -d $(DESTDIR)/$(datadir)/paludis/hooks/ebuild_$${d}_pre ; \
- touch $(DESTDIR)/$(datadir)/paludis/hooks/ebuild_$${d}_pre/.keep ; \
- install -d $(DESTDIR)/$(datadir)/paludis/hooks/ebuild_$${d}_post ; \
- touch $(DESTDIR)/$(datadir)/paludis/hooks/ebuild_$${d}_post/.keep ; \
- done
-
diff --git a/hooks/Makefile.am.m4 b/hooks/Makefile.am.m4
new file mode 100644
index 0000000..6b6d410
--- /dev/null
+++ b/hooks/Makefile.am.m4
@@ -0,0 +1,79 @@
+ifdef(`__gnu__',`',`errprint(`This is not GNU m4...
+')m4exit(1)') include(`misc/generated-file.txt')
+
+dnl vim: set ft=m4 noet :
+
+MAINTAINERCLEANFILES = Makefile.in
+CLEANFILES = *~ .keep
+SUBDIRS = .
+
+installhookcommonprogdir = $(libexecdir)/paludis/hooks/common
+installhookinstallallpostdir = $(libexecdir)/paludis/hooks/install_all_post
+
+installhookcommonprog_SCRIPTS = \
+ gnu_info_index.bash \
+ eselect_env_update.bash
+
+installhookinstallallpost_SCRIPTS = \
+ find_config_updates.bash
+
+TESTS_ENVIRONMENT = env \
+ PALUDIS_EBUILD_DIR="$(srcdir)/ebuild/" \
+ TEST_SCRIPT_DIR="$(srcdir)/" \
+ $(SHELL) $(top_srcdir)/ebuild/run_test.bash
+
+TESTS =
+EXTRA_DIST = \
+ $(installhookcommonprog_SCRIPTS) \
+ $(installhookinstallallpost_SCRIPTS) \
+ $(TESTS)
+
+check_SCRIPTS = $(TESTS)
+check_PROGRAMS =
+
+.keep :
+ touch $@
+
+define(`userhook', `
+installuserhooks$1dir = $(datadir)/paludis/hooks/$1
+installuserhooks$1_SCRIPTS = .keep')
+
+userhook(`install_pre')
+userhook(`install_post')
+userhook(`install_all_pre')
+userhook(`install_all_post')
+userhook(`uninstall_pre')
+userhook(`uninstall_post')
+userhook(`uninstall_all_pre')
+userhook(`uninstall_all_post')
+userhook(`sync_pre')
+userhook(`sync_post')
+userhook(`sync_all_pre')
+userhook(`sync_all_post')
+
+define(`systemhook', `
+installsystemhooks$1dir = $(libexecdir)/paludis/hooks/$1
+installsystemhooks$1_SCRIPTS = .keep')
+
+systemhook(`install_post')
+systemhook(`install_all_post')
+systemhook(`uninstall_all_post')
+
+install-data-local :
+ install -d $(DESTDIR)/$(libexecdir)/paludis/hooks/uninstall_all_post/
+ install -d $(DESTDIR)/$(libexecdir)/paludis/hooks/install_all_post/
+ install -d $(DESTDIR)/$(libexecdir)/paludis/hooks/install_post/
+ ln -sf ../common/gnu_info_index.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/uninstall_all_post/
+ ln -sf ../common/gnu_info_index.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/install_all_post/
+ ln -sf ../common/eselect_env_update.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/uninstall_all_post/
+ ln -sf ../common/eselect_env_update.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/install_post/
+
+uninstall-local :
+ rm $(DESTDIR)/$(libexecdir)/paludis/hooks/uninstall_all_post/gnu_info_index.bash
+ rm $(DESTDIR)/$(libexecdir)/paludis/hooks/install_all_post/gnu_info_index.bash
+ rm $(DESTDIR)/$(libexecdir)/paludis/hooks/uninstall_all_post/eselect_env_update.bash
+ rm $(DESTDIR)/$(libexecdir)/paludis/hooks/install_post/eselect_env_update.bash
+
+Makefile.am : Makefile.am.m4
+ $(top_srcdir)/misc/do_m4.bash Makefile.am
+