Added GNUmakefile, configure, and a missing "my".

This commit is contained in:
hjp 2003-06-28 20:50:33 +00:00
parent d79e2212ca
commit c56b63d964
3 changed files with 66 additions and 2 deletions

30
ts/GNUmakefile Normal file
View File

@ -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

34
ts/configure vendored Normal file
View File

@ -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

View File

@ -1,8 +1,8 @@
#!/usr/bin/perl -wT
#!@@@perl@@@ -wT
use strict;
use POSIX;
while (<>) {
chomp;
$now = strftime('%Y-%m-%dT%H:%M:%S', localtime);
my $now = strftime('%Y-%m-%dT%H:%M:%S', localtime);
print "$now $_\n";
}