/
Makefile
97 lines (74 loc) · 2.82 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
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
# raw makefile
# - ease repeatitive operations
all:
PKGNAME="neoip-utils"
VERSION="0.7.1"
SRC_DIR=$(shell /bin/pwd)
DST_DIR_LIB=$(DESTDIR)/usr/share/neoip-utils
DST_DIR_BIN=$(DESTDIR)/usr/bin
DST_DIR_MAN=$(DESTDIR)/usr/share/man
#################################################################################
# misc #
#################################################################################
doc: manpage_build
manpage_build:
pod2man --section=1 --release=$(VERSION) lib/url_builder_oload_exe.js > man/neoip-url-static.1
pod2man --section=1 --release=$(VERSION) lib/url_builder_casto_exe.js > man/neoip-url-stream.1
pod2man --section=1 --release=$(VERSION) lib/neoip_app_detect_exe.js > man/neoip-detect.1
manpage_clean:
rm -f man/*.1
jsdoc:
jsrun.sh -d=doc/jsdoc lib/
tag_version:
git tag -a v$(VERSION) -m "v$(VERSION) - version bump"
git push origin v$(VERSION)
#################################################################################
# npm package handling #
#################################################################################
npm_link:
npm link .
npm_install:
npm install .
npm_uninstall:
npm uninstall webpeer
npm_publish:
npm publish .
#################################################################################
# usual targets #
#################################################################################
build: doc
echo "make build"
clean: manpage_clean
echo "make clean"
install: build
install -d $(DST_DIR_LIB)
rsync -va --exclude debian --exclude .git $(SRC_DIR)/. $(DST_DIR_LIB)
install -d $(DST_DIR_BIN)
cp $(DST_DIR_LIB)/bin/neoip-url-static $(DST_DIR_BIN)
cp $(DST_DIR_LIB)/bin/neoip-url-stream $(DST_DIR_BIN)
cp $(DST_DIR_LIB)/bin/neoip-detect $(DST_DIR_BIN)
install -d $(DST_DIR_MAN)/man1
cp man/neoip-url-static.1 $(DST_DIR_MAN)/man1
cp man/neoip-url-stream.1 $(DST_DIR_MAN)/man1
cp man/neoip-detect.1 $(DST_DIR_MAN)/man1
uninstall:
rm -rf $(DST_DIR_LIB)
rm -f $(DST_DIR_BIN)/neoip-url-static
rm -f $(DST_DIR_BIN)/neoip-url-stream
rm -f $(DST_DIR_BIN)/neoip-detect
rm -f $(DST_DIR_MAN)/man1/neoip-url-static.1
rm -f $(DST_DIR_MAN)/man1/neoip-url-stream.1
rm -f $(DST_DIR_MAN)/man1/neoip-detect.1
#################################################################################
# deb package handling #
#################################################################################
deb_src_build:
debuild -S -k'jerome etienne' -I.git
deb_bin_build:
debuild -i -us -uc -b
deb_upd_changelog:
dch --newversion $(VERSION)~lucid1~ppa`date +%Y%m%d%H%M` --maintmaint --force-bad-version --distribution `lsb_release -c -s` Another build
deb_clean:
rm -f ../$(PKGNAME)_$(VERSION)~lucid1~ppa*
ppa_upload: clean build deb_clean deb_upd_changelog deb_src_build
dput -U ppa:jerome-etienne/neoip ../$(PKGNAME)_$(VERSION)~lucid1~ppa*_source.changes