Blame SPECS/osbuild.spec

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