diff mbox series

[2/4] package/volume_key: add new package

Message ID 20200217143030.5031-3-giulio.benetti@benettiengineering.com
State Changes Requested
Headers show
Series udisks bump to version 2.8.4 | expand

Commit Message

Giulio Benetti Feb. 17, 2020, 2:30 p.m. UTC
The volume_key project provides a libvolume_key, a library for manipulating
storage volume encryption keys and storing them separately from volumes, and an
associated command-line tool, named volume_key.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 DEVELOPERS                                    |  1 +
 package/Config.in                             |  1 +
 ...ove-po-Makefile.in-entry-from-AC_CON.patch | 28 +++++++++++++++++++
 package/volume_key/Config.in                  | 19 +++++++++++++
 package/volume_key/volume_key.hash            |  3 ++
 package/volume_key/volume_key.mk              | 22 +++++++++++++++
 6 files changed, 74 insertions(+)
 create mode 100644 package/volume_key/0001-configure.ac-remove-po-Makefile.in-entry-from-AC_CON.patch
 create mode 100644 package/volume_key/Config.in
 create mode 100644 package/volume_key/volume_key.hash
 create mode 100644 package/volume_key/volume_key.mk

Comments

Thomas Petazzoni Feb. 17, 2020, 6:51 p.m. UTC | #1
Hello,

On Mon, 17 Feb 2020 15:30:28 +0100
Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:

> diff --git a/DEVELOPERS b/DEVELOPERS
> index 6f2dbbb11a..5276c09384 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -1016,6 +1016,7 @@ F:	package/minicom/
>  F:	package/nfs-utils/
>  F:	package/sunxi-mali-mainline/
>  F:	package/sunxi-mali-mainline-driver/
> +F:	package/volume_key/

Would you mind naming the package volume-key instead of volume_key ?

> diff --git a/package/volume_key/0001-configure.ac-remove-po-Makefile.in-entry-from-AC_CON.patch b/package/volume_key/0001-configure.ac-remove-po-Makefile.in-entry-from-AC_CON.patch
> new file mode 100644
> index 0000000000..44d6ee0d4b
> --- /dev/null
> +++ b/package/volume_key/0001-configure.ac-remove-po-Makefile.in-entry-from-AC_CON.patch
> @@ -0,0 +1,28 @@
> +From d1142e667f4f2f2fcd2d36a006919325c1a4377e Mon Sep 17 00:00:00 2001
> +From: Giulio Benetti <giulio.benetti@benettiengineering.com>
> +Date: Sat, 25 Jan 2020 17:24:38 +0100
> +Subject: [PATCH] configure.ac: remove po/Makefile.in entry from
> + AC_CONFIG_FILES
> +
> +AC_CONFIG_FILES should not contain po/Makefile.in file because
> +gettextize will re-add it again causing build failure.
> +
> +Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>

Was this reported upstream?

> diff --git a/package/volume_key/Config.in b/package/volume_key/Config.in
> new file mode 100644
> index 0000000000..0c0827253d
> --- /dev/null
> +++ b/package/volume_key/Config.in
> @@ -0,0 +1,19 @@
> +config BR2_PACKAGE_VOLUME_KEY
> +	bool "volume_key"
> +	depends on BR2_TOOLCHAIN_HAS_THREADS # cryptsetup, libassuan, libglib2, libgpgme, libnss
> +	depends on BR2_USE_MMU # cryptsetup, libassuan, libglib2, libgpgme
> +	depends on !BR2_STATIC_LIBS # cryptsetup, libnss
> +	depends on BR2_TOOLCHAIN_HAS_SYNC_4 # cryptsetup
> +	depends on BR2_USE_WCHAR # libglib2
> +	depends on BR2_PACKAGE_LIBGPG_ERROR_ARCH_SUPPORTS # libgpgme, libassuan
> +	select BR2_PACKAGE_CRYPTSETUP
> +	select BR2_PACKAGE_LIBASSUAN
> +	select BR2_PACKAGE_LIBGLIB2
> +	select BR2_PACKAGE_LIBGPGME
> +	select BR2_PACKAGE_LIBNSS
> +	help
> +	  The volume_key project provides a libvolume_key, a library for manipulating
> +	  storage volume encryption keys and storing them separately from volumes, and an
> +	  associated command-line tool, named volume_key.
> +
> +	  https://pagure.io/volume_key

You need a Config.in comment about the (numerous) dependencies.

> diff --git a/package/volume_key/volume_key.mk b/package/volume_key/volume_key.mk
> new file mode 100644
> index 0000000000..8d5bff6d8e
> --- /dev/null
> +++ b/package/volume_key/volume_key.mk
> @@ -0,0 +1,22 @@
> +################################################################################
> +#
> +# volume_key
> +#
> +################################################################################
> +
> +VOLUME_KEY_VERSION = f56614199726ba1897d8687f0927535693b6603f

Why not use the 0.3.12 release ?

> +VOLUME_KEY_SITE = https://pagure.io/volume_key.git
> +VOLUME_KEY_SITE_METHOD = git
> +VOLUME_KEY_LICENSE = GPL-2.0+

I don't see the "or later" option in any of the source files, so shouldn't this be GPL-2.0 ?

> +VOLUME_KEY_LICENSE_FILES = COPYING
> +VOLUME_KEY_DEPENDENCIES = cryptsetup libglib2 libgpgme libnss $(TARGET_NLS_DEPENDENCIES)
> +VOLUME_KEY_INSTALL_STAGING = YES
> +VOLUME_KEY_AUTORECONF = YES
> +VOLUME_KEY_GETTEXTIZE = YES
> +
> +VOLUME_KEY_CONF_OPTS = --with-sysroot=$(STAGING_DIR) \

The --with-sysroot option always looks weird. What is this needed for ?

> +		       --with-gpgme-prefix=$(STAGING_DIR)/usr \
> +		       --without-python \
> +		       --without-python3
> +
> +$(eval $(autotools-package))

In the configure.ac file, I see:

AC_PATH_PROG([GPG], [gpg2])
AC_ARG_VAR([GPG])
AC_DEFINE_UNQUOTED([GPG_PATH], "$GPG", [Path to the gpg2 executable])

So don't we need gnupg on the host for this to work ?

I see:

PKG_CHECK_MODULES(blkid, [blkid])

don't we need the blkid library from util-linux ? I see it is selected
by cryptsetup, which is why it works.

Thanks!

Thomas
Giulio Benetti Feb. 18, 2020, 1:46 p.m. UTC | #2
Hi Thomas,

On 2/17/20 7:51 PM, Thomas Petazzoni wrote:
> Hello,
> 
> On Mon, 17 Feb 2020 15:30:28 +0100
> Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:
> 
>> diff --git a/DEVELOPERS b/DEVELOPERS
>> index 6f2dbbb11a..5276c09384 100644
>> --- a/DEVELOPERS
>> +++ b/DEVELOPERS
>> @@ -1016,6 +1016,7 @@ F:	package/minicom/
>>   F:	package/nfs-utils/
>>   F:	package/sunxi-mali-mainline/
>>   F:	package/sunxi-mali-mainline-driver/
>> +F:	package/volume_key/
> 
> Would you mind naming the package volume-key instead of volume_key ?

Sure

>> diff --git a/package/volume_key/0001-configure.ac-remove-po-Makefile.in-entry-from-AC_CON.patch b/package/volume_key/0001-configure.ac-remove-po-Makefile.in-entry-from-AC_CON.patch
>> new file mode 100644
>> index 0000000000..44d6ee0d4b
>> --- /dev/null
>> +++ b/package/volume_key/0001-configure.ac-remove-po-Makefile.in-entry-from-AC_CON.patch
>> @@ -0,0 +1,28 @@
>> +From d1142e667f4f2f2fcd2d36a006919325c1a4377e Mon Sep 17 00:00:00 2001
>> +From: Giulio Benetti <giulio.benetti@benettiengineering.com>
>> +Date: Sat, 25 Jan 2020 17:24:38 +0100
>> +Subject: [PATCH] configure.ac: remove po/Makefile.in entry from
>> + AC_CONFIG_FILES
>> +
>> +AC_CONFIG_FILES should not contain po/Makefile.in file because
>> +gettextize will re-add it again causing build failure.
>> +
>> +Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> 
> Was this reported upstream?

Not this patch, because the issue happens only when gettextizing, and if 
instead you build without getextizing it fails. So I don't think 
upstream will be interested about it, what do you think?
This was a doubt I had while dealing with this.

>> diff --git a/package/volume_key/Config.in b/package/volume_key/Config.in
>> new file mode 100644
>> index 0000000000..0c0827253d
>> --- /dev/null
>> +++ b/package/volume_key/Config.in
>> @@ -0,0 +1,19 @@
>> +config BR2_PACKAGE_VOLUME_KEY
>> +	bool "volume_key"
>> +	depends on BR2_TOOLCHAIN_HAS_THREADS # cryptsetup, libassuan, libglib2, libgpgme, libnss
>> +	depends on BR2_USE_MMU # cryptsetup, libassuan, libglib2, libgpgme
>> +	depends on !BR2_STATIC_LIBS # cryptsetup, libnss
>> +	depends on BR2_TOOLCHAIN_HAS_SYNC_4 # cryptsetup
>> +	depends on BR2_USE_WCHAR # libglib2
>> +	depends on BR2_PACKAGE_LIBGPG_ERROR_ARCH_SUPPORTS # libgpgme, libassuan
>> +	select BR2_PACKAGE_CRYPTSETUP
>> +	select BR2_PACKAGE_LIBASSUAN
>> +	select BR2_PACKAGE_LIBGLIB2
>> +	select BR2_PACKAGE_LIBGPGME
>> +	select BR2_PACKAGE_LIBNSS
>> +	help
>> +	  The volume_key project provides a libvolume_key, a library for manipulating
>> +	  storage volume encryption keys and storing them separately from volumes, and an
>> +	  associated command-line tool, named volume_key.
>> +
>> +	  https://pagure.io/volume_key
> 
> You need a Config.in comment about the (numerous) dependencies.

Oh yes,completely forgotten!

>> diff --git a/package/volume_key/volume_key.mk b/package/volume_key/volume_key.mk
>> new file mode 100644
>> index 0000000000..8d5bff6d8e
>> --- /dev/null
>> +++ b/package/volume_key/volume_key.mk
>> @@ -0,0 +1,22 @@
>> +################################################################################
>> +#
>> +# volume_key
>> +#
>> +################################################################################
>> +
>> +VOLUME_KEY_VERSION = f56614199726ba1897d8687f0927535693b6603f
> 
> Why not use the 0.3.12 release ?

Right

>> +VOLUME_KEY_SITE = https://pagure.io/volume_key.git
>> +VOLUME_KEY_SITE_METHOD = git
>> +VOLUME_KEY_LICENSE = GPL-2.0+
> 
> I don't see the "or later" option in any of the source files, so shouldn't this be GPL-2.0 ?

Right

>> +VOLUME_KEY_LICENSE_FILES = COPYING
>> +VOLUME_KEY_DEPENDENCIES = cryptsetup libglib2 libgpgme libnss $(TARGET_NLS_DEPENDENCIES)
>> +VOLUME_KEY_INSTALL_STAGING = YES
>> +VOLUME_KEY_AUTORECONF = YES
>> +VOLUME_KEY_GETTEXTIZE = YES
>> +
>> +VOLUME_KEY_CONF_OPTS = --with-sysroot=$(STAGING_DIR) \
> 
> The --with-sysroot option always looks weird. What is this needed for ?

This is a mistake, it's been left there after several tries. Sorry.

>> +		       --with-gpgme-prefix=$(STAGING_DIR)/usr \
>> +		       --without-python \
>> +		       --without-python3
>> +
>> +$(eval $(autotools-package))
> 
> In the configure.ac file, I see:
> 
> AC_PATH_PROG([GPG], [gpg2])
> AC_ARG_VAR([GPG])
> AC_DEFINE_UNQUOTED([GPG_PATH], "$GPG", [Path to the gpg2 executable])
> 
> So don't we need gnupg on the host for this to work ?

Yes, host-gnupg2, I've missed it since my distro provides it.

> I see:
> 
> PKG_CHECK_MODULES(blkid, [blkid])
> 
> don't we need the blkid library from util-linux ? I see it is selected
> by cryptsetup, which is why it works.

Yes, but if cryptsetup already selects it, do I need to repeat it in 
volume-key dependencies?

Best regards
Giulio Benetti Feb. 18, 2020, 2:06 p.m. UTC | #3
On 2/18/20 2:46 PM, Giulio Benetti wrote:
> Hi Thomas,
> 
> On 2/17/20 7:51 PM, Thomas Petazzoni wrote:
>> Hello,
>>
>> On Mon, 17 Feb 2020 15:30:28 +0100
>> Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:
>>
>>> diff --git a/DEVELOPERS b/DEVELOPERS
>>> index 6f2dbbb11a..5276c09384 100644
>>> --- a/DEVELOPERS
>>> +++ b/DEVELOPERS
>>> @@ -1016,6 +1016,7 @@ F:	package/minicom/
>>>    F:	package/nfs-utils/
>>>    F:	package/sunxi-mali-mainline/
>>>    F:	package/sunxi-mali-mainline-driver/
>>> +F:	package/volume_key/
>>
>> Would you mind naming the package volume-key instead of volume_key ?
> 
> Sure
> 
>>> diff --git a/package/volume_key/0001-configure.ac-remove-po-Makefile.in-entry-from-AC_CON.patch b/package/volume_key/0001-configure.ac-remove-po-Makefile.in-entry-from-AC_CON.patch
>>> new file mode 100644
>>> index 0000000000..44d6ee0d4b
>>> --- /dev/null
>>> +++ b/package/volume_key/0001-configure.ac-remove-po-Makefile.in-entry-from-AC_CON.patch
>>> @@ -0,0 +1,28 @@
>>> +From d1142e667f4f2f2fcd2d36a006919325c1a4377e Mon Sep 17 00:00:00 2001
>>> +From: Giulio Benetti <giulio.benetti@benettiengineering.com>
>>> +Date: Sat, 25 Jan 2020 17:24:38 +0100
>>> +Subject: [PATCH] configure.ac: remove po/Makefile.in entry from
>>> + AC_CONFIG_FILES
>>> +
>>> +AC_CONFIG_FILES should not contain po/Makefile.in file because
>>> +gettextize will re-add it again causing build failure.
>>> +
>>> +Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
>>
>> Was this reported upstream?
> 
> Not this patch, because the issue happens only when gettextizing, and if
> instead you build without getextizing it fails. So I don't think
> upstream will be interested about it, what do you think?
> This was a doubt I had while dealing with this.
> 
>>> diff --git a/package/volume_key/Config.in b/package/volume_key/Config.in
>>> new file mode 100644
>>> index 0000000000..0c0827253d
>>> --- /dev/null
>>> +++ b/package/volume_key/Config.in
>>> @@ -0,0 +1,19 @@
>>> +config BR2_PACKAGE_VOLUME_KEY
>>> +	bool "volume_key"
>>> +	depends on BR2_TOOLCHAIN_HAS_THREADS # cryptsetup, libassuan, libglib2, libgpgme, libnss
>>> +	depends on BR2_USE_MMU # cryptsetup, libassuan, libglib2, libgpgme
>>> +	depends on !BR2_STATIC_LIBS # cryptsetup, libnss
>>> +	depends on BR2_TOOLCHAIN_HAS_SYNC_4 # cryptsetup
>>> +	depends on BR2_USE_WCHAR # libglib2
>>> +	depends on BR2_PACKAGE_LIBGPG_ERROR_ARCH_SUPPORTS # libgpgme, libassuan
>>> +	select BR2_PACKAGE_CRYPTSETUP
>>> +	select BR2_PACKAGE_LIBASSUAN
>>> +	select BR2_PACKAGE_LIBGLIB2
>>> +	select BR2_PACKAGE_LIBGPGME
>>> +	select BR2_PACKAGE_LIBNSS
>>> +	help
>>> +	  The volume_key project provides a libvolume_key, a library for manipulating
>>> +	  storage volume encryption keys and storing them separately from volumes, and an
>>> +	  associated command-line tool, named volume_key.
>>> +
>>> +	  https://pagure.io/volume_key
>>
>> You need a Config.in comment about the (numerous) dependencies.
> 
> Oh yes,completely forgotten!
> 
>>> diff --git a/package/volume_key/volume_key.mk b/package/volume_key/volume_key.mk
>>> new file mode 100644
>>> index 0000000000..8d5bff6d8e
>>> --- /dev/null
>>> +++ b/package/volume_key/volume_key.mk
>>> @@ -0,0 +1,22 @@
>>> +################################################################################
>>> +#
>>> +# volume_key
>>> +#
>>> +################################################################################
>>> +
>>> +VOLUME_KEY_VERSION = f56614199726ba1897d8687f0927535693b6603f
>>
>> Why not use the 0.3.12 release ?
> 
> Right
> 
>>> +VOLUME_KEY_SITE = https://pagure.io/volume_key.git
>>> +VOLUME_KEY_SITE_METHOD = git
>>> +VOLUME_KEY_LICENSE = GPL-2.0+
>>
>> I don't see the "or later" option in any of the source files, so shouldn't this be GPL-2.0 ?
> 
> Right
> 
>>> +VOLUME_KEY_LICENSE_FILES = COPYING
>>> +VOLUME_KEY_DEPENDENCIES = cryptsetup libglib2 libgpgme libnss $(TARGET_NLS_DEPENDENCIES)
>>> +VOLUME_KEY_INSTALL_STAGING = YES
>>> +VOLUME_KEY_AUTORECONF = YES
>>> +VOLUME_KEY_GETTEXTIZE = YES
>>> +
>>> +VOLUME_KEY_CONF_OPTS = --with-sysroot=$(STAGING_DIR) \
>>
>> The --with-sysroot option always looks weird. What is this needed for ?
> 
> This is a mistake, it's been left there after several tries. Sorry.
> 
>>> +		       --with-gpgme-prefix=$(STAGING_DIR)/usr \
>>> +		       --without-python \
>>> +		       --without-python3
>>> +
>>> +$(eval $(autotools-package))
>>
>> In the configure.ac file, I see:
>>
>> AC_PATH_PROG([GPG], [gpg2])
>> AC_ARG_VAR([GPG])
>> AC_DEFINE_UNQUOTED([GPG_PATH], "$GPG", [Path to the gpg2 executable])
>>
>> So don't we need gnupg on the host for this to work ?
> 
> Yes, host-gnupg2, I've missed it since my distro provides it.

I've retried building, gnupg2 only is supported but it's not mandatory 
to build. So as I can understand we can avoid adding host-gnupg2.

>> I see:
>>
>> PKG_CHECK_MODULES(blkid, [blkid])
>>
>> don't we need the blkid library from util-linux ? I see it is selected
>> by cryptsetup, which is why it works.
> 
> Yes, but if cryptsetup already selects it, do I need to repeat it in
> volume-key dependencies?
> 
> Best regards
> 

Best regards
Thomas Petazzoni Feb. 18, 2020, 2:46 p.m. UTC | #4
Hello,

On Tue, 18 Feb 2020 14:46:17 +0100
Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:

> >> diff --git a/package/volume_key/0001-configure.ac-remove-po-Makefile.in-entry-from-AC_CON.patch b/package/volume_key/0001-configure.ac-remove-po-Makefile.in-entry-from-AC_CON.patch
> >> new file mode 100644
> >> index 0000000000..44d6ee0d4b
> >> --- /dev/null
> >> +++ b/package/volume_key/0001-configure.ac-remove-po-Makefile.in-entry-from-AC_CON.patch
> >> @@ -0,0 +1,28 @@
> >> +From d1142e667f4f2f2fcd2d36a006919325c1a4377e Mon Sep 17 00:00:00 2001
> >> +From: Giulio Benetti <giulio.benetti@benettiengineering.com>
> >> +Date: Sat, 25 Jan 2020 17:24:38 +0100
> >> +Subject: [PATCH] configure.ac: remove po/Makefile.in entry from
> >> + AC_CONFIG_FILES
> >> +
> >> +AC_CONFIG_FILES should not contain po/Makefile.in file because
> >> +gettextize will re-add it again causing build failure.
> >> +
> >> +Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>  
> > 
> > Was this reported upstream?  
> 
> Not this patch, because the issue happens only when gettextizing, and if 
> instead you build without getextizing it fails. So I don't think 
> upstream will be interested about it, what do you think?
> This was a doubt I had while dealing with this.

Well, it is a problem if one can't autoreconf/gettextize the upstream
project as-is, no?

> > I see:
> > 
> > PKG_CHECK_MODULES(blkid, [blkid])
> > 
> > don't we need the blkid library from util-linux ? I see it is selected
> > by cryptsetup, which is why it works.  
> 
> Yes, but if cryptsetup already selects it, do I need to repeat it in 
> volume-key dependencies?

I think since the configure.ac explicitly checks it, it makes sense to
not rely on the fact that a dependency by chance also uses it.

Thanks,

Thomas
Thomas Petazzoni Feb. 18, 2020, 2:47 p.m. UTC | #5
On Tue, 18 Feb 2020 15:06:47 +0100
Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:

> >> AC_PATH_PROG([GPG], [gpg2])
> >> AC_ARG_VAR([GPG])
> >> AC_DEFINE_UNQUOTED([GPG_PATH], "$GPG", [Path to the gpg2 executable])
> >>
> >> So don't we need gnupg on the host for this to work ?  
> > 
> > Yes, host-gnupg2, I've missed it since my distro provides it.  
> 
> I've retried building, gnupg2 only is supported but it's not mandatory 
> to build. So as I can understand we can avoid adding host-gnupg2.

Weird, I thought AC_PATH_PROG() was aborting if the tool was not found.
If that's not the case, then we should ensure the build never uses
gpg2, even if available, so that the build result doesn't depend on
whether gpg2 is available system-wide or not.

Thomas
Giulio Benetti Feb. 18, 2020, 2:55 p.m. UTC | #6
On 2/18/20 3:46 PM, Thomas Petazzoni wrote:
> Hello,
> 
> On Tue, 18 Feb 2020 14:46:17 +0100
> Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:
> 
>>>> diff --git a/package/volume_key/0001-configure.ac-remove-po-Makefile.in-entry-from-AC_CON.patch b/package/volume_key/0001-configure.ac-remove-po-Makefile.in-entry-from-AC_CON.patch
>>>> new file mode 100644
>>>> index 0000000000..44d6ee0d4b
>>>> --- /dev/null
>>>> +++ b/package/volume_key/0001-configure.ac-remove-po-Makefile.in-entry-from-AC_CON.patch
>>>> @@ -0,0 +1,28 @@
>>>> +From d1142e667f4f2f2fcd2d36a006919325c1a4377e Mon Sep 17 00:00:00 2001
>>>> +From: Giulio Benetti <giulio.benetti@benettiengineering.com>
>>>> +Date: Sat, 25 Jan 2020 17:24:38 +0100
>>>> +Subject: [PATCH] configure.ac: remove po/Makefile.in entry from
>>>> + AC_CONFIG_FILES
>>>> +
>>>> +AC_CONFIG_FILES should not contain po/Makefile.in file because
>>>> +gettextize will re-add it again causing build failure.
>>>> +
>>>> +Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
>>>
>>> Was this reported upstream?
>>
>> Not this patch, because the issue happens only when gettextizing, and if
>> instead you build without getextizing it fails. So I don't think
>> upstream will be interested about it, what do you think?
>> This was a doubt I had while dealing with this.
> 
> Well, it is a problem if one can't autoreconf/gettextize the upstream
> project as-is, no?

Yes, so let's keep it locally.

>>> I see:
>>>
>>> PKG_CHECK_MODULES(blkid, [blkid])
>>>
>>> don't we need the blkid library from util-linux ? I see it is selected
>>> by cryptsetup, which is why it works.
>>
>> Yes, but if cryptsetup already selects it, do I need to repeat it in
>> volume-key dependencies?
> 
> I think since the configure.ac explicitly checks it, it makes sense to
> not rely on the fact that a dependency by chance also uses it.

Ok then, it is the first time I add a package with so many dependencies.

Thank you
Best regards
Giulio Benetti Feb. 20, 2020, 4:28 p.m. UTC | #7
On 2/18/20 3:47 PM, Thomas Petazzoni wrote:
> On Tue, 18 Feb 2020 15:06:47 +0100
> Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:
> 
>>>> AC_PATH_PROG([GPG], [gpg2])
>>>> AC_ARG_VAR([GPG])
>>>> AC_DEFINE_UNQUOTED([GPG_PATH], "$GPG", [Path to the gpg2 executable])
>>>>
>>>> So don't we need gnupg on the host for this to work ?
>>>
>>> Yes, host-gnupg2, I've missed it since my distro provides it.
>>
>> I've retried building, gnupg2 only is supported but it's not mandatory
>> to build. So as I can understand we can avoid adding host-gnupg2.
> 
> Weird, I thought AC_PATH_PROG() was aborting if the tool was not found.
> If that's not the case, then we should ensure the build never uses
> gpg2, even if available, so that the build result doesn't depend on
> whether gpg2 is available system-wide or not.

I went deeper in the volume_key code and found that gnupg2 is needed at 
runtime to create packet with passphrase, so even if build doesn't fail 
gnupg2 is needed at runtime. In gcr packet is the same.

But then, it turns out that gnupg2's binary name is gpg and not gpg2, 
but usually gpg2 name is used(i.e. on Ubuntu 19.10). Also in gcr package 
they assume its name is gpg2 but if you try to build you find gpg. 
Gnupg2 failure is difficult to find since it's at runtime(i.e. gpgme 
calls /usr/bin/gpg2 to encrypt/decrypt something).

So what do you suggest? Better change gpg binary file name to gpg2 or 
better fix gcr package to use /usr/bin/gpg instead of /usr/bin/gpg2 And 
do the same here with volume-key?

Gcr package is wrong in any case at the moment, so it must be fixed, and 
find someone who's able to test it.

Best regards
diff mbox series

Patch

diff --git a/DEVELOPERS b/DEVELOPERS
index 6f2dbbb11a..5276c09384 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1016,6 +1016,7 @@  F:	package/minicom/
 F:	package/nfs-utils/
 F:	package/sunxi-mali-mainline/
 F:	package/sunxi-mali-mainline-driver/
+F:	package/volume_key/
 
 N:	Gregory Dymarek <gregd72002@gmail.com>
 F:	package/ding-libs/
diff --git a/package/Config.in b/package/Config.in
index 4d76a5791f..a058d7d2f0 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1310,6 +1310,7 @@  menu "Crypto"
 	source "package/tpm2-tss/Config.in"
 	source "package/trousers/Config.in"
 	source "package/ustream-ssl/Config.in"
+	source "package/volume_key/Config.in"
 	source "package/wolfssl/Config.in"
 endmenu
 
diff --git a/package/volume_key/0001-configure.ac-remove-po-Makefile.in-entry-from-AC_CON.patch b/package/volume_key/0001-configure.ac-remove-po-Makefile.in-entry-from-AC_CON.patch
new file mode 100644
index 0000000000..44d6ee0d4b
--- /dev/null
+++ b/package/volume_key/0001-configure.ac-remove-po-Makefile.in-entry-from-AC_CON.patch
@@ -0,0 +1,28 @@ 
+From d1142e667f4f2f2fcd2d36a006919325c1a4377e Mon Sep 17 00:00:00 2001
+From: Giulio Benetti <giulio.benetti@benettiengineering.com>
+Date: Sat, 25 Jan 2020 17:24:38 +0100
+Subject: [PATCH] configure.ac: remove po/Makefile.in entry from
+ AC_CONFIG_FILES
+
+AC_CONFIG_FILES should not contain po/Makefile.in file because
+gettextize will re-add it again causing build failure.
+
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 7d3d27a..f4295ff 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -244,5 +244,5 @@ if test "$GCC" = yes ; then
+ fi
+ 
+ dnl po/Makefile
+-AC_CONFIG_FILES([Makefile contrib/Makefile doc/Makefile lib/Makefile po/Makefile.in python/Makefile python/python/Makefile python/python3/Makefile src/Makefile tests/Makefile])
++AC_CONFIG_FILES([Makefile contrib/Makefile doc/Makefile lib/Makefile python/Makefile python/python/Makefile python/python3/Makefile src/Makefile tests/Makefile])
+ AC_OUTPUT
+-- 
+2.20.1
+
diff --git a/package/volume_key/Config.in b/package/volume_key/Config.in
new file mode 100644
index 0000000000..0c0827253d
--- /dev/null
+++ b/package/volume_key/Config.in
@@ -0,0 +1,19 @@ 
+config BR2_PACKAGE_VOLUME_KEY
+	bool "volume_key"
+	depends on BR2_TOOLCHAIN_HAS_THREADS # cryptsetup, libassuan, libglib2, libgpgme, libnss
+	depends on BR2_USE_MMU # cryptsetup, libassuan, libglib2, libgpgme
+	depends on !BR2_STATIC_LIBS # cryptsetup, libnss
+	depends on BR2_TOOLCHAIN_HAS_SYNC_4 # cryptsetup
+	depends on BR2_USE_WCHAR # libglib2
+	depends on BR2_PACKAGE_LIBGPG_ERROR_ARCH_SUPPORTS # libgpgme, libassuan
+	select BR2_PACKAGE_CRYPTSETUP
+	select BR2_PACKAGE_LIBASSUAN
+	select BR2_PACKAGE_LIBGLIB2
+	select BR2_PACKAGE_LIBGPGME
+	select BR2_PACKAGE_LIBNSS
+	help
+	  The volume_key project provides a libvolume_key, a library for manipulating
+	  storage volume encryption keys and storing them separately from volumes, and an
+	  associated command-line tool, named volume_key.
+
+	  https://pagure.io/volume_key
diff --git a/package/volume_key/volume_key.hash b/package/volume_key/volume_key.hash
new file mode 100644
index 0000000000..3925429b4e
--- /dev/null
+++ b/package/volume_key/volume_key.hash
@@ -0,0 +1,3 @@ 
+# Locally calculated
+sha256 f83146352464048f823c164e755dc10da0e06db024de5b1b6f78beeb8438dc22  volume_key-f56614199726ba1897d8687f0927535693b6603f.tar.gz
+sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643  COPYING
diff --git a/package/volume_key/volume_key.mk b/package/volume_key/volume_key.mk
new file mode 100644
index 0000000000..8d5bff6d8e
--- /dev/null
+++ b/package/volume_key/volume_key.mk
@@ -0,0 +1,22 @@ 
+################################################################################
+#
+# volume_key
+#
+################################################################################
+
+VOLUME_KEY_VERSION = f56614199726ba1897d8687f0927535693b6603f
+VOLUME_KEY_SITE = https://pagure.io/volume_key.git
+VOLUME_KEY_SITE_METHOD = git
+VOLUME_KEY_LICENSE = GPL-2.0+
+VOLUME_KEY_LICENSE_FILES = COPYING
+VOLUME_KEY_DEPENDENCIES = cryptsetup libglib2 libgpgme libnss $(TARGET_NLS_DEPENDENCIES)
+VOLUME_KEY_INSTALL_STAGING = YES
+VOLUME_KEY_AUTORECONF = YES
+VOLUME_KEY_GETTEXTIZE = YES
+
+VOLUME_KEY_CONF_OPTS = --with-sysroot=$(STAGING_DIR) \
+		       --with-gpgme-prefix=$(STAGING_DIR)/usr \
+		       --without-python \
+		       --without-python3
+
+$(eval $(autotools-package))