1
0
mirror of https://github.com/rd235/cado synced 2024-12-27 06:24:11 +01:00

[CMake] PostInstall refactoring

PostInstall was refactored to mimick the debian installer.
This commit is contained in:
Davide Berardi 2020-01-31 18:00:51 +01:00
parent 5e294e0a8c
commit 14c8d46714

View File

@ -1,11 +1,25 @@
execute_process(COMMAND bash "-c" execute_process(COMMAND bash -c "\
"(useradd -r -s /bin/nologin -g `getent passwd | grep cado | cut -f 3 -d ':'` cado || useradd -r -s /bin/nologin -U cado) || true;\ if ! getent group _cado >/dev/null 2>&1; then
mkdir -p /usr/local/var/spool/cado;\ groupadd \
chown root:cado /usr/local/var/spool/cado && chmod 4770 /usr/local/var/spool/cado;\ --system \
chown :cado ${BINDIR}/scado;\ _cado;
chmod g+s ${BINDIR}/scado;\ fi")
chown cado ${BINDIR}/cado;\ execute_process(COMMAND bash -c "\
chmod u+s ${BINDIR}/cado;\ if ! getent passwd _cado >/dev/null 2>&1; then
ldconfig ${LIBDIR};\ useradd \
${BINDIR}/cado -s" --no-create-home \
) --home-dir /nonexistent \
--system \
--shell /bin/nologin \
-g _cado \
_cado;
fi")
execute_process(COMMAND mkdir -p /usr/local/var/spool/cado)
execute_process(COMMAND chown root:_cado /usr/local/var/spool/cado)
execute_process(COMMAND chmod 4770 /usr/local/var/spool/cado)
execute_process(COMMAND chown :_cado ${BINDIR}/scado)
execute_process(COMMAND chmod g+s ${BINDIR}/scado)
execute_process(COMMAND chown _cado: ${BINDIR}/cado)
execute_process(COMMAND chmod u+s ${BINDIR}/cado)
execute_process(COMMAND ldconfig ${LIBDIR})
execute_process(COMMAND ${BINDIR}/cado --setup)