first commit
[scm/bb/meta-tizen.git] / recipes-tizen / gpg2 / gpg2.inc
1 DESCRIPTION = "GnuPG 2"
2 HOMEPAGE = "http://www.gnupg.org/aegypten2/"
3 SECTION = "Security/Certificate Management"
4 LICENSE = "GPL-3.0+"
5
6 SRC_URI = ""
7
8 S = "${WORKDIR}/git"
9
10 PROVIDES = ""
11
12 #PROVIDES by gpg2 
13 PROVIDES += "gpg2"
14 RPROVIDES_gpg2 += "gpg2"
15 # the PROVIDES rules is ignore "gnupg = 2.0.19"
16 PROVIDES += "gnupg"
17 RPROVIDES_gpg2 += "gnupg"
18 # the PROVIDES rules is ignore "gpg = 1.4.9"
19 PROVIDES += "gpg"
20 RPROVIDES_gpg2 += "gpg"
21 # the PROVIDES rules is ignore "newpg  "
22 PROVIDES += "newpg"
23 RPROVIDES_gpg2 += "newpg"
24 # the PROVIDES rules is ignore "gpg2_signd_support  "
25 PROVIDES += "gpg2_signd_support"
26 RPROVIDES_gpg2 += "gpg2_signd_support"
27
28 RDEPENDS = ""
29
30 DEPENDS = ""
31 #DEPENDS of gpg2 
32 DEPENDS += "zlib-devel"
33 DEPENDS += "libpth-devel"
34 DEPENDS += "readline-devel"
35 DEPENDS += "adns"
36 DEPENDS += "libgpg-error-devel"
37 DEPENDS += "libksba-devel"
38 #Replace "DEPENDS" on gettext by "inherit gettext"
39 inherit gettext
40 DEPENDS += "automake-native"
41 DEPENDS += "pkgconfig(libusb-1.0)"
42 DEPENDS += "expect"
43 DEPENDS += "libgcrypt-devel"
44 DEPENDS += "curl"
45 DEPENDS += "fdupes-native"
46 DEPENDS += "libassuan-devel"
47
48 do_patch() {
49  chmod -Rf a+rX,u+w,g-w,o-w ${S}
50  #setup  -q -n gnupg-2.0.19
51  cp ${S}/packaging/gpg2.manifest .
52  
53  
54 }
55
56 do_configure() {
57 }
58
59 do_compile() {
60  LANG=C
61  export LANG
62  unset DISPLAY
63  CFLAGS="-O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables" ; export CFLAGS ; 
64  CXXFLAGS="${CXXFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export CXXFLAGS ; 
65  FFLAGS="${FFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -I%_fmoddir}" ; export FFLAGS ; 
66  LD_AS_NEEDED=1; export LD_AS_NEEDED ; 
67  
68  autoreconf -fi
69  # build PIEs (position independent executables) for address space randomisation:
70  PIE="-fpie"
71  export CFLAGS="-O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables ${PIE}"
72  export LDFLAGS=-pie
73  
74    CFLAGS="${CFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export CFLAGS ; 
75    CXXFLAGS="${CXXFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export CXXFLAGS ; 
76    FFLAGS="${FFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -I%_fmoddir}" ; export FFLAGS ; 
77    autotools_do_configure --build=${TARGET_SYS} --host=${HOST_SYS} \
78          --target=x86_64-tizen-linux \
79          --program-prefix= \
80          --prefix=/usr \
81          --exec-prefix=/usr \
82          --bindir=/usr/bin \
83          --sbindir=/usr/sbin \
84          --sysconfdir=/etc \
85          --datadir=/usr/share \
86          --includedir=/usr/include \
87          --libdir=/usr/lib \
88          --libexecdir=/usr/libexec \
89          --localstatedir=/var \
90          --sharedstatedir=/usr/com \
91          --mandir=/usr/share/man \
92          --infodir=/usr/share/info \
93      --libexecdir=/usr/lib \
94      --docdir=/usr/share/doc/packages/gpg2 \
95      --with-agent-pgm=/usr/bin/gpg-agent \
96      --with-scdaemon-pgm=/usr/bin/scdaemon \
97      --enable-gpgsm=yes \
98      --enable-gpg \
99      --with-gnu-ld
100  
101  make -j16
102  
103  exit 0
104  make check
105  ${D}/usr/bin/gpgsplit -v -p pubsplit-                    --uncompress <tests/openpgp/pubring.gpg
106  ${D}/usr/bin/gpgsplit -v -p secsplit- --secret-to-public --uncompress <tests/openpgp/secring.gpg
107  
108  
109  
110 }
111
112 do_install() {
113  echo export RPM_BUILD_ROOT=${D}
114  LANG=C
115  export LANG
116  unset DISPLAY
117  rm -rf ${D} 
118  mkdir -p ${D} 
119  
120  
121    oe_runmake \
122          DESTDIR=${D} \
123          INSTALL_ROOT=${D} \
124          BINDIR=/usr/bin \
125    install  
126    rm -f ${D}/usr/share/info/dir 
127    find ${D} -regex ".*\.la$" | xargs rm -f -- 
128    find ${D} -regex ".*\.a$" | xargs rm -f --
129  mkdir -p ${D}/etc/gnupg/
130  
131  install -m 644 doc/examples/gpgconf.conf ${D}/etc/gnupg
132  
133  rm -rf ${D}/usr/share/doc/packages/gpg2/examples/gpgconf.conf
134  
135  ln -sf gpg2 ${D}/usr/bin/gpg
136  ln -sf gpgv2 ${D}/usr/bin/gpgv
137  ln -sf gpg2.1 ${D}/usr/share/man/man1/gpg.1
138  ln -sf gpgv2.1 ${D}/usr/share/man/man1/gpgv.1
139  
140  rm -rf ${D}//usr/share/locale/en@{bold,}quot
141  
142  /usr/share/spec2yocto/macro/lib/find-lang.sh ${D} gnupg2
143  
144  
145   _target=""; 
146   _symlinks=0; 
147    
148   fdupes -q -n -r ${D} | 
149    while read _file; do 
150      if test -z "$_target" ; then 
151        _target="$_file"; 
152      else 
153        if test -z "$_file" ; then 
154         _target=""; 
155         continue ; 
156        fi ; 
157        if test "$_symlinks" = 1; then 
158          ln -sf "${_target#${D}}" "$_file"; 
159        else 
160          ln -f "$_target" "$_file"; 
161        fi ;
162      fi ; 
163   done 
164  
165  
166  
167  
168 }
169
170 PACKAGES = ""
171 PACKAGES += "gpg2"
172
173 gpg2_files = ""
174 gpg2_files += "gpg2.manifest"
175 gpg2_files += "/usr/share/info/gnupg*"
176 gpg2_files += "/usr/share/doc/packages/gpg2"
177 gpg2_files += "/usr/share/man/man*/*"
178 gpg2_files += "/usr/bin/*"
179 gpg2_files += "/usr/lib/[^d]*"
180 gpg2_files += "/usr/sbin/addgnupghome"
181 gpg2_files += "/usr/sbin/applygnupgdefaults"
182 gpg2_files += "/usr/share/gnupg"
183 gpg2_files += "/etc/gnupg"
184 gpg2_files += "/etc/gnupg/gpgconf.conf"
185
186 FILES_${PN} = "${gpg2_files}"
187
188 PKG_gpg2= "gpg2"
189
190 require gpg2-extraconf.inc