diff --git a/Cargo.toml b/Cargo.toml index 60137583..68c2645c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -81,6 +81,11 @@ assets = [ "/usr/bin/ffplayout", "755" ], + [ + "target/x86_64-unknown-linux-musl/release/ffpapi", + "/usr/bin/ffpapi", + "755" + ], ["assets/ffplayout.yml", "/etc/ffplayout/ffplayout.yml", "644"], ["assets/logo.png", "/usr/share/ffplayout/logo.png", "644"], ["README.md", "/usr/share/doc/ffplayout-engine/README", "644"], @@ -94,6 +99,7 @@ name = "ffplayout-engine" license = "GPL-3.0" assets = [ { source = "target/x86_64-unknown-linux-musl/release/ffplayout", dest = "/usr/bin/ffplayout", mode = "755" }, + { source = "target/x86_64-unknown-linux-musl/release/ffpapi", dest = "/usr/bin/ffpapi", mode = "755" }, { source = "assets/ffplayout.yml", dest = "/etc/ffplayout/ffplayout.yml", mode = "644", config = true }, { source = "assets/ffplayout-engine.service", dest = "/lib/systemd/system/ffplayout-engine.service", mode = "644" }, { source = "README.md", dest = "/usr/share/doc/ffplayout-engine/README", mode = "644", doc = true }, diff --git a/assets/ffpapi.service b/assets/ffpapi.service new file mode 100644 index 00000000..3cd83f38 --- /dev/null +++ b/assets/ffpapi.service @@ -0,0 +1,14 @@ +[Unit] +Description=Rest API for ffplayout +After=network.target remote-fs.target + +[Service] +ExecStart= /usr/bin/ffpapi +ExecReload=/bin/kill -1 $MAINPID +Restart=always +RestartSec=1 +User=www-data +Group=www-data + +[Install] +WantedBy=multi-user.target diff --git a/cross_compile_all.sh b/cross_compile_all.sh index 7e0f0a0c..957d4852 100755 --- a/cross_compile_all.sh +++ b/cross_compile_all.sh @@ -25,16 +25,18 @@ for target in "${targets[@]}"; do fi cp ./target/${target}/release/ffplayout.exe . - zip -r "ffplayout-engine-v${version}_${target}.zip" assets docs LICENSE README.md ffplayout.exe -x *.db - rm -f ffplayout.exe + cp ./target/${target}/release/ffpapi.exe . + zip -r "ffplayout-engine-v${version}_${target}.zip" assets docs LICENSE README.md ffplayout.exe ffpapi.exe -x *.db + rm -f ffplayout.exe ffpapi.exe else if [[ -f "ffplayout-engine-v${version}_${target}.tar.gz" ]]; then rm -f "ffplayout-engine-v${version}_${target}.tar.gz" fi cp ./target/${target}/release/ffplayout . - tar -czvf "ffplayout-engine-v${version}_${target}.tar.gz" --exclude='*.db' assets docs LICENSE README.md ffplayout - rm -f ffplayout + cp ./target/${target}/release/ffpapi . + tar -czvf "ffplayout-engine-v${version}_${target}.tar.gz" --exclude='*.db' assets docs LICENSE README.md ffplayout ffpapi + rm -f ffplayout ffpapi fi echo ""