forked from JiriSko/amixer-webui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (44 loc) · 1.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
#
# File: Makefile
# Date: 12. 12. 2016
# Author: Jiri Skorpil <[email protected]>
# Desc.: Makefile for ALSA Mixer WebUI
#
INSTALL_PATH=/usr/share/amixer-webui
BUILD_PATH=production/deb-package
VERSION := $(shell cat ${BUILD_PATH}/DEBIAN/control | awk 'NR==2 {print $$2}')
.PHONY: all
all:
.PHONY: install
install: clean package
mkdir ${INSTALL_PATH}
rsync -av --progress ${BUILD_PATH}/ / --exclude DEBIAN
cp amixer-webui.conf /etc/amixer-webui.conf
cp amixer-webui /etc/init.d/amixer-webui
.PHONY: uninstall
uninstall:
rm -rf ${INSTALL_PATH}
rm /etc/init.d/amixer-webui
rm /etc/amixer-webui.conf
.PHONE: package
package:
mkdir -p ${BUILD_PATH}${INSTALL_PATH}
cp -r htdocs ${BUILD_PATH}${INSTALL_PATH}/
cp alsamixer_webui.py ${BUILD_PATH}${INSTALL_PATH}/
cp amixer-webui ${BUILD_PATH}${INSTALL_PATH}/
cp amixer-webui.conf ${BUILD_PATH}${INSTALL_PATH}/
cp index.tpl ${BUILD_PATH}${INSTALL_PATH}/
cp logo.svg ${BUILD_PATH}${INSTALL_PATH}/
cp README.md ${BUILD_PATH}${INSTALL_PATH}/
.PHONY: deb
deb: package
touch ${BUILD_PATH}/DEBIAN/md5sums
cd ${BUILD_PATH} && find * ! -path "DEBIAN/*" -type f -exec md5sum {} \; >> DEBIAN/md5sums
cp production/deb-package/DEBIAN/control production/control
du -sx --apparent-size --exclude ${BUILD_PATH}/DEBIAN ${BUILD_PATH} | awk '{ print "Installed-Size: " $$1 }' >> ${BUILD_PATH}/DEBIAN/control
fakeroot dpkg-deb -b production/deb-package production/amixer-webui_${VERSION}_all.deb
rm ${BUILD_PATH}/DEBIAN/control
mv production/control production/deb-package/DEBIAN/control
.PHONY: clean
clean:
rm -rf ${BUILD_PATH}/usr ${BUILD_PATH}/DEBIAN/md5sums