c8f8ac3
%global         forgeurl https://github.com/osbuild/osbuild
cee28ed
%global         selinuxtype targeted
379cdcf
4bf7755
Version:        18
379cdcf
379cdcf
%forgemeta
379cdcf
1f3a9a5
%global         pypi_name osbuild
50e059e
%global         pkgdir %{_prefix}/lib/%{pypi_name}
1f3a9a5
1f3a9a5
Name:           %{pypi_name}
88685db
Release:        2%{?dist}
1f3a9a5
License:        ASL 2.0
1f3a9a5
379cdcf
URL:            %{forgeurl}
1f3a9a5
379cdcf
Source0:        %{forgesource}
88685db
Patch0:         no-floats-in-sources.patch
1f3a9a5
BuildArch:      noarch
1f3a9a5
Summary:        A build system for OS images
1f3a9a5
7eb3afa
BuildRequires:  make
1f3a9a5
BuildRequires:  python3-devel
7eb3afa
BuildRequires:  python3-docutils
7eb3afa
7eb3afa
Requires:       bash
7eb3afa
Requires:       coreutils
7eb3afa
Requires:       curl
7eb3afa
Requires:       dnf
7eb3afa
Requires:       e2fsprogs
7eb3afa
Requires:       glibc
7eb3afa
Requires:       policycoreutils
7eb3afa
Requires:       qemu-img
7eb3afa
Requires:       systemd
7eb3afa
Requires:       systemd-container
7eb3afa
Requires:       tar
7eb3afa
Requires:       util-linux
2d70e43
Requires:       python3-%{pypi_name} = %{version}-%{release}
cee28ed
Requires:       (%{name}-selinux if selinux-policy-%{selinuxtype})
1f3a9a5
59460e0
# Turn off dependency generators for assemblers, runners and stages.
59460e0
# They run in a container, so there's no reason to generate dependencies
59460e0
# from them. As of 2020-03-25 this filters out python3.6 dependency generated
59460e0
# by rhel runner.
59460e0
%global __requires_exclude_from ^%{pkgdir}/(assemblers|runners|stages)/.*$
59460e0
1f3a9a5
%{?python_enable_dependency_generator}
1f3a9a5
1f3a9a5
%description
1f3a9a5
A build system for OS images
1f3a9a5
1f3a9a5
%package -n     python3-%{pypi_name}
1f3a9a5
Summary:        %{summary}
1f3a9a5
%{?python_provide:%python_provide python3-%{pypi_name}}
1f3a9a5
7eb3afa
%description -n python3-%{pypi_name}
1f3a9a5
A build system for OS images
1f3a9a5
2d70e43
%package        ostree
2d70e43
Summary:        OSTree support
2d70e43
Requires:       %{name} = %{version}-%{release}
2d70e43
Requires:       ostree
2d70e43
Requires:       rpm-ostree
2d70e43
2d70e43
%description ostree
2d70e43
Contains the necessary stages, assembler and source
2d70e43
to build OSTree based images.
2d70e43
cee28ed
%package        selinux
cee28ed
Summary:        SELinux policies
cee28ed
Requires:       %{name} = %{version}-%{release}
cee28ed
BuildRequires:  selinux-policy
cee28ed
BuildRequires:  selinux-policy-devel
cee28ed
%{?selinux_requires}
cee28ed
cee28ed
%description    selinux
cee28ed
Contains the necessary SELinux policies that allows
cee28ed
osbuild to use labels unknown to the host inside the
cee28ed
containers it uses to build OS artifacts.
cee28ed
1f3a9a5
%prep
379cdcf
%forgesetup
88685db
%patch0 -p1
1f3a9a5
1f3a9a5
%build
1f3a9a5
%py3_build
7eb3afa
make man
1f3a9a5
cee28ed
# SELinux
cee28ed
make -f /usr/share/selinux/devel/Makefile osbuild.pp
cee28ed
bzip2 -9 osbuild.pp
cee28ed
cee28ed
%pre
cee28ed
%selinux_relabel_pre -s %{selinuxtype}
cee28ed
1f3a9a5
%install
1f3a9a5
%py3_install
1f3a9a5
310744b
mkdir -p %{buildroot}%{pkgdir}/stages
310744b
install -p -m 0755 $(find stages -type f) %{buildroot}%{pkgdir}/stages/
1f3a9a5
310744b
mkdir -p %{buildroot}%{pkgdir}/assemblers
310744b
install -p -m 0755 $(find assemblers -type f) %{buildroot}%{pkgdir}/assemblers/
1f3a9a5
50e059e
mkdir -p %{buildroot}%{pkgdir}/runners
379cdcf
install -p -m 0755 $(find runners -type f -or -type l) %{buildroot}%{pkgdir}/runners
379cdcf
379cdcf
mkdir -p %{buildroot}%{pkgdir}/sources
379cdcf
install -p -m 0755 $(find sources -type f) %{buildroot}%{pkgdir}/sources
50e059e
23359b9
# mount point for bind mounting the osbuild library
23359b9
mkdir -p %{buildroot}%{pkgdir}/osbuild
1f3a9a5
608a057
# schemata
608a057
mkdir -p %{buildroot}%{_datadir}/osbuild/schemas
608a057
install -p -m 0755 $(find schemas/*.json) %{buildroot}%{_datadir}/osbuild/schemas
608a057
ln -s %{_datadir}/osbuild/schemas %{buildroot}%{pkgdir}/schemas
608a057
7eb3afa
# documentation
7eb3afa
mkdir -p %{buildroot}%{_mandir}/man1
7eb3afa
mkdir -p %{buildroot}%{_mandir}/man5
7eb3afa
install -p -m 0644 -t %{buildroot}%{_mandir}/man1/ docs/*.1
7eb3afa
install -p -m 0644 -t %{buildroot}%{_mandir}/man5/ docs/*.5
7eb3afa
cee28ed
# SELinux
cee28ed
install -D -m 644 -t %{buildroot}%{_datadir}/selinux/packages/%{selinuxtype} %{name}.pp.bz2
cee28ed
install -D -m 644 -t %{buildroot}%{_mandir}/man8 selinux/%{name}_selinux.8
cee28ed
1f3a9a5
%check
1f3a9a5
exit 0
1f3a9a5
# We have some integration tests, but those require running a VM, so that would
1f3a9a5
# be an overkill for RPM check script.
1f3a9a5
1f3a9a5
%files
1f3a9a5
%license LICENSE
1f3a9a5
%{_bindir}/osbuild
7eb3afa
%{_mandir}/man1/%{name}.1*
7eb3afa
%{_mandir}/man5/%{name}-manifest.5*
608a057
%{_datadir}/osbuild/schemas
310744b
%{pkgdir}
2d70e43
# the following files are in the ostree sub-package
2d70e43
%exclude %{pkgdir}/assemblers/org.osbuild.ostree.commit
2d70e43
%exclude %{pkgdir}/sources/org.osbuild.ostree
2d70e43
%exclude %{pkgdir}/stages/org.osbuild.ostree
2d70e43
%exclude %{pkgdir}/stages/org.osbuild.rpm-ostree
1f3a9a5
7eb3afa
%files -n       python3-%{pypi_name}
1f3a9a5
%license LICENSE
7eb3afa
%doc README.md NEWS.md
1f3a9a5
%{python3_sitelib}/%{pypi_name}-*.egg-info/
1f3a9a5
%{python3_sitelib}/%{pypi_name}/
1f3a9a5
2d70e43
%files ostree
2d70e43
%{pkgdir}/assemblers/org.osbuild.ostree.commit
2d70e43
%{pkgdir}/sources/org.osbuild.ostree
2d70e43
%{pkgdir}/stages/org.osbuild.ostree
2d70e43
%{pkgdir}/stages/org.osbuild.rpm-ostree
2d70e43
cee28ed
%files selinux
cee28ed
%{_datadir}/selinux/packages/%{selinuxtype}/%{name}.pp.bz2
cee28ed
%{_mandir}/man8/%{name}_selinux.8.*
cee28ed
%ghost %{_sharedstatedir}/selinux/%{selinuxtype}/active/modules/200/%{name}
cee28ed
cee28ed
%post selinux
cee28ed
%selinux_modules_install -s %{selinuxtype} %{_datadir}/selinux/packages/%{selinuxtype}/%{name}.pp.bz2
cee28ed
cee28ed
%postun selinux
cee28ed
if [ $1 -eq 0 ]; then
cee28ed
    %selinux_modules_uninstall -s %{selinuxtype} %{name}
cee28ed
fi
cee28ed
cee28ed
%posttrans selinux
cee28ed
%selinux_relabel_post -s %{selinuxtype}
cee28ed
1f3a9a5
%changelog
88685db
* Fri Jun 26 2020 Christian Kellner <ckellner@redhat.com> - 18-2
88685db
- Add patch to not pass floats to curl in the files source
88685db
  https://github.com/osbuild/osbuild/pull/459
88685db
4bf7755
* Tue Jun 23 2020 Christian Kellner <ckellner@redhat.com> - 18-1
4bf7755
- Upstream release 18
4bf7755
- All RHEL runners now use platform-python.
4bf7755
cee28ed
* Wed Jun 10 2020 Christian Kellner <ckellner@redhat.com> - 17-1
cee28ed
- new upstream relaese 17
cee28ed
- Add custom SELinux policy that lets osbuild set labels inside
cee28ed
  the build root that are unknown to the host.
cee28ed
7d9cc21
* Thu Jun  4 2020 Christian Kellner <ckellner@redhat.com> - 16-1
cee28ed
- new upstream release 16
7d9cc21
- Drop sources-fix-break-when-secrets-is-None.patch included in
7d9cc21
  the new upstream reelase.
7d9cc21
3c8e2ca
* Wed May 27 2020 Miro Hrončok <mhroncok@redhat.com> - 15-4
3c8e2ca
- Rebuilt for Python 3.9
3c8e2ca
52237c4
* Tue May 26 2020 Christian Kellner <ckellner@redhat.com> - 15-3
52237c4
- Add a patch to allow org.osbuild.files source in the new format
52237c4
  but without actually containing the secrets key.
52237c4
  Taken from merged PR: https://github.com/osbuild/osbuild/pull/416
52237c4
9a4f2e0
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 15-2
9a4f2e0
- Rebuilt for Python 3.9
9a4f2e0
52f9485
* Thu May 21 2020 Christian Kellner <ckellner@redhat.com> - 15-1
52f9485
- new upstream release 15
52f9485
608a057
* Wed May  6 2020 Christian Kellner <christian@kellner.me> - 14-2
608a057
- Install schemata to <datadir>/osbuild/schemas and include a
608a057
  symlink to it in /usr/lib/osbuild/schemas
608a057
23359b9
* Wed May  6 2020 Christian Kellner <christian@kellner.me> - 14-1
23359b9
- new upstream release 14
23359b9
- The directories /usr/lib/osbuild/{assemblers, stages}/osbuild
23359b9
  got removed. Changes to osbuild made them obsolete.
23359b9
2d70e43
* Wed Apr 15 2020 Christian Kellner <ckellner@redhat.com> - 12-1
2d70e43
- new upstream release 12
2d70e43
- Specify the exact version in the 'python3-osbuild' requirement
2d70e43
  to avoid the library and the main binary being out of sync.
2d70e43
- osbuild-ostree sub-package with the necessary bits to create
2d70e43
  OSTree based images
2d70e43
59460e0
* Thu Apr  2 2020 Christian Kellner <ckellner@redhat.com> - 11-1
59460e0
- new upstream release 11
59460e0
- Turn of dependency generator for internal components
59460e0
7eb3afa
* Thu Mar 19 2020 Christian Kellner <ckellner@redhat.com> - 10-1
7eb3afa
- new upstream release 10
7eb3afa
- build and include man pages, this adds 'make' and 'python3-docutils'
7eb3afa
  to the build requirements
7eb3afa
- add NEWS.md file with the release notes
7eb3afa
c8f8ac3
* Thu Mar  5 2020 Christian Kellner <ckellner@redhat.com> - 9-1
7eb3afa
- new upstream release: 9
c8f8ac3
- Remove host runner link, it now is being auto-detected
c8f8ac3
- Cleanup use of mixed use of spaces/tabs
c8f8ac3
c80791c
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 7-2
c80791c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
c80791c
Packit Service 4d0e0a2
* Mon Dec 16 2019 Packit Service <user-cont-team+packit-service@redhat.com> - 7-1
Packit Service 4d0e0a2
- new upstream release: 7
Packit Service 4d0e0a2
50e059e
* Sat Nov 30 2019 Tom Gundersen <teg@jklm.no> - 6-1
50e059e
- new upstream release: 6
50e059e
b718b28
* Wed Oct 30 2019 Lars Karlitski <lars@karlitski.net> - 5-1
b718b28
- new upstream release: 5
b718b28
cbdd345
* Wed Oct 16 2019 Tom Gundersen <tgunders@redhat.com> - 4-1
cbdd345
- new upstream release: 4
cbdd345
310744b
* Fri Oct 04 2019 Lars Karlitski <lars@karlitski.net> - 3-1
310744b
- new upstream release: 3
310744b
96fcfca
* Wed Sep 18 2019 Martin Sehnoutka <msehnout@redhat.com> - 2-1
96fcfca
- new upstream release: 2
96fcfca
769e09f
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1-3
769e09f
- Rebuilt for Python 3.8
769e09f
01e171a
* Mon Jul 29 2019 Martin Sehnoutka <msehnout@redhat.com> - 1-2
01e171a
- update upstream URL to the new Github organization
01e171a
1f3a9a5
* Wed Jul 17 2019 Martin Sehnoutka <msehnout@redhat.com> - 1-1
1f3a9a5
- Initial package