You are not logged in.

#1 2014-06-05 19:48:41

alphazo
Member
Registered: 2009-10-20
Posts: 163

[SOLVED] libgcrypt-git

Hello,

I'm maintaining gnupg-git AUR package. A nice beta of gnupg development branch has just arrived today that brings experimental support for Ed25519 ECC for signature. However for encryption support a patched libgcrypt is required. I tried to put together a PKGBUILD to build libgcrypt based upon the git version but it fails towards the end on the doc section.
Would someone be kind enough to try to fix it?

# $Id$
# Maintainer: Andreas Radke <andyrtr@archlinux.org>

_gitname=libgcrypt
pkgname=libgcrypt-git
pkgver=1.6.0+83+gf14fb5b
pkgrel=1
pkgdesc="General purpose cryptographic library based on the code from GnuPG"
arch=(i686 x86_64)
url="http://www.gnupg.org"
license=('LGPL')
depends=('libgpg-error>=1.10-2')
makedepends=('git' 'automake-1.11')
provides=("libgcrypt=${pkgver}")
conflicts=('libgcrypt')
install=${pkgname}.install
source=("git://git.gnupg.org/libgcrypt.git")
sha1sums=('SKIP')

pkgver() {
  cd "$_gitname"
  git describe --tags | sed 's/libgcrypt-//;s/-/+/g'
}


build() {
  cd "$_gitname"
  AUTOMAKE_SUFFIX="-1.11" ./autogen.sh --force
   ./configure --prefix=/usr \
	--disable-static \
    --disable-padlock-support
  make
}

package() {
  cd "$_gitname"
  make DESTDIR=${pkgdir} install
}

Here is the error message I am getting:

make[2]: Leaving directory '/home/alpha/PERSO/GIT-REPOS/arch-packages/NOTDONEYET/libgcrypt-git/src/libgcrypt/src'
Making all in doc
make[2]: Entering directory '/home/alpha/PERSO/GIT-REPOS/arch-packages/NOTDONEYET/libgcrypt-git/src/libgcrypt/doc'
fig2dev -L eps `test -f 'libgcrypt-modules.fig' || echo './'`libgcrypt-modules.fig libgcrypt-modules.eps
fig2dev -L eps `test -f 'fips-fsm.fig' || echo './'`fips-fsm.fig fips-fsm.eps
fig2dev -L png `test -f 'libgcrypt-modules.fig' || echo './'`libgcrypt-modules.fig libgcrypt-modules.png
fig2dev -L png `test -f 'fips-fsm.fig' || echo './'`fips-fsm.fig fips-fsm.png
fig2dev -L pdf `test -f 'libgcrypt-modules.fig' || echo './'`libgcrypt-modules.fig libgcrypt-modules.pdf
fig2dev -L pdf `test -f 'fips-fsm.fig' || echo './'`fips-fsm.fig fips-fsm.pdf
make  all-am
make[3]: Entering directory '/home/alpha/PERSO/GIT-REPOS/arch-packages/NOTDONEYET/libgcrypt-git/src/libgcrypt/doc'
restore=: && backupdir=".am$$" && \
am__cwd=`pwd` && CDPATH="${ZSH_VERSION+.}:" && cd . && \
rm -rf $backupdir && mkdir $backupdir && \
if (/bin/sh /home/alpha/PERSO/GIT-REPOS/arch-packages/NOTDONEYET/libgcrypt-git/src/libgcrypt/build-aux/missing --run makeinfo --version) >/dev/null 2>&1; then \
  for f in gcrypt.info gcrypt.info-[0-9] gcrypt.info-[0-9][0-9] gcrypt.i[0-9] gcrypt.i[0-9][0-9]; do \
    if test -f $f; then mv $f $backupdir; restore=mv; else :; fi; \
  done; \
else :; fi && \
cd "$am__cwd"; \
if /bin/sh /home/alpha/PERSO/GIT-REPOS/arch-packages/NOTDONEYET/libgcrypt-git/src/libgcrypt/build-aux/missing --run makeinfo   -I . \
 -o gcrypt.info gcrypt.texi; \
then \
  rc=0; \
  CDPATH="${ZSH_VERSION+.}:" && cd .; \
else \
  rc=$?; \
  CDPATH="${ZSH_VERSION+.}:" && cd . && \
  $restore $backupdir/* `echo "./gcrypt.info" | sed 's|[^/]*$||'`; \
fi; \
rm -rf $backupdir; exit $rc
gcrypt.texi:4: @include: could not find version.texi
gcrypt.texi:12: warning: undefined flag: VERSION
gcrypt.texi:12: warning: undefined flag: UPDATED
gcrypt.texi:58: warning: undefined flag: VERSION
gcrypt.texi:59: warning: undefined flag: UPDATED
Makefile:370: recipe for target 'gcrypt.info' failed
make[3]: *** [gcrypt.info] Error 1
make[3]: Leaving directory '/home/alpha/PERSO/GIT-REPOS/arch-packages/NOTDONEYET/libgcrypt-git/src/libgcrypt/doc'
Makefile:328: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/home/alpha/PERSO/GIT-REPOS/arch-packages/NOTDONEYET/libgcrypt-git/src/libgcrypt/doc'
Makefile:411: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/alpha/PERSO/GIT-REPOS/arch-packages/NOTDONEYET/libgcrypt-git/src/libgcrypt'
Makefile:342: recipe for target 'all' failed
make: *** [all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...

Thanks
alphazo

Last edited by alphazo (2014-06-07 19:32:10)

Offline

#2 2014-06-05 22:06:18

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] libgcrypt-git

When posting configs, code or command output, please use [ code ] tags https://bbs.archlinux.org/help.php#bbcode

like this

It makes the code more readable and - in case of longer listings - more convenient to scroll through.


Can you post the error you're getting?

Offline

#3 2014-06-06 08:32:01

alphazo
Member
Registered: 2009-10-20
Posts: 163

Re: [SOLVED] libgcrypt-git

Sorry for the poor initial formatting. I have since updated the post and also added the error message.

Thanks
alphazo

Last edited by alphazo (2014-06-07 19:37:41)

Offline

#4 2014-06-07 18:49:30

AdrianCohea
Member
Registered: 2013-06-29
Posts: 16

Re: [SOLVED] libgcrypt-git

Please let me know if the following works for you. You can verify the changes with a diff. Here's a summary of what I did:

1) pkgver=1.7

This is because although the git describe says we're 1.6.something, the output from the ./configure says it's actually 1.7. This matters, in my opinion.

2) Removed pkgver() for reason mentioned above

3) depends=('libgpg-error>=1.13-1')

When I compiled, outside of the Arch Build System, I had trouble with compiling libgcrypt without having a high enough version of libgpg-error. You may find that this is not needed, and that requirement can be relaxed at your discretion.

4) Configure invocation: --enable-maintainer-mode --with-capabilities

We're Arch, so we're definitely Linux, so configure with Linux capabilities. I have no idea what this means, but why not enable it, right? Enabling maintainer mode is apparently required to get the doc portion to build correctly. Not sure why.

5) make -j

Who only has one core anyway?

5) Added check()

Since libgcrypt and gnupg 2.1 are still unstable, we should always run the test suite.

# $Id$
# Maintainer: Andreas Radke <andyrtr@archlinux.org>
# Contributor: Adrian Cohea <adriancohea@gmail.com>

_gitname=libgcrypt
pkgname=libgcrypt-git
pkgver=1.7
pkgrel=1
pkgdesc="General purpose cryptographic library based on the code from GnuPG"
arch=(i686 x86_64)
url="http://www.gnupg.org"
license=('LGPL')
depends=('libgpg-error>=1.13-1')
makedepends=('git' 'automake-1.11')
provides=("libgcrypt=${pkgver}")
conflicts=('libgcrypt')
install=${pkgname}.install
source=("git://git.gnupg.org/libgcrypt.git")
sha1sums=('SKIP')

build() {
  cd "$_gitname"
  AUTOMAKE_SUFFIX="-1.11" ./autogen.sh --force
   ./configure --prefix=/usr --enable-maintainer-mode --with-capabilities --disable-static --disable-padlock-support
  make -j
}

check() {
  cd "$_gitname"
  make check
}

package() {
  cd "$_gitname"
  make DESTDIR=${pkgdir} install
}

gpg --keyserver hkps.pool.sks-keyservers.net --recv-key 0x77660e16dba99933

0B85 1AC2 4980 B654 0DA3  D1E1 7766 0E16 DBA9 9933

Offline

#5 2014-06-07 19:33:05

alphazo
Member
Registered: 2009-10-20
Posts: 163

Re: [SOLVED] libgcrypt-git

Thanks for the great job. I have marked the thread as solved since I can compile it now. Now we just need to decide between the two of the us about who is going to publish it.

Cheers.

Offline

#6 2014-06-07 19:51:15

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,541

Re: [SOLVED] libgcrypt-git

A -git package without a pkgver function is a bad idea. If you want it to say 1.7, put 1.7 in the pkgver function. Better yet, get the version number out of configure.ac.

Offline

#7 2014-06-08 07:42:04

alphazo
Member
Registered: 2009-10-20
Posts: 163

Re: [SOLVED] libgcrypt-git

libgcrypt-git and new gnupg-git are now on AUR. pkgversion is back and it says 1.6.X. However I changed the dependency in gnupg-git PKGBUILD so it now requires libgcrypt-git instead of libgcrypt>=1.5.

I will be adding the optional patch for Curve25519 encryption soon.

Last edited by alphazo (2014-06-08 08:17:18)

Offline

#8 2014-06-08 12:49:12

alphazo
Member
Registered: 2009-10-20
Posts: 163

Re: [SOLVED] libgcrypt-git

Beware! I couldn't reboot my machine LUKS+LVM after installing this package since it gets stuck at boot mounting my encrypted swap (x2dswap.device?).

Offline

#9 2014-09-27 18:46:43

AdrianCohea
Member
Registered: 2013-06-29
Posts: 16

Re: [SOLVED] libgcrypt-git

I posted my apology on the AUR, but I thought I would do so here as well. I am responsible for breaking this package on the AUR.

The issue is "--with-capabilities" in the ./configure invocation. That needs to be removed from the PKGBUILD.

I definitely owe the community an apology, especially to the maintainer alphazo (to the extent his reputation was hurt by my error) and want to explain exactly what led to my error. As you can see above, I argued for adding "--with-capabilities" essentially "just 'cuz." That decision was based on no research or testing, and I should not have said that. This breaks cryptsetup. After you install the package as is (having the "--with-capabilities" option), run "cryptsetup --debug" for an appropriate volume, an you will find an error for

# device-mapper: version ioctl on  failed: Permission denied
# Incompatible libdevmapper  and kernel driver 

This issue has been known for a very long time and was closed as a "won't fix" issue. I am speculating here, but it's entirely possible that core/libgcrypt maintainer Andreas Radke already knew this, since "--with-capabilities" is not found in the core package.

I have run two separate tests, and I know this fixes the issue:

1) Build broken libgcrypt-git, and replicate the problem. All cryptsetup invocations fail.
2) Build libgcrypt-git with "--with-capabilities" removed from the PKGBUILD. Run "sudo mkinitcpio -p linux" and reboot. The "encrypt" hook now runs properly, and cryptsetup invocations no longer fail. I verified loading files from an external HDD that I have also encrypted using cryptsetup.

Last edited by AdrianCohea (2014-09-27 19:02:13)


gpg --keyserver hkps.pool.sks-keyservers.net --recv-key 0x77660e16dba99933

0B85 1AC2 4980 B654 0DA3  D1E1 7766 0E16 DBA9 9933

Offline

#10 2014-10-01 07:52:21

alphazo
Member
Registered: 2009-10-20
Posts: 163

Re: [SOLVED] libgcrypt-git

Thanks @AdrianCohea for the fix and don't worry about my reputation wink

Offline

Board footer

Powered by FluxBB