alpm.h: document transaction flags
[pacman-ng.git] / scripts / Makefile.am
blobae6ce3667087d947f87702e443983afa8007f9e0
1 # enforce that all scripts have a --help and --version option
2 AUTOMAKE_OPTIONS = std-options
4 bin_SCRIPTS = \
5         $(OURSCRIPTS) \
6         repo-remove
8 OURSCRIPTS = \
9         makepkg \
10         pacman-db-upgrade \
11         pacman-optimize \
12         pkgdelta \
13         rankmirrors \
14         repo-add
16 EXTRA_DIST = \
17         makepkg.sh.in \
18         pacman-db-upgrade.sh.in \
19         pacman-optimize.sh.in \
20         pkgdelta.sh.in \
21         rankmirrors.sh.in \
22         repo-add.sh.in
24 # Files that should be removed, but which Automake does not know.
25 MOSTLYCLEANFILES = $(bin_SCRIPTS) *.tmp
27 if USE_GIT_VERSION
28 GIT_VERSION := $(shell sh -c 'git describe --abbrev=4 --dirty | sed s/^v//')
29 REAL_PACKAGE_VERSION = $(GIT_VERSION)
30 else
31 REAL_PACKAGE_VERSION = $(PACKAGE_VERSION)
32 endif
34 #### Taken from the autoconf scripts Makefile.am ####
35 edit = sed \
36         -e 's|@localedir[@]|$(localedir)|g' \
37         -e 's|@sysconfdir[@]|$(sysconfdir)|g' \
38         -e 's|@localstatedir[@]|$(localstatedir)|g' \
39         -e 's|@prefix[@]|$(prefix)|g' \
40         -e 's|@BASH_SHELL[@]|$(BASH_SHELL)|g' \
41         -e 's|@PACKAGE_VERSION[@]|$(REAL_PACKAGE_VERSION)|g' \
42         -e 's|@PACKAGE_BUGREPORT[@]|$(PACKAGE_BUGREPORT)|g' \
43         -e 's|@PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' \
44         -e 's|@BUILDSCRIPT[@]|$(BUILDSCRIPT)|g' \
45         -e 's|@SIZECMD[@]|$(SIZECMD)|g' \
46         -e 's|@SEDINPLACE[@]|$(SEDINPLACE)|g' \
47         -e 's|@DUPATH[@]|$(DUPATH)|g' \
48         -e 's|@configure_input[@]|Generated from $@.in; do not edit by hand.|g'
50 ## All the scripts depend on Makefile so that they are rebuilt when the
51 ## prefix etc. changes. Use chmod -w to prevent people from editing the
52 ## wrong file by accident.
53 # two 'test' lines- make sure we can handle both sh and py type scripts
54 # third 'test' line- make sure one of the two checks succeeded
55 $(OURSCRIPTS): Makefile
56         @echo '    ' GEN $@;
57         @rm -f $@ $@.tmp
58         @test -f $(srcdir)/$@.sh.in && $(edit) $(srcdir)/$@.sh.in >$@.tmp || true
59         @test -f $(srcdir)/$@.py.in && $(edit) $(srcdir)/$@.py.in >$@.tmp || true
60         @test -f $@.tmp || false
61         @chmod +x $@.tmp
62         @chmod a-w $@.tmp
63         @mv $@.tmp $@
65 makepkg: $(srcdir)/makepkg.sh.in
66 pacman-db-upgrade: $(srcdir)/pacman-db-upgrade.sh.in
67 pacman-optimize: $(srcdir)/pacman-optimize.sh.in
68 pkgdelta: $(srcdir)/pkgdelta.sh.in
69 rankmirrors: $(srcdir)/rankmirrors.sh.in
70 repo-add: $(srcdir)/repo-add.sh.in
71 repo-remove: $(srcdir)/repo-add.sh.in
72         rm -f repo-remove
73         $(LN_S) repo-add repo-remove
75 # vim:set ts=2 sw=2 noet: