continuwuity/pkg/fedora/continuwuity.spec.rpkg
Jade Ellis 67e5e11a97
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m24s
Checks / Prek / Check changed files (pull_request) Successful in 8s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m26s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m53s
Checks / Changelog / Check changelog is added (pull_request_target) Failing after 16s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 8m43s
refactor: Rename all remaining conduwuit references to Continuwuity
Also adds an alias for the old binary name to the dockerfile

Supersedes !1485
Closes #1536
Closes #2277
2026-10-05 00:58:24 +01:00

79 lines
2.4 KiB
Text

# This should be run using rpkg: https://docs.pagure.org/rpkg
# it requires Internet access and is not suitable for Fedora main repos
Name: continuwuity
Version: {{{ git_repo_version }}}
Release: 1%{?dist}
Summary: A Matrix homeserver written in Rust.
License: Apache-2.0 AND MIT
URL: https://continuwuity.org
VCS: {{{ git_repo_vcs }}}
Source: {{{ git_repo_pack }}}
BuildRequires: cargo-rpm-macros >= 25
BuildRequires: systemd-rpm-macros
# Needed to build rust-librocksdb-sys
BuildRequires: clang
BuildRequires: liburing-devel
Requires: liburing
Requires: glibc
Requires: libstdc++
%global _description %{expand:
A community-driven Matrix homeserver.}
%description %{_description}
%prep
{{{ git_repo_setup_macro }}}
%cargo_prep -N
# Perform an online build so Git dependencies can be retrieved
sed -i 's/^offline = true$//' .cargo/config.toml
%build
%cargo_build
# Here's the one legally required mystery incantation in this file.
# Some of our dependencies have source files which are (for some reason) marked as executable.
# Files in .cargo/registry/ are copied into /usr/src/ by the debuginfo machinery
# at the end of the build step, and then the BRP shebang mangling script checks
# the entire buildroot to find executable files, and fails the build because
# it thinks Rust's file attributes are shebangs because they start with `#!`.
# So we have to clear the executable bit on all of them before that happens.
find .cargo/registry/ -executable -name "*.rs" -exec chmod -x {} +
# TODO: this fails currently because it's forced to run in offline mode
# {cargo_license -- --no-dev} > LICENSE.dependencies
%install
install -Dpm0755 target/rpm/continuwuity -t %{buildroot}%{_bindir}
install -Dpm0644 pkg/continuwuity.service -t %{buildroot}%{_unitdir}
install -Dpm0600 continuwuity-example.toml %{buildroot}%{_sysconfdir}/continuwuity/continuwuity.toml
%files
%license LICENSE
%license src/core/matrix/state_res/LICENSE
%doc CODE_OF_CONDUCT.md
%doc CONTRIBUTING.md
%doc README.md
%doc SECURITY.md
%config(noreplace) %{_sysconfdir}/continuwuity/continuwuity.toml
%{_bindir}/continuwuity
%{_unitdir}/continuwuity.service
# Do not create /var/lib/continuwuity, systemd will create it if necessary
%post
%systemd_post continuwuity.service
%preun
%systemd_preun continuwuity.service
%postun
%systemd_postun_with_restart continuwuity.service
%changelog
{{{ git_repo_changelog }}}