From: Erwin Rol <[email protected]>

- Adds a target version of squashf-tools

Signed-off-by: Erwin Rol <[email protected]>
---
 patches/squashfs3.4/series             |    1 +
 patches/squashfs3.4/squashfs_libs.diff |   34 ++++++++++++++
 patches/squashfs4.0/series             |    1 +
 patches/squashfs4.0/squashfs_libs.diff |   34 ++++++++++++++
 rules/host-squashfs-tools.make         |   15 +------
 rules/squashfs-tools.in                |   24 ++++++++++
 rules/squashfs-tools.make              |   78 ++++++++++++++++++++++++++++++++
 7 files changed, 173 insertions(+), 14 deletions(-)
 create mode 100644 patches/squashfs3.4/series
 create mode 100644 patches/squashfs3.4/squashfs_libs.diff
 create mode 100644 patches/squashfs4.0/series
 create mode 100644 patches/squashfs4.0/squashfs_libs.diff
 create mode 100644 rules/squashfs-tools.in
 create mode 100644 rules/squashfs-tools.make

diff --git a/patches/squashfs3.4/series b/patches/squashfs3.4/series
new file mode 100644
index 0000000..de458cd
--- /dev/null
+++ b/patches/squashfs3.4/series
@@ -0,0 +1 @@
+squashfs_libs.diff
diff --git a/patches/squashfs3.4/squashfs_libs.diff 
b/patches/squashfs3.4/squashfs_libs.diff
new file mode 100644
index 0000000..382e42d
--- /dev/null
+++ b/patches/squashfs3.4/squashfs_libs.diff
@@ -0,0 +1,34 @@
+Subject: Add way to change linker settings
+From: Erwin Rol <[email protected]>
+
+When cross compiling the linker can not find libz, this patch
+adds a LIBS variable that makes it possible to pass the right
+linker flags.
+
+Signed-off-by: Erwin Rol <[email protected]>
+
+--- squashfs3.4/squashfs-tools/Makefile.orig   2010-02-27 00:01:56.000000000 
+0100
++++ squashfs3.4/squashfs-tools/Makefile        2010-02-27 00:02:46.000000000 
+0100
+@@ -4,10 +4,12 @@
+ 
+ CFLAGS := -I$(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE 
-D_GNU_SOURCE -O2
+ 
++LIBS := -lz -lpthread -lm 
++
+ all: mksquashfs unsquashfs
+ 
+ mksquashfs: mksquashfs.o read_fs.o sort.o
+-      $(CC) mksquashfs.o read_fs.o sort.o -lz -lpthread -lm -o $@
++      $(CC) mksquashfs.o read_fs.o sort.o $(LIBS) -o $@
+ 
+ mksquashfs.o: mksquashfs.c squashfs_fs.h mksquashfs.h global.h sort.h
+ 
+@@ -16,7 +18,7 @@
+ sort.o: sort.c squashfs_fs.h global.h sort.h
+ 
+ unsquashfs: unsquashfs.o
+-      $(CC) unsquashfs.o -lz -lpthread -lm -o $@
++      $(CC) unsquashfs.o $(LIBS) -o $@
+ 
+ unsquashfs.o: unsquashfs.c squashfs_fs.h read_fs.h global.h
+ 
diff --git a/patches/squashfs4.0/series b/patches/squashfs4.0/series
new file mode 100644
index 0000000..de458cd
--- /dev/null
+++ b/patches/squashfs4.0/series
@@ -0,0 +1 @@
+squashfs_libs.diff
diff --git a/patches/squashfs4.0/squashfs_libs.diff 
b/patches/squashfs4.0/squashfs_libs.diff
new file mode 100644
index 0000000..10303d7
--- /dev/null
+++ b/patches/squashfs4.0/squashfs_libs.diff
@@ -0,0 +1,34 @@
+Subject: Add way to change linker settings
+From: Erwin Rol <[email protected]>
+
+When cross compiling the linker can not find libz, this patch
+adds a LIBS variable that makes it possible to pass the right
+linker flags.
+
+Signed-off-by: Erwin Rol <[email protected]>
+
+--- squashfs4.0/squashfs-tools/Makefile.orig   2010-02-26 13:25:30.000000000 
+0100
++++ squashfs4.0/squashfs-tools/Makefile        2010-02-26 13:26:31.000000000 
+0100
+@@ -4,10 +4,12 @@
+ 
+ CFLAGS := -I$(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE 
-D_GNU_SOURCE -O2
+ 
++LIBS := -lz -lpthread -lm 
++
+ all: mksquashfs unsquashfs
+ 
+ mksquashfs: mksquashfs.o read_fs.o sort.o swap.o pseudo.o
+-      $(CC) mksquashfs.o read_fs.o sort.o swap.o pseudo.o -lz -lpthread -lm 
-o $@
++      $(CC) mksquashfs.o read_fs.o sort.o swap.o pseudo.o $(LIBS) -o $@
+ 
+ mksquashfs.o: mksquashfs.c squashfs_fs.h mksquashfs.h global.h sort.h 
squashfs_swap.h Makefile
+ 
+@@ -20,7 +22,7 @@
+ pseudo.o: pseudo.c pseudo.h Makefile
+ 
+ unsquashfs: unsquashfs.o unsquash-1.o unsquash-2.o unsquash-3.o unsquash-4.o 
swap.o
+-      $(CC) unsquashfs.o unsquash-1.o unsquash-2.o unsquash-3.o unsquash-4.o 
swap.o -lz -lpthread -lm -o $@
++      $(CC) unsquashfs.o unsquash-1.o unsquash-2.o unsquash-3.o unsquash-4.o 
swap.o $(LIBS) -o $@
+ 
+ unsquashfs.o: unsquashfs.h unsquashfs.c squashfs_fs.h squashfs_swap.h 
squashfs_compat.h global.h Makefile
+ 
diff --git a/rules/host-squashfs-tools.make b/rules/host-squashfs-tools.make
index 504365f..cd42c2a 100644
--- a/rules/host-squashfs-tools.make
+++ b/rules/host-squashfs-tools.make
@@ -16,23 +16,10 @@ HOST_PACKAGES-$(PTXCONF_HOST_SQUASHFS_TOOLS) += 
host-squashfs-tools
 #
 # Paths and names
 #
-HOST_SQUASHFS_TOOLS_VERSION    := $(call ptx/ifdef, 
PTXCONF_HOST_SQUASHFS_TOOLS_V3X, 3.4, 4.0)
-HOST_SQUASHFS_TOOLS            := squashfs$(HOST_SQUASHFS_TOOLS_VERSION)
-HOST_SQUASHFS_TOOLS_SUFFIX     := tar.gz
-HOST_SQUASHFS_TOOLS_URL                := 
$(PTXCONF_SETUP_SFMIRROR)/squashfs/$(HOST_SQUASHFS_TOOLS).$(HOST_SQUASHFS_TOOLS_SUFFIX)
-HOST_SQUASHFS_TOOLS_SOURCE     := 
$(SRCDIR)/$(HOST_SQUASHFS_TOOLS).$(HOST_SQUASHFS_TOOLS_SUFFIX)
-HOST_SQUASHFS_TOOLS_DIR                := 
$(HOST_BUILDDIR)/$(HOST_SQUASHFS_TOOLS)
+HOST_SQUASHFS_TOOLS_DIR                := $(HOST_BUILDDIR)/$(SQUASHFS_TOOLS)
 HOST_SQUASHFS_TOOLS_SUBDIR     := squashfs-tools
 
 # ----------------------------------------------------------------------------
-# Get
-# ----------------------------------------------------------------------------
-
-$(HOST_SQUASHFS_TOOLS_SOURCE):
-       @$(call targetinfo)
-       @$(call get, HOST_SQUASHFS_TOOLS)
-
-# ----------------------------------------------------------------------------
 # Compile
 # ----------------------------------------------------------------------------
 
diff --git a/rules/squashfs-tools.in b/rules/squashfs-tools.in
new file mode 100644
index 0000000..8e17402
--- /dev/null
+++ b/rules/squashfs-tools.in
@@ -0,0 +1,24 @@
+## SECTION=disk_and_file
+
+menuconfig SQUASHFS_TOOLS
+       tristate
+       select ZLIB
+       prompt "squashfs-tools"
+       help
+         Squashfs is a highly compressed read-only filesystem for Linux.
+         It uses zlib compression to compress both files, inodes and 
directories.
+         Inodes in the system are very small and all blocks are packed to 
minimise
+         data overhead. Block sizes greater than 4K are supported up to a 
maximum
+         of 1Mbytes (default block size 128K).
+
+if SQUASHFS_TOOLS
+
+config SQUASHFS_TOOLS_MKSQUASHFS
+       bool
+       prompt "Install mksquashfs"
+
+config SQUASHFS_TOOLS_UNSQUASHFS
+       bool
+       prompt "Install unsquashfs"
+
+endif
diff --git a/rules/squashfs-tools.make b/rules/squashfs-tools.make
new file mode 100644
index 0000000..a0d3a99
--- /dev/null
+++ b/rules/squashfs-tools.make
@@ -0,0 +1,78 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2010 by Erwin Rol
+#
+# 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_SQUASHFS_TOOLS) += squashfs-tools
+
+#
+# Paths and names
+#
+SQUASHFS_TOOLS_VERSION  = $(call ptx/ifdef, PTXCONF_HOST_SQUASHFS_TOOLS_V3X, 
3.4, 4.0)
+SQUASHFS_TOOLS         := squashfs$(SQUASHFS_TOOLS_VERSION)
+SQUASHFS_TOOLS_SUFFIX  := tar.gz
+SQUASHFS_TOOLS_URL     := 
$(PTXCONF_SETUP_SFMIRROR)/squashfs/$(SQUASHFS_TOOLS).$(SQUASHFS_TOOLS_SUFFIX)
+SQUASHFS_TOOLS_SOURCE  := $(SRCDIR)/$(SQUASHFS_TOOLS).$(SQUASHFS_TOOLS_SUFFIX)
+SQUASHFS_TOOLS_DIR     := $(BUILDDIR)/$(SQUASHFS_TOOLS)
+SQUASHFS_TOOLS_SUBDIR  := squashfs-tools
+SQUASHFS_TOOLS_LICENSE := unknown
+
+# ----------------------------------------------------------------------------
+# Get
+# ----------------------------------------------------------------------------
+
+$(SQUASHFS_TOOLS_SOURCE):
+       @$(call targetinfo)
+       @$(call get, SQUASHFS_TOOLS)
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+SQUASHFS_TOOLS_MAKE_OPT := \
+       $(CROSS_ENV) \
+       LIBS="$(CROSS_LDFLAGS) -lz -lpthread -lm"
+
+SQUASHFS_TOOLS_MAKE_PAR := NO
+SQUASHFS_TOOLS_INSTALL_OPT := \
+       $(SQUASHFS_TOOLS_MAKE_OPT) \
+       INSTALL_DIR="$(SQUASHFS_TOOLS_PKGDIR)/usr/sbin" \
+       install
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/squashfs-tools.targetinstall:
+       @$(call targetinfo)
+
+       @$(call install_init,  squashfs-tools)
+       @$(call install_fixup, squashfs-tools,PACKAGE,squashfs-tools)
+       @$(call install_fixup, squashfs-tools,PRIORITY,optional)
+       @$(call install_fixup, squashfs-tools,VERSION,$(SQUASHFS_TOOLS_VERSION))
+       @$(call install_fixup, squashfs-tools,SECTION,base)
+       @$(call install_fixup, squashfs-tools,AUTHOR,"Erwin Rol")
+       @$(call install_fixup, squashfs-tools,DEPENDS,)
+       @$(call install_fixup, squashfs-tools,DESCRIPTION,missing)
+
+
+ifdef PTXCONF_SQUASHFS_TOOLS_MKSQUASHFS
+       @$(call install_copy, squashfs-tools, 0, 0, 0755, -, 
/usr/sbin/mksquashfs)
+endif
+ifdef PTXCONF_SQUASHFS_TOOLS_UNSQUASHFS
+       @$(call install_copy, squashfs-tools, 0, 0, 0755, -, 
/usr/sbin/unsquashfs)
+endif
+
+       @$(call install_finish, squashfs-tools)
+
+       @$(call touch)
+
+# vim: syntax=make
-- 
1.7.0


--
ptxdist mailing list
[email protected]

Reply via email to