Name: hello Version: 1.0 Release: 1%{?dist} Summary: Installs a simple hello world command License: MIT # Runtime dependencies Requires: bash # We do not need a Source0 line because we create the source inline %description This package installs a simple 'hello' world command line utility. # %prep # Nothing to unpack, but we need the section %build # Create the script directly inside the build directory cat << 'EOF' > hello #!/bin/bash echo "Hello World!" EOF %install # Create the /usr/bin directory in the build root mkdir -p %{buildroot}%{_bindir} # Copy the script to /usr/bin/hello cp hello %{buildroot}%{_bindir}/hello # Make the script executable chmod +x %{buildroot}%{_bindir}/hello %files # Tell RPM to track and include this file in the package %{_bindir}/hello