Move important information up in -Si output
[pacman-ng.git] / contrib / Makefile.am
blob3641a08573e7029f2b0fbac1c919c59074f7fff5
1 # enforce that all scripts have a --help and --version option
2 AUTOMAKE_OPTIONS = std-options
4 bin_SCRIPTS = \
5   $(OURSCRIPTS)
7 BASHSCRIPTS = \
8         bacman \
9         paccache \
10         pacdiff \
11         paclist \
12         paclog-pkglist \
13         pacscripts \
14         pacsysclean \
15         rankmirrors \
16         updpkgsums
18 OTHERSCRIPTS = \
19         pacsearch
21 OURSCRIPTS = \
22         $(BASHSCRIPTS) \
23         $(OTHERSCRIPTS)
25 OURFILES = \
26         bash_completion \
27         zsh_completion
29 EXTRA_DIST = \
30         PKGBUILD.vim \
31         bacman.sh.in \
32         bash_completion.in \
33         paccache.sh.in \
34         paclog-pkglist.sh.in \
35         pacdiff.sh.in \
36         paclist.sh.in \
37         pacscripts.sh.in \
38         pacsearch.in \
39         pacsysclean.sh.in \
40         rankmirrors.sh.in
41         updpkgsums.sh.in \
42         vimprojects \
43         zsh_completion.in \
44         README
46 # Files that should be removed, but which Automake does not know.
47 MOSTLYCLEANFILES = $(OURSCRIPTS) $(OURFILES) *.tmp
49 if USE_GIT_VERSION
50 GIT_VERSION := $(shell sh -c 'git describe --abbrev=4 --dirty | sed s/^v//')
51 REAL_PACKAGE_VERSION = $(GIT_VERSION)
52 else
53 REAL_PACKAGE_VERSION = $(PACKAGE_VERSION)
54 endif
56 edit = sed \
57         -e 's|@sysconfdir[@]|$(sysconfdir)|g' \
58         -e 's|@localstatedir[@]|$(localstatedir)|g' \
59         -e 's|@PACKAGE_VERSION[@]|$(REAL_PACKAGE_VERSION)|g' \
60         -e 's|@SIZECMD[@]|$(SIZECMD)|g' \
61         -e 's|@SCRIPTNAME[@]|$@|g' \
62         -e '1s|!/bin/bash|!$(BASH_SHELL)|g'
64 $(OTHERSCRIPTS): Makefile
65         $(AM_V_at)$(RM) $@ $@.tmp
66         $(AM_V_GEN)$(edit) $(srcdir)/$@.in >$@.tmp
67         $(AM_V_at)chmod +x,a-w $@.tmp
68         $(AM_V_at)mv $@.tmp $@
70 $(BASHSCRIPTS): Makefile
71         $(AM_V_at)$(RM) $@
72         $(AM_V_GEN)test -f $(srcdir)/$@.sh.in && m4 -P -I $(srcdir) $(srcdir)/$@.sh.in | $(edit) >$@
73         $(AM_V_at)chmod +x,a-w $@
74         @$(BASH_SHELL) -O extglob -n $@
76 $(OURFILES): Makefile
77         $(AM_V_at)$(RM) $@ $@.tmp
78         $(AM_V_GEN)$(edit) $(srcdir)/$@.in >$@.tmp
79         $(AM_V_at)chmod a-w $@.tmp
80         $(AM_V_at)mv $@.tmp $@
82 all-am: $(OURSCRIPTS) $(OURFILES)
84 install-data-local:
85         $(MKDIR_P) $(DESTDIR)$(sysconfdir)/bash_completion.d/
86         $(INSTALL_DATA) bash_completion $(DESTDIR)$(sysconfdir)/bash_completion.d/pacman
87         $(MKDIR_P) $(DESTDIR)$(datarootdir)/zsh/site-functions/
88         $(INSTALL_DATA) zsh_completion $(DESTDIR)$(datarootdir)/zsh/site-functions/_pacman
90 uninstall-local:
91         $(RM) $(DESTDIR)$(sysconfdir)/bash_completion.d/pacman
92         $(RM) $(DESTDIR)$(datarootdir)/zsh/site-functions/_pacman
94 bacman: $(srcdir)/bacman.sh.in
95 bash_completion: $(srcdir)/bash_completion.in
96 paccache: $(srcdir)/paccache.sh.in $(top_srcdir)/scripts/library/parseopts.sh $(top_srcdir)/scripts/library/size_to_human.sh
97 pacdiff: $(srcdir)/pacdiff.sh.in
98 paclist: $(srcdir)/paclist.sh.in
99 paclog-pkglist: $(srcdir)/paclog-pkglist.sh.in
100 pacscripts: $(srcdir)/pacscripts.sh.in
101 pacsearch: $(srcdir)/pacsearch.in
102 pacsysclean: $(srcdir)/pacsysclean.sh.in
103 rankmirrors: $(srcdir)/rankmirrors.sh.in
104 updpkgsums: $(srcdir)/updpkgsums.sh.in
105 zsh_completion: $(srcdir)/zsh_completion.in
107 # vim:set ts=2 sw=2 noet: