Initial commit

Signed-off-by: Scott R. Shinn <scott@atomicorp.com>
This commit is contained in:
Scott R. Shinn 2024-05-23 09:01:03 -04:00
commit 3164410be5
No known key found for this signature in database
GPG Key ID: EE1B0E6B2D8387B7
5 changed files with 280 additions and 0 deletions

0
README.md Normal file
View File

17
SOURCES/owncast.service Normal file
View File

@ -0,0 +1,17 @@
[Unit]
Description=Owncast Service
After=network.target
[Service]
Type=simple
User=owncast
Group=owncast
ExecStart=/usr/bin/owncast
Restart=on-failure
RestartSec=10
WorkingDirectory=/var/lib/owncast
Environment=OWNCAST_DIR=/var/lib/owncast
[Install]
WantedBy=multi-user.target

97
mock/el9-aarch64.cfg Normal file
View File

@ -0,0 +1,97 @@
config_opts['root'] = 'el9-aarch64'
config_opts['target_arch'] = 'aarch64'
config_opts['legal_host_arches'] = ('aarch64',)
config_opts['chroot_setup_cmd'] = 'install bash bzip2 coreutils cpio diffutils redhat-release findutils gawk glibc-minimal-langpack grep gzip info patch redhat-rpm-config rpm-build sed shadow-utils tar unzip util-linux which xz'
config_opts['dist'] = 'el9' # only useful for --resultdir variable subst
config_opts['extra_chroot_dirs'] = [ '/run/lock', ]
config_opts['releasever'] = '9'
config_opts['package_manager'] = 'dnf'
config_opts['bootstrap_image'] = 'quay.io/rockylinux/rockylinux:9'
config_opts['rpmbuild_networking'] = True
config_opts['use_host_resolv'] = True
config_opts['yum.conf'] = """
[main]
keepcache=1
debuglevel=2
reposdir=/dev/null
logfile=/var/log/yum.log
retries=20
obsoletes=1
gpgcheck=0
assumeyes=1
install_weak_deps=0
syslog_ident=mock
syslog_device=
mdpolicy=group:primary
best=1
metadata_expire=0
module_platform_id=platform:el9
# repos
[baseos]
name=Rocky Linux $releasever - BaseOS
mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=BaseOS-$releasever
#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/BaseOS/$basearch/os/
gpgcheck=0
enabled=1
countme=1
metadata_expire=6h
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9
[appstream]
name=Rocky Linux $releasever - AppStream
mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=AppStream-$releasever
#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/AppStream/$basearch/os/
gpgcheck=0
enabled=1
countme=1
metadata_expire=6h
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9
[extras]
name=Rocky Linux $releasever - Extras
mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=extras-$releasever
#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/extras/$basearch/os/
gpgcheck=0
enabled=1
countme=1
metadata_expire=6h
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9
[epel]
name=Extra Packages for Enterprise Linux $releasever - $basearch
# It is much more secure to use the metalink, but if you wish to use a local mirror
# place its address here.
#baseurl=https://download.example/pub/epel/$releasever/Everything/$basearch/
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-$releasever&arch=$basearch
enabled=1
gpgcheck=0
countme=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-$releasever
[crb]
name=Rocky Linux $releasever - CRB
mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=CRB-$releasever
#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/CRB/$basearch/os/
gpgcheck=0
enabled=1
countme=1
metadata_expire=6h
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9
#[go-repo]
#name=go-repo - CentOS
#baseurl=https://mirror.go-repo.io/centos/$releasever/$basearch/
#enabled=1
#gpgcheck=1
#gpgkey=https://mirror.go-repo.io/centos/RPM-GPG-KEY-GO-REPO
"""

97
mock/el9-x86_64.cfg Normal file
View File

@ -0,0 +1,97 @@
config_opts['root'] = 'el9-x86_64'
config_opts['target_arch'] = 'x86_64'
config_opts['legal_host_arches'] = ('x86_64',)
config_opts['chroot_setup_cmd'] = 'install bash bzip2 coreutils cpio diffutils redhat-release findutils gawk glibc-minimal-langpack grep gzip info patch redhat-rpm-config rpm-build sed shadow-utils tar unzip util-linux which xz'
config_opts['dist'] = 'el9' # only useful for --resultdir variable subst
config_opts['extra_chroot_dirs'] = [ '/run/lock', ]
config_opts['releasever'] = '9'
config_opts['package_manager'] = 'dnf'
config_opts['bootstrap_image'] = 'quay.io/rockylinux/rockylinux:9'
config_opts['rpmbuild_networking'] = True
config_opts['use_host_resolv'] = True
config_opts['yum.conf'] = """
[main]
keepcache=1
debuglevel=2
reposdir=/dev/null
logfile=/var/log/yum.log
retries=20
obsoletes=1
gpgcheck=0
assumeyes=1
install_weak_deps=0
syslog_ident=mock
syslog_device=
mdpolicy=group:primary
best=1
metadata_expire=0
module_platform_id=platform:el9
# repos
[baseos]
name=Rocky Linux $releasever - BaseOS
mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=BaseOS-$releasever
#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/BaseOS/$basearch/os/
gpgcheck=0
enabled=1
countme=1
metadata_expire=6h
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9
[appstream]
name=Rocky Linux $releasever - AppStream
mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=AppStream-$releasever
#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/AppStream/$basearch/os/
gpgcheck=0
enabled=1
countme=1
metadata_expire=6h
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9
[extras]
name=Rocky Linux $releasever - Extras
mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=extras-$releasever
#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/extras/$basearch/os/
gpgcheck=0
enabled=1
countme=1
metadata_expire=6h
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9
[epel]
name=Extra Packages for Enterprise Linux $releasever - $basearch
# It is much more secure to use the metalink, but if you wish to use a local mirror
# place its address here.
#baseurl=https://download.example/pub/epel/$releasever/Everything/$basearch/
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-$releasever&arch=$basearch
enabled=1
gpgcheck=0
countme=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-$releasever
[crb]
name=Rocky Linux $releasever - CRB
mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=CRB-$releasever
#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/CRB/$basearch/os/
gpgcheck=0
enabled=1
countme=1
metadata_expire=6h
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9
#[go-repo]
#name=go-repo - CentOS
#baseurl=https://mirror.go-repo.io/centos/$releasever/$basearch/
#enabled=1
#gpgcheck=1
#gpgkey=https://mirror.go-repo.io/centos/RPM-GPG-KEY-GO-REPO
"""

69
owncast.spec Normal file
View File

@ -0,0 +1,69 @@
%global debug_package %{nil}
Name: owncast
Version: 0.1.3
Release: 0.1%{?dist}
Summary: Self-hosted live video and web chat server
License: MIT
URL: https://owncast.online
Source0: https://github.com/owncast/owncast/archive/v%{version}/%{name}-%{version}.tar.gz
Source1: owncast.service
BuildRequires: golang
Requires: glibc
%description
Owncast is a self-hosted live video and web chat server for use with existing popular broadcasting software.
%prep
%setup -q
%build
#export CGO_ENABLED=0
go build -ldflags "-buildid=owncast_build_id" -o %{name}
%install
install -d %{buildroot}%{_bindir}
install -m 0755 %{name} %{buildroot}%{_bindir}/%{name}
install -d %{buildroot}/usr/lib/systemd/system/
install -m 644 %{SOURCE1} %{buildroot}/usr/lib/systemd/system/%{name}.service
install -d %{buildroot}/var/lib/owncast
%pre
getent group owncast >/dev/null || groupadd -r owncast
getent passwd owncast >/dev/null || useradd -r -g owncast -d /var/lib/owncast -s /sbin/nologin -c "Owncast User" owncast
mkdir -p /var/lib/owncast
chown owncast:owncast /var/lib/owncast
%post
systemctl daemon-reload
%preun
if [ $1 -eq 0 ]; then
systemctl stop owncast.service
systemctl disable owncast.service
fi
%postun
if [ $1 -eq 0 ]; then
userdel owncast
groupdel owncast
rm -rf /var/lib/owncast
systemctl daemon-reload
fi
%files
%{_bindir}/%{name}
/usr/lib/systemd/system/%{name}.service
%changelog
* Wed May 22 2024 Your Name <scott@atomicrocketturtle.com> - 0.1.3-1
- Initial package for Owncast