libglob: new package
authorJörg Krause <joerg.krause@embedded.rocks>
Mon, 1 Aug 2016 19:58:36 +0000 (21:58 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 25 Oct 2016 19:52:00 +0000 (21:52 +0200)
libglob is the OpenBSD implementation of glob(3).

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
[Thomas: slightly rework how the make targets are calculated.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/Config.in
package/libglob/Config.in [new file with mode: 0644]
package/libglob/libglob.hash [new file with mode: 0644]
package/libglob/libglob.mk [new file with mode: 0644]

index e8ec723eb081f2a22a0c8900e431e40d95cafa3a..f90336b60746e614a843de617bda76bc5b91b9e9 100644 (file)
@@ -1308,6 +1308,7 @@ menu "Other"
        source "package/libffi/Config.in"
        source "package/libgee/Config.in"
        source "package/libglib2/Config.in"
+       source "package/libglob/Config.in"
        source "package/libical/Config.in"
        source "package/libite/Config.in"
        source "package/liblinear/Config.in"
diff --git a/package/libglob/Config.in b/package/libglob/Config.in
new file mode 100644 (file)
index 0000000..029ed6a
--- /dev/null
@@ -0,0 +1,4 @@
+config BR2_PACKAGE_LIBGLOB
+       bool "libglob"
+       help
+         OpenBSD implementation of glob(3).
diff --git a/package/libglob/libglob.hash b/package/libglob/libglob.hash
new file mode 100644 (file)
index 0000000..0b39407
--- /dev/null
@@ -0,0 +1,2 @@
+# Locally calculated:
+sha256  4f1b204dad065689941c64828a92441fb316c9c7539b39525fa728125da65e22  libglob-1.0.tar.gz
diff --git a/package/libglob/libglob.mk b/package/libglob/libglob.mk
new file mode 100644 (file)
index 0000000..534f936
--- /dev/null
@@ -0,0 +1,48 @@
+################################################################################
+#
+# libglob
+#
+################################################################################
+
+LIBGLOB_VERSION = 1.0
+LIBGLOB_SITE = $(call github,voidlinux,libglob,$(LIBGLOB_VERSION))
+LIBGLOB_LICENSE = BSD-3c
+LIBGLOB_LICENSE_FILE = LICENSE
+LIBGLOB_INSTALL_STAGING = YES
+
+ifeq ($(BR2_SHARED_LIBS)$(BR2_SHARED_STATIC_LIBS),y)
+LIBGLOB_MAKE_TARGETS += libglob.so
+# $1: destination directory
+define LIBGLOB_INSTALL_SHARED
+       $(INSTALL) -m 0755 -D $(@D)/libglob.so.0.0.0 \
+               $(1)/usr/lib/libglob.so.0.0.0
+       ln -sf libglob.so.0.0.0 $(1)/usr/lib/libglob.so.0
+       ln -sf libglob.so.0.0.0 $(1)/usr/lib/libglob.so
+endef
+endif
+
+ifeq ($(BR2_STATIC_LIBS)$(BR2_SHARED_STATIC_LIBS),y)
+LIBGLOB_MAKE_TARGETS += libglob.a
+# $1: destination directory
+define LIBGLOB_INSTALL_STATIC
+       $(INSTALL) -m 0644 -D $(@D)/libglob.a $(1)/usr/lib/libglob.a
+endef
+endif
+
+define LIBGLOB_BUILD_CMDS
+       $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
+               $(LIBGLOB_MAKE_TARGETS)
+endef
+
+define LIBGLOB_INSTALL_STAGING_CMDS
+       $(INSTALL) -m 0644 -D $(@D)/glob.h \
+               $(STAGING_DIR)/usr/include/libglob/glob.h
+       $(call LIBGLOB_INSTALL_SHARED,$(STAGING_DIR))
+       $(call LIBGLOB_INSTALL_STATIC,$(STAGING_DIR))
+endef
+
+define LIBGLOB_INSTALL_TARGET_CMDS
+       $(call LIBGLOB_INSTALL_SHARED,$(TARGET_DIR))
+endef
+
+$(eval $(generic-package))