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:
authorDan McGee <dan@archlinux.org>2007-05-30 11:04:49 -0400
committerDan McGee <dan@archlinux.org>2007-05-30 11:04:49 -0400
commitb6387b954f7c35d0d51978aac24ca6bd6a5308fc (patch)
treea6beb14f4280b848fafc00059c7c4a54df2db8f2 /scripts/Makefile.am
parentdd926c7a1c23eab0db242184c7668f32fd4defee (diff)
scripts: do autoconf path replacement right
This should finally get the path replacement in our scripts right. This is the way the autoconf package itself does it and should not need much further tweaking. Threw in a few trailing whitespace corrections from the scripts as well. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'scripts/Makefile.am')
-rw-r--r--scripts/Makefile.am47
1 files changed, 46 insertions, 1 deletions
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 45f0957d..1ebd785f 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -12,4 +12,49 @@ bin_SCRIPTS = \
repo-remove \
updatesync
-abs gensync makepkg makeworld pacman-optimize rankmirrors repo-add repo-remove re-pacman updatesync:
+EXTRA_DIST = \
+ abs.in \
+ gensync.in \
+ makepkg.in \
+ makeworld.in \
+ pacman-optimize.in \
+ rankmirrors.in \
+ repo-add.in \
+ repo-remove.in \
+ updatesync.in
+
+# Files that should be removed, but which Automake does not know.
+MOSTLYCLEANFILES = $(bin_SCRIPTS) *.tmp
+
+#### Taken from the autoconf scripts Makefile.am ####
+edit = sed \
+ -e 's|@localedir[@]|$(localedir)|g' \
+ -e 's|@sysconfdir[@]|$(sysconfdir)|g' \
+ -e 's|@prefix[@]|$(prefix)|g' \
+ -e 's|@PACKAGE_VERSION[@]|$(PACKAGE_VERSION)|g' \
+ -e 's|@PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' \
+ -e 's|@ROOTDIR[@]|$(ROOTDIR)|g' \
+ -e 's|@DBPATH[@]|$(DBPATH)|g' \
+ -e 's|@LOCKFILE[@]|$(LOCKFILE)|g' \
+ -e 's|@configure_input[@]|Generated from $@.in; do not edit by hand.|g'
+
+## All the scripts depend on Makefile so that they are rebuilt when the
+## prefix etc. changes. Use chmod -w to prevent people from editing the
+## wrong file by accident.
+$(bin_SCRIPTS): Makefile
+ rm -f $@ $@.tmp
+ $(edit) `test -f ./$@.in || echo $(srcdir)/`$@.in >$@.tmp
+ chmod +x $@.tmp
+ chmod a-w $@.tmp
+ mv $@.tmp $@
+
+abs: $(srcdir)/abs.in
+gensync: $(srcdir)/gensync.in
+makepkg: $(srcdir)/makepkg.in
+makeworld: $(srcdir)/makeworld.in
+pacman-optimize: $(srcdir)/pacman-optimize.in
+rankmirrors: $(srcdir)/rankmirrors.in
+repo-add: $(srcdir)/repo-add.in
+repo-remove: $(srcdir)/repo-remove.in
+re-pacman: $(srcdir)/re-pacman.in
+updatesync: $(srcdir)/updatesync.in