Added GNUmakefile, configure, and a missing "my".
This commit is contained in:
parent
d79e2212ca
commit
c56b63d964
|
@ -0,0 +1,30 @@
|
||||||
|
include GNUmakevars
|
||||||
|
|
||||||
|
CONFDIR=../../configure
|
||||||
|
CONFDIR_exists=$(shell [ -d $(CONFDIR) ] && echo ok)
|
||||||
|
|
||||||
|
all: configure ts
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm ts
|
||||||
|
|
||||||
|
install: \
|
||||||
|
$(BINDIR)/ts \
|
||||||
|
|
||||||
|
ts: ts.pl
|
||||||
|
|
||||||
|
%: %.pl customize
|
||||||
|
sh ./customize < $< > $@
|
||||||
|
chmod +x $@
|
||||||
|
|
||||||
|
customize: configure
|
||||||
|
sh ./configure
|
||||||
|
|
||||||
|
ifeq ($(CONFDIR_exists),ok)
|
||||||
|
|
||||||
|
configure: $(CONFDIR)/start $(CONFDIR)/perl $(CONFDIR)/finish
|
||||||
|
cat $^ > $@
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
include GNUmakerules
|
|
@ -0,0 +1,34 @@
|
||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
echo "#!/bin/sh" > customize.$$
|
||||||
|
echo "sed \\" > customize.$$
|
||||||
|
chmod +x customize.$$
|
||||||
|
|
||||||
|
################################################################
|
||||||
|
# find a working perl:
|
||||||
|
#
|
||||||
|
for i in /usr/bin/perl /usr/local/bin/perl /usr/bin/perl5 /usr/local/bin/perl5
|
||||||
|
do
|
||||||
|
if $i -e 'exit ($] < 5.000)'
|
||||||
|
then
|
||||||
|
echo $i works
|
||||||
|
perl="$i"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [ -z "$perl" ]
|
||||||
|
then
|
||||||
|
echo could not find a working perl command, sorry.
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo " -e 's,@@@perl@@@,$perl,g' \\" >> customize.$$
|
||||||
|
|
||||||
|
|
||||||
|
################################################################
|
||||||
|
# finish
|
||||||
|
# Add trailing newline and rename temp file to final name
|
||||||
|
#
|
||||||
|
echo >> customize.$$
|
||||||
|
|
||||||
|
mv customize.$$ customize
|
||||||
|
|
4
ts/ts.pl
4
ts/ts.pl
|
@ -1,8 +1,8 @@
|
||||||
#!/usr/bin/perl -wT
|
#!@@@perl@@@ -wT
|
||||||
use strict;
|
use strict;
|
||||||
use POSIX;
|
use POSIX;
|
||||||
while (<>) {
|
while (<>) {
|
||||||
chomp;
|
chomp;
|
||||||
$now = strftime('%Y-%m-%dT%H:%M:%S', localtime);
|
my $now = strftime('%Y-%m-%dT%H:%M:%S', localtime);
|
||||||
print "$now $_\n";
|
print "$now $_\n";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue