mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] iniparser: Add package
@ 2013-02-18  9:09 Alexander Stein
  2013-02-18  9:58 ` Alexander Dahl
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Stein @ 2013-02-18  9:09 UTC (permalink / raw)
  To: ptxdist; +Cc: Alexander Stein

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
---
iniparser.make seems trivial and works, but I'm still uncertain, if
INIPARSER_CONF_TOOL := autoconf would be needed or not. There are new
packages setting this. But IIRC it should not be necessary.

 .../iniparser-3.1/0001-Add-extern-C-wrappers.patch | 61 ++++++++++++++++++++++
 ...Add-files-for-autotools-based-compilation.patch | 60 +++++++++++++++++++++
 patches/iniparser-3.1/autogen.sh                   |  1 +
 patches/iniparser-3.1/series                       |  5 ++
 rules/iniparser.in                                 |  7 +++
 rules/iniparser.make                               | 47 +++++++++++++++++
 6 files changed, 181 insertions(+)
 create mode 100644 patches/iniparser-3.1/0001-Add-extern-C-wrappers.patch
 create mode 100644 patches/iniparser-3.1/0002-Add-files-for-autotools-based-compilation.patch
 create mode 120000 patches/iniparser-3.1/autogen.sh
 create mode 100644 patches/iniparser-3.1/series
 create mode 100644 rules/iniparser.in
 create mode 100644 rules/iniparser.make

diff --git a/patches/iniparser-3.1/0001-Add-extern-C-wrappers.patch b/patches/iniparser-3.1/0001-Add-extern-C-wrappers.patch
new file mode 100644
index 0000000..d78e433
--- /dev/null
+++ b/patches/iniparser-3.1/0001-Add-extern-C-wrappers.patch
@@ -0,0 +1,61 @@
+From: Alexander Stein <alexander.stein@systec-electronic.com>
+Date: Mon, 18 Feb 2013 09:51:07 +0100
+Subject: [PATCH] Add extern "C" wrappers
+
+Taken from Gentoo portage tree.
+
+Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
+---
+ src/dictionary.c | 8 ++++++++
+ src/iniparser.h  | 8 ++++++++
+ 2 files changed, 16 insertions(+)
+
+diff --git a/src/dictionary.c b/src/dictionary.c
+index 3f0f5cf..7fcc355 100644
+--- a/src/dictionary.c
++++ b/src/dictionary.c
+@@ -32,6 +32,9 @@
+ /*---------------------------------------------------------------------------
+                             Private functions
+  ---------------------------------------------------------------------------*/
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ /* Doubles the allocated size associated to a pointer */
+ /* 'size' is the current allocated size. */
+@@ -394,5 +397,10 @@ int main(int argc, char *argv[])
+     dictionary_del(d);
+     return 0 ;
+ }
++
++#ifdef __cplusplus
++}
++#endif
++
+ #endif
+ /* vim: set ts=4 et sw=4 tw=75 */
+diff --git a/src/iniparser.h b/src/iniparser.h
+index ecd73bf..5421455 100644
+--- a/src/iniparser.h
++++ b/src/iniparser.h
+@@ -49,6 +49,10 @@
+ int iniparser_getnsec(dictionary * d);
+ 
+ 
++#ifdef __cplusplus
++extern "C" {
++#endif
++
+ /*-------------------------------------------------------------------------*/
+ /**
+   @brief    Get name for section n in a dictionary.
+@@ -304,4 +308,8 @@ dictionary * iniparser_load(const char * ininame);
+ /*--------------------------------------------------------------------------*/
+ void iniparser_freedict(dictionary * d);
+ 
++#ifdef __cplusplus
++}
++#endif
++
+ #endif
diff --git a/patches/iniparser-3.1/0002-Add-files-for-autotools-based-compilation.patch b/patches/iniparser-3.1/0002-Add-files-for-autotools-based-compilation.patch
new file mode 100644
index 0000000..0cc1718
--- /dev/null
+++ b/patches/iniparser-3.1/0002-Add-files-for-autotools-based-compilation.patch
@@ -0,0 +1,60 @@
+From: Alexander Stein <alexander.stein@systec-electronic.com>
+Date: Mon, 18 Feb 2013 09:52:02 +0100
+Subject: [PATCH] Add files for autotools based compilation
+
+Taken from Gentoo portage tree.
+
+Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
+---
+ Makefile.am  | 10 ++++++++++
+ configure.ac | 24 ++++++++++++++++++++++++
+ 2 files changed, 34 insertions(+)
+ create mode 100644 Makefile.am
+ create mode 100644 configure.ac
+
+diff --git a/Makefile.am b/Makefile.am
+new file mode 100644
+index 0000000..63ca53b
+--- /dev/null
++++ b/Makefile.am
+@@ -0,0 +1,10 @@
++ACLOCAL_AMFLAGS = -I config
++
++lib_LTLIBRARIES = libiniparser.la
++
++libiniparser_la_LDFLAGS = -no-undefined -version-info @SHARED_VERSION_INFO@
++libiniparser_la_SOURCES = src/dictionary.c  src/iniparser.c
++
++include_HEADERS = src/dictionary.h  src/iniparser.h
++
++
+diff --git a/configure.ac b/configure.ac
+new file mode 100644
+index 0000000..2aa2d4e
+--- /dev/null
++++ b/configure.ac
+@@ -0,0 +1,24 @@
++AC_PREREQ([2.65])
++AC_INIT([iniparser], [3.0], [ndevilla@free.fr])
++
++AC_CONFIG_AUX_DIR(config)
++AC_CONFIG_MACRO_DIR(config)
++
++AM_INIT_AUTOMAKE([1.8 foreign])
++
++SHARED_VERSION_INFO="0"
++AC_SUBST(SHARED_VERSION_INFO)
++
++
++# Checks for programs.
++AC_PROG_CC
++
++LT_INIT
++# Checks for header files.
++AC_CHECK_HEADERS([ ctype.h stdio.h stdlib.h string.h ])
++
++# Checks for library functions.
++AC_CHECK_FUNCS([strcmp])
++
++AC_CONFIG_FILES([Makefile])
++AC_OUTPUT
diff --git a/patches/iniparser-3.1/autogen.sh b/patches/iniparser-3.1/autogen.sh
new file mode 120000
index 0000000..9f8a4cb
--- /dev/null
+++ b/patches/iniparser-3.1/autogen.sh
@@ -0,0 +1 @@
+../autogen.sh
\ No newline at end of file
diff --git a/patches/iniparser-3.1/series b/patches/iniparser-3.1/series
new file mode 100644
index 0000000..352b5ea
--- /dev/null
+++ b/patches/iniparser-3.1/series
@@ -0,0 +1,5 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-Add-extern-C-wrappers.patch
+0002-Add-files-for-autotools-based-compilation.patch
+# a3c1900847ba70cdfd3a21aaa6e48824  - git-ptx-patches magic
diff --git a/rules/iniparser.in b/rules/iniparser.in
new file mode 100644
index 0000000..7184391
--- /dev/null
+++ b/rules/iniparser.in
@@ -0,0 +1,7 @@
+## SECTION=system_libraries
+
+config INIPARSER
+	tristate
+	prompt "iniparser"
+	help
+	  iniparser is a free stand-alone ini file parsing library.
diff --git a/rules/iniparser.make b/rules/iniparser.make
new file mode 100644
index 0000000..b34aac2
--- /dev/null
+++ b/rules/iniparser.make
@@ -0,0 +1,47 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2013 by Alexander Stein <alexander.stein@systec-electronic.com>
+#
+# 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_INIPARSER) += iniparser
+
+#
+# Paths and names
+#
+INIPARSER_VERSION	:= 3.1
+INIPARSER_MD5		:= 0aa4f995468ed390caf323f50a285bc3
+INIPARSER		:= iniparser-$(INIPARSER_VERSION)
+INIPARSER_SUFFIX	:= tar.gz
+INIPARSER_URL		:= http://ndevilla.free.fr/iniparser/$(INIPARSER).$(INIPARSER_SUFFIX)
+INIPARSER_SOURCE	:= $(SRCDIR)/$(INIPARSER).$(INIPARSER_SUFFIX)
+INIPARSER_DIR		:= $(BUILDDIR)/$(INIPARSER)
+INIPARSER_LICENSE	:= MIT
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/iniparser.targetinstall:
+	@$(call targetinfo)
+
+	@$(call install_init, iniparser)
+	@$(call install_fixup, iniparser,PRIORITY,optional)
+	@$(call install_fixup, iniparser,SECTION,base)
+	@$(call install_fixup, iniparser,AUTHOR,"Alexander Stein <alexander.stein@systec-electronic.com>")
+	@$(call install_fixup, iniparser,DESCRIPTION,missing)
+
+	@$(call install_lib, iniparser, 0, 0, 0644, libiniparser)
+
+	@$(call install_finish, iniparser)
+
+	@$(call touch)
+
+# vim: syntax=make
-- 
1.8.1.2


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-02-18 10:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-18  9:09 [ptxdist] [PATCH] iniparser: Add package Alexander Stein
2013-02-18  9:58 ` Alexander Dahl
2013-02-18 10:18   ` Alexander Stein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox