-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
71 lines (57 loc) · 1.95 KB
/
Makefile
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
MAJOR ?= $(shell date +%Y)
MINOR ?= $(shell date +%m)
SUB ?= $(shell date +%d)
PATCH ?= 1
MD5SUM = md5sum
SEDI = sed -i
ifeq ($(shell uname), Darwin)
MD5SUM = md5 -r
SEDI = sed -i ""
endif
all: setup
./Build
versions:
find lib bin t -type f -exec perl -i -pe 's/VERSION\s+=\s+q[[\d.]+]/VERSION = q[$(MAJOR).$(MINOR).$(SUB)]/g' {} \;
setup:
perl Build.PL
manifest: setup
rm MANIFEST
./Build manifest
clean: setup
./Build clean
touch tmp
rm -rf build.tap MYMETA.yml MYMETA.json _build Build rpmbuild spec tmp *rpm *deb *tar.gz test.db MANIFEST.bak nytprof*
test: setup
TEST_AUTHOR=1 ./Build test verbose=1
cover: setup
./Build testcover verbose=1
nytcover: setup
TEST_AUTHOR=1 perl -d:NYTProf Build test
nytprofmerge nytprof.out*
nytprofhtml --file nytprof-merged.out
install: setup
./Build install
dist: setup
./Build dist
deb: manifest
make test
touch tmp
rm -rf tmp
mkdir -p tmp/usr/share/perl5
cp -pR deb-src/* tmp/
cp tmp/DEBIAN/control.tmpl tmp/DEBIAN/control
$(SEDI) "s/MAJOR/$(MAJOR)/g" tmp/DEBIAN/control
$(SEDI) "s/MINOR/$(MINOR)/g" tmp/DEBIAN/control
$(SEDI) "s/SUB/$(SUB)/g" tmp/DEBIAN/control
$(SEDI) "s/PATCH/$(PATCH)/g" tmp/DEBIAN/control
$(SEDI) "s/RELEASE/$(RELEASE)/g" tmp/DEBIAN/control
rsync --exclude .svn --exclude .git -va lib/* tmp/usr/share/perl5/
rsync --exclude .svn --exclude .git -va bin/* tmp/usr/bin/
find tmp -type f ! -regex '.*\(\bDEBIAN\b\|\.\bsvn\b\|\bdeb-src\b\|\.\bgit\b\|\.\bsass-cache\b\|\.\bnetbeans\b\).*' -exec $(MD5SUM) {} \; | sed 's/tmp\///' > tmp/DEBIAN/md5sums
(cd tmp; fakeroot dpkg -b . ../libclearpress-perl-$(MAJOR).$(MINOR).$(SUB)-$(PATCH).deb)
cpan: clean
make dist
cpan-upload ClearPress-v$(MAJOR).$(MINOR).$(SUB)-$(PATCH).tar.gz
debdeps:
grep Depends deb-src/DEBIAN/control.tt2 | cut -d : -f 2 | sed 's/,/ /g' | xargs sudo apt-get install
grep Recommends deb-src/DEBIAN/control.tt2 | cut -d : -f 2 | sed 's/,/ /g' | xargs sudo apt-get install