diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..5f5b333 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +alvr (20.14.1-1rakuos1) rakuos; urgency=medium + + * inital packaging + + -- Joshua Webb Tue, 09 Dec 2025 17:19:38 GMT diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..c6c31db --- /dev/null +++ b/debian/control @@ -0,0 +1,13 @@ +Source: alvr +Section: admin +Priority: optional +Maintainer: ferreo +Standards-Version: 4.6.1 +Build-Depends: + debhelper-compat (= 13), +Rules-Requires-Root: no + +Package: alvr +Architecture: linux-any +Depends: ${misc:Depends}, ${shlibs:Depends}, libunwind8, mesa-vulkan-drivers, libdrm2 +Description: Stream VR games from your PC to your headset via Wi-Fi. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..5367d2a --- /dev/null +++ b/debian/copyright @@ -0,0 +1,23 @@ +Copyright (c) 2018-2019 polygraphene +Copyright (c) 2020-2021 alvr-org + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/debian/install b/debian/install new file mode 100644 index 0000000..77a975e --- /dev/null +++ b/debian/install @@ -0,0 +1,2 @@ +alvr_streamer_linux/* opt/alvr/ +usr/* usr/ diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..fc7587c --- /dev/null +++ b/debian/rules @@ -0,0 +1,14 @@ +#!/usr/bin/make -f +# Simple dh (debhelper) build rules file +%: + dh $@ + +override_dh_fixperms: + dh_fixperms + chmod 755 debian/alvr/opt/alvr/bin/alvr_dashboard + chmod u+x debian/alvr/opt/alvr/bin/alvr_dashboard + chmod 755 debian/alvr/usr/games/alvr_dashboard + chmod u+x debian/alvr/usr/games/alvr_dashboard + chmod 755 debian/alvr/usr/share/applications/alvr.desktop + chmod u+x debian/alvr/usr/share/applications/alvr.desktop + diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/usr/games/alvr_dashboard b/usr/games/alvr_dashboard new file mode 100755 index 0000000..0ca7524 --- /dev/null +++ b/usr/games/alvr_dashboard @@ -0,0 +1,2 @@ +#!/bin/bash +exec /opt/alvr/bin/alvr_dashboard "$@" diff --git a/usr/share/alvr/alvr_fw_config.sh b/usr/share/alvr/alvr_fw_config.sh new file mode 100644 index 0000000..fa853c0 --- /dev/null +++ b/usr/share/alvr/alvr_fw_config.sh @@ -0,0 +1,113 @@ +#!/usr/bin/env bash +# Basic script to add / remove firewall configuration for ALVR +# Usage: ./alvr_fw_config.sh add|remove +# Exit codes: +# 1 - Invalid command +# 2 - Invalid action +# 3 - Failed to copy UFW configuration +# 99 - Firewall not found +# 126 - pkexec failed - Request dismissed + +firewalld_cfg() { + # Iterate around each active zone + for zone in $(firewall-cmd --get-active-zones | grep -P --only-matching '^[\w/-]+'); do + if [ "${1}" == 'add' ]; then + # If running or permanent alvr service is missing, add it + if ! firewall-cmd --zone="${zone}" --list-services | grep 'alvr' >/dev/null 2>&1; then + firewall-cmd --zone="${zone}" --add-service='alvr' + fi + if ! firewall-cmd --zone="${zone}" --list-services --permanent | grep 'alvr' >/dev/null 2>&1; then + firewall-cmd --zone="${zone}" --add-service='alvr' --permanent + fi + elif [ "${1}" == 'remove' ]; then + # If running or persistent alvr service exists, remove it + if firewall-cmd --zone="${zone}" --list-services | grep 'alvr' >/dev/null 2>&1; then + firewall-cmd --zone="${zone}" --remove-service='alvr' + fi + if firewall-cmd --zone="${zone}" --list-services --permanent | grep 'alvr' >/dev/null 2>&1; then + firewall-cmd --zone="${zone}" --remove-service='alvr' --permanent + fi + else + exit 2 + fi + done +} + +ufw_cfg() { + # Try and install the application file + if ! ufw app info 'alvr'; then + # Pull application file from local build first if the script lives inside it + if [ -f "$(dirname "$(realpath "${0}")")/ufw-alvr" ]; then + cp "$(dirname "$(realpath "${0}")")/ufw-alvr" '/etc/ufw/applications.d/' + elif [ -f '/usr/share/alvr/ufw-alvr' ]; then + cp '/usr/share/alvr/ufw-alvr' '/etc/ufw/applications.d/' + else + exit 3 + fi + fi + + if [ "${1}" == 'add' ] && ! ufw status | grep 'alvr' >/dev/null 2>&1; then + ufw allow 'alvr' + elif [ "${1}" == 'remove' ] && ufw status | grep 'alvr' >/dev/null 2>&1; then + ufw delete allow 'alvr' + else + exit 2 + fi +} + +iptables_cfg() { + first_port_match_count=$(iptables -S | grep -c '9943') + second_port_match_count=$(iptables -S | grep -c '9944') + if [ "${1}" == 'add' ]; then + if [ "$first_port_match_count" == "0" ] || [ "$second_port_match_count" == "0" ]; then + if [ ! -d '/etc/iptables' ]; then + mkdir '/etc/iptables' + fi + + iptables -I OUTPUT -p tcp --sport 9943 -j ACCEPT + iptables -I INPUT -p tcp --dport 9943 -j ACCEPT + iptables -I OUTPUT -p udp --sport 9943 -j ACCEPT + iptables -I INPUT -p udp --dport 9943 -j ACCEPT + iptables -I OUTPUT -p tcp --sport 9944 -j ACCEPT + iptables -I INPUT -p tcp --dport 9944 -j ACCEPT + iptables -I OUTPUT -p udp --sport 9944 -j ACCEPT + iptables -I INPUT -p udp --dport 9944 -j ACCEPT + iptables-save >/etc/iptables/rules.v4 + fi + elif [ "${1}" == 'remove' ]; then + if [ "$first_port_match_count" == "4" ] || [ "$second_port_match_count" == "4" ]; then + iptables -D OUTPUT -p tcp --sport 9943 -j ACCEPT + iptables -D INPUT -p tcp --dport 9943 -j ACCEPT + iptables -D OUTPUT -p udp --sport 9943 -j ACCEPT + iptables -D INPUT -p udp --dport 9943 -j ACCEPT + iptables -D OUTPUT -p tcp --sport 9944 -j ACCEPT + iptables -D INPUT -p tcp --dport 9944 -j ACCEPT + iptables -D OUTPUT -p udp --sport 9944 -j ACCEPT + iptables -D INPUT -p udp --dport 9944 -j ACCEPT + iptables-save >/etc/iptables/rules.v4 + fi + else + exit 2 + fi +} + +main() { + # If we're not root use pkexec for GUI prompt + if [ "${USER}" == 'root' ]; then + # Check if firewall-cmd exists and firewalld is running + if which firewall-cmd >/dev/null 2>&1 && firewall-cmd --state >/dev/null 2>&1; then + firewalld_cfg "${1,,}" + # Check if ufw exists and is running + elif which ufw >/dev/null 2>&1 && ! ufw status | grep 'Status: inactive' >/dev/null 2>&1; then + ufw_cfg "${1,,}" + elif which iptables >/dev/null 2>&1; then + iptables_cfg "${1,,}" + else + exit 99 + fi + else + pkexec "$(realpath "${0}")" "${@}" + fi +} + +main "${@}" diff --git a/usr/share/applications/alvr.desktop b/usr/share/applications/alvr.desktop new file mode 100644 index 0000000..0cb28b5 --- /dev/null +++ b/usr/share/applications/alvr.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Version=1.0 +Type=Application +Name=ALVR +GenericName=Game +Comment=ALVR is an open source remote VR display which allows playing SteamVR games on a standalone headset such as Gear VR or Oculus Go/Quest. +Exec=alvr_dashboard +Icon=alvr +Categories=Game; +StartupNotify=true +StartupWMClass=alvr.dashboard diff --git a/usr/share/icons/hicolor/scalable/apps/alvr.svg b/usr/share/icons/hicolor/scalable/apps/alvr.svg new file mode 100644 index 0000000..754e662 --- /dev/null +++ b/usr/share/icons/hicolor/scalable/apps/alvr.svg @@ -0,0 +1,97 @@ + + + +ALVR Logoimage/svg+xmlALVR Logo01/12/24Issac DowlingALVR