autoclean.sh: abide by POSIX shebang
[pacman-ng.git] / contrib / Makefile.am
blobeca39e75234dfa826b2a7f3028703dfcca90229f
1 # enforce that all scripts have a --help and --version option
2 AUTOMAKE_OPTIONS = std-options
4 bin_SCRIPTS = \
5   $(OURSCRIPTS)
7 OURSCRIPTS = \
8         bacman \
9         paccache \
10         pacdiff \
11         paclist \
12         paclog-pkglist \
13         pacscripts \
14         pacsearch \
15         pacsysclean
17 OURFILES = \
18         bash_completion \
19         zsh_completion
21 EXTRA_DIST = \
22         PKGBUILD.vim \
23         bacman.in \
24         bash_completion.in \
25         paccache.in \
26         paclog-pkglist.in \
27         pacdiff.in \
28         paclist.in \
29         pacscripts.in \
30         pacsearch.in \
31         pacsysclean.in \
32         vimprojects \
33         zsh_completion.in \
34         README
36 # Files that should be removed, but which Automake does not know.
37 MOSTLYCLEANFILES = $(OURSCRIPTS) $(OURFILES) *.tmp
39 if USE_GIT_VERSION
40 GIT_VERSION := $(shell sh -c 'git describe --abbrev=4 --dirty | sed s/^v//')
41 REAL_PACKAGE_VERSION = $(GIT_VERSION)
42 else
43 REAL_PACKAGE_VERSION = $(PACKAGE_VERSION)
44 endif
46 edit = sed \
47         -e 's|@sysconfdir[@]|$(sysconfdir)|g' \
48         -e 's|@localstatedir[@]|$(localstatedir)|g' \
49         -e 's|@PACKAGE_VERSION[@]|$(REAL_PACKAGE_VERSION)|g' \
50         -e 's|@SIZECMD[@]|$(SIZECMD)|g' \
51         -e '1s|!/bin/bash|!$(BASH_SHELL)|g'
53 $(OURSCRIPTS): Makefile
54         $(AM_V_at)$(RM) $@ $@.tmp
55         $(AM_V_GEN)$(edit) $(srcdir)/$@.in >$@.tmp
56         $(AM_V_at)chmod +x,a-w $@.tmp
57         $(AM_V_at)mv $@.tmp $@
59 $(OURFILES): Makefile
60         $(AM_V_at)$(RM) $@ $@.tmp
61         $(AM_V_GEN)$(edit) $(srcdir)/$@.in >$@.tmp
62         $(AM_V_at)chmod a-w $@.tmp
63         $(AM_V_at)mv $@.tmp $@
65 all-am: $(OURSCRIPTS) $(OURFILES)
67 install-data-local:
68         $(MKDIR_P) $(DESTDIR)$(sysconfdir)/bash_completion.d/
69         $(INSTALL_DATA) bash_completion $(DESTDIR)$(sysconfdir)/bash_completion.d/pacman
70         $(MKDIR_P) $(DESTDIR)$(datarootdir)/zsh/site-functions/
71         $(INSTALL_DATA) zsh_completion $(DESTDIR)$(datarootdir)/zsh/site-functions/_pacman
73 uninstall-local:
74         $(RM) $(DESTDIR)$(sysconfdir)/bash_completion.d/pacman
75         $(RM) $(DESTDIR)$(datarootdir)/zsh/site-functions/_pacman
77 bacman: $(srcdir)/bacman.in
78 bash_completion: $(srcdir)/bash_completion.in
79 paccache: $(srcdir)/paccache.in
80 pacdiff: $(srcdir)/pacdiff.in
81 paclist: $(srcdir)/paclist.in
82 paclog-pkglist: $(srcdir)/paclog-pkglist.in
83 pacscripts: $(srcdir)/pacscripts.in
84 pacsearch: $(srcdir)/pacsearch.in
85 pacsysclean: $(srcdir)/pacsysclean.in
86 pactree: $(srcdir)/pactree.in
87 zsh_completion: $(srcdir)/zsh_completion.in
89 # vim:set ts=2 sw=2 noet: