download callback: show decimal places in rate if we have room
[pacman-ng.git] / scripts / Makefile.am
blob52a784ab70306ad008c7310813edc88846ca47a1
1 # enforce that all scripts have a --help and --version option
2 AUTOMAKE_OPTIONS = std-options
4 SUBDIRS = po
6 bin_SCRIPTS = \
7         $(OURSCRIPTS)
9 OURSCRIPTS = \
10         makepkg \
11         pacman-db-upgrade \
12         pacman-key \
13         pacman-optimize \
14         pkgdelta \
15         rankmirrors \
16         repo-add
18 EXTRA_DIST = \
19         makepkg.sh.in \
20         pacman-db-upgrade.sh.in \
21         pacman-key.sh.in \
22         pacman-optimize.sh.in \
23         pkgdelta.sh.in \
24         rankmirrors.sh.in \
25         repo-add.sh.in \
26         $(LIBRARY)
28 LIBRARY = \
29         library/output_format.sh \
30         library/parse_options.sh
32 # Files that should be removed, but which Automake does not know.
33 MOSTLYCLEANFILES = $(bin_SCRIPTS)
35 if USE_GIT_VERSION
36 GIT_VERSION := $(shell sh -c 'git describe --abbrev=4 --dirty | sed s/^v//')
37 REAL_PACKAGE_VERSION = $(GIT_VERSION)
38 else
39 REAL_PACKAGE_VERSION = $(PACKAGE_VERSION)
40 endif
42 #### Taken from the autoconf scripts Makefile.am ####
43 edit = sed \
44         -e 's|@localedir[@]|$(localedir)|g' \
45         -e 's|@sysconfdir[@]|$(sysconfdir)|g' \
46         -e 's|@localstatedir[@]|$(localstatedir)|g' \
47         -e 's|@pkgdatadir[@]|$(pkgdatadir)|g' \
48         -e 's|@prefix[@]|$(prefix)|g' \
49         -e '1s|!/bin/bash|!$(BASH_SHELL)|g' \
50         -e 's|@PACKAGE_VERSION[@]|$(REAL_PACKAGE_VERSION)|g' \
51         -e 's|@PACKAGE_BUGREPORT[@]|$(PACKAGE_BUGREPORT)|g' \
52         -e 's|@PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' \
53         -e 's|@BUILDSCRIPT[@]|$(BUILDSCRIPT)|g' \
54         -e 's|@SIZECMD[@]|$(SIZECMD)|g' \
55         -e 's|@SEDINPLACE[@]|$(SEDINPLACE)|g' \
56         -e 's|@DUPATH[@]|$(DUPATH)|g' \
57         -e 's|@SCRIPTNAME[@]|$@|g' \
58         -e 's|@configure_input[@]|Generated from $@.sh.in; do not edit by hand.|g'
60 ## All the scripts depend on Makefile so that they are rebuilt when the
61 ## prefix etc. changes. Use chmod -w to prevent people from editing the
62 ## wrong file by accident.
63 # two 'test' lines- make sure we can handle both sh and py type scripts
64 # third 'test' line- make sure one of the two checks succeeded
65 $(OURSCRIPTS): Makefile
66         @echo '    ' GEN $@;
67         @$(RM) $@
68         @test -f $(srcdir)/$@.sh.in && m4 -P -I $(srcdir) $(srcdir)/$@.sh.in | $(edit) >$@
69         @chmod +x $@
70         @chmod a-w $@
72 makepkg: \
73         $(srcdir)/makepkg.sh.in \
74         $(srcdir)/library/parse_options.sh
76 pacman-db-upgrade: \
77         $(srcdir)/pacman-db-upgrade.sh.in \
78         $(srcdir)/library/output_format.sh
80 pacman-key: \
81         $(srcdir)/pacman-key.sh.in \
82         $(srcdir)/library/output_format.sh \
83         $(srcdir)/library/parse_options.sh
85 pacman-optimize: \
86         $(srcdir)/pacman-optimize.sh.in \
87         $(srcdir)/library/output_format.sh
89 pkgdelta: \
90         $(srcdir)/pkgdelta.sh.in \
91         $(srcdir)/library/output_format.sh
93 rankmirrors: $(srcdir)/rankmirrors.sh.in
95 repo-add: \
96         $(srcdir)/repo-add.sh.in \
97         $(srcdir)/library/output_format.sh
99 repo-remove: $(srcdir)/repo-add.sh.in
100         $(RM) repo-remove
101         $(LN_S) repo-add repo-remove
103 repo-elephant: $(srcdir)/repo-add.sh.in
104         $(RM) repo-elephant
105         $(LN_S) repo-add repo-elephant
107 install-data-hook:
108         cd $(DESTDIR)$(bindir) && \
109                 ( $(LN_S) repo-add repo-elephant || \
110                 ln repo-add repo-elephant || \
111                 cp repo-add repo-elephant )
112         cd $(DESTDIR)$(bindir) && \
113                 ( $(LN_S) repo-add repo-remove || \
114                 ln repo-add repo-remove || \
115                 cp repo-add repo-remove )
117 uninstall-hook:
118         cd $(DESTDIR)$(bindir) && \
119                 $(RM) repo-remove repo-elephant
121 # vim:set ts=2 sw=2 noet: