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
|
SHELL = /bin/sh
# ------------------------------------------------
# DEFINITIONS
# ------------------------------------------------
# installation tools
SHTOOL = ./shtool
INSTALL_SCRIPT = $(SHTOOL) install -c -m 755
INSTALL_DATA = $(SHTOOL) install -c -m 644
MKDIR = $(SHTOOL) mkdir -p -f -m 755
VERSION_TOOL = $(SHTOOL) version
prefix = /usr/local
bindir = $(prefix)/bin
mandir = $(prefix)/man
# ------------------------------------------------
# STANDARD TARGETS
# ------------------------------------------------
all: tarcust tarcust.1
tarcust: tarcust.pl
set -e; path_perl=`$(SHTOOL) path -m perl5 perl`; \
sed -e "1s|@path_perl@|$${path_perl}|" \
-e '/__END__/,$$d' tarcust.pl > $@ && chmod a+x $@
tarcust.1: tarcust.pl
set -e; V=`$(VERSION_TOOL) -l perl -d long version.pl`; \
pod2man --section=1 \
--center="A tar Customizer" \
--release="TarCust $$V" tarcust.pl > $@
install: all
$(MKDIR) $(bindir)
$(MKDIR) $(mandir)/man1
$(INSTALL_SCRIPT) tarcust $(bindir)/tarcust
$(INSTALL_DATA) tarcust.1 $(mandir)/man1/tarcust.1
clean:
-rm -f tarcust tarcust.1
distclean: clean
@:
# ------------------------------------------------
# THE CONFIGURATION SUPPORT
# ------------------------------------------------
shtool:
@shtoolize echo version install fixperm mkdir path
# ------------------------------------------------
# THE RELEASE STUFF
# ------------------------------------------------
TAR = tar # where to find GNU Tar
FIND = find # where to find a good Find tool
GZIP = gzip # where to find GNU Zip
NAME = barbier # name of maintainer who rolls the tarball
NEWVERS = \
$(VERSION_TOOL) -l perl -p TarCust $$OPT version.pl; \
V=`$(VERSION_TOOL) -l perl -d long version.pl`;\
sed -e "s/Version .*(.*)/Version $$V/g" <README >README.n && mv README.n README
UPDATEVERS = \
V=`$(VERSION_TOOL) -l perl -d short version.pl`; \
$(VERSION_TOOL) -l perl -p TarCust -s $$V version.pl; \
V=`$(VERSION_TOOL) -l perl -d long version.pl`; \
sed -e "s/Version .*(.*)/Version $$V/g" <README >README.n && mv README.n README; \
sed -e "s/\\(TarCust_VersionStr.*\\)\"\\(.*\\)\"/\\1\"$$V\"/" <tarcust.pl >tarcust.n && mv tarcust.n tarcust.pl
_GETDISTINFO = \
_version=`$(VERSION_TOOL) -l perl -d short version.pl`; \
_date=`date '+%Y%m%d_%H%M'`;
_BUILDDIST = \
echo "Creating tarball..."; \
awk '{print $$1}' MANIFEST | xargs $(TAR) cvf - |\
./tarcust --user-name=$(NAME) \
--group-name=tarcust \
--prefix="$${_distname}" - |\
$(GZIP) --best - >$${_tarball}; \
ls -l $${_tarball}; \
echo "Done"
release: fixperm tarcust
set -e; $(_GETDISTINFO) \
_distname="tarcust-$${_version}"; \
_tarball="$${_distname}.tar.gz"; \
echo "Release Distribution: TarCust Version $$_version"; \
$(_BUILDDIST)
snap: fixperm tarcust
set -e; @$(_GETDISTINFO) \
_distname="tarcust-$${_version}-SNAP"; \
_tarball="$${_distname}.tar.gz"; \
echo "Snap of whole source tree: TarCust Version $$_version as of $$_date"; \
$(_BUILDDIST)
new-version:
OPT=-iv; $(NEWVERS)
new-revision:
OPT=-ir; $(NEWVERS)
new-patchlevel:
OPT=-iP; $(NEWVERS)
new-release:
OPT=-s$(R); $(NEWVERS)
update-version:
$(UPDATEVERS)
fixperm:
$(SHTOOL) fixperm *
##EOF##
|