Source: f2fs-tools
Version: 1.4.1-1
Severity: wishlist
Tags: patch
X-Debbugs-CC: 
komaldsukh...@gmail.com,h...@at.or.at,a...@gambaru.de,android-tools-de...@lists.alioth.debian.org

Hi,

I am packaging Android SDK which requires a libf2fs_fmt.so compiled
from libf2fs.c, f2fs_format.c and f2fs_format_utils.c. Android SDK
also needs the headers of f2fs-tools. More information can be found at
<https://android.googlesource.com/platform/external/f2fs-tools/+/master/Android.mk>.
Currently f2fs-tools package does not provide these files for external
development use, so I wish to add a new package "f2fs-tools-dev"
containing some development files. I have made a patch for the
modifications.

This patch creates a new package "f2fs-tools-dev" and a
f2fs-tools-dev.mk that compiles the source files mentioned above into
2 .a files. The package installs this 2 .a files and the headers.
Please consider using it, thank you.

Cheers,
Kai-Chung Yan
diff --git a/debian/control b/debian/control
index d068f6d..73dd0f0 100644
--- a/debian/control
+++ b/debian/control
@@ -28,3 +28,13 @@ Description: Tools for Flash-Friendly File System (debug)
  System (LFS).
  .
  This package contains the debugging symbols.
+
+Package: f2fs-tools-dev
+Architecture: linux-any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: Tools for Flash-Friendly File System - Development files
+ F2FS is a new filesystem for Linux aimed at NAND flash memory-based storage
+ devices, such as SSD, eMMC, and SD cards. It is based on Log-structured File
+ System (LFS).
+ .
+ This package contains the development files.
\ No newline at end of file
diff --git a/debian/f2fs-tools-dev.install b/debian/f2fs-tools-dev.install
new file mode 100644
index 0000000..9683263
--- /dev/null
+++ b/debian/f2fs-tools-dev.install
@@ -0,0 +1,3 @@
+include/*        usr/include/f2fs-tools
+libf2fs.a        usr/lib
+libf2fs_format.a usr/lib
\ No newline at end of file
diff --git a/debian/f2fs-tools-dev.mk b/debian/f2fs-tools-dev.mk
new file mode 100644
index 0000000..0ff48dd
--- /dev/null
+++ b/debian/f2fs-tools-dev.mk
@@ -0,0 +1,23 @@
+LIBF2FS_SOURCES = lib/libf2fs.c lib/libf2fs_io.c
+LIBF2FS_FORMAT_SOURCES = mkfs/f2fs_format.c \
+                         mkfs/f2fs_format_main.c \
+                         mkfs/f2fs_format_utils.c
+LOCAL_CFLAGS = -fPIC -c
+LOCAL_CPPFLAGS = -Iinclude -Imkfs
+
+build: libf2fs.a libf2fs_format.a
+
+lib/%.o: lib/%.c
+	cc $< -o $@ $(CFLAGS) $(CPPFLAGS) $(LOCAL_CFLAGS) $(LOCAL_CPPFLAGS)
+
+mkfs/%.o: mkfs/%.c
+	cc $^ -o $@ $(CFLAGS) $(CPPFLAGS) $(LOCAL_CFLAGS) $(LOCAL_CPPFLAGS)
+
+libf2fs.a: $(LIBF2FS_SOURCES:.c=.o)
+	ar rs $@ $^
+
+libf2fs_format.a: $(LIBF2FS_FORMAT_SOURCES:.c=.o)
+	ar rc $@ $^
+
+clean:
+	rm -f lib/*.o mkfs/*.o libf2fs.a libf2fs_format.a
\ No newline at end of file
diff --git a/debian/rules b/debian/rules
index 06ec920..9a4573c 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,6 +7,14 @@ DEB_UPSTREAM_VERSION ?= $(shell dpkg-parsechangelog | \
 %:
 	dh $@ --with autoreconf
 
+override_dh_auto_build:
+	dh_auto_build
+	make -f debian/f2fs-tools-dev.mk
+
+override_dh_auto_clean:
+	dh_auto_clean
+	make clean -f debian/f2fs-tools-dev.mk
+
 override_dh_auto_configure:
 	dh_auto_configure -- --bindir=/sbin --libdir=/lib/$(DEB_HOST_MULTIARCH)
 

Reply via email to