mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-07 17:12:51 +02:00
Proposed rpm build spec
This commit is contained in:
parent
3de72946a6
commit
b072b90eef
10 changed files with 292 additions and 0 deletions
18
rpm/athena-assignment-client.service
Normal file
18
rpm/athena-assignment-client.service
Normal file
|
@ -0,0 +1,18 @@
|
|||
[Unit]
|
||||
Description=Assignment client service for Athena server
|
||||
After=network.target
|
||||
PartOf=athena-server.target
|
||||
|
||||
[Service]
|
||||
Restart=always
|
||||
|
||||
WorkingDirectory=/var/lib/athena
|
||||
Environment="LD_LIBRARY_PATH=/usr/share/athena/lib"
|
||||
User=athena
|
||||
Group=athena
|
||||
#LimitCORE=infinity
|
||||
#ExecStart=/usr/share/athena/assignment-client -n 6
|
||||
ExecStart=/usr/share/athena/assignment-client --min 6 --max 20
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
20
rpm/athena-assignment-client@.service
Normal file
20
rpm/athena-assignment-client@.service
Normal file
|
@ -0,0 +1,20 @@
|
|||
[Unit]
|
||||
Description=Assignment client service for Athena server
|
||||
After=network.target
|
||||
PartOf=athena-server@%i.target
|
||||
|
||||
[Service]
|
||||
Restart=always
|
||||
|
||||
WorkingDirectory=/var/lib/athena
|
||||
EnvironmentFile=/etc/athena/%i.conf
|
||||
Environment="LD_LIBRARY_PATH=/usr/share/athena/lib" "HOME=/var/lib/athena/%i"
|
||||
PrivateTmp=true
|
||||
User=athena
|
||||
Group=athena
|
||||
#LimitCORE=infinity
|
||||
#ExecStart=/usr/share/athena/assignment-client -n 6
|
||||
ExecStart=/usr/share/athena/assignment-client --min 6 --max 20 --server-port $HIFI_DOMAIN_SERVER_PORT
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
18
rpm/athena-domain-server.service
Normal file
18
rpm/athena-domain-server.service
Normal file
|
@ -0,0 +1,18 @@
|
|||
[Unit]
|
||||
Description=Domain Server service for Athena
|
||||
After=network.target
|
||||
PartOf=athena-server.target
|
||||
|
||||
[Service]
|
||||
Restart=on-failure
|
||||
|
||||
WorkingDirectory=/var/lib/athena
|
||||
Environment="LD_LIBRARY_PATH=/usr/share/athena/lib"
|
||||
User=athena
|
||||
Group=athena
|
||||
#LimitCORE=infinity
|
||||
#ExecStartPre=/bin/bash -c 'if /usr/bin/pgrep -l domain-server; then /usr/bin/pkill -SIGKILL -f /usr/share/hifi/domain-server/domain-server; fi'
|
||||
ExecStart=/usr/share/athena/domain-server
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
20
rpm/athena-domain-server@.service
Normal file
20
rpm/athena-domain-server@.service
Normal file
|
@ -0,0 +1,20 @@
|
|||
[Unit]
|
||||
Description=Domain Server service for Athena
|
||||
After=network.target
|
||||
PartOf=athena-server@%i.target
|
||||
|
||||
[Service]
|
||||
Restart=on-failure
|
||||
|
||||
WorkingDirectory=/var/lib/athena
|
||||
EnvironmentFile=/etc/athena/%i.conf
|
||||
Environment="LD_LIBRARY_PATH=/usr/share/athena/lib" "HOME=/var/lib/athena/%i"
|
||||
PrivateTmp=true
|
||||
User=athena
|
||||
Group=athena
|
||||
#LimitCORE=infinity
|
||||
#ExecStartPre=/bin/bash -c 'if /usr/bin/pgrep -l domain-server; then /usr/bin/pkill -SIGKILL -f /usr/share/hifi/domain-server/domain-server; fi'
|
||||
ExecStart=/usr/share/athena/domain-server
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
18
rpm/athena-ice-server.service
Normal file
18
rpm/athena-ice-server.service
Normal file
|
@ -0,0 +1,18 @@
|
|||
[Unit]
|
||||
Description=Ice Server service for Athena
|
||||
After=network.target
|
||||
PartOf=athena-server.target
|
||||
|
||||
[Service]
|
||||
Restart=on-failure
|
||||
|
||||
Environment="HIFI_ENVIRONMENT=production" "LD_LIBRARY_PATH=/usr/share/athena/lib"
|
||||
WorkingDirectory=/var/lib/athena
|
||||
User=athena
|
||||
Group=athena
|
||||
#ExecStartPre=/bin/bash -c 'if /usr/bin/pgrep -l ice-server; then /usr/bin/pkill -SIGKILL -f /usr/share/hifi/ice-server/ice-server; fi'
|
||||
#LimitCORE=infinity
|
||||
ExecStart=/usr/share/athena/ice-server
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
20
rpm/athena-ice-server@.service
Normal file
20
rpm/athena-ice-server@.service
Normal file
|
@ -0,0 +1,20 @@
|
|||
[Unit]
|
||||
Description=Ice Server service for Athena
|
||||
After=network.target
|
||||
PartOf=athena-server@%i.target
|
||||
|
||||
[Service]
|
||||
Restart=on-failure
|
||||
|
||||
EnvironmentFile=/etc/athena/%i.conf
|
||||
Environment="HIFI_ENVIRONMENT=production" "LD_LIBRARY_PATH=/usr/share/athena/lib" "HOME=/var/lib/athena/%i"
|
||||
PrivateTmp=true
|
||||
WorkingDirectory=/var/lib/athena
|
||||
User=athena
|
||||
Group=athena
|
||||
#ExecStartPre=/bin/bash -c 'if /usr/bin/pgrep -l ice-server; then /usr/bin/pkill -SIGKILL -f /usr/share/hifi/ice-server/ice-server; fi'
|
||||
#LimitCORE=infinity
|
||||
ExecStart=/usr/share/athena/ice-server
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
108
rpm/athena-server.spec
Normal file
108
rpm/athena-server.spec
Normal file
|
@ -0,0 +1,108 @@
|
|||
#ATHENA=~/Athena rpmbuild --target x86_64 -bb athena-server.spec
|
||||
Name: athena-server
|
||||
Version: 0.86.0_K1_20200112_7584429
|
||||
Release: 4%{?dist}
|
||||
Summary: Project Athena metaverse platform, based on the High Fidelity Engine.
|
||||
|
||||
License: ASL 2.0
|
||||
URL: https://projectathena.io
|
||||
Source0: https://github.com/daleglass/athena-builder/blob/master/athena_builder
|
||||
|
||||
#BuildRequires: systemd-rpm-macros
|
||||
BuildRequires: chrpath
|
||||
Requires: alsa-lib, cups, glib2, gtk3, libdrm, libinput, libjpeg-turbo, libtiff, libxkbcommon, libxkbcommon-x11, mesa-libEGL, mesa-libGL, mesa-libgbm, pcre2, pcre2-utf16, sqlite, xkeyboard-config, zlib, at-spi2-core, dbus, fontconfig, harfbuzz, libICE, libSM, libicu, libmng, libpng, libproxy, libxcb, openssl, pcre, pulseaudio-libs, unixODBC, xcb-util-image, xcb-util-keysyms, xcb-util-renderutil, xcb-util-wm, libxcb, nss, jsoncpp, libxslt, libvpx, libicu, libxml2, opus, libicu, libwebp, libXtst
|
||||
BuildArch: x86_64
|
||||
AutoReq: no
|
||||
AutoProv: no
|
||||
|
||||
%description
|
||||
Project Athena allows creation and sharing of VR experiences.
|
||||
The Project Athena metaverse provides built-in social features, including avatar interactions, spatialized audio and interactive physics. Additionally, you have the ability to import any 3D object into your virtual environment.
|
||||
|
||||
|
||||
%prep
|
||||
|
||||
|
||||
%build
|
||||
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
install -d $RPM_BUILD_ROOT/etc/athena
|
||||
install -m 0755 -t $RPM_BUILD_ROOT/etc/athena $ATHENA/source/rpm/new-server
|
||||
install -d $RPM_BUILD_ROOT/usr/share/athena
|
||||
install -m 0755 $ATHENA/build/assignment-client/assignment-client $RPM_BUILD_ROOT/usr/share/athena
|
||||
install -m 0755 $ATHENA/build/domain-server/domain-server $RPM_BUILD_ROOT/usr/share/athena
|
||||
#install -m 0755 $ATHENA/build/ice-server/ice-server $RPM_BUILD_ROOT/usr/share/athena
|
||||
chrpath -d $RPM_BUILD_ROOT/usr/share/athena/*
|
||||
install -d $RPM_BUILD_ROOT/usr/share/athena/lib
|
||||
install -m 0644 -t $RPM_BUILD_ROOT/usr/share/athena/lib $ATHENA/qt5-install/lib/*.so.*.*.*
|
||||
install -m 0644 -t $RPM_BUILD_ROOT/usr/share/athena/lib $ATHENA/build/ext/makefiles/quazip/project/lib/*.so.*.*.*
|
||||
install -d $RPM_BUILD_ROOT/usr/lib/systemd/system
|
||||
install -m 0644 -t $RPM_BUILD_ROOT/usr/lib/systemd/system $ATHENA/source/rpm/athena-assignment-client.service
|
||||
install -m 0644 -t $RPM_BUILD_ROOT/usr/lib/systemd/system $ATHENA/source/rpm/athena-assignment-client@.service
|
||||
install -m 0644 -t $RPM_BUILD_ROOT/usr/lib/systemd/system $ATHENA/source/rpm/athena-domain-server.service
|
||||
install -m 0644 -t $RPM_BUILD_ROOT/usr/lib/systemd/system $ATHENA/source/rpm/athena-domain-server@.service
|
||||
#install -m 0644 -t $RPM_BUILD_ROOT/usr/lib/systemd/system $ATHENA/source/rpm/athena-ice-server.service
|
||||
#install -m 0644 -t $RPM_BUILD_ROOT/usr/lib/systemd/system $ATHENA/source/rpm/athena-ice-server@.service
|
||||
install -m 0644 -t $RPM_BUILD_ROOT/usr/lib/systemd/system $ATHENA/source/rpm/athena-server.target
|
||||
install -m 0644 -t $RPM_BUILD_ROOT/usr/lib/systemd/system $ATHENA/source/rpm/athena-server@.target
|
||||
cp -a $ATHENA/source/domain-server/resources $RPM_BUILD_ROOT/usr/share/athena
|
||||
|
||||
|
||||
%files
|
||||
%license $ATHENA/source/LICENSE
|
||||
/etc/athena
|
||||
/usr/share/athena
|
||||
/usr/lib/systemd/system
|
||||
|
||||
|
||||
%changelog
|
||||
|
||||
|
||||
%post
|
||||
# create users
|
||||
getent passwd athena >/dev/numm 2>&1 || useradd -r -c "Project Athena" -d /var/lib/athena -U -M athena
|
||||
#getent group athena >/dev/null 2>&1 || groupadd -r athena
|
||||
|
||||
# create data folder
|
||||
#mkdir -p /.local && chown root:athena /.local && chmod 775 /.local
|
||||
#mkdir -p /.config && chown root:athena /.config && chmod 775 /.config
|
||||
mkdir -p /var/lib/athena && chown athena:athena /var/lib/athena && chmod 775 /var/lib/athena
|
||||
|
||||
ldconfig -n /usr/share/athena/lib
|
||||
if [ ! -d "/var/lib/athena/default" ]
|
||||
then
|
||||
/etc/athena/new-server default 40100
|
||||
fi
|
||||
|
||||
%systemd_post athena-assignment-client.service
|
||||
%systemd_post athena-assignment-client@.service
|
||||
%systemd_post athena-domain-server.service
|
||||
%systemd_post athena-domain-server@.service
|
||||
#%systemd_post athena-ice-server.service
|
||||
#%systemd_post athena-ice-server@.service
|
||||
%systemd_post athena-server.target
|
||||
%systemd_post athena-server@.target
|
||||
|
||||
|
||||
%preun
|
||||
%systemd_preun athena-server.target
|
||||
%systemd_preun athena-server@.target
|
||||
%systemd_preun athena-assignment-client.service
|
||||
%systemd_preun athena-assignment-client@.service
|
||||
%systemd_preun athena-domain-server.service
|
||||
%systemd_preun athena-domain-server@.service
|
||||
#%systemd_preun athena-ice-server.service
|
||||
#%systemd_preun athena-ice-server@.service
|
||||
|
||||
|
||||
%postun
|
||||
%systemd_postun_with_restart athena-server.target
|
||||
%systemd_postun_with_restart athena-server@.target
|
||||
%systemd_postun_with_restart athena-assignment-client.service
|
||||
%systemd_postun_with_restart athena-assignment-client@.service
|
||||
%systemd_postun_with_restart athena-domain-server.service
|
||||
%systemd_postun_with_restart athena-domain-server@.service
|
||||
#%systemd_postun_with_restart athena-ice-server.service
|
||||
#%systemd_postun_with_restart athena-ice-server@.service
|
11
rpm/athena-server.target
Normal file
11
rpm/athena-server.target
Normal file
|
@ -0,0 +1,11 @@
|
|||
[Unit]
|
||||
Description=Athena virtual domain
|
||||
Wants=athena-assignment-client.service
|
||||
Wants=athena-domain-server.service
|
||||
#Wants=athena-ice-server.service
|
||||
After=athena-assignment-client.service
|
||||
After=athena-domain-server.service
|
||||
#After=athena-ice-server.service
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
11
rpm/athena-server@.target
Normal file
11
rpm/athena-server@.target
Normal file
|
@ -0,0 +1,11 @@
|
|||
[Unit]
|
||||
Description=Athena virtual domain
|
||||
Wants=athena-assignment-client@%i.service
|
||||
Wants=athena-domain-server@%i.service
|
||||
#Wants=athena-ice-server@%i.service
|
||||
After=athena-assignment-client@%i.service
|
||||
After=athena-domain-server@%i.service
|
||||
#After=athena-ice-server@%i.service
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
48
rpm/new-server
Normal file
48
rpm/new-server
Normal file
|
@ -0,0 +1,48 @@
|
|||
#!/bin/sh
|
||||
if [ -z "$1" ] || [ -z "$2" ]; then
|
||||
echo "new-server {name} {base-port}"
|
||||
echo
|
||||
echo "Sets up a new athena server with the specified name and base port number"
|
||||
echo " {name} - a simple name used to identify the server to scripts (not used in the server configuration)"
|
||||
echo " {base-port} - the base port number (default server is 40100). The metaverse port will be {base-port}+2"
|
||||
echo " Four contiguous port numbers are allocated, these must not overlap with other running services on this machine"
|
||||
echo
|
||||
echo "Launching a server created by this script is done with:"
|
||||
echo " sudo systemctl start athena-server@{name}.target"
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
echo "new-server {name} {base-port}"
|
||||
echo
|
||||
echo 'This script must be run by root' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -d "/var/lib/athena/$1" ]; then
|
||||
echo "Path /var/lib/athena/$1 already exists"
|
||||
echo
|
||||
echo "Please remove this path first if you wish to recreate this server"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
mkdir -p /var/lib/athena/$1/.local/share
|
||||
ln -s ../.. /var/lib/athena/$1/.local/share/High\ Fidelity\ -\ dev
|
||||
mkdir -p /var/lib/athena/$1/domain-server
|
||||
echo "{\"metaverse\": {\"local_port\": $(($2 + 2))},\"version\": 2.4}" > /var/lib/athena/$1/domain-server/config.json
|
||||
chown -R athena.athena /var/lib/athena/$1
|
||||
|
||||
echo HIFI_DOMAIN_SERVER_HTTP_PORT=$2 > /etc/athena/$1.conf
|
||||
echo HIFI_DOMAIN_SERVER_HTTPS_PORT=$(($2 + 1)) >> /etc/athena/$1.conf
|
||||
echo HIFI_DOMAIN_SERVER_PORT=$(($2 + 2)) >> /etc/athena/$1.conf
|
||||
echo HIFI_DOMAIN_SERVER_DTLS_PORT=$(($2 + 3)) >> /etc/athena/$1.conf
|
||||
|
||||
echo "A new athena server has been created with the name of '$1'"
|
||||
echo
|
||||
echo "To launch it:"
|
||||
echo " sudo systemctl start athena-server@$1.target"
|
||||
echo "To have it launch at system start:"
|
||||
echo " sudo systemctl enable athena-server@$1.target"
|
||||
echo "The server configuration console is available at:"
|
||||
echo " http://localhost:$2"
|
Loading…
Reference in a new issue