# rpmlint filters for one-focus, read by OBS from the package sources.
#
# Tumbleweed's and Leap 16.0's rpmlint fail the package on checks that are
# about what it is rather than mistakes in it: a PyInstaller one-dir bundle
# (#39) under /opt, carrying its own Python and Qt. Leap 15.6 builds the same
# rpm with 0 errors. Each filter below is one such check, and why it does not
# apply; anything not listed still fails the build.

# The bundle is self-contained and third-party in the sense /opt is for; every
# recipe (deb, rpm, Arch) installs to /opt/one-focus, and get_base_dir() and the
# systemd unit depend on that path.
addFilter("filelist-forbidden-opt")
addFilter("dir-or-file-outside-snapshot")

# The bundled Qt and Python libraries are private to the bundle, located through
# their $ORIGIN RUNPATH, and never registered with ld.so - ldconfig has nothing
# to do for them. Rebuilding PySide6's wheels to drop RUNPATH or add hash
# sections is not something a repackager can do.
addFilter("binary-or-shlib-defines-rpath")
addFilter("postin-without-ldconfig")
addFilter("postun-without-ldconfig")
addFilter("missing-hash-section")
# Stripping a PyInstaller executable discards the archive appended to it.
addFilter("unstripped-binary-or-object")

# The unit is enabled and started in %post, and stopped (with the DNS restore
# that must come first) in %preun, identically to debian.postinst and the
# PKGBUILD. The %service_* macros would enable it only by preset, which would
# leave a fresh install not enforcing anything.
addFilter("systemd-service-without-service_add_pre")
addFilter("systemd-service-without-service_add_post")
addFilter("systemd-service-without-service_del_preun")
addFilter("systemd-service-without-service_del_postun")

# The version history is the git history (debian.changelog says the same).
addFilter("no-changelogname-tag")

# desktop-file-validate passes on this file (checked on openSUSE Tumbleweed);
# rpmlint reports it invalid regardless.
addFilter("invalid-desktopfile")
