1 # Copyright 2023-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit flag-o-matic systemd
8 DESCRIPTION
="A Modern Dashboard For dae"
9 HOMEPAGE
="https://github.com/daeuniverse/daed"
11 https://github.com/daeuniverse/daed/releases/download/v${PV/_rc/rc}/daed-full-src.zip -> ${P}.zip
12 webui? ( https://github.com/daeuniverse/daed/releases/download/v${PV/_rc/rc}/web.zip -> ${P}-web.zip )
14 # EGIT_REPO_URI="https://github.com/daeuniverse/daed.git"
22 app-alternatives/v2ray-geoip
23 app-alternatives/v2ray-geosite
35 # Prevent conflicting with the user's flags
36 sed -i -e 's/-Werror//' wing
/dae-core
/Makefile || die
'Failed to remove -Werror via sed'
38 # Use upstream web archive
39 sed -e 's|daed: submodule $(DAE_WING_READY) dist|daed: $(DAE_WING_READY)|' \
41 mv -v "${WORKDIR}/web" "${S}/dist" || die
48 # sed -i '/git submodule update/d' wing/Makefile || die
49 # sed -i 's/git rev-parse --short HEAD/echo/' vite.config.ts || die
54 # for dae's ebpf target
56 filter-flags
"-march=*" "-mtune=*"
57 append-cflags
"-fno-stack-protector"
59 GO_ROOT
="${S}" SKIP_SUBMODULES=1 emake APPNAME="${PN}" VERSION="${PV}"
63 local service
=install
/daed.service
66 systemd_dounit
${service}
69 sed -i "s!/usr/bin/daed!/usr/bin/dae-wing!" ${service} || die
70 systemd_newunit
${service} dae-wing.service
73 dosym
-r "/usr/share/v2ray/geosite.dat" /usr
/share
/daed
/geosite.dat
74 dosym
-r "/usr/share/v2ray/geoip.dat" /usr
/share
/daed
/geoip.dat
76 # thanks to @MarksonHon
77 newinitd
"${FILESDIR}"/${PN}.initd daed
82 elog
"For OpenRC user, if you want to use"
83 elog
"openrc to manager daed service,"
84 elog
"please refer to dae document to modify"
85 elog
"rc.conf and sysfs first, then reboot."
86 elog
"https://github.com/daeuniverse/dae/blob/main/docs/en/tutorials/run-on-alpine.md"
87 elog
"Now you can start and add it to default runlevel "
88 elog
"# rc-service daed start"
89 elog
"# rc-update add daed default"