forked from erlyvideo/flussonic-old
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
168 lines (132 loc) · 6.59 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
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# include version.mk
VERSION := $(shell ./contrib/version.erl)
NODENAME ?= flussonic
all: app
install:
mkdir -p $(DESTDIR)/usr/share/flussonic/deps $(DESTDIR)/etc/init.d/ $(DESTDIR)/etc/default
cp -r apps deps wwwroot $(DESTDIR)/usr/share/flussonic
cp priv/flussonic $(DESTDIR)/etc/init.d/
echo "FLUDIR=/usr/share/flussonic" >> $(DESTDIR)/etc/default/flussonic
mkdir -p $(DESTDIR)/usr/share/doc/flussonic/ $(DESTDIR)/etc/flussonic/
cp COPYING $(DESTDIR)/usr/share/doc/flussonic/copyright
cp priv/sample/flussonic.conf $(DESTDIR)/etc/flussonic/flussonic.conf
ct:
ct_run -pa `pwd`/apps/*/ebin -pa `pwd`/deps/*/ebin -dir apps/*/test -logdir logs/
eunit:
./rebar eunit skip_deps=true
test: ct eunit
app: deps/cowboy deps/lager/ebin/lager_transform.beam
./rebar compile skip_deps=true
deps/cowboy:
./rebar get-deps compile
deps/lager/ebin/lager_transform.beam:
./rebar compile
clean:
./rebar clean
rm -f apps/*/test/*.beam
rm -f erl_crash.dump
compile_public:
vagrant destroy -f compile_public
vagrant up compile_public
run:
ERL_LIBS=apps:deps erl +K true +A 16 +a 2048 -name [email protected] -pa apps/*/ebin -pa deps/*/ebin -boot start_sasl -s flussonic -sasl errlog_type error
shell:
erl -name [email protected] -remsh [email protected]
vagrant:
vagrant destroy -f
vagrant up
vagrant ssh -c "sudo -s /etc/init.d/flussonic start"
.PHONY: test
# check_public:
# vagrant destroy -f
start:
mkdir -p log/pipe log/console
export RUN_ERL_LOG_GENERATIONS=5
export RUN_ERL_LOG_MAXSIZE=100000
run_erl -daemon log/pipe/ log/console/ "exec make run"
while [ ! -e log/flussonic.pid ] ; do sleep 1; echo "."; done
attach:
to_erl log/pipe/
stop:
echo -e "init:stop().\n" > log/pipe/erlang.pipe.1.w
kill `cat log/flussonic.pid`
dist-clean: clean
tgz:
rm -rf flussonic-$(VERSION)
git archive --prefix=flussonic-$(VERSION)/ master | tar x
mkdir -p flussonic-$(VERSION)/deps
[ -d deps ] && for d in deps/* ; do git clone $$d flussonic-$(VERSION)/deps/`basename $$d`; done || true
cd flussonic-$(VERSION) && ./rebar get-deps
cp -f contrib/Makefile.debian flussonic-$(VERSION)/Makefile
perl -pi -e s,vsn_subst,$(VERSION),g flussonic-$(VERSION)/Makefile
rm -f flussonic-$(VERSION)/deps/mimetypes/src/mimetypes_parse.erl
find flussonic-$(VERSION) -name *.beam -delete
find flussonic-$(VERSION) -name *.so -delete
find flussonic-$(VERSION) -name *.o -delete
find flussonic-$(VERSION) -name *.app.src -exec perl -pi -e s,git,'"v1.0"',g {} \;
find flussonic-$(VERSION) -name .gitignore -delete
cat rebar.config |grep -v meck > flussonic-$(VERSION)/rebar.config
rm -rf flussonic-$(VERSION)/test
rm -rf flussonic-$(VERSION)/deps/meck
rm -rf flussonic-$(VERSION)/deps/cowboy/test
rm -rf flussonic-$(VERSION)/deps/cowboy/examples
rm -rf flussonic-$(VERSION)/deps/*/.git
rm -rf flussonic-$(VERSION)/apps/rtsp/priv
rm -rf flussonic-$(VERSION)/deps/lager/rebar
rm -rf flussonic-$(VERSION)/apps/flussonic/c_src
rm -f flussonic-$(VERSION)/apps/mpegts/contrib/build_table.rb
rm -f flussonic-$(VERSION)/apps/flussonic/mibs-unused/ERLYVIDEO-MIB.mib
tar zcf flussonic-$(VERSION).tgz flussonic-$(VERSION)
rm -rf flussonic-$(VERSION)
package:
rm -rf tmproot
mkdir -p tmproot/opt/flussonic
git archive master | (cd tmproot/opt/flussonic; tar x)
mkdir -p tmproot/opt/flussonic/deps
rm -rf tmproot/opt/flussonic/priv/mbr*.mp4
rm -rf tmproot/opt/flussonic/test
[ -d deps ] && for d in deps/* ; do git clone $$d tmproot/opt/flussonic/deps/`basename $$d`; done || true
(cd tmproot/opt/flussonic/ && ./rebar get-deps && ./rebar compile)
mkdir -p tmproot/opt/flussonic/apps/flussonic/priv/
mkdir -p tmproot/opt/flussonic/apps/mpegts/priv/
rm -rf tmproot/opt/flussonic/deps/proper*
rm -rf tmproot/opt/flussonic/apps/ffmpeg
rm -rf tmproot/opt/flussonic/apps/mpegts/contrib/build_table.rb tmproot/opt/flussonic/apps/rtsp/priv/* tmproot/opt/flussonic/deps/*/test
rm -rf tmproot/opt/flussonic/deps/*/.git tmproot/opt/flussonic/.git
mkdir -p tmproot/usr/share/doc/flussonic
find tmproot -name .gitignore -delete
cp COPYING tmproot/usr/share/doc/flussonic/copyright
mkdir -p tmproot/etc/init.d/
cp priv/flussonic tmproot/etc/init.d/
mkdir -p tmproot/etc/flussonic
cp priv/sample/*.conf tmproot/etc/flussonic/
cp -f priv/mpegts_udp-squeeze64.so tmproot/opt/flussonic/apps/mpegts/priv/mpegts_udp.so
cd tmproot && \
fpm -s dir -t deb -n flussonic -v $(VERSION) --category net \
--post-install ../debian/postinst --pre-uninstall ../debian/prerm --post-uninstall ../debian/postrm \
--config-files /etc/flussonic/flussonic.conf --config-files /etc/flussonic/streams.conf --config-files '/etc/flussonic/*.conf' \
-d 'esl-erlang (>= 15) | esl-erlang-nox (>= 15) | erlang-nox (>= 1:15)' -m "Max Lapshin <[email protected]>" -a amd64 etc/init.d/flussonic etc/flussonic opt
cp -f priv/mpegts_udp-squeeze32.so tmproot/opt/flussonic/apps/mpegts/priv/mpegts_udp.so
cd tmproot && \
fpm -s dir -t deb -n flussonic -v $(VERSION) --category net \
--post-install ../debian/postinst --pre-uninstall ../debian/prerm --post-uninstall ../debian/postrm \
--config-files /etc/flussonic/flussonic.conf --config-files /etc/flussonic/streams.conf --config-files '/etc/flussonic/*.conf' \
-d 'esl-erlang (>= 15) | esl-erlang-nox (>= 15) | erlang-nox (>= 1:15)' -m "Max Lapshin <[email protected]>" -a i386 etc/init.d/flussonic etc/flussonic opt
#cp -f priv/mpegts_udp-armel.so tmproot/opt/flussonic/apps/mpegts/priv/mpegts_udp.so
#cd tmproot && \
#fpm -s dir -t deb -n flussonic -v $(VERSION) --category net \
#--post-install ../debian/postinst --pre-uninstall ../debian/prerm --post-uninstall ../debian/postrm \
#--config-files /etc/flussonic/flussonic.conf --config-files /etc/flussonic/streams.conf --config-files '/etc/flussonic/*.conf' \
#-d 'esl-erlang (>= 15) | esl-erlang-nox (>= 15) | erlang-nox (>= 1:15)' -m "Max Lapshin <[email protected]>" -a armel etc/init.d/flussonic etc/flussonic opt
mv tmproot/*.deb .
rm -rf tmproot
escriptize:
./contrib/escriptize
upload:
./contrib/license_pack upload2 $(VERSION)
rsync -avz flussonic_$(VERSION)_*.deb flussonic flussonic-$(VERSION).tgz [email protected]:/apps/erlyvideo/debian/public/binary/
# scp flussonic [email protected]:/apps/erlyvideo/debian/public/binary/flussonic
ssh [email protected] "cd /apps/erlyvideo/debian ; ./update ; cd public/binary ; ln -sf flussonic-$(VERSION).tgz flussonic-latest.tgz "
./contrib/send_email.erl [email protected] $(VERSION)
@#echo "Erlyvideo version ${VERSION} uploaded to debian repo http://debian.erlyvideo.org/ ." | mail -r "Erlybuild <[email protected]>" -s "Erlyvideo version ${VERSION}" -v [email protected]
new_version: tgz package escriptize upload