24
.gitea/workflows/build-rpm.yml
Normal file
24
.gitea/workflows/build-rpm.yml
Normal file
@@ -0,0 +1,24 @@
|
||||
name: build-rpm
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
rpm:
|
||||
runs-on: nixos
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Build RPM
|
||||
run: nix develop .#rpm --command ./scripts/build-rpm.sh
|
||||
|
||||
- name: Upload RPM artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: prem2resolve-rpm
|
||||
path: rpmbuild/RPMS/**/*.rpm
|
||||
@@ -45,6 +45,15 @@
|
||||
pkgs.ffmpeg
|
||||
];
|
||||
};
|
||||
|
||||
devShells.rpm = pkgs.mkShell {
|
||||
buildInputs = [
|
||||
pkgs.git
|
||||
pkgs.gzip
|
||||
pkgs.python3
|
||||
pkgs.rpm-build
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
32
packaging/prem2resolve.spec
Normal file
32
packaging/prem2resolve.spec
Normal file
@@ -0,0 +1,32 @@
|
||||
Name: prem2resolve
|
||||
Version: 0.1.0
|
||||
Release: 1%{?dist}
|
||||
Summary: Convert Premiere Pro XML exports for DaVinci Resolve on Linux
|
||||
License: 0BSD
|
||||
BuildArch: noarch
|
||||
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
|
||||
BuildRequires: python3
|
||||
Requires: python3
|
||||
Requires: ffmpeg
|
||||
|
||||
%description
|
||||
Command-line tool that updates Adobe Premiere Pro XML exports for DaVinci Resolve
|
||||
on Linux, optionally re-encoding MP4 media into Resolve-friendly MOV codecs.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
%build
|
||||
# No build step required for this Python script.
|
||||
|
||||
%install
|
||||
install -D -m 0755 premiere_to_resolve.py %{buildroot}%{_bindir}/prem2resolve
|
||||
|
||||
%files
|
||||
%{_bindir}/prem2resolve
|
||||
|
||||
%changelog
|
||||
* Thu Feb 19 2026 Danilo Reyes <danilo.reyes.251@proton.me> - 0.1.0-1
|
||||
- Initial RPM packaging
|
||||
33
scripts/build-rpm.sh
Executable file
33
scripts/build-rpm.sh
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
|
||||
SPEC_FILE="$ROOT_DIR/packaging/prem2resolve.spec"
|
||||
|
||||
if ! command -v rpmspec >/dev/null 2>&1; then
|
||||
echo "rpmspec not found. Install rpm-build." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
VERSION=$(rpmspec -q --qf '%{version}\n' "$SPEC_FILE" | head -n1)
|
||||
NAME=$(rpmspec -q --qf '%{name}\n' "$SPEC_FILE" | head -n1)
|
||||
|
||||
DIST_DIR="$ROOT_DIR/dist"
|
||||
TOPDIR="$ROOT_DIR/rpmbuild"
|
||||
TARBALL="$DIST_DIR/${NAME}-${VERSION}.tar.gz"
|
||||
|
||||
mkdir -p "$DIST_DIR" "$TOPDIR/BUILD" "$TOPDIR/RPMS" "$TOPDIR/SOURCES" "$TOPDIR/SPECS" "$TOPDIR/SRPMS"
|
||||
|
||||
if ! git -C "$ROOT_DIR" rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
||||
echo "Not a git repository; cannot create source archive." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
git -C "$ROOT_DIR" archive --format=tar --prefix="${NAME}-${VERSION}/" HEAD | gzip -n > "$TARBALL"
|
||||
|
||||
cp "$SPEC_FILE" "$TOPDIR/SPECS/"
|
||||
cp "$TARBALL" "$TOPDIR/SOURCES/"
|
||||
|
||||
rpmbuild --define "_topdir $TOPDIR" -ba "$TOPDIR/SPECS/$(basename "$SPEC_FILE")"
|
||||
|
||||
echo "Built RPM(s) in: $TOPDIR/RPMS"
|
||||
Reference in New Issue
Block a user