Tentando compilar o gnupg a partir da fonte

5

Eu fiz o download do último tarball estável do link e o extraí para uma pasta na minha máquina do ubuntu. Eu tive que chmod 775 configurar para poder executá-lo, então corri ./configure

Recebi esta mensagem no final:

    GnuPG v2.0.29 has been configured as follows:


    Revision:  120fc69  (4623)
    Platform:  GNU/Linux (x86_64-unknown-linux-gnu)


    OpenPGP:   yes
    S/MIME:    yes
    Agent:     yes 
    Smartcard: yes (without internal CCID driver)
    Gpgtar:    no


    Protect tool:      (default)
    Default agent:     (default)
    Default pinentry:  (default)
    Default scdaemon:  (default)
    Default dirmngr:   (default)


    Warning: Mismatches between the target platform and the
             to be used libraries have been detected for:
               libgpg-error libgcrypt
             Please check above for more warning messages.

Eu tentei rodar um sudo apt-get install libgpg-error libgcrypt mas ele disse que eles não puderam ser encontrados, então eu tentei o libgpg-error-dev libgcrypt-dev e entendi:

Reading package lists...
Building dependency tree...
Reading state information...
libgpg-error-dev is already the newest version.
libgcrypt11-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 69 not upgraded.

Então, tentei executar o make e foi isso que vi no final

Making all in .
make[3]: Entering directory '/home/nitrous/gnupg-new/tests'
srcdir=. GNUPGHOME='/bin/pwd' GPG_AGENT_INFO= LC_ALL=C GPGSM=../sm/gpgsm ./runtest ./inittests
make[3]: Leaving directory '/home/nitrous/gnupg-new/tests'
make[2]: Leaving directory '/home/nitrous/gnupg-new/tests'
make[1]: Leaving directory '/home/nitrous/gnupg-new'
/bin/bash: ./runtest: permission denied
make[3]: *** [inittests.stamp] Error 126
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Making all in .
make[3]: Entering directory '/home/nitrous/gnupg-new/tests'
srcdir=. GNUPGHOME='/bin/pwd' GPG_AGENT_INFO= LC_ALL=C GPGSM=../sm/gpgsm ./runtest ./inittests
/bin/bash: ./runtest: Permission denied
make[3]: *** [inittests.stamp] Error 126
make[3]: Leaving directory '/home/nitrous/gnupg-new/tests'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/nitrous/gnupg-new/tests'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/nitrous/gnupg-new'
make: *** [all] Error 2

Eu então corri make install e recebi o mesmo erro no final. O que está errado?

Editar:

Eu manualmente compilei e instalei o libgpg-error e o libgcrypt, o ./configure correu bem sem nenhum aviso, quando eu executei o sudo make , recebi isso no final:

chmod 755 ./gpg_dearmor
./gpg_dearmor > ./pubring.gpg < ./pubring.asc
../../g10/gpg2: error while loading shared libraries: libgcrypt.so.20: cannot open shared object file: No such file or directory
make[3]: *** [pubring.gpg] Error 127
make[3]: Leaving directory '/home/nitrous/gnupg-new/tests/openpgp'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/nitrous/gnupg-new/tests'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/nitrous/gnupg-new'
make: *** [all] Error 2

Então, quando tentei instalar novamente, recebi isso:

Making install in tests
make[1]: Entering directory '/home/nitrous/gnupg-new/tests'
Making install in openpgp
make[2]: Entering directory '/home/nitrous/gnupg-new/tests/openpgp'
./gpg_dearmor > ./secring.gpg < ./secring.asc
../../g10/gpg2: error while loading shared libraries: libgcrypt.so.20: cannot open shared object file: No such file or directory
make[2]: *** [secring.gpg] Error 127
make[2]: Leaving directory '/home/nitrous/gnupg-new/tests/openpgp'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory '/home/nitrous/gnupg-new/tests'
make: *** [install-recursive] Error 1

Editar 2:

Encontrei uma postagem que dizia para executar sudo ldconfig -v

E quando eu executei ./configure e sudo make install novamente, recebi esse erro no final:

Making all in .
make[3]: Entering directory '/home/nitrous/gnupg-new/tests'
srcdir=. GNUPGHOME='/bin/pwd' GPG_AGENT_INFO= LC_ALL=C GPGSM=../sm/gpgsm ./runtest ./inittests
/bin/bash: ./runtest: Permission denied
make[3]: *** [inittests.stamp] Error 126
make[3]: Leaving directory '/home/nitrous/gnupg-new/tests'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/nitrous/gnupg-new/tests'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/nitrous/gnupg-new'
make: *** [all] Error 2

Editar 3:

Eu executei um sudo chmod 755 on tests/runtest e fiz ./configure e sudo make AGAIN e agora tenho este erro:

Making all in .
make[3]: Entering directory '/home/nitrous/gnupg-new/tests'
srcdir=. GNUPGHOME='/bin/pwd' GPG_AGENT_INFO= LC_ALL=C GPGSM=../sm/gpgsm ./runtest ./inittests
asschk: interpreter: invalid statement 'set'
make[3]: *** [inittests.stamp] Error 1
make[3]: Leaving directory '/home/nitrous/gnupg-new/tests'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/nitrous/gnupg-new/tests'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/nitrous/gnupg-new'
make: *** [all] Error 2

Suspiro ....

    
por Joshua Terrill 03.10.2015 / 10:12

1 resposta

5

Eu achei o método speedo fornecido o mais fácil para o gnupg-2.1.X:

  1. sudo apt-get update

  2. sudo apt-get install libldap2-dev gtk+-2 libbz2-dev

  3. após descompactar o último tarball gnupg-2.1.X e cd para a nova pasta, execute o comando:

    sudo make -f build-aux/speedo.mk native INSTALL_PREFIX=/usr/local
    
  4. sudo ldconfig

  5. faça o download do pinentry-0.9.5 mais recente, execute ./configure && make && sudo make install .

  6. teste: gpg2 --version

**** Gostaria de atualizar esta resposta para o GnuPG v2.2.x. O seguinte arquivo bash será instalado no Ubuntu 16.04, 17.10:

cd ~/Downloads
version=gnupg-2.2.2
wget https://gnupg.org/ftp/gcrypt/gnupg/$version.tar.bz2
wget https://gnupg.org/ftp/gcrypt/gnupg/$version.tar.bz2.sig
tar xf $version.tar.bz2
cd $version
sudo apt-get update
sudo apt-get install -y libldap2-dev
sudo apt-get install -y gtk+-2
sudo apt-get install -y rng-tools
sudo apt-get install -y libbz2-dev
sudo apt-get install -y zlib1g-dev
sudo apt-get install -y libgmp-dev
sudo apt-get install -y nettle-dev
sudo apt-get install -y libgnutls28-dev
sudo apt-get install -y libsqlite3-dev
sudo apt-get install -y adns-tools
sudo apt-get install -y libreadline-dev
sudo apt-get install -y pinentry-gtk2
sudo apt-get install -y pcscd scdaemon
sudo make -f build-aux/speedo.mk native INSTALL_PREFIX=/usr/local
sudo ldconfig

Isso suportará TOFU e Smart Cards, como o Yubikey 4 Nano. Para atualizar para a versão mais recente , edite versão = gnupg-2.2.2 Teste: gpg --version

    
por mac333 03.10.2015 / 13:40