From: Don Slutz <dslutz@verizon.com>
To: George Dunlap <george.dunlap@eu.citrix.com>, xen-devel@lists.xen.org
Cc: Olaf Hering <olaf@aepfle.de>,
Ian Campbell <ian.campbell@citrix.com>,
Dario Faggioli <dario.faggioli@citrix.com>,
Don Slutz <dslutz@verizon.com>,
M A Young <m.a.young@durham.ac.uk>,
Ian Jackson <ian.jackson@citrix.com>
Subject: Re: [PATCH v2 2/2] Add a "make rpmball" target
Date: Tue, 04 Mar 2014 15:17:43 -0500 [thread overview]
Message-ID: <531634E7.3050103@terremark.com> (raw)
In-Reply-To: <1393941409-9105-2-git-send-email-george.dunlap@eu.citrix.com>
On 03/04/14 08:56, George Dunlap wrote:
> Build a simplistic dummy package, similar to "make debball", for
> developers on rpm-based systems.
>
> Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
> ---
> v2:
> - use --no-print-directory rather than '| grep -v :'
> - use find boot/ -type l -delete rather
> - bash-ify the script, so that we can...
> - use string manipulation to break down version and release numbers
> - Don't delete xen-syms, xen-*.gz links
>
> CC: Ian Jackson <ian.jackson@citrix.com>
> CC: Ian Campbell <ian.campbell@citrix.com>
> CC: Dario Faggioli <dario.faggioli@citrix.com>
> CC: Olaf Hering <olaf@aepfle.de>
> CC: Don Slutz <dslutz@verizon.com>
> CC: M A Young <m.a.young@durham.ac.uk>
> ---
> Makefile | 7 +++++
> tools/misc/mkrpm | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 83 insertions(+)
> create mode 100644 tools/misc/mkrpm
>
> diff --git a/Makefile b/Makefile
> index 4c5d1b6..91ca280 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -152,6 +152,13 @@ world:
> debball: dist
> fakeroot sh ./tools/misc/mkdeb $(XEN_ROOT) $$($(MAKE) -C xen xenversion --no-print-directory)
>
> +# Package a build in an rpmball file, that is inside a .rpm format
> +# container to allow for easy and clean removal. This is not intended
> +# to be a full featured policy compliant .rpm package.
> +.PHONY: rpmball
> +rpmball: dist
> + bash ./tools/misc/mkrpm $(XEN_ROOT) $$($(MAKE) -C xen xenversion --no-print-directory)
> +
> # clean doesn't do a kclean
> .PHONY: clean
> clean::
> diff --git a/tools/misc/mkrpm b/tools/misc/mkrpm
> new file mode 100644
> index 0000000..88cf13e
> --- /dev/null
> +++ b/tools/misc/mkrpm
> @@ -0,0 +1,76 @@
> +#!/bin/bash
> +#
> +# mkrpm: package the dist/install output of a Xen build in an .rpm
> +#
> +# Takes 2 arguments, the path to the dist directory and the version
> +
> +set -e
> +
> +if [[ -z "$1" || -z "$2" ]] ; then
> + echo "usage: $0 path-to-XEN_ROOT xen-version"
> + exit 1
> +fi
> +
> +xenroot="$1"
> +
> +# rpmbuild doesn't like dashes in the version; break it down into
> +# version and release. Default to "0" if there isn't a release.
> +v=(${2/-/ })
> +version=${v[0]}
> +release=${v[1]}
> +
> +[[ -n "$release" ]] || release="0"
> +
> +cd $xenroot
> +
> +# Prepare the directory to package
> +cd dist
> +rm -rf rpm
> +
> +# Fill in the rpm boilerplate
> +mkdir -p rpm/SPEC
On CentOS 5.10 I get:
bash ./tools/misc/mkrpm /home/don/xen-4.4.0-rc6 $(make -C xen xenversion --no-print-directory)
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.7024
+ umask 022
+ cd /home/don/xen-4.4.0-rc6/dist/rpm/BUILD
/var/tmp/rpm-tmp.7024: line 23: cd: /home/don/xen-4.4.0-rc6/dist/rpm/BUILD: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.7024 (%build)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.7024 (%build)
make: *** [rpmball] Error 1
Adding:
diff --git a/tools/misc/mkrpm b/tools/misc/mkrpm
index 88cf13e..a0aa357 100644
--- a/tools/misc/mkrpm
+++ b/tools/misc/mkrpm
@@ -29,6 +29,8 @@ rm -rf rpm
# Fill in the rpm boilerplate
mkdir -p rpm/SPEC
+mkdir -p rpm/BUILD
+mkdir -p rpm/RPMS/x86_64
cat >rpm/SPEC/xen.spec <<EOF
Summary: Xen development build, version $version
Name: xen
Fixes things up for me.
(Fedora 17 does not need this.)
-Don Slutz
> +cat >rpm/SPEC/xen.spec <<EOF
> +Summary: Xen development build, version $version
> +Name: xen
> +Version: $version
> +Release: $release
> +License: GPL
> +Group: System/Hypervisor
> +URL: http://xenbits.xenproject.org/xen.git
> +
> +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
> +%define __spec_install_post /usr/lib/rpm/brp-compress || :
> +%define debug_package %{nil}
> +
> +%description
> +This package contains the Xen hypervisor and associated tools, built
> +from a source tree. It is not a fully packaged and supported Xen, just
> +the output of a xen "make dist" wrapped in an .rpm to make it easy to
> +uninstall.
> +
> +%build
> +
> +%install
> +rm -rf \$RPM_BUILD_ROOT
> +mkdir -p \$RPM_BUILD_ROOT
> +cd %{_xenroot}
> +dist/install.sh \$RPM_BUILD_ROOT/
> +
> +cd \$RPM_BUILD_ROOT
> +
> +%clean
> +rm -rf \$RPM_BUILD_ROOT
> +
> +%files
> +%defattr(-,root,root,-)
> +/*
> +
> +%post
> +EOF
> +
> +# Package it up
> +rpmbuild --define "_xenroot $xenroot" --define "_topdir $PWD/rpm" -bb rpm/SPEC/xen.spec
> +
> +# Tidy up after ourselves
> +mv rpm/RPMS/*/*.rpm .
> +rm -rf rpm
next prev parent reply other threads:[~2014-03-04 20:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-04 13:56 [PATCH v2 1/2] tools: Use --no-print-directory instead of grep for debball version George Dunlap
2014-03-04 13:56 ` [PATCH v2 2/2] Add a "make rpmball" target George Dunlap
2014-03-04 20:17 ` Don Slutz [this message]
2014-03-04 20:23 ` George Dunlap
2014-03-04 20:35 ` Don Slutz
2014-03-05 10:10 ` George Dunlap
2014-03-05 15:27 ` Don Slutz
2014-03-04 21:29 ` Don Koch
2014-03-06 10:34 ` [PATCH v2 1/2] tools: Use --no-print-directory instead of grep for debball version Tim Deegan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=531634E7.3050103@terremark.com \
--to=dslutz@verizon.com \
--cc=dario.faggioli@citrix.com \
--cc=george.dunlap@eu.citrix.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@citrix.com \
--cc=m.a.young@durham.ac.uk \
--cc=olaf@aepfle.de \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.