From: Carsten Schlote <[email protected]>

Works with linux kernel 2.6.31 or higher.

Signed-off-by: Carsten Schlote <[email protected]>
---
 .../btrfs-progs-crosscompile-fixes.patch           |   83 +++++++++++++
 patches/btrfs-progs-0.19/series                    |    1 +
 rules/btrfs-progs.in                               |   11 ++
 rules/btrfs-progs.make                             |  122 ++++++++++++++++++++
 4 files changed, 217 insertions(+), 0 deletions(-)
 create mode 100644 
patches/btrfs-progs-0.19/btrfs-progs-crosscompile-fixes.patch
 create mode 100644 patches/btrfs-progs-0.19/series
 create mode 100644 rules/btrfs-progs.in
 create mode 100644 rules/btrfs-progs.make

diff --git a/patches/btrfs-progs-0.19/btrfs-progs-crosscompile-fixes.patch 
b/patches/btrfs-progs-0.19/btrfs-progs-crosscompile-fixes.patch
new file mode 100644
index 0000000..4a89b83
--- /dev/null
+++ b/patches/btrfs-progs-0.19/btrfs-progs-crosscompile-fixes.patch
@@ -0,0 +1,83 @@
+---
+ Makefile |   31 ++++++++++++++++---------------
+ 1 file changed, 16 insertions(+), 15 deletions(-)
+
+Index: btrfs-progs-0.19/Makefile
+===================================================================
+--- btrfs-progs-0.19.orig/Makefile     2009-06-11 18:56:15.000000000 +0200
++++ btrfs-progs-0.19/Makefile  2009-12-18 17:07:41.000000000 +0100
+@@ -1,4 +1,4 @@
+-CC=gcc
++CC?=$(CC)
+ AM_CFLAGS = -Wall -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2
+ CFLAGS = -g -Werror -Os
+ objects = ctree.o disk-io.o radix-tree.o extent-tree.o print-tree.o \
+@@ -16,7 +16,8 @@
+ bindir = $(prefix)/bin
+ LIBS=-luuid
+ 
+-progs = btrfsctl mkfs.btrfs btrfs-debug-tree btrfs-show btrfs-vol btrfsck
++progs = btrfsctl mkfs.btrfs btrfs-debug-tree btrfs-show btrfs-vol btrfsck \
++  btrfs-image btrfstune quick-test btrfs-convert
+ 
+ # make C=1 to enable sparse
+ ifdef C
+@@ -27,7 +28,7 @@
+ 
+ .c.o:
+       $(check) $<
+-      $(CC) $(DEPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c $<
++      $(CC) $(DEPFLAGS) $(AM_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c $<
+ 
+ 
+ all: version $(progs) manpages
+@@ -36,37 +37,37 @@
+       bash version.sh
+ 
+ btrfsctl: $(objects) btrfsctl.o
+-      gcc $(CFLAGS) -o btrfsctl btrfsctl.o $(objects) $(LDFLAGS) $(LIBS)
++      $(CC) $(CFLAGS) -o btrfsctl btrfsctl.o $(objects) $(LDFLAGS) $(LIBS)
+ 
+ btrfs-vol: $(objects) btrfs-vol.o
+-      gcc $(CFLAGS) -o btrfs-vol btrfs-vol.o $(objects) $(LDFLAGS) $(LIBS)
++      $(CC) $(CFLAGS) -o btrfs-vol btrfs-vol.o $(objects) $(LDFLAGS) $(LIBS)
+ 
+ btrfs-show: $(objects) btrfs-show.o
+-      gcc $(CFLAGS) -o btrfs-show btrfs-show.o $(objects) $(LDFLAGS) $(LIBS)
++      $(CC) $(CFLAGS) -o btrfs-show btrfs-show.o $(objects) $(LDFLAGS) $(LIBS)
+ 
+ btrfsck: $(objects) btrfsck.o
+-      gcc $(CFLAGS) -o btrfsck btrfsck.o $(objects) $(LDFLAGS) $(LIBS)
++      $(CC) $(CFLAGS) -o btrfsck btrfsck.o $(objects) $(LDFLAGS) $(LIBS)
+ 
+ mkfs.btrfs: $(objects) mkfs.o
+-      gcc $(CFLAGS) -o mkfs.btrfs $(objects) mkfs.o $(LDFLAGS) $(LIBS)
++      $(CC) $(CFLAGS) -o mkfs.btrfs $(objects) mkfs.o $(LDFLAGS) $(LIBS)
+ 
+ btrfs-debug-tree: $(objects) debug-tree.o
+-      gcc $(CFLAGS) -o btrfs-debug-tree $(objects) debug-tree.o $(LDFLAGS) 
$(LIBS)
++      $(CC) $(CFLAGS) -o btrfs-debug-tree $(objects) debug-tree.o $(LDFLAGS) 
$(LIBS)
+ 
+ btrfstune: $(objects) btrfstune.o
+-      gcc $(CFLAGS) -o btrfstune $(objects) btrfstune.o $(LDFLAGS) $(LIBS)
++      $(CC) $(CFLAGS) -o btrfstune $(objects) btrfstune.o $(LDFLAGS) $(LIBS)
+ 
+ btrfs-image: $(objects) btrfs-image.o
+-      gcc $(CFLAGS) -o btrfs-image $(objects) btrfs-image.o -lpthread -lz 
$(LDFLAGS) $(LIBS)
++      $(CC) $(CFLAGS) -o btrfs-image $(objects) btrfs-image.o -lpthread -lz 
$(LDFLAGS) $(LIBS)
+ 
+ dir-test: $(objects) dir-test.o
+-      gcc $(CFLAGS) -o dir-test $(objects) dir-test.o $(LDFLAGS) $(LIBS)
++      $(CC) $(CFLAGS) -o dir-test $(objects) dir-test.o $(LDFLAGS) $(LIBS)
+ 
+ quick-test: $(objects) quick-test.o
+-      gcc $(CFLAGS) -o quick-test $(objects) quick-test.o $(LDFLAGS) $(LIBS)
++      $(CC) $(CFLAGS) -o quick-test $(objects) quick-test.o $(LDFLAGS) $(LIBS)
+ 
+-convert: $(objects) convert.o
+-      gcc $(CFLAGS) -o btrfs-convert $(objects) convert.o -lext2fs $(LDFLAGS) 
$(LIBS)
++btrfs-convert: $(objects) convert.o
++      $(CC) $(CFLAGS) -o btrfs-convert $(objects) convert.o -lext2fs 
$(LDFLAGS) $(LIBS)
+ 
+ manpages:
+       cd man; make
diff --git a/patches/btrfs-progs-0.19/series b/patches/btrfs-progs-0.19/series
new file mode 100644
index 0000000..fbdb15e
--- /dev/null
+++ b/patches/btrfs-progs-0.19/series
@@ -0,0 +1 @@
+btrfs-progs-crosscompile-fixes.patch
diff --git a/rules/btrfs-progs.in b/rules/btrfs-progs.in
new file mode 100644
index 0000000..055b5fa
--- /dev/null
+++ b/rules/btrfs-progs.in
@@ -0,0 +1,11 @@
+## SECTION=disk_and_file
+
+config BTRFS_PROGS
+       tristate
+       select UTIL_LINUX_NG
+       select UTIL_LINUX_NG_LIBUUID
+       select ZLIB
+       prompt "btrfs-progs"
+       help
+         Tools to create and manipulate btfsfs filesystem volumes. Requires 
Linux
+         2.6.30 or higher.
diff --git a/rules/btrfs-progs.make b/rules/btrfs-progs.make
new file mode 100644
index 0000000..decd033
--- /dev/null
+++ b/rules/btrfs-progs.make
@@ -0,0 +1,122 @@
+# -*-makefile-*-
+# $Id$
+#
+# Copyright (C) 2009 by Carsten Schlote <[email protected]>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_BTRFS_PROGS) += btrfs-progs
+
+#
+# Paths and names
+#
+BTRFS_PROGS_VERSION    := 0.19
+BTRFS_PROGS            := btrfs-progs-$(BTRFS_PROGS_VERSION)
+BTRFS_PROGS_SUFFIX     := tar.bz2
+BTRFS_PROGS_URL                := 
http://www.kernel.org/pub/linux/kernel/people/mason/btrfs/$(BTRFS_PROGS).$(BTRFS_PROGS_SUFFIX)
+BTRFS_PROGS_SOURCE     := $(SRCDIR)/$(BTRFS_PROGS).$(BTRFS_PROGS_SUFFIX)
+BTRFS_PROGS_DIR                := $(BUILDDIR)/$(BTRFS_PROGS)
+
+# ----------------------------------------------------------------------------
+# Get
+# ----------------------------------------------------------------------------
+
+$(BTRFS_PROGS_SOURCE):
+       @$(call targetinfo)
+       @$(call get, BTRFS_PROGS)
+
+# ----------------------------------------------------------------------------
+# Extract
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/btrfs-progs.extract:
+       @$(call targetinfo)
+       @$(call clean, $(BTRFS_PROGS_DIR))
+       @$(call extract, BTRFS_PROGS)
+       @$(call patchin, BTRFS_PROGS)
+       @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+BTRFS_PROGS_PATH       := PATH=$(CROSS_PATH)
+BTRFS_PROGS_ENV        := $(CROSS_ENV)
+
+#
+# autoconf
+#
+BTRFS_PROGS_AUTOCONF := $(CROSS_AUTOCONF_USR)
+
+$(STATEDIR)/btrfs-progs.prepare:
+       @$(call targetinfo)
+       @$(call clean, $(BTRFS_PROGS_DIR)/config.cache)
+#      cd $(BTRFS_PROGS_DIR) && \
+#              $(BTRFS_PROGS_PATH) $(BTRFS_PROGS_ENV) \
+#              ./configure $(BTRFS_PROGS_AUTOCONF)
+       @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Compile
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/btrfs-progs.compile:
+       @$(call targetinfo)
+       cd $(BTRFS_PROGS_DIR) && $(BTRFS_PROGS_PATH) $(BTRFS_PROGS_ENV) $(MAKE) 
$(PARALLELMFLAGS)
+       @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/btrfs-progs.install:
+       @$(call targetinfo)
+       @$(call install, BTRFS_PROGS)
+       @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/btrfs-progs.targetinstall:
+       @$(call targetinfo)
+
+       @$(call install_init, btrfs-progs)
+       @$(call install_fixup, btrfs-progs,PACKAGE,btrfs-progs)
+       @$(call install_fixup, btrfs-progs,PRIORITY,optional)
+       @$(call install_fixup, btrfs-progs,VERSION,$(BTRFS_PROGS_VERSION))
+       @$(call install_fixup, btrfs-progs,SECTION,base)
+       @$(call install_fixup, btrfs-progs,AUTHOR,"Carsten Schlote 
<[email protected]>")
+       @$(call install_fixup, btrfs-progs,DEPENDS,)
+       @$(call install_fixup, btrfs-progs,DESCRIPTION,missing)
+
+       @$(call install_copy, btrfs-progs, 0, 0, 0755, 
$(BTRFS_PROGS_DIR)/btrfsck, /sbin/btrfsck)
+       @$(call install_copy, btrfs-progs, 0, 0, 0755, 
$(BTRFS_PROGS_DIR)/btrfsctl, /sbin/btrfsctl)
+       @$(call install_copy, btrfs-progs, 0, 0, 0755, 
$(BTRFS_PROGS_DIR)/btrfs-debug-tree, /sbin/btrfs-debug-tree)
+       @$(call install_copy, btrfs-progs, 0, 0, 0755, 
$(BTRFS_PROGS_DIR)/btrfs-image, /sbin/btrfs-image)
+       @$(call install_copy, btrfs-progs, 0, 0, 0755, 
$(BTRFS_PROGS_DIR)/btrfs-show, /sbin/btrfs-show)
+       @$(call install_copy, btrfs-progs, 0, 0, 0755, 
$(BTRFS_PROGS_DIR)/btrfstune, /sbin/btrfstune)
+       @$(call install_copy, btrfs-progs, 0, 0, 0755, 
$(BTRFS_PROGS_DIR)/btrfs-vol, /sbin/btrfs-vol)
+       @$(call install_copy, btrfs-progs, 0, 0, 0755, 
$(BTRFS_PROGS_DIR)/mkfs.btrfs, /sbin/mkfs.btrfs)
+
+       @$(call install_finish, btrfs-progs)
+
+       @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Clean
+# ----------------------------------------------------------------------------
+
+btrfs-progs_clean:
+       rm -rf $(STATEDIR)/btrfs-progs.*
+       rm -rf $(PKGDIR)/btrfs-progs_*
+       rm -rf $(BTRFS_PROGS_DIR)
+
+# vim: syntax=make
-- 
1.6.5.6.gb3118


--
ptxdist mailing list
[email protected]

Reply via email to