1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
|
# Gash-Utils
# Copyright © 2017, 2018, 2019 Timothy Sample <[email protected]>
# Copyright © 2018, 2019 Jan (janneke) Nieuwenhuizen <[email protected]>
#
# This file is part of Gash-Utils.
#
# Gash-Utils is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Gash-Utils is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Gash-Utils. If not, see <https://www.gnu.org/licenses/>.
include $(top_srcdir)/build-aux/guile.am
EXTRA_DIST += \
.dir-locals.el \
COPYING.CC0 \
bootstrap \
build-aux/git-version-gen \
build-aux/gitlab-ci.yml \
build-aux/gitlog-to-changelog \
build-aux/gitlog-to-changelog-repro.patch \
doc/awk-syntax.txt \
guix.scm \
tests/data/README
# Modules and scripts
#####################
SOURCES = \
gash/commands/awk.scm \
gash/commands/awk/lexer.scm \
gash/commands/awk/parser.scm \
gash/commands/basename.scm \
gash/commands/cat.scm \
gash/commands/chmod.scm \
gash/commands/cmp.scm \
gash/commands/compress.scm \
gash/commands/config.scm \
gash/commands/cp.scm \
gash/commands/cut.scm \
gash/commands/diff.scm \
gash/commands/dirname.scm \
gash/commands/env.scm \
gash/commands/expr.scm \
gash/commands/false.scm \
gash/commands/find.scm \
gash/commands/grep.scm \
gash/commands/head.scm \
gash/commands/ln.scm \
gash/commands/ls.scm \
gash/commands/mkdir.scm \
gash/commands/mv.scm \
gash/commands/printf.scm \
gash/commands/pwd.scm \
gash/commands/reboot.scm \
gash/commands/rm.scm \
gash/commands/rmdir.scm \
gash/commands/sed.scm \
gash/commands/sed/reader.scm \
gash/commands/sleep.scm \
gash/commands/sort.scm \
gash/commands/tar.scm \
gash/commands/test.scm \
gash/commands/testb.scm \
gash/commands/touch.scm \
gash/commands/tr.scm \
gash/commands/true.scm \
gash/commands/uname.scm \
gash/commands/uniq.scm \
gash/commands/wc.scm \
gash/commands/which.scm \
gash/compress.scm \
gash/diff.scm \
gash/guix-utils.scm \
gash/io.scm \
gash/lzw.scm \
gash/shell-utils.scm \
gash/ustar.scm \
gash/util.scm \
gash-utils/file-formats.scm \
gash-utils/options.scm \
gash-utils/regex.scm
gash/commands/testb.scm: $(srcdir)/gash/commands/test.scm Makefile
$(AM_V_GEN)sed \
-e 's,gash commands test,gash commands testb,g' \
-e 's,apply test (cdr,apply test/bracket (cdr,g' \
< $< > $@
WRAPPERS = \
scripts/awk \
scripts/basename \
scripts/cat \
scripts/chmod \
scripts/cmp \
scripts/compress \
scripts/cp \
scripts/cut \
scripts/diff \
scripts/dirname \
scripts/env \
scripts/expr \
scripts/false \
scripts/find \
scripts/grep \
scripts/head \
scripts/ln \
scripts/ls \
scripts/mkdir \
scripts/mv \
scripts/printf \
scripts/pwd \
scripts/reboot \
scripts/rm \
scripts/rmdir \
scripts/sed \
scripts/sleep \
scripts/sort \
scripts/tar \
scripts/test \
scripts/touch \
scripts/tr \
scripts/true \
scripts/uname \
scripts/uniq \
scripts/wc \
scripts/which
bin_SCRIPTS = \
$(WRAPPERS) \
scripts/[ \
scripts/egrep \
scripts/fgrep
do_subst = $(AM_V_GEN)sed \
-e 's,[@]GUILE[@],$(GUILE),g' \
-e 's,[@]MODDIR[@],$(moddir),g' \
-e 's,[@]GODIR[@],$(ccachedir),g'
$(WRAPPERS): $(srcdir)/scripts/template.in Makefile
$(AM_V_at) mkdir -p scripts
$(do_subst) -e 's,@UTILITY@,'"$$(basename '$@')"',' < $< > $@
$(AM_V_at)chmod a+x $@
scripts/[: $(srcdir)/scripts/template.in Makefile
$(AM_V_at) mkdir -p scripts
$(do_subst) -e 's,@UTILITY@,testb,' < $< > $@
$(AM_V_at)chmod a+x $@
EXTRA_DIST += \
scripts/egrep \
scripts/fgrep \
scripts/template.in
CLEANFILES += \
$(WRAPPERS) \
gash/commands/testb.scm \
scripts/[
# Tests
#######
TEST_EXTENSIONS = .scm .org
SCM_LOG_COMPILER = $(top_builddir)/pre-inst-env $(GUILE)
AM_SCM_LOG_FLAGS = --no-auto-compile
ORG_LOG_COMPILER = $(top_builddir)/pre-inst-env \
$(top_builddir)/tests/run-test-suite
UNIT_TESTS = \
tests/unit/awk-parser.scm \
tests/unit/file-formats.scm \
tests/unit/shell-utils.scm \
tests/unit/sed-reader.scm
FULL_TESTS = \
tests/awk.org \
tests/core-utils.org \
tests/grep.org \
tests/printf.org \
tests/sed.org \
tests/sort.org \
tests/tar.org
TEST_DATA_FILES = \
tests/data/empty \
tests/data/foo \
tests/data/fooRbar \
tests/data/ro.tar \
tests/data/star/0 \
tests/data/star/1 \
tests/data/star/2 \
tests/data/star/3
TESTS = $(UNIT_TESTS) $(FULL_TESTS)
EXTRA_DIST += \
$(TESTS) \
$(TEST_DATA_FILES) \
tests/unit/automake.scm
# Distribution
##############
dist-hook: gen-ChangeLog
echo $(VERSION) > $(distdir)/.tarball-version
if test -e .git; then \
git ls-tree -r --name-only HEAD \
> $(distdir)/.tarball-manifest; \
git show HEAD --format=%ct --no-patch 2>/dev/null \
> $(distdir)/.tarball-timestamp; \
else \
cp $(srcdir)/.tarball-manifest $(distdir)/.tarball-manifest; \
cp $(srcdir)/.tarball-timestamp $(distdir)/.tarball-timestamp; \
fi
build-aux/gitlog-to-changelog-repro: \
$(srcdir)/build-aux/gitlog-to-changelog \
$(srcdir)/build-aux/gitlog-to-changelog-repro.patch
$(AM_V_GEN){ mkdir -p $$(dirname $@) && \
patch -t --output=$@ $? && \
chmod a+x $@; }
.PHONY: gen-ChangeLog
gen-ChangeLog: build-aux/gitlog-to-changelog-repro
$(AM_V_GEN)if test -e .git; then \
{ ./build-aux/gitlog-to-changelog-repro \
--format='%s%n%n%b%n' -- v0.1.0.. && \
echo && \
sed -n -e '/^Copyright/,$$p' < $(top_srcdir)/ChangeLog; \
} > $(distdir)/ChangeLog-t && \
{ rm -f $(distdir)/ChangeLog && \
mv $(distdir)/ChangeLog-t $(distdir)/ChangeLog; } \
fi
# Reproducible tarball
# Be friendly to Debian; avoid using EPOCH
override GZIP_ENV = "--best --no-name"
am__tar = $${TAR-tar} -chof - --sort=name \
--mtime=@$$(cat "$$tardir"/.tarball-timestamp) \
--owner=0 --group=0 --numeric-owner \
--mode=go=rX,u+rw,a-s "$$tardir"
distcheck-hook:
set -e; \
manifest=$(distdir)/.tarball-manifest; \
test -f "$$manifest"; \
for x in `cat "$$manifest"`; \
do \
if ! test -f $(distdir)/"$$x" \
&& ! test "$$x" = .gitignore; \
then \
echo "Missing: $$x"; \
exit 1; \
fi; \
done
DISTCLEANFILES = build-aux/gitlog-to-changelog-repro
|