LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-27-2017, 01:49 PM   #1
FranekW
LQ Newbie
 
Registered: Apr 2017
Distribution: CentOS 7
Posts: 29

Rep: Reputation: Disabled
Installing GnuGP 2.1.x from sources on CentOS 7


Hello,

I am trying to install GnuGP2 from sources on CentOS 7 using a custom folder. I am running into problem because either 'configure' or a compiler cannot see libraries / include files even though I set variables for that. I found a script in `github` which downloads and installs everything in to `/usr/local/bin`. I try to install gnugp2 in my custom folder. However, somewhere in the middle I've got error and don't know how to proceed.

This is the error:

Code:
ntbtls-int.h:27:20: fatal error: gcrypt.h: No such file or directory
 #include <gcrypt.h>
                    ^
compilation terminated.
make[2]: *** [visibility.lo] Error 1
make[2]: Leaving directory `/opt/applications/gpg-install/ntbtls-0.1.1/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/applications/gpg-install/ntbtls-0.1.1'
make: *** [all] Error 2
Here is the script I am trying to run. Please notice that I have set environmental variables which configure and linker supposed to see. Also, there is a line "echo "/usr/local/lib" > /etc/ld.so.conf.d/gpg2.conf" commented as I haven't figure out how to do this.

Thanks


Code:
#!/bin/bash -e

CD=$(pwd)
FOLDER=/opt/applications/gpg-install
APPFOLDER=/opt/applications/gnupg2

mkdir --parents $FOLDER
cd $FOLDER

wget -c https://www.gnupg.org/ftp/gcrypt/gnupg/gnupg-2.1.21.tar.bz2
wget -c https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.27.tar.bz2
wget -c https://www.gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.7.7.tar.bz2
wget -c https://www.gnupg.org/ftp/gcrypt/libassuan/libassuan-2.4.3.tar.bz2
wget -c https://www.gnupg.org/ftp/gcrypt/libksba/libksba-1.3.5.tar.bz2
wget -c https://www.gnupg.org/ftp/gcrypt/npth/npth-1.5.tar.bz2
wget -c https://www.gnupg.org/ftp/gcrypt/ntbtls/ntbtls-0.1.1.tar.bz2
wget -c ftp://ftp.gnu.org/gnu/ncurses/ncurses-6.0.tar.gz
wget -c https://www.gnupg.org/ftp/gcrypt/pinentry/pinentry-1.0.0.tar.bz2
wget -c https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-1.9.0.tar.bz2

tar -xjf libgpg-error-1.27.tar.bz2
tar -xjf libgcrypt-1.7.7.tar.bz2
tar -xjf libassuan-2.4.3.tar.bz2
tar -xjf libksba-1.3.5.tar.bz2
tar -xjf npth-1.5.tar.bz2
tar -xjf ntbtls-0.1.1.tar.bz2
tar -zxf ncurses-6.0.tar.gz
tar -xjf pinentry-1.0.0.tar.bz2
tar -xjf gpgme-1.9.0.tar.bz2
tar -xjf gnupg-2.1.21.tar.bz2

rm libgpg-error-1.27.tar.bz2
rm libgcrypt-1.7.7.tar.bz2
rm libassuan-2.4.3.tar.bz2
rm libksba-1.3.5.tar.bz2
rm npth-1.5.tar.bz2
rm ntbtls-0.1.1.tar.bz2
rm ncurses-6.0.tar.gz
rm pinentry-1.0.0.tar.bz2
rm gpgme-1.9.0.tar.bz2
rm gnupg-2.1.21.tar.bz2

PATH=$APPFOLDER/libgpg-error-1.27/bin:$APPFOLDER/libgcrypt-1.7.7/bin:$APPFOLDER/libksba-1.3.5/bin:$PATH
CPPFLAGS=-I$APPFOLDER/libgpg-error-1.27/include:$APPFOLDER/libgcrypt-1.7.7/include:$APPFOLDER/libksba-1.3.5/include
LDFLAGS=-L$APPFOLDER/libgpg-error-1.27/lib:$APPFOLDER/libgcrypt-1.7.7/lib:$APPFOLDER/libksba-1.3.5/lib

cd libgpg-error-1.27
./configure --prefix=$APPFOLDER/libgpg-error-1.27
make
make install
cd ../

cd libgcrypt-1.7.7
./configure --prefix=$APPFOLDER/libgcrypt-1.7.7 
make
make install
cd ../

cd libassuan-2.4.3
./configure --prefix=$APPFOLDER/libassuan-2.4.3
make
make install
cd ../

cd libksba-1.3.5
./configure --prefix=$APPFOLDER2/libksba-1.3.5
make
make install
cd ../

cd npth-1.5
./configure --prefix=$APPFOLDER/npth-1.5
make
make install
cd ../

cd ntbtls-0.1.1
./configure --prefix=$APPFOLDER/ntbtls-0.1.1gnupg-2.1.21
make
make install
cd ../

cd ncurses-6.0
./configure --prefix=/opt/applications/gnupg2/ncurses-6.0
make
make install
cd ../

cd pinentry-1.0.0
./configure --prefix=--prefix=$APPFOLDER/pinentry-1.0.0 --enable-pinentry-curses --disable-pinentry-qt4
make
make install
cd ../

cd gpgme-1.9.0
./configure --prefix=$APPFOLDER/gpgme-1.9.0
make
make install
cd ../

cd gnupg-2.1.21
./configure --prefix=$APPFOLDER/gnupg-2.1.21
make
make install
cd ../

#echo "/usr/local/lib" > /etc/ld.so.conf.d/gpg2.conf
#ldconfig -v

cd $CD

# Without the line below, gpg2 might fail to create / import secret keys !!! 
if [ -d ~/.gnugp ]
then
	rm -ri ~/.gnugp
fi
gpgconf --kill gpg-agent

echo "Complete !!!"
 
Old 06-27-2017, 02:53 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668
The message is clearly saying it can't find the header file gcrypt.h.

Is that file found in any of the tar bundles you extracted in either /opt/applications/gpg-install or /opt/applications/gnupg2? (You can run "find <directory> -name gcrypt.h" to see. If not you may need another bundle that includes that file.

I'm curious why you're building your own given gnupgp2 is included with RHEL7 so should already be in CentOS7? The gcrypt.h is part of the libgcrypt-devel package on RHEL7 (and presumably CentOS7).

Last edited by MensaWater; 06-27-2017 at 04:09 PM.
 
Old 06-27-2017, 03:37 PM   #3
FranekW
LQ Newbie
 
Registered: Apr 2017
Distribution: CentOS 7
Posts: 29

Original Poster
Rep: Reputation: Disabled
Hi,

I changed the script slightly. Now everything is loaded to one folder "/opt/applications/gnupg2", which contains: lib, include, bin, and share. In ".bashrc", I set CPPFLAGS and LDFLAGS that point out to folders in "/opt/applications/gnupg2". It gets further now but still complains about missing libraries. Now pinentry complains about missing <curses.h> as a part of "ncurses"; "ncurses" installs libraries into its own subfolder: '/opt/applications/gnupg2/lib/ncurses/'--strange. I added an extra folder to CPPFLAGS to include ncurses:

Code:
CPPFLAGS=-I/opt/applications/gnupg2/include:/opt/applications/gnupg2/include/ncurses
LDFLAGS=-L/opt/applications/gnupg2/lib
but "pinentry" still cannot find the <curses.h> :/

"find . -name curses.h -type f" finds the missing file in proper folder: "/opt/applications/gnupg2/include/ncurses/curses.h"

I must say I am out of options now!


To answer your question, I could use gpg 2.0 which is installed in CentOS by default but I read that due to new version gpg 2.1.x version 2.0 will be discontinued. There is something about how keys are stored and they changed it in gpg 2.1.x. I had to do the same with git. The newest version is 2.13.2 whereas v1.8 is the max version available in CentOS 7!



The script
Code:
#!/bin/bash -e

CD=$(pwd)
FOLDER=/opt/applications/gpg-install
APPFOLDER=/opt/applications/gnupg2

mkdir --parents $FOLDER
cd $FOLDER

wget -c https://www.gnupg.org/ftp/gcrypt/gnupg/gnupg-2.1.21.tar.bz2
wget -c https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.27.tar.bz2
wget -c https://www.gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.7.7.tar.bz2
wget -c https://www.gnupg.org/ftp/gcrypt/libassuan/libassuan-2.4.3.tar.bz2
wget -c https://www.gnupg.org/ftp/gcrypt/libksba/libksba-1.3.5.tar.bz2
wget -c https://www.gnupg.org/ftp/gcrypt/npth/npth-1.5.tar.bz2
wget -c https://www.gnupg.org/ftp/gcrypt/ntbtls/ntbtls-0.1.1.tar.bz2
wget -c ftp://ftp.gnu.org/gnu/ncurses/ncurses-6.0.tar.gz
wget -c https://www.gnupg.org/ftp/gcrypt/pinentry/pinentry-1.0.0.tar.bz2
wget -c https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-1.9.0.tar.bz2

tar -xjf libgpg-error-1.27.tar.bz2
tar -xjf libgcrypt-1.7.7.tar.bz2
tar -xjf libassuan-2.4.3.tar.bz2
tar -xjf libksba-1.3.5.tar.bz2
tar -xjf npth-1.5.tar.bz2
tar -xjf ntbtls-0.1.1.tar.bz2
tar -zxf ncurses-6.0.tar.gz
tar -xjf pinentry-1.0.0.tar.bz2
tar -xjf gpgme-1.9.0.tar.bz2
tar -xjf gnupg-2.1.21.tar.bz2

rm libgpg-error-1.27.tar.bz2
rm libgcrypt-1.7.7.tar.bz2
rm libassuan-2.4.3.tar.bz2
rm libksba-1.3.5.tar.bz2
rm npth-1.5.tar.bz2
rm ntbtls-0.1.1.tar.bz2
rm ncurses-6.0.tar.gz
rm pinentry-1.0.0.tar.bz2
rm gpgme-1.9.0.tar.bz2
rm gnupg-2.1.21.tar.bz2

cd libgpg-error-1.27
./configure --prefix=$APPFOLDER
make
make install
cd ../

cd libgcrypt-1.7.7
./configure --prefix=$APPFOLDER
make
make install
cd ../

cd libassuan-2.4.3
./configure --prefix=$APPFOLDER
make
make install
cd ../

cd libksba-1.3.5
./configure --prefix=$APPFOLDER
make
make install
cd ../

cd npth-1.5
./configure --prefix=$APPFOLDER
make
make install
cd ../

cd ntbtls-0.1.1
./configure --prefix=$APPFOLDER
make
make install
cd ../

cd ncurses-6.0
./configure --prefix=$APPFOLDER
make
make install
cd ../

cd pinentry-1.0.0
./configure --prefix=$APPFOLDER --enable-pinentry-curses --disable-pinentry-qt4
make
make install
cd ../

cd gpgme-1.9.0
./configure --prefix=$APPFOLDER
make
make install
cd ../

cd gnupg-2.1.21
./configure --prefix=$APPFOLDER
make
make install
cd ../

echo "$APPFOLDER/lib" > /etc/ld.so.conf.d/gpg2.conf
ldconfig -v

cd $CD

# Without the line below, gpg2 might fail to create / import secret keys !!! 
if [ -d ~/.gnugp ]
then
	rm -ri ~/.gnugp
fi
gpgconf --kill gpg-agent

echo "Complete !!!"
 
Old 06-27-2017, 04:22 PM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668
Your reasoning for moving to 2.1 misses the driving setup of RHEL/CentOS. Although they DO start with a certain upstream version they back port bug and security fixes and often enough enhancements into the version they create so it is NOT exactly the same as the original upstream version. You have to look for the extended versioning they put on it.

Also with RHEL7 they are sometimes actually replacing older upstream based packages with newer upstream based packages if the older one is no longer supported.
 
Old 06-27-2017, 06:14 PM   #5
FranekW
LQ Newbie
 
Registered: Apr 2017
Distribution: CentOS 7
Posts: 29

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by MensaWater View Post
Your reasoning for moving to 2.1 misses the driving setup of RHEL/CentOS. Although they DO start with a certain upstream version they back port bug and security fixes and often enough enhancements into the version they create so it is NOT exactly the same as the original upstream version. You have to look for the extended versioning they put on it.

Also with RHEL7 they are sometimes actually replacing older upstream based packages with newer upstream based packages if the older one is no longer supported.
Well, I can only say that the point is taken.

Regarding my issue with a missing file, would you have any suggestion why I cannot proceed to compile next library after ncurses is built? I cannot figure out the reason why make cannot find <curses.h> while it passed configure.

Thanks
 
Old 06-27-2017, 06:28 PM   #6
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,513

Rep: Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009
You may need to install ncurses-dev, or whatever Centos calls it.
 
Old 06-27-2017, 07:09 PM   #7
norobro
Member
 
Registered: Feb 2006
Distribution: Debian Sid
Posts: 792

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
Quote:
Originally Posted by FranekW View Post
Code:
CPPFLAGS=-I/opt/applications/gnupg2/include:/opt/applications/gnupg2/include/ncurses
I don't think a colon separated list of directories works here. Try it with "-I" in front of both:
Code:
CPPFLAGS=-I/opt/applications/gnupg2/include -I/opt/applications/gnupg2/include/ncurses
 
1 members found this post helpful.
Old 06-28-2017, 04:17 AM   #8
FranekW
LQ Newbie
 
Registered: Apr 2017
Distribution: CentOS 7
Posts: 29

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by norobro View Post
I don't think a colon separated list of directories works here. Try it with "-I" in front of both:
Code:
CPPFLAGS=-I/opt/applications/gnupg2/include -I/opt/applications/gnupg2/include/ncurses
I could not find how to provide multiple directories like this. I assumed colon would be ok. I'll try without colon. Thanks.

Quote:
Originally Posted by AwesomeMachine View Post
You may need to install ncurses-dev, or whatever Centos calls it.
I think it 'ncurses-devel'. I have not checked what version is required by GnuGP 2.1.12 though. CentOS 7 provides v5.9
 
Old 06-28-2017, 05:23 AM   #9
FranekW
LQ Newbie
 
Registered: Apr 2017
Distribution: CentOS 7
Posts: 29

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by norobro View Post
I don't think a colon separated list of directories works here. Try it with "-I" in front of both:
Code:
CPPFLAGS=-I/opt/applications/gnupg2/include -I/opt/applications/gnupg2/include/ncurses
Thanks. This worked. The only comment on that is I had to put it between quotation marks. Otherwise, it complained that the folder ncurses was not available.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Creating A Portable MySQL On CentOS 6 And Ubuntu 11.10 Linux From Sources LXer Syndicated Linux News 0 02-29-2012 10:50 AM
HOWTO: Patching GNUGP and KGPG for 8192-bit keys richinsc Gentoo 4 11-27-2011 01:24 PM
gnugp w/o email client DonLuis Linux - Software 1 10-16-2010 04:56 PM
installing kernel sources bhodi Slackware 1 04-12-2005 01:07 PM
Installing gtkmm from the sources lord_ruyk Linux - Software 0 12-11-2003 04:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration