add postinst to rpm

This commit is contained in:
jb-alvarado 2022-06-27 14:55:34 +02:00
parent ec00367901
commit 1494cbfdac
2 changed files with 12 additions and 1 deletions

10
debian/postinst vendored
View File

@ -6,5 +6,13 @@ if [ ! -d "/usr/share/ffplayout/db" ]; then
/usr/bin/ffpapi -i /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 fi

View File

@ -70,4 +70,7 @@ assets = [
{ source = "../README.md", dest = "/usr/share/doc/ffplayout/README", mode = "644", doc = true }, { source = "../README.md", dest = "/usr/share/doc/ffplayout/README", mode = "644", doc = true },
{ source = "../LICENSE", dest = "/usr/share/doc/ffplayout/LICENSE", mode = "644" }, { source = "../LICENSE", dest = "/usr/share/doc/ffplayout/LICENSE", mode = "644" },
{ source = "../assets/logo.png", dest = "/usr/share/ffplayout/logo.png", 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"