diff mbox

[05/36] package/libiscsi: new package

Message ID 1344815664-28138-5-git-send-email-yann.morin.1998@free.fr
State RFC
Headers show

Commit Message

Yann E. MORIN Aug. 12, 2012, 11:53 p.m. UTC
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 package/Config.in            |    1 +
 package/libiscsi/Config.in   |   12 ++++++++++++
 package/libiscsi/libiscsi.mk |   23 +++++++++++++++++++++++
 3 files changed, 36 insertions(+), 0 deletions(-)
 create mode 100644 package/libiscsi/Config.in
 create mode 100644 package/libiscsi/libiscsi.mk

Comments

Thomas Petazzoni Aug. 17, 2012, 11:14 a.m. UTC | #1
Le Mon, 13 Aug 2012 01:53:53 +0200,
"Yann E. MORIN" <yann.morin.1998@free.fr> a écrit :

> +LIBISCSI_VERSION         = 1.5.0
> +LIBISCSI_SITE            = git://github.com/sahlberg/libiscsi.git

You can instead use

https://github.com/sahlberg/libiscsi/zipball/$(LIBISCI_VERSION)

which will download a zip file of the project.

> +LIBISCSI_LICENSE         = LGPLv2.1+
> +LIBISCSI_LICENSE_FILES   = COPYING LICENCE-LGPL-2.1.txt
> +# Note: the binaries are GPLv2+, but we do not use them
> +LIBISCSI_INSTALL_STAGING = YES
> +LIBISCSI_DEPENDENCIES    = popt
> +
> +#----------------------------------------------------------------------------
> +# Package build process
> +
> +# As we use the git repository, we need to generate the configure script
> +# Using the standard autoreconf does not work (missing m4/ dir)
> +define LIBISCSI_CREATE_CONFIGURE
> +	cd $(@D); ./autogen.sh
> +endef
> +LIBISCSI_PRE_CONFIGURE_HOOKS += LIBISCSI_CREATE_CONFIGURE
> +LIBISCSI_DEPENDENCIES        += host-autoconf

host-autoconf will not bring host-automake, so I think you should
either depend on host-automake (which itself depends on host-autoconf),
or you should do like the autotools package infrastructure does:
FOO_DEPENDENCIES += host-automake host-autoconf host-libtool.

Or, you can do something like:

LIBISCSI_AUTORECONF = YES
# Having a m4/ directory is mandatory for autoreconf to work
define LIBISCSI_CREATE_M4_DIR
	mkdir -p $(@D)/m4
endef
LIBISCSI_PRE_CONFIGURE_HOOKS += LIBISCSI_CREATE_M4_DIR

I don't have a strong opinion between those two solutions.

Thomas
Samuel Martin Aug. 17, 2012, 12:29 p.m. UTC | #2
2012/8/17 Thomas Petazzoni <thomas.petazzoni@free-electrons.com>:
> Le Mon, 13 Aug 2012 01:53:53 +0200,
> "Yann E. MORIN" <yann.morin.1998@free.fr> a écrit :
>
>> +LIBISCSI_VERSION         = 1.5.0
>> +LIBISCSI_SITE            = git://github.com/sahlberg/libiscsi.git
>
> You can instead use
>
> https://github.com/sahlberg/libiscsi/zipball/$(LIBISCI_VERSION)
>
> which will download a zip file of the project.

I think the right url is:
https://github.com/downloads/sahlberg/libiscsi/libiscsi-1.5.0.tar.gz

Though the zipball/tarball url is valid as soon as a tag is pushed in
the repository, it will require some more plumbing in the download
infrastructure since the downloaded file name is $(FOO_VERSION) with
no extension. What a pity!

BTW, to get a source archive available on
https://github.com/downloads/*, the maintainers of the projects have
to upload it.

>
>> +LIBISCSI_LICENSE         = LGPLv2.1+
>> +LIBISCSI_LICENSE_FILES   = COPYING LICENCE-LGPL-2.1.txt
>> +# Note: the binaries are GPLv2+, but we do not use them
>> +LIBISCSI_INSTALL_STAGING = YES
>> +LIBISCSI_DEPENDENCIES    = popt
>> +
>> +#----------------------------------------------------------------------------
>> +# Package build process
>> +
>> +# As we use the git repository, we need to generate the configure script
>> +# Using the standard autoreconf does not work (missing m4/ dir)
>> +define LIBISCSI_CREATE_CONFIGURE
>> +     cd $(@D); ./autogen.sh
>> +endef
>> +LIBISCSI_PRE_CONFIGURE_HOOKS += LIBISCSI_CREATE_CONFIGURE
>> +LIBISCSI_DEPENDENCIES        += host-autoconf
>
> host-autoconf will not bring host-automake, so I think you should
> either depend on host-automake (which itself depends on host-autoconf),
> or you should do like the autotools package infrastructure does:
> FOO_DEPENDENCIES += host-automake host-autoconf host-libtool.

I would assume that the autotools-package infrastructure automatically
pulled these host dependencies...
Thomas Petazzoni Aug. 17, 2012, 12:42 p.m. UTC | #3
Le Fri, 17 Aug 2012 14:29:53 +0200,
Samuel Martin <s.martin49@gmail.com> a écrit :

> > You can instead use
> >
> > https://github.com/sahlberg/libiscsi/zipball/$(LIBISCI_VERSION)
> >
> > which will download a zip file of the project.
> 
> I think the right url is:
> https://github.com/downloads/sahlberg/libiscsi/libiscsi-1.5.0.tar.gz

Well, the above URL worked for me as well :)

> Though the zipball/tarball url is valid as soon as a tag is pushed in
> the repository, it will require some more plumbing in the download
> infrastructure since the downloaded file name is $(FOO_VERSION) with
> no extension. What a pity!

We have done changes to allow that for external toolchains (i.e
download a funky Git URL into a reasonably named tarball file), should
we do this for packages?

> > host-autoconf will not bring host-automake, so I think you should
> > either depend on host-automake (which itself depends on host-autoconf),
> > or you should do like the autotools package infrastructure does:
> > FOO_DEPENDENCIES += host-automake host-autoconf host-libtool.
> 
> I would assume that the autotools-package infrastructure automatically
> pulled these host dependencies...

It does if you do FOO_AUTORECONF=YES. But in this case, the
FOO_AUTORECONF mechanism doesn't work because the source tree lacks a
m4/ directory, needed for autoreconf. Usually, the packages come with
some ./autogen or ./autogen.sh or ./bootstrap script doing the
necessary preparation + autoreconf call, but there is no really
commonly adopted best practice here.

Best regards,

Thomas
diff mbox

Patch

diff --git a/package/Config.in b/package/Config.in
index 3b581a2..ef411e3 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -417,6 +417,7 @@  source "package/libesmtp/Config.in"
 source "package/libeXosip2/Config.in"
 source "package/libfcgi/Config.in"
 source "package/libidn/Config.in"
+source "package/libiscsi/Config.in"
 source "package/liboauth/Config.in"
 source "package/libmicrohttpd/Config.in"
 source "package/neon/Config.in"
diff --git a/package/libiscsi/Config.in b/package/libiscsi/Config.in
new file mode 100644
index 0000000..f3fc29e
--- /dev/null
+++ b/package/libiscsi/Config.in
@@ -0,0 +1,12 @@ 
+config BR2_PACKAGE_LIBISCSI
+	bool "libiscsi"
+	select BR2_PACKAGE_POPT
+	help
+	  Libiscsi is a client-side library to implement the iSCSI protocol
+	  that can be used to access resource of an iSCSI Target.
+	  
+	  The library is fully async with regards to iscsi commands and scsi
+	  tasks, but a sync layer is also provided for ease of use for simpler
+	  applications.
+	  
+	  https://github.com/sahlberg/libiscsi  (no proper homepage)
diff --git a/package/libiscsi/libiscsi.mk b/package/libiscsi/libiscsi.mk
new file mode 100644
index 0000000..4e1fe1a
--- /dev/null
+++ b/package/libiscsi/libiscsi.mk
@@ -0,0 +1,23 @@ 
+#-----------------------------------------------------------------------------
+# Package description
+
+LIBISCSI_VERSION         = 1.5.0
+LIBISCSI_SITE            = git://github.com/sahlberg/libiscsi.git
+LIBISCSI_LICENSE         = LGPLv2.1+
+LIBISCSI_LICENSE_FILES   = COPYING LICENCE-LGPL-2.1.txt
+# Note: the binaries are GPLv2+, but we do not use them
+LIBISCSI_INSTALL_STAGING = YES
+LIBISCSI_DEPENDENCIES    = popt
+
+#----------------------------------------------------------------------------
+# Package build process
+
+# As we use the git repository, we need to generate the configure script
+# Using the standard autoreconf does not work (missing m4/ dir)
+define LIBISCSI_CREATE_CONFIGURE
+	cd $(@D); ./autogen.sh
+endef
+LIBISCSI_PRE_CONFIGURE_HOOKS += LIBISCSI_CREATE_CONFIGURE
+LIBISCSI_DEPENDENCIES        += host-autoconf
+
+$(eval $(autotools-package))