-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
47 lines (37 loc) · 1.57 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
.POSIX:
SHELL := /bin/bash
NAME = cbetar2
# paths
PREFIX = /usr
BIN = ${PREFIX}/bin
DATA = ${PREFIX}/share
MANPREFIX = ${DATA}/man
METAINFO = ${PREFIX}/share/metainfo
DOCPREFIX = ${PREFIX}/share/doc/${NAME}
OPT = ${PREFIX}
electronPackagePath = $(shell ls -d ./dist/linux*unpacked)
all:
HOME=`pwd`; \
npm i --ignore-scripts; \
npm run build-electron; \
npm x -- electron-builder -l dir -c electronBuilderConfigs/flatpak.json
clean:
rm -rf ${electronPackagePath} node_modules
install: all
install -d ${DESTDIR}/${OPT}/${NAME} ${DESTDIR}/${BIN} ${DESTDIR}/${METAINFO} ${DESTDIR}/${DATA}/applications ${DESTDIR}/${DATA}/icons ${DESTDIR}/${MANPREFIX}/man1
cp -a ${electronPackagePath}/. ${DESTDIR}/${OPT}/${NAME}
ln -s ${OPT}/${NAME}/${NAME} ${DESTDIR}/${BIN}
cp buildElectron/io.github.mrmyhuang.${NAME}.metainfo.xml ${DESTDIR}/${METAINFO}
cp buildElectron/io.github.mrmyhuang.${NAME}.desktop ${DESTDIR}/${DATA}/applications/${NAME}.desktop
sed -i 's#^Exec=.*$$#Exec=${BIN}/${NAME} --no-sandbox#' ${DESTDIR}/${DATA}/applications/${NAME}.desktop
sed -i 's#^Icon=.*$$#Icon=${DATA}/icons/${NAME}.png#' ${DESTDIR}/${DATA}/applications/${NAME}.desktop
#desktop-file-validate ${DESTDIR}/${DATA}/applications/${NAME}.desktop
cp buildElectron/icon.png ${DESTDIR}/${DATA}/icons/${NAME}.png
uninstall:
rm -rf ${DESTDIR}/${PREFIX}/${NAME}
rm -f \
"${DESTDIR}/${BIN}/${NAME}"\
"${DESTDIR}/${METAINFO}/io.github.mrmyhuang.${NAME}.metainfo.xml"\
"${DESTDIR}/${DATA}/applications/io.github.mrmyhuang.${NAME}.desktop"\
"${DESTDIR}/${DATA}/icons/${NAME}.png"
.PHONY: all clean install uninstall