From 1494cbfdacb420cab7214e8104cb352d21675e94 Mon Sep 17 00:00:00 2001 From: jb-alvarado Date: Mon, 27 Jun 2022 14:55:34 +0200 Subject: [PATCH] add postinst to rpm --- debian/postinst | 10 +++++++++- ffplayout-engine/Cargo.toml | 3 +++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/debian/postinst b/debian/postinst index b4bc4c02..b3429e61 100644 --- a/debian/postinst +++ b/debian/postinst @@ -6,5 +6,13 @@ if [ ! -d "/usr/share/ffplayout/db" ]; then /usr/bin/ffpapi -i - chown www-data. "/usr/share/ffplayout/db/ffplayout.db" + if id "www-data" &>/dev/null; then + chown www-data. "/usr/share/ffplayout/db/ffplayout.db" + else + sed -i "s|www-data|root|g" /lib/systemd/system/ffpapi.service + sed -i "s|www-data|root|g" /lib/systemd/system/ffplayout.service + rm -f /etc/sudoers.d/11-ffplayout + + systemctl daemon-reload + fi fi diff --git a/ffplayout-engine/Cargo.toml b/ffplayout-engine/Cargo.toml index 313763ae..e7c88472 100644 --- a/ffplayout-engine/Cargo.toml +++ b/ffplayout-engine/Cargo.toml @@ -70,4 +70,7 @@ assets = [ { source = "../README.md", dest = "/usr/share/doc/ffplayout/README", mode = "644", doc = true }, { source = "../LICENSE", dest = "/usr/share/doc/ffplayout/LICENSE", mode = "644" }, { source = "../assets/logo.png", dest = "/usr/share/ffplayout/logo.png", mode = "644" }, + { source = "../debian/postinst", dest = "/usr/share/ffplayout/postinst", mode = "755" }, ] +auto-req = "no" +post_install_script = "/usr/share/ffplayout/postinst"