File: Makefile

package info (click to toggle)
tarcust 0.9.0-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 148 kB
  • ctags: 34
  • sloc: sh: 1,029; perl: 450; makefile: 121
file content (127 lines) | stat: -rw-r--r-- 3,648 bytes parent folder | download | duplicates (2)
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

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 version.pl
	set -e; path_perl=`$(SHTOOL) path -m perl5 perl`; \
	V=`$(VERSION_TOOL) -l perl -d long version.pl`; \
        sed -e "1s|@path_perl@|$${path_perl}|" \
            -e "s|@version@|$$V|" \
            -e '/__END__/,$$d' tarcust.pl > $@ && chmod a+x $@

tarcust.1: tarcust.pl version.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 -n tarcust -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 -n tarcust -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;

_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}:775" |\
    $(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)

deb: release
	fakeroot ./debian/rules clean
	set -e; $(_GETDISTINFO) \
    mv tarcust-$${_version}.tar.gz ../tarcust_$${_version}.orig.tar.gz
	dpkg-buildpackage -i'.*CVS.*|.*\.cvsignore' -rfakeroot
	fakeroot ./debian/rules clean

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:
	@V="$(VERSION)"; \
    if [ ".$$V" != . ]; then \
        OPT="-s$$V"; \
    else \
        OPT="-e"; \
    fi; \
    $(NEWVERS)

update-version:
	$(UPDATEVERS)

fixperm:
	$(SHTOOL) fixperm *

##EOF##