Blame SPECS/osbuild.spec

740e31
%global         forgeurl https://github.com/osbuild/osbuild
c730a6
%global         selinuxtype targeted
740e31
e0b478
Version:        23
740e31
740e31
%forgemeta
740e31
740e31
%global         pypi_name osbuild
740e31
%global         pkgdir %{_prefix}/lib/%{pypi_name}
740e31
740e31
Name:           %{pypi_name}
e0b478
Release:        1%{?dist}
740e31
License:        ASL 2.0
740e31
740e31
URL:            %{forgeurl}
740e31
740e31
Source0:        %{forgesource}
740e31
BuildArch:      noarch
740e31
Summary:        A build system for OS images
740e31
740e31
BuildRequires:  make
740e31
BuildRequires:  python3-devel
740e31
BuildRequires:  python3-docutils
740e31
740e31
Requires:       bash
e0b478
Requires:       bubblewrap
740e31
Requires:       coreutils
740e31
Requires:       curl
740e31
Requires:       dnf
740e31
Requires:       e2fsprogs
740e31
Requires:       glibc
740e31
Requires:       policycoreutils
740e31
Requires:       qemu-img
740e31
Requires:       systemd
740e31
Requires:       tar
740e31
Requires:       util-linux
740e31
Requires:       python3-%{pypi_name} = %{version}-%{release}
c730a6
Requires:       (%{name}-selinux if selinux-policy-%{selinuxtype})
740e31
740e31
# Turn off dependency generators for assemblers, runners and stages.
740e31
# They run in a container, so there's no reason to generate dependencies
740e31
# from them. As of 2020-03-25 this filters out python3.6 dependency generated
740e31
# by rhel runner.
740e31
%global __requires_exclude_from ^%{pkgdir}/(assemblers|runners|stages)/.*$
740e31
e0b478
# Turn off shebang mangling on RHEL. brp-mangle-shebangs (from package
e0b478
# redhat-rpm-config) is run on all executables in a package after the `install`
e0b478
# section runs. The below macro turns this behavior off for:
e0b478
#   - runners, because they already have the correct shebang for the platform
e0b478
#     they're meant for, and
e0b478
#   - stages and assemblers, because they are run within osbuild build roots,
e0b478
#     which are not required to contain the same OS as the host and might thus
e0b478
#     have a different notion of "platform-python".
e0b478
%global __brp_mangle_shebangs_exclude_from ^%{pkgdir}/(assemblers|runners|stages)/.*$
e0b478
740e31
%{?python_enable_dependency_generator}
740e31
740e31
%description
740e31
A build system for OS images
740e31
740e31
%package -n     python3-%{pypi_name}
740e31
Summary:        %{summary}
740e31
%{?python_provide:%python_provide python3-%{pypi_name}}
740e31
740e31
%description -n python3-%{pypi_name}
740e31
A build system for OS images
740e31
740e31
%package        ostree
740e31
Summary:        OSTree support
740e31
Requires:       %{name} = %{version}-%{release}
740e31
Requires:       ostree
740e31
Requires:       rpm-ostree
740e31
740e31
%description ostree
740e31
Contains the necessary stages, assembler and source
740e31
to build OSTree based images.
740e31
c730a6
%package        selinux
c730a6
Summary:        SELinux policies
c730a6
Requires:       %{name} = %{version}-%{release}
c730a6
BuildRequires:  selinux-policy
c730a6
BuildRequires:  selinux-policy-devel
c730a6
%{?selinux_requires}
c730a6
c730a6
%description    selinux
c730a6
Contains the necessary SELinux policies that allows
c730a6
osbuild to use labels unknown to the host inside the
c730a6
containers it uses to build OS artifacts.
c730a6
740e31
%prep
740e31
%forgesetup
740e31
740e31
%build
740e31
%py3_build
740e31
make man
740e31
c730a6
# SELinux
c730a6
make -f /usr/share/selinux/devel/Makefile osbuild.pp
c730a6
bzip2 -9 osbuild.pp
c730a6
c730a6
%pre
c730a6
%selinux_relabel_pre -s %{selinuxtype}
c730a6
740e31
%install
740e31
%py3_install
740e31
740e31
mkdir -p %{buildroot}%{pkgdir}/stages
740e31
install -p -m 0755 $(find stages -type f) %{buildroot}%{pkgdir}/stages/
740e31
740e31
mkdir -p %{buildroot}%{pkgdir}/assemblers
740e31
install -p -m 0755 $(find assemblers -type f) %{buildroot}%{pkgdir}/assemblers/
740e31
740e31
mkdir -p %{buildroot}%{pkgdir}/runners
740e31
install -p -m 0755 $(find runners -type f -or -type l) %{buildroot}%{pkgdir}/runners
740e31
740e31
mkdir -p %{buildroot}%{pkgdir}/sources
740e31
install -p -m 0755 $(find sources -type f) %{buildroot}%{pkgdir}/sources
740e31
33d4c8
# mount point for bind mounting the osbuild library
33d4c8
mkdir -p %{buildroot}%{pkgdir}/osbuild
33d4c8
33d4c8
# schemata
33d4c8
mkdir -p %{buildroot}%{_datadir}/osbuild/schemas
33d4c8
install -p -m 0755 $(find schemas/*.json) %{buildroot}%{_datadir}/osbuild/schemas
33d4c8
ln -s %{_datadir}/osbuild/schemas %{buildroot}%{pkgdir}/schemas
740e31
740e31
# documentation
740e31
mkdir -p %{buildroot}%{_mandir}/man1
740e31
mkdir -p %{buildroot}%{_mandir}/man5
740e31
install -p -m 0644 -t %{buildroot}%{_mandir}/man1/ docs/*.1
740e31
install -p -m 0644 -t %{buildroot}%{_mandir}/man5/ docs/*.5
740e31
c730a6
# SELinux
c730a6
install -D -m 644 -t %{buildroot}%{_datadir}/selinux/packages/%{selinuxtype} %{name}.pp.bz2
c730a6
install -D -m 644 -t %{buildroot}%{_mandir}/man8 selinux/%{name}_selinux.8
c730a6
740e31
%check
740e31
exit 0
740e31
# We have some integration tests, but those require running a VM, so that would
740e31
# be an overkill for RPM check script.
740e31
740e31
%files
740e31
%license LICENSE
740e31
%{_bindir}/osbuild
740e31
%{_mandir}/man1/%{name}.1*
740e31
%{_mandir}/man5/%{name}-manifest.5*
33d4c8
%{_datadir}/osbuild/schemas
740e31
%{pkgdir}
740e31
# the following files are in the ostree sub-package
740e31
%exclude %{pkgdir}/assemblers/org.osbuild.ostree.commit
740e31
%exclude %{pkgdir}/sources/org.osbuild.ostree
740e31
%exclude %{pkgdir}/stages/org.osbuild.ostree
740e31
%exclude %{pkgdir}/stages/org.osbuild.rpm-ostree
740e31
740e31
%files -n       python3-%{pypi_name}
740e31
%license LICENSE
740e31
%doc README.md NEWS.md
740e31
%{python3_sitelib}/%{pypi_name}-*.egg-info/
740e31
%{python3_sitelib}/%{pypi_name}/
740e31
33d4c8
%files ostree
740e31
%{pkgdir}/assemblers/org.osbuild.ostree.commit
740e31
%{pkgdir}/sources/org.osbuild.ostree
740e31
%{pkgdir}/stages/org.osbuild.ostree
740e31
%{pkgdir}/stages/org.osbuild.rpm-ostree
740e31
c730a6
%files selinux
c730a6
%{_datadir}/selinux/packages/%{selinuxtype}/%{name}.pp.bz2
c730a6
%{_mandir}/man8/%{name}_selinux.8.*
c730a6
%ghost %{_sharedstatedir}/selinux/%{selinuxtype}/active/modules/200/%{name}
c730a6
c730a6
%post selinux
c730a6
%selinux_modules_install -s %{selinuxtype} %{_datadir}/selinux/packages/%{selinuxtype}/%{name}.pp.bz2
c730a6
c730a6
%postun selinux
c730a6
if [ $1 -eq 0 ]; then
c730a6
    %selinux_modules_uninstall -s %{selinuxtype} %{name}
c730a6
fi
c730a6
c730a6
%posttrans selinux
c730a6
%selinux_relabel_post -s %{selinuxtype}
c730a6
c730a6
740e31
%changelog
e0b478
* Fri Oct 23 2020 Christian Kellner <ckellner@redhat.com> - 23-1
e0b478
- Upstream release 23
e0b478
- Do not mangle shebangs for assemblers, runners & stages.
e0b478
e0b478
* Wed Oct 14 2020 Christian Kellner <ckellner@redhat.com> - 22-1
e0b478
- Upstream release 22
e0b478
- Remove all patches since they are all in osbuild-22.
e0b478
- bubblewrap replaced systemd-nspawn for sandboxing; change the
e0b478
  requirements accordingly.
e0b478
7238b3
* Thu Aug 13 2020 Christian Kellner <ckellner@redhat.com> - 18-3
7238b3
- Add patch to allow nnp and nosuid domain transitions
7238b3
  https://github.com/osbuild/osbuild/pull/495
7238b3
c730a6
* Fri Jun 26 2020 Christian Kellner <ckellner@redhat.com> - 18-2
c730a6
- Add patch to not pass floats to curl in the files source
c730a6
  https://github.com/osbuild/osbuild/pull/459
c730a6
c730a6
* Tue Jun 23 2020 Christian Kellner <ckellner@redhat.com> - 18-1
c730a6
- Upstream release 18
c730a6
- All RHEL runners now use platform-python.
c730a6
c730a6
* Wed Jun 10 2020 Christian Kellner <ckellner@redhat.com> - 17-1
c730a6
- Upstream release 17
c730a6
- Add custom SELinux policy that lets osbuild set labels inside
c730a6
  the build root that are unknown to the host.
c730a6
33d4c8
* Thu Jun  4 2020 Christian Kellner <christian@kellner.me> - 16-1
33d4c8
- Upstream release 16
33d4c8
- Drop sources-fix-break-when-secrets-is-None.patch included in
33d4c8
  osbuild-16.
33d4c8
33d4c8
* Tue May 26 2020 Christian Kellner <ckellner@redhat.com> - 15-2
33d4c8
- Add a patch to allow org.osbuild.files source in the new format
33d4c8
  but without actually containing the secrets key.
33d4c8
  Taken from merged PR: https://github.com/osbuild/osbuild/pull/416
33d4c8
33d4c8
* Thu May 21 2020 Christian Kellner <ckellner@redhat.com> - 15-1
33d4c8
- New upstream release 15
33d4c8
- Drop draft4-validator.json patch, included in osbuild-15
33d4c8
33d4c8
* Wed May 13 2020 Christian Kellner <ckellner@redhat.com> - 14-2
33d4c8
- Add draft4-validator.json patch
33d4c8
  python3-jsonschema in RHEL currently has version 2.6.0 which
33d4c8
  has support validating up to and including draft4 of jsonschema.
33d4c8
  See https://github.com/osbuild/osbuild/pull/394
33d4c8
33d4c8
* Wed May 13 2020 Christian Kellner <ckellner@redhat.com> - 14-1
33d4c8
- Upstream release 14
33d4c8
- Install schemata to <datadir>/osbuild/schemas and include a
33d4c8
  symlink to it in /usr/lib/osbuild/schemas
33d4c8
- The directories /usr/lib/osbuild/{assemblers, stages}/osbuild
33d4c8
  got removed. Changes to osbuild made them obsolete.
33d4c8
740e31
* Wed Apr 15 2020 Christian Kellner <ckellner@redhat.com> - 12-1
740e31
- Sync with Fedora and use upstream release 12
740e31
- Specify the exact version in the 'python3-osbuild' requirement
740e31
  to avoid the library and the main binary being out of sync.
740e31
- osbuild-ostree sub-package with the necessary bits to create
740e31
  OSTree based images
740e31
- Turn off dependency generator for internal components
740e31
- Add NEWS.md file with the release notes and man pages
740e31
33d4c8
* Mon Dec 16 2019 Lars Karlitski <lars@karlitski.net> - 7-1
740e31
- New upstream release
740e31
740e31
* Sun Dec 1 2019 Tom Gundersen <teg@jklm.no> - 6-2
740e31
- New upstream release
740e31
740e31
* Thu Oct 24 2019 Lars Karlitski <lueberni@redhat.com> - 3-2
740e31
- add gating infra and tests
740e31
740e31
* Mon Aug 19 2019 Miro HronĨok <mhroncok@redhat.com> - 1-3
740e31
- Rebuilt for Python 3.8
740e31
740e31
* Mon Jul 29 2019 Martin Sehnoutka <msehnout@redhat.com> - 1-2
740e31
- update upstream URL to the new Github organization
740e31
740e31
* Wed Jul 17 2019 Martin Sehnoutka <msehnout@redhat.com> - 1-1
740e31
- Initial package