Add a -devel subpackage containing automated RPM dependency generator for supermin appliances.

This commit is contained in:
Richard W.M. Jones 2015-03-12 13:49:13 +00:00
parent d2f8d87958
commit 69cab538c2
3 changed files with 60 additions and 1 deletions

26
supermin-find-requires Executable file
View File

@ -0,0 +1,26 @@
#!/bin/bash -
# Generate RPM requires automatically for supermin appliances.
# Copyright (C) 2009-2015 Red Hat Inc.
# This script is called with a list of supermin.d/*packages* files
# (either passed on the command line, or if that is empty, then passed
# through stdin). Each file is a simple list of packages, so we
# simply have to `cat' the contents in order to get the list of
# requires - it could hardly be simpler.
function process_file
{
cat "$1"
}
if [ "$#" -ge 1 ]; then
for f in "$@"; do
process_file "$f"
done
else
# Get the list of files from stdin. One filename per line?
while read line; do
process_file "$line"
done
fi

2
supermin.attr Normal file
View File

@ -0,0 +1,2 @@
%__supermin_requires %{_rpmconfigdir}/supermin-find-requires
%__supermin_path /supermin.d/[^/]*packages[^/]*

View File

@ -4,7 +4,7 @@
Summary: Tool for creating supermin appliances Summary: Tool for creating supermin appliances
Name: supermin Name: supermin
Version: 5.1.12 Version: 5.1.12
Release: 2%{?dist} Release: 4%{?dist}
License: GPLv2+ License: GPLv2+
%if 0%{?rhel} >= 7 %if 0%{?rhel} >= 7
@ -45,6 +45,11 @@ Requires: findutils
Provides: supermin-helper = %{version}-%{release} Provides: supermin-helper = %{version}-%{release}
Obsoletes: supermin-helper < 4.1.6-3 Obsoletes: supermin-helper < 4.1.6-3
# For automatic RPM dependency generation.
# See: http://www.rpm.org/wiki/PackagerDocs/DependencyGenerator
Source1: supermin.attr
Source2: supermin-find-requires
%description %description
Supermin is a tool for building supermin appliances. These are tiny Supermin is a tool for building supermin appliances. These are tiny
@ -53,6 +58,19 @@ size, which get fully instantiated on-the-fly in a fraction of a
second when you need to boot one of them. second when you need to boot one of them.
%package devel
Summary: Development tools for %{name}
Requires: %{name} = %{version}-%{release}
Requires: rpm-build
%description devel
%{name}-devel contains development tools for %{name}.
It just contains tools for automatic RPM dependency generation
from supermin appliances.
%prep %prep
%setup -q %setup -q
@ -65,6 +83,10 @@ make
%install %install
make DESTDIR=$RPM_BUILD_ROOT install make DESTDIR=$RPM_BUILD_ROOT install
mkdir -p $RPM_BUILD_ROOT%{_rpmconfigdir}/fileattrs/
install -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_rpmconfigdir}/fileattrs/
install -m 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_rpmconfigdir}/
%check %check
@ -87,7 +109,16 @@ make check || {
%{_mandir}/man1/supermin.1* %{_mandir}/man1/supermin.1*
%files devel
%{_rpmconfigdir}/fileattrs/supermin.attr
%{_rpmconfigdir}/supermin-find-requires
%changelog %changelog
* Thu Mar 12 2015 Richard W.M. Jones <rjones@redhat.com> - 5.1.12-4
- Add a -devel subpackage containing automated RPM dependency generator
for supermin appliances.
* Mon Mar 9 2015 Richard W.M. Jones <rjones@redhat.com> - 5.1.12-2 * Mon Mar 9 2015 Richard W.M. Jones <rjones@redhat.com> - 5.1.12-2
- Disable hardened build as it breaks building the static 'init' binary. - Disable hardened build as it breaks building the static 'init' binary.