[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [PATCH v2 2/2] Add a "make rpmball" target
On 03/04/2014 08:17 PM, Don Slutz wrote:
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@xxxxxxxxxxxxx>
---
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@xxxxxxxxxx>
CC: Ian Campbell <ian.campbell@xxxxxxxxxx>
CC: Dario Faggioli <dario.faggioli@xxxxxxxxxx>
CC: Olaf Hering <olaf@xxxxxxxxx>
CC: Don Slutz <dslutz@xxxxxxxxxxx>
CC: M A Young <m.a.young@xxxxxxxxxxxx>
---
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
Hrm, looks like maybe your version or rpmbuild doesn't automatically
create the directories under %topdir?
You could try changing the "mkdir" to something like this?
mkdir -p rpm/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
-George
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|