## START: Set by rpmautospec ## (rpmautospec version 0.8.4) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 1; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec %global debug_package %{nil} %global __provides_exclude_from ^(%{nodejs_sitelib}/%{name}/.*)$ %global __requires_exclude_from ^(%{nodejs_sitelib}/%{name}/.*)$ Name: bitfocus-companion Version: 5.0.4 Release: %autorelease Summary: Headless server for broadcast control and device management License: MIT URL: https://github.com/bitfocus/companion Source0: https://github.com/bitfocus/companion/archive/refs/tags/v%{version}.tar.gz Source1: https://repo.yarnpkg.com/4.17.1/packages/yarnpkg-cli/bin/yarn.js Source2: %{name}.sysusers.conf Source3: %{name}.service Source4: %{name}.sysconfig # Bundle Node.js runtimes # TODO: When F45 happens, depend on Fedora's nodejs versions and add symlinks to the expected paths %global node18_version 18.20.8 %global node22_version 22.23.1 %global node26_version 26.5.0 Source10: https://nodejs.org/download/release/v%{node18_version}/node-v%{node18_version}-linux-x64.tar.gz Source11: https://nodejs.org/download/release/v%{node22_version}/node-v%{node22_version}-linux-x64.tar.gz Source12: https://nodejs.org/download/release/v%{node26_version}/node-v%{node26_version}-linux-x64.tar.gz BuildRequires: git BuildRequires: zip BuildRequires: nodejs24-devel BuildRequires: nodejs24-npm BuildRequires: systemd-rpm-macros Requires: nodejs24 Requires: nodejs24-bin Requires: libatomic ExclusiveArch: x86_64 aarch64 %description Companion elevates the affordable Elgato Stream Deck and similar devices into professional control surfaces for an extensive range of equipment and applications. From presentation switchers and broadcast equipment to video playback software and home automation systems, Companion delivers studio-grade control, putting powerful workflows right at your fingertips. %prep %setup -q -n companion-%{version} # Create BUILD file (required by esbuild for version embedding) echo "%{version}" > BUILD # Set version on a git tag git init git add . git -c user.name='none' -c user.email='' commit -m "." git tag %{version} %build # Install yarn mkdir -p .yarn/releases cp %{SOURCE1} .yarn/releases/yarn-4.17.1.cjs chmod +x .yarn/releases/yarn-4.17.1.cjs YARN_CMD="node .yarn/releases/yarn-4.17.1.cjs" # Workspace postinstall hooks fail $YARN_CMD config set enableScripts false $YARN_CMD install --mode=skip-build # Build Server $YARN_CMD build:ts $YARN_CMD workspace companion build $YARN_CMD run build:writefile $YARN_CMD run build:whatsnew # Build webui (cd webui && node post-install.ts) $YARN_CMD workspace @companion-app/webui build # Add bundled runtimes mkdir -p node-runtimes/node18 node-runtimes/node22 node-runtimes/node26 tar -xzf %{SOURCE10} --strip-components=1 -C node-runtimes/node18 tar -xzf %{SOURCE11} --strip-components=1 -C node-runtimes/node22 tar -xzf %{SOURCE12} --strip-components=1 -C node-runtimes/node26 # Remove unnecessary files for runtime in node-runtimes/node18 node-runtimes/node22 node-runtimes/node26; do rm -rf "$runtime/lib/node_modules/npm" rm -rf "$runtime/share" rm -rf "$runtime/include" done # HACK: Docs won't build, add dummy # $YARN_CMD workspace @companion-app/docs build mkdir -p docs/build printf '