feat: initial setup
Some checks failed
continuous-integration/drone/push Build is failing

- add Makefile
- add spec file
This commit is contained in:
Ben Vincent 2024-08-26 23:08:36 +10:00
parent 734b9f3543
commit c94c534367
4 changed files with 119 additions and 0 deletions

36
.drone.yml Normal file
View File

@ -0,0 +1,36 @@
kind: pipeline
type: docker
name: almalinux8
trigger:
event:
include:
- push
- pull_request
steps:
- name: build
image: git.query.consul/unkin/almalinux8:latest
commands:
# Install the required packages using custom repositories
- dnf module install -y nodejs:20
- dnf install -y gcc gcc-c++ make patch autoconf automake libtool rpm-build nodejs npm git curl wget which
# Run the `make` command
- make build
- name: upload
image: git.query.consul/unkin/almalinux8:latest
environment:
GITEA_PASSWORD:
from_secret: gitea_password
commands:
- >
for rpm in /drone/src/rpmbuild/RPMS/*/*.rpm; do
curl --user droneci:$GITEA_PASSWORD --upload-file $rpm https://git.query.consul/api/packages/unkin/rpm/almalinux/el8/upload
done
when:
branch:
- master
event:
- push

31
Makefile Normal file
View File

@ -0,0 +1,31 @@
.PHONY: all prep download build clean
NAME := jellyfin-web
RPMBUILD := /drone/src/rpmbuild
SOURCES := $(RPMBUILD)/SOURCES
SPECS := $(RPMBUILD)/SPECS
SPECFILE := $(NAME).spec
# Extract the version from the spec file
VERSION := $(shell grep "^Version:" $(SPECFILE) | awk '{print $$2}')
all: build
prep:
@echo "Creating rpmbuild directories..."
@mkdir -p $(RPMBUILD)/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
download: prep
@echo "Downloading sources..."
@wget -O $(SOURCES)/$(NAME)-$(VERSION).tar.gz https://github.com/jellyfin/jellyfin-web/archive/refs/tags/v$(VERSION).tar.gz
@echo "Sources downloaded."
build: $(SPECFILE) download
@echo "Building RPM..."
@rpmbuild -ba --define "_topdir $(RPMBUILD)" $(SPECFILE)
@echo "RPM built."
clean:
@echo "Cleaning up..."
@rm -rf $(RPMBUILD)
@echo "Clean up done."

View File

@ -1,5 +1,7 @@
# RPMBuild: jellyfin-web
[![Build Status](https://droneci.query.consul/api/badges/unkin/rpmbuild-jellyfin-web/status.svg)](https://droneci.query.consul/unkin/rpmbuild-jellyfin-web)
## Overview
This project provides an RPM package that installs the jellyfin-web package.

50
jellyfin-web.spec Normal file
View File

@ -0,0 +1,50 @@
%global debug_package %{nil}
Name: jellyfin-web
Version: 10.9.10
Release: 1%{?dist}
Summary: The Free Software Media System web client
License: GPLv2
URL: https://jellyfin.org
Source0: %{name}-%{version}.tar.gz
BuildArch: noarch
%if 0%{?rhel} > 0 && 0%{?rhel} < 8
BuildRequires: nodejs
%else
BuildRequires: git
%if 0%{?fedora} >= 37
BuildRequires: nodejs-npm
%else
BuildRequires: npm
%endif
%endif
%description
Jellyfin is a free software media system that puts you in control of managing and streaming your media.
%prep
%autosetup -n jellyfin-web-%{version} -b 0
%if 0%{?rhel} > 0 && 0%{?rhel} < 8
# Required for CentOS build
chown root:root -R .
%endif
%build
npm ci --no-audit --unsafe-perm
%install
ls -lha
%{__mkdir} -p %{buildroot}%{_libdir}/jellyfin/jellyfin-web
%{__cp} -r dist/* %{buildroot}%{_libdir}/jellyfin/jellyfin-web
%files
%defattr(644,root,root,755)
%{_libdir}/jellyfin/jellyfin-web
%license LICENSE
%changelog
* Mon Aug 26 2024 Ben Vincent <ben@unkin.net> - 10.9.10
- Initial package