<commit_before># Disable the stupid stuff rpm distros include in the build process by default:
<% %w(prep build install clean).each do |step| -%>
<%# These definitions have to be non-empty... I guess... -%>
#   Disable any <%= step %> shell actions. replace them with simply 'true'
%define __spec_<%= step %>_post true
%define __spec_<%= step %>_pre true
<% end -%>
# Disable checking for unpackaged files ?
#%undefine __check_files

Name: <%= name %>
Version: <%= version %>
<% if epoch -%>
Epoch: <%= epoch %>
<% end -%>
Release: <%= iteration or 1 %>
<%# use the first line of the description as the summary -%>
Summary: <%= description.split("\n").first.empty? ? "_" :  description.split("\n").first %>
BuildArch: <%= architecture %>
AutoReqProv: no

Group: <%= category %>
License: <%= license %>
Vendor: <%= vendor %>
URL: <%= url or "http://nourlgiven.example.com/" %>
Packager: <%= maintainer %>

<% dependencies.each do |req| -%>
Requires: <%= req %>
<% end -%>
<% provides.each do |prov| -%>
Provides: <%= prov %>
<% end -%>
<% replaces.each do |repl| -%>
<%# The closes equivalent in RPM to "replaces" is "Obsoletes" -%>
Obsoletes: <%= repl %>
<% end -%>
<%# rpm rejects descriptions with blank lines (even between content), so hack
    around it by replacing blank lines with ' .' -%>
%description
<%= description.gsub(/^\s*$/, " .") %>

%prep
# noop

%build
# noop

%install
<% files.each do |path| -%>
<%   source = File.join(staging_path, path) -%>
<%   # Copy to the build_path/BUILD/ to make rpmbuild happy -%>
<%   target = File.join(build_path, "BUILD", path) -%>
<%   dir = File.dirname(target) %>
mkdir -p "<%= dir %>"
if [ -f "<%= source %>" ] ; then
  cp "<%= source %>" "<%= target %>"
elif [ -d "<%= source %>" ] ; then
  mkdir "<%= target %>"
fi
<% end %>

%clean
# noop

<% if scripts["pre-install"] -%>
%pre
<%= File.read(scripts["pre-install"]) %>

<% end -%>
<% if scripts["post-install"] -%>
%post
<%= File.read(scripts["post-install"]) %>

<% end -%>
<% if scripts["pre-uninstall"] -%>
%preun
<%= File.read(scripts["pre-uninstall"]) %>

<% end -%>
<% if scripts["post-uninstall"] -%>
%postun
<%= File.read(scripts["post-uninstall"]) %>

<% end -%>
%files
%defattr(-,root,root,-)
<%# Output config files and then regular files. -%>
<%= config_files.collect { |c| '%config ' + c }.join("\n") -%>
<%# list only files, not directories? %>
<%= files.reject { |f| File.directory?(File.join(staging_path, f)) }.collect { |f| "/#{f}" }.join("\n") %>

%changelog<commit_msg>- Fix #164<commit_after># Disable the stupid stuff rpm distros include in the build process by default:
<% %w(prep build install clean).each do |step| -%>
<%# These definitions have to be non-empty... I guess... -%>
#   Disable any <%= step %> shell actions. replace them with simply 'true'
%define __spec_<%= step %>_post true
%define __spec_<%= step %>_pre true
<% end -%>
# Disable checking for unpackaged files ?
#%undefine __check_files

Name: <%= name %>
Version: <%= version %>
<% if epoch -%>
Epoch: <%= epoch %>
<% end -%>
Release: <%= iteration or 1 %>
<%# use the first line of the description as the summary -%>
Summary: <%= description.split("\n").first.empty? ? "_" :  description.split("\n").first %>
BuildArch: <%= architecture %>
AutoReqProv: no

Group: <%= category %>
License: <%= license %>
Vendor: <%= vendor %>
URL: <%= url or "http://nourlgiven.example.com/" %>
Packager: <%= maintainer %>

<% dependencies.each do |req| -%>
Requires: <%= req %>
<% end -%>
<% provides.each do |prov| -%>
Provides: <%= prov %>
<% end -%>
<% replaces.each do |repl| -%>
<%# The closes equivalent in RPM to "replaces" is "Obsoletes" -%>
Obsoletes: <%= repl %>
<% end -%>
<%# rpm rejects descriptions with blank lines (even between content), so hack
    around it by replacing blank lines with ' .' -%>
%description
<%= description.gsub(/^\s*$/, " .") %>

%prep
# noop

%build
# noop

%install
<% files.each do |path| -%>
<%   source = File.join(staging_path, path) -%>
<%   # Copy to the build_path/BUILD/ to make rpmbuild happy -%>
<%   target = File.join(build_path, "BUILD", path) -%>
<%   dir = File.dirname(target) %>
mkdir -p "<%= dir %>"
if [ -f "<%= source %>" ] ; then
  cp "<%= source %>" "<%= target %>"
elif [ -d "<%= source %>" ] ; then
  mkdir "<%= target %>"
fi
<% end %>

%clean
# noop

<% if scripts["pre-install"] -%>
%pre
<%= File.read(scripts["pre-install"]) %>

<% end -%>
<% if scripts["post-install"] -%>
%post
<%= File.read(scripts["post-install"]) %>

<% end -%>
<% if scripts["pre-uninstall"] -%>
%preun
<%= File.read(scripts["pre-uninstall"]) %>

<% end -%>
<% if scripts["post-uninstall"] -%>
%postun
<%= File.read(scripts["post-uninstall"]) %>

<% end -%>
%files
%defattr(-,root,root,-)
<%# Output config files and then regular files. -%>
<%= config_files.collect { |c| '%config ' + c }.join("\n") -%>
<%# list only files, not directories? %>
<%= 
  # Reject directories, then prefix files with "/", then make sure
  # paths with spaces are quoted. I hate rpm so much.
  files.reject { |f| File.directory?(File.join(staging_path, f)) } \
    .collect { |f| "/#{f}" } \
    .collect { |f| f[/\s/] and "\"#{f}\"" or f } \
    .join("\n") 
%>

%changelog
{'fraction_non_alphanumeric': 0.22756224667052694, 'fraction_numerical': 0.0009650646593321753, 'mean_word_length': 3.789279112754159, 'pattern_counts': {'":': 0, '<': 123, '<?xml version=': 0, '>': 123, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7614081', 'n_tokens_mistral': 2045, 'n_tokens_neox': 1808, 'n_words': 503}