Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions package_manifest.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
all:
vars:
bootstrap: false
foremandist: .fm3_18
foreman_version: 'nightly'
katello_version: 'nightly'
Expand All @@ -17,8 +18,7 @@ copr_projects:
vars:
core_modules_el9:
- 'nodejs:22'
core_buildroot_packages:
- 'foreman-build'
core_buildroot_packages: "{{ [] if bootstrap|bool else ['foreman-build']}}"
plugins_buildroot_packages:
- 'foreman-build'
- python3.12-rpm-macros
Expand All @@ -39,6 +39,7 @@ copr_projects:
copr_project_chroots:
- name: "rhel-{{ rhel_9 }}-x86_64"
modules: "{{ core_modules_el9 }}"
rpmbuild_with: "{{ ['bootstrap'] if bootstrap|bool else []}}"
external_repos:
- "{{ puppet_baseurl }}/el/{{ rhel_9 }}/x86_64/"
- "{{ foreman_staging }}/rhel-{{ rhel_9 }}-x86_64"
Expand Down
41 changes: 34 additions & 7 deletions packages/foreman/foreman/foreman.spec
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
%bcond bootstrap 0

%global homedir %{_datadir}/%{name}
%global confdir extras/packaging/rpm/sources
%global foreman_rake %{_sbindir}/%{name}-rake
%global dynflow_sidekiq_service_name dynflow-sidekiq@
%global rake /usr/bin/rake

%global release 2
%global release 3
%global prereleasesource develop
%global prerelease %{?prereleasesource}

Expand All @@ -24,6 +26,7 @@ Source4: %{name}.cron.d
Source5: %{name}.tmpfiles
BuildArch: noarch

%if %{without bootstrap}
# Plugin was removed in Foreman 3.3, 3.5 includes DB cleanup
Obsoletes: rubygem-foreman_docker < 5.0.0-4

Expand Down Expand Up @@ -352,6 +355,8 @@ Meta package with support for plugins.
%{_sysconfdir}/rpm/macros.%{name}-plugin
%{_datadir}/%{name}/schema.rb.nulldb
%{_datadir}/%{name}/bundler.d/nulldb.rb
# endif without bootstrap
%endif

%package build
Summary: Foreman package RPM support
Expand All @@ -363,6 +368,7 @@ Meta package with support for building RPMs in the Foreman release cycle.
%files build
%{_sysconfdir}/rpm/macros.%{name}-dist

%if %{without bootstrap}
%package console
Summary: Foreman console support
Group: Applications/System
Expand Down Expand Up @@ -497,6 +503,8 @@ Configuration files for the Performance Co-Pilot integration
%files pcp
%{_sysconfdir}/pcp/proc/%{name}-hotproc.conf
%{_sharedstatedir}/pcp/config/pmlogconf/%{name}-hotproc
# endif without bootstrap
%endif

%description
Foreman is aimed to be a Single Address For All Machines Life Cycle Management.
Expand All @@ -505,15 +513,19 @@ plugins required for Foreman to work.

%prep
%setup -q -n %{name}-%{version}%{?prerelease:-}%{?prerelease}
%if %{without bootstrap}
%generate_buildrequires
# Generate rubygem BuildRequires with a script that uses bundler
%{SOURCE1}
# Generate NPM BuildRequires
/usr/libexec/platform-python script/filter-package-json.py
%{SOURCE2}
# endif without bootstrap
%endif


%build
%if %{without bootstrap}
#build man pages
%{rake} -f Rakefile.dist build \
PREFIX=%{_prefix} \
Expand All @@ -536,10 +548,13 @@ export NODE_ENV=production
%{rake} webpack:compile DATABASE_URL=nulldb://nohost
%{rake} assets:precompile RAILS_ENV=production DATABASE_URL=nulldb://nohost --trace
rm db/schema.rb
# endif without bootstrap
%endif

%install
rm -rf %{buildroot}

%if %{without bootstrap}
#install man pages
%{rake} -f Rakefile.dist install \
PREFIX=%{buildroot}%{_prefix} \
Expand Down Expand Up @@ -633,7 +648,15 @@ ln -sv %{_sysconfdir}/%{name}/plugins %{buildroot}%{_datadir}/%{name}/config/set
install -pm0644 VERSION %{buildroot}%{_datadir}/%{name}/VERSION

# Create RPM macros for plugin packages to use at build time
# endif without bootstrap
%endif
mkdir -p %{buildroot}%{_sysconfdir}/rpm
cat > %{buildroot}%{_sysconfdir}/rpm/macros.%{name}-dist << EOF
# Version to use like a dist tag
%%%{name}dist .fm$(echo %{version} | awk -F. '{print $1 "_" $2}')
EOF

%if %{without bootstrap}
cat > %{buildroot}%{_sysconfdir}/rpm/macros.%{name} << EOF
# Common locations
%%%{name}_dir %{_datadir}/%{name}
Expand All @@ -644,11 +667,6 @@ cat > %{buildroot}%{_sysconfdir}/rpm/macros.%{name} << EOF
%%%{name}_rake %{foreman_rake}
EOF

cat > %{buildroot}%{_sysconfdir}/rpm/macros.%{name}-dist << EOF
# Version to use like a dist tag
%%%{name}dist .fm$(echo %{version} | awk -F. '{print $1 "_" $2}')
EOF

cat > %{buildroot}%{_sysconfdir}/rpm/macros.%{name}-plugin << EOF
# Generate bundler.d file for a plugin
# -n<plugin_name> Overrides default of gem_name
Expand Down Expand Up @@ -720,11 +738,15 @@ rm -rf ./usr \\
%%{?-s:rm -rf %%{buildroot}%%{gem_instdir}/public/webpack/fonts} \\
%%{?-s:rm -rf %%{buildroot}%%{gem_instdir}/public/webpack/images}
EOF
# endif without bootstrap
%endif


%clean
rm -rf %{buildroot}


%if %{without bootstrap}
%files
%defattr(-,root,root,0755)
%doc CHANGELOG Contributors README.md VERSION
Expand Down Expand Up @@ -837,8 +859,13 @@ exit 0
%postun service
%systemd_postun_with_restart %{name}.service
%systemd_postun %{name}.socket
# endif without bootstrap
%endif

%changelog
* Sat Nov 22 2025 Ewoud Kohl van Wijngaarden <[email protected]> - 3.18.0-0.3.develop
- Allow bootstrapping the package

* Thu Nov 20 2025 Evgeni Golov - 3.18.0-0.2.develop
- Support limiting loaded plugins via FOREMAN_ENABLED_PLUGINS

Expand All @@ -852,7 +879,7 @@ exit 0
- Remove Obsoletes entry to fix migration to new ovirt plugin

* Tue Sep 30 2025 Odilon Sousa <[email protected]> - 3.17.0-0.2.develop
- Update %generate_buildrequires macro section after the %prep phase
- Update generate_buildrequires macro section after the prep phase

* Wed Aug 13 2025 Ondřej Gajdušek <[email protected]> - 3.17.0-0.1.develop
- Bump version to 3.17-develop
Expand Down