aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Fechner <mfechner@FreeBSD.org>2026-04-08 06:32:13 +0000
committerMatthias Fechner <mfechner@FreeBSD.org>2026-04-08 06:34:02 +0000
commitd1cd65d39dca2bfa2ab96938df1a5f8b54385a54 (patch)
tree9f0a4ed5ba487f7d689478e529a2fd6e284abc5b
parentefed77193807757891b4723ea02f72fe89621aa0 (diff)
www/evcc: add version 0.304.1
Software to enhance charging of electric vehicle. evcc can be used as an energy management system. See here for more details: https://evcc.io/
-rw-r--r--GIDs2
-rw-r--r--UIDs2
-rw-r--r--www/Makefile1
-rw-r--r--www/evcc/Makefile50
-rw-r--r--www/evcc/distinfo7
-rw-r--r--www/evcc/files/evcc.in55
-rw-r--r--www/evcc/pkg-descr6
-rw-r--r--www/evcc/pkg-message35
8 files changed, 156 insertions, 2 deletions
diff --git a/GIDs b/GIDs
index 17de833c18ed..9871200f4fb5 100644
--- a/GIDs
+++ b/GIDs
@@ -340,7 +340,7 @@ ldap:*:389:
rtorrent:*:397:
tiarra:*:398:
# free: 399
-# free: 400
+evcc:*:400:
# free: 401
# free: 402
# free: 403
diff --git a/UIDs b/UIDs
index b09dd1f16156..fe9a88c867a5 100644
--- a/UIDs
+++ b/UIDs
@@ -346,7 +346,7 @@ ldap:*:389:389::0:0:OpenLDAP Server:/nonexistent:/usr/sbin/nologin
rtorrent:*:397:397::0:0:rtorrent Daemon User:/nonexistent:/usr/sbin/nologin
tiarra:*:398:398::0:0:Tiarra IRC Proxy:/nonexistent:/usr/sbin/nologin
# free: 399
-# free: 400
+evcc:*:400:400::0:0:evcc Daemon:/nonexistent:/usr/sbin/nologin
# free: 401
# free: 402
# free: 403
diff --git a/www/Makefile b/www/Makefile
index 288db9e71365..a7518a5a7f41 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -185,6 +185,7 @@
SUBDIR += eolie
SUBDIR += ephemera
SUBDIR += epiphany
+ SUBDIR += evcc
SUBDIR += fabio
SUBDIR += falkon
SUBDIR += fancybox
diff --git a/www/evcc/Makefile b/www/evcc/Makefile
new file mode 100644
index 000000000000..586eba9c0bc2
--- /dev/null
+++ b/www/evcc/Makefile
@@ -0,0 +1,50 @@
+PORTNAME= evcc
+DISTVERSION= 0.304.1
+CATEGORIES= www
+MASTER_SITES= LOCAL/mfechner/${PORTNAME}/:npmcache
+DISTFILES= ${PORTNAME}-npm-cache-${DISTVERSION}${EXTRACT_SUFX}:npmcache
+
+MAINTAINER= mfechner@FreeBSD.org
+COMMENT= Extensible EV Charge Controller
+WWW= https://evcc.io/ \
+ https://github.com/evcc-io/evcc
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+BUILD_DEPENDS= npm>0:www/npm
+
+USES= gmake go:1.26+,modules,no_targets nodejs:lts,build tar:zstd
+
+USE_GITHUB= yes
+GH_ACCOUNT= evcc-io
+USE_RC_SUBR= ${PORTNAME}
+GO_MOD_DIST= github
+GO_MODULE= github.com/evcc-io/evccmain
+
+MAKE_ENV= npm_config_offline=true
+# parallel build failed in my tests, so disable it here
+MAKE_JOBS_UNSAFE=yes
+ALL_TARGET= default
+
+USERS= evcc
+GROUPS= evcc
+
+PLIST_FILES= bin/${PORTNAME}
+
+pre-build:
+ cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} npm ci --legacy-peer-deps
+ #cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} npm run build
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/evcc ${STAGEDIR}${PREFIX}/bin
+
+# (for maintainer) helper target to generate node_modules tarball
+make-npm-cache: patch
+ @cd ${WRKDIR} && ${RM} -r .npm
+ @cd ${WRKSRC} && ${SETENV} HOME=${WRKDIR} npm ci --legacy-peer-deps
+ @cd ${WRKDIR} \
+ && ${TAR} -c --zstd -f ${PORTNAME}-npm-cache-${DISTVERSION}${EXTRACT_SUFX} .npm \
+ && ${ECHO} "Please upload the file: scp ${WRKDIR}/${PORTNAME}-npm-cache-${DISTVERSION}${EXTRACT_SUFX} mfechner@freefall.freebsd.org:public_distfiles/${PORTNAME}/"
+
+.include <bsd.port.mk>
diff --git a/www/evcc/distinfo b/www/evcc/distinfo
new file mode 100644
index 000000000000..ffe3516a9572
--- /dev/null
+++ b/www/evcc/distinfo
@@ -0,0 +1,7 @@
+TIMESTAMP = 1775594949
+SHA256 (go/www_evcc/evcc-io-evcc-0.304.1_GH0/evcc-npm-cache-0.304.1.tar.zst) = 9107309843175aff7653b9852e41b59910362d684d0b698631e947de43c3fce6
+SIZE (go/www_evcc/evcc-io-evcc-0.304.1_GH0/evcc-npm-cache-0.304.1.tar.zst) = 100180494
+SHA256 (go/www_evcc/evcc-io-evcc-0.304.1_GH0/go.mod) = 4397db753eca6cae55e970c879b369d22ad700dea9ec1ca94e9c18a899afef26
+SIZE (go/www_evcc/evcc-io-evcc-0.304.1_GH0/go.mod) = 12776
+SHA256 (go/www_evcc/evcc-io-evcc-0.304.1_GH0/evcc-io-evcc-0.304.1_GH0.tar.gz) = 06d7cfd668a8826e414dc128abb98e8544180a0670fa5e98471f425e796d1c52
+SIZE (go/www_evcc/evcc-io-evcc-0.304.1_GH0/evcc-io-evcc-0.304.1_GH0.tar.gz) = 2811294
diff --git a/www/evcc/files/evcc.in b/www/evcc/files/evcc.in
new file mode 100644
index 000000000000..abae8d9a83f4
--- /dev/null
+++ b/www/evcc/files/evcc.in
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+# PROVIDE: evcc
+# REQUIRE: NETWORKING
+# KEYWORD: shutdown
+
+. /etc/rc.subr
+
+name="evcc"
+rcvar=evcc_enable
+
+load_rc_config $name
+
+: ${evcc_enable:="NO"}
+: ${evcc_user:="evcc"}
+: ${evcc_group:="evcc"}
+: ${evcc_command:="/usr/local/bin/evcc"}
+: ${evcc_dbdir:="/var/db/evcc"}
+: ${evcc_log:="/var/log/evcc.log"}
+
+logfile="/var/log/${name}.log"
+pidfile="/var/run/${name}/${name}.pid"
+workingdir="/var/empty"
+
+command="/usr/sbin/daemon"
+# -r = restart on exit
+# -f = stay in foreground (rc handles it)
+# -P = write pidfile
+# -u = run as user
+# -o = log output
+command_args="-H -r -f -o ${logfile} -P ${pidfile} -t ${name} \
+ /bin/sh -c 'cd ${workingdir} && ${evcc_command} --database ${evcc_dbdir}/evcc.db'"
+
+start_precmd="${name}_precmd"
+start_cmd="${name}_start"
+
+evcc_precmd() {
+ echo "Preparing ${name} environment..."
+
+ # Create required directories
+ install -d -o ${evcc_user} -g ${evcc_group} ${evcc_dbdir}
+ install -d -o ${evcc_user} -g ${evcc_group} /var/run/${name}
+
+ # Ensure log file exists and is writable
+ touch ${evcc_log}
+ chown ${evcc_user}:${evcc_group} ${evcc_log}
+}
+
+evcc_start() {
+ echo "Starting ${name}"
+ su -m ${evcc_user} -c "${command} ${command_args}"
+}
+
+run_rc_command "$1"
+
diff --git a/www/evcc/pkg-descr b/www/evcc/pkg-descr
new file mode 100644
index 000000000000..efbbb9f1bb81
--- /dev/null
+++ b/www/evcc/pkg-descr
@@ -0,0 +1,6 @@
+evcc is an extensible EV Charge Controller and home energy management system.
+
+evcc optimizes charging your electric vehicle with self-generated solar energy
+or low-cost electricity tariffs. The software works across manufacturers with
+hundreds of wallboxes, solar systems, and vehicles. evcc runs locally on a
+Raspberry Pi or NAS - no cloud required.
diff --git a/www/evcc/pkg-message b/www/evcc/pkg-message
new file mode 100644
index 000000000000..5bffe2e487b7
--- /dev/null
+++ b/www/evcc/pkg-message
@@ -0,0 +1,35 @@
+[
+{ type: install
+ message: <<EOM
+To run evcc on startup, execute:
+sysrc evcc_enable="YES"
+
+To start evcc directly:
+service evcc start
+
+evcc listen by default on port 127.0.0.1:7070, but a reverse proxy like nginx before:
+location / {
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header Host $http_host;
+
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection "upgrade";
+
+ proxy_redirect off;
+ proxy_read_timeout 240s;
+
+ proxy_http_version 1.1;
+
+ proxy_pass http://127.0.0.1:7070;
+}
+
+After this access evcc via browser and set your admin password.
+evcc is using database only mode, so no need to modify any configuration file.
+
+Check the manual for more information:
+https://docs.evcc.io/docs/Home
+
+EOM
+}
+]