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

Richard W.M. Jones rjones at fedoraproject.org
Thu Mar 12 14:47:47 UTC 2015


commit 69cab538c2961e5f5a17ccdbe134f01fec084f28
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Thu Mar 12 13:49:13 2015 +0000

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

 supermin-find-requires | 26 ++++++++++++++++++++++++++
 supermin.attr          |  2 ++
 supermin.spec          | 33 ++++++++++++++++++++++++++++++++-
 3 files changed, 60 insertions(+), 1 deletion(-)
---
diff --git a/supermin-find-requires b/supermin-find-requires
new file mode 100755
index 0000000..984f783
--- /dev/null
+++ b/supermin-find-requires
@@ -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
diff --git a/supermin.attr b/supermin.attr
new file mode 100644
index 0000000..d794e71
--- /dev/null
+++ b/supermin.attr
@@ -0,0 +1,2 @@
+%__supermin_requires   %{_rpmconfigdir}/supermin-find-requires
+%__supermin_path       /supermin.d/[^/]*packages[^/]*
diff --git a/supermin.spec b/supermin.spec
index b4c320b..66bb3e6 100644
--- a/supermin.spec
+++ b/supermin.spec
@@ -4,7 +4,7 @@
 Summary:       Tool for creating supermin appliances
 Name:          supermin
 Version:       5.1.12
-Release:       2%{?dist}
+Release:       4%{?dist}
 License:       GPLv2+
 
 %if 0%{?rhel} >= 7
@@ -45,6 +45,11 @@ Requires:      findutils
 Provides:      supermin-helper = %{version}-%{release}
 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
 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.
 
 
+%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
 %setup -q
 
@@ -65,6 +83,10 @@ make
 %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
 
@@ -87,7 +109,16 @@ make check || {
 %{_mandir}/man1/supermin.1*
 
 
+%files devel
+%{_rpmconfigdir}/fileattrs/supermin.attr
+%{_rpmconfigdir}/supermin-find-requires
+
+
 %changelog
+* Thu Mar 12 2015 Richard W.M. Jones <rjones at 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 at redhat.com> - 5.1.12-2
 - Disable hardened build as it breaks building the static 'init' binary.
 


More information about the scm-commits mailing list