[gnome-ostree] manifest: Pull in grubby



commit f33001dcfc33b0b4e1064efbdf5f7a6820e85e57
Author: Colin Walters <walters verbum org>
Date:   Tue Feb 12 16:13:03 2013 -0500

    manifest: Pull in grubby
    
    Since ostree uses it.

 manifest.json                 |    5 +-
 patches/grubby-buildapi.patch |  129 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 133 insertions(+), 1 deletions(-)
---
diff --git a/manifest.json b/manifest.json
index 1776430..359f887 100644
--- a/manifest.json
+++ b/manifest.json
@@ -787,7 +787,10 @@
 
 		{"src": "gnome:pygobject"},
 
-		{"src": "gnome:caribou"}
+		{"src": "gnome:caribou"},
+
+		{"src": "git:git://git.fedorahosted.org/grubby.git",
+		 "patches": ["grubby-buildapi.patch"]}
 
 	],
     
diff --git a/patches/grubby-buildapi.patch b/patches/grubby-buildapi.patch
new file mode 100644
index 0000000..f1267f3
--- /dev/null
+++ b/patches/grubby-buildapi.patch
@@ -0,0 +1,129 @@
+From f14743109af2f70f6b0b5e14deba54242a7f9a73 Mon Sep 17 00:00:00 2001
+From: Colin Walters <walters verbum org>
+Date: Tue, 12 Feb 2013 15:05:44 -0500
+Subject: [PATCH] build: Rework to implement GNOME Build API
+
+See http://people.gnome.org/~walters/docs/build-api.txt
+
+The advantage of this is that the spec file (and debian/rules, and
+ebuilds, and...)  all look exactly the same.  We honor --prefix, and
+use DESTDIR in the same way the autotools do.
+
+Also, the Makefile shouldn't hardcode something called RPM_OPT_FLAGS -
+instead we take CFLAGS at configure time, the same way the autotools
+do.
+
+Signed-off-by: Colin Walters <walters verbum org>
+---
+ Makefile  |   26 ++++++++++++++++----------
+ configure |   52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 68 insertions(+), 10 deletions(-)
+ create mode 100755 configure
+
+diff --git a/Makefile b/Makefile
+index 51f6754..51fa1e2 100644
+--- a/Makefile
++++ b/Makefile
+@@ -22,9 +22,15 @@ VERSION=8.21
+ TARGETS = grubby
+ OBJECTS = grubby.o
+ 
++-include Makefile.inc
++
++prefix ?= /usr
++mandir ?= $(prefix)/share/man
++
++CFLAGS ?= -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector
++
+ CC = gcc
+-RPM_OPT_FLAGS := -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector
+-CFLAGS += $(RPM_OPT_FLAGS) -std=gnu99 -Wall -Werror -Wno-error=unused-function -Wno-unused-function -ggdb
++CFLAGS += -std=gnu99 -Wall -Werror -Wno-error=unused-function -Wno-unused-function -ggdb
+ LDFLAGS := 
+ 
+ grubby_LIBS = -lblkid -lpopt
+@@ -42,15 +48,15 @@ test: all
+ 	@./test.sh
+ 
+ install: all
+-	mkdir -p $(DESTDIR)/sbin
+-	mkdir -p $(DESTDIR)/$(mandir)/man8
+-	install -m 755 new-kernel-pkg $(DESTDIR)/sbin
+-	install -m 644 new-kernel-pkg.8 $(DESTDIR)/$(mandir)/man8
+-	install -m 755 installkernel $(DESTDIR)/sbin
+-	install -m 644 installkernel.8 $(DESTDIR)/$(mandir)/man8
++	mkdir -p $(DESTDIR)$(prefix)/sbin
++	mkdir -p $(DESTDIR)$(mandir)/man8
++	install -m 755 new-kernel-pkg $(DESTDIR)$(prefix)/sbin
++	install -m 644 new-kernel-pkg.8 $(DESTDIR)$(mandir)/man8
++	install -m 755 installkernel $(DESTDIR)$(prefix)/sbin
++	install -m 644 installkernel.8 $(DESTDIR)$(mandir)/man8
+ 	if [ -f grubby ]; then \
+-		install -m 755 grubby $(DESTDIR)/sbin ; \
+-		install -m 644 grubby.8 $(DESTDIR)/$(mandir)/man8 ; \
++		install -m 755 grubby $(DESTDIR)$(prefix)/sbin ; \
++		install -m 644 grubby.8 $(DESTDIR)$(mandir)/man8 ; \
+ 	fi
+ 
+ grubby:: $(OBJECTS)
+diff --git a/configure b/configure
+new file mode 100755
+index 0000000..2b94d8f
+--- /dev/null
++++ b/configure
+@@ -0,0 +1,52 @@
++#!/bin/bash
++# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
++# ex: ts=8 sw=4 sts=4 et filetype=sh
++
++# We don't support srcdir != builddir
++#buildapi-variable-no-builddir
++
++prefix=/usr
++
++# Little helper function for reading args from the commandline.
++# it automatically handles -a b and -a=b variants, and returns 1 if
++# we need to shift $3.
++read_arg() {
++    # $1 = arg name
++    # $2 = arg value
++    # $3 = arg parameter
++    local rematch='^[^=]*=(.*)$'
++    if [[ $2 =~ $rematch ]]; then
++        read "$1" <<< "${BASH_REMATCH[1]}"
++    else
++        read "$1" <<< "$3"
++        # There is no way to shift our callers args, so
++        # return 1 to indicate they should do it instead.
++        return 1
++    fi
++}
++
++while (($# > 0)); do
++    case "${1%%=*}" in
++        --prefix) read_arg prefix "$@" || shift;;
++        --bindir) read_arg bindir "$@" || shift;;
++        --libdir) read_arg libdir "$@" || shift;;
++        --datadir) read_arg datadir "$@" || shift;;
++        --sysconfdir) read_arg sysconfdir "$@" || shift;;
++        --sbindir) read_arg sbindir "$@" || shift;;
++        --mandir) read_arg mandir "$@" || shift;;
++        *) ;;
++    esac
++    shift
++done
++
++cat > Makefile.inc.tmp <<EOF
++prefix ?= ${prefix}
++bindir ?= ${bindir:-${prefix}/bin}
++libdir ?= ${libdir:-${prefix}/lib}
++datadir ?= ${datadir:-${prefix}/share}
++sysconfdir ?= ${sysconfdir:-${prefix}/etc}
++sbindir ?= ${sbindir:-${prefix}/sbin}
++mandir ?= ${mandir:-${prefix}/share/man}
++CFLAGS ?= $CFLAGS
++EOF
++mv Makefile.inc.tmp Makefile.inc
+-- 
+1.7.1
+


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]