Name: example Version: 1.0 Release: 1%{?dist} Summary: A minimal static library example License: MIT BuildRequires: gcc %undefine _preserve_static_debuginfo %define _find_debuginfo_opts --no-ar-files %description This is a simple example package that builds a static library containing one object file and packages it. %build echo "int main() {}" > example.c gcc -c -g -o example.o example.c gcc example.o %install mkdir -p %{buildroot}%{_libdir} mkdir -p %{buildroot}%{_bindir} # Use 'ar' to create the static archive (libexample.a) from the object file # The 's' flag updates the object file index. ar rcs libexample.a example.o # Move the created archive to the final installation directory mv libexample.a %{buildroot}%{_libdir}/libexample.a mv a.out %{buildroot}%{_bindir}/a.out %debug_package %files %{_libdir}/libexample.a %{_bindir}/a.out # --- Changelog --- %changelog * Wed Aug 27 2025 Dummy Author - 1.0-1 - Initial release