/[gentoo-alt]/trunk/prefix/app-crypt/gnupg/gnupg-1.4.5.ebuild
Gentoo

Contents of /trunk/prefix/app-crypt/gnupg/gnupg-1.4.5.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1429 - (show annotations) (download)
Sun Sep 10 10:28:51 2006 UTC (7 years, 7 months ago) by grobian
File size: 6564 byte(s)
added gnupg and gpgme


1 # Copyright 1999-2006 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/app-crypt/gnupg/gnupg-1.4.5.ebuild,v 1.9 2006/09/02 23:49:37 kloeri Exp $
4
5 EAPI="prefix"
6
7 inherit eutils flag-o-matic linux-info
8
9 ECCVER=0.1.6
10 ECCVER_GNUPG=1.4.4
11 MY_P=${P/_/}
12
13 DESCRIPTION="The GNU Privacy Guard, a GPL pgp replacement"
14 HOMEPAGE="http://www.gnupg.org/"
15 SRC_URI="mirror://gnupg/gnupg/${P}.tar.bz2
16 idea? ( ftp://ftp.gnupg.dk/pub/contrib-dk/idea.c.gz )
17 ecc? ( http://alumnes.eps.udl.es/%7Ed4372211/src/${PN}-${ECCVER_GNUPG}-ecc${ECCVER}.diff.bz2 )"
18
19 LICENSE="GPL-2"
20 SLOT="0"
21 KEYWORDS="amd64 ppc-macos x86"
22 IUSE="bzip2 curl ecc idea ldap nls readline selinux smartcard static usb zlib X linguas_ru"
23 # IUSE+=caps
24
25 # caps? ( sys-libs/libcap )
26 COMMON_DEPEND="
27 ldap? ( net-nds/openldap )
28 bzip2? ( app-arch/bzip2 )
29 zlib? ( sys-libs/zlib )
30 curl? ( net-misc/curl )
31 virtual/mta
32 readline? ( sys-libs/readline )
33 smartcard? ( dev-libs/libusb )
34 usb? ( dev-libs/libusb )"
35
36 RDEPEND="!static? (
37 ${COMMON_DEPEND}
38 X? ( || ( media-gfx/xloadimage media-gfx/xli ) )
39 )
40 selinux? ( sec-policy/selinux-gnupg )
41 nls? ( virtual/libintl )"
42
43 DEPEND="${COMMON_DEPEND}
44 dev-lang/perl
45 nls? ( sys-devel/gettext )"
46
47 S="${WORKDIR}/${MY_P}"
48
49 pkg_setup() {
50 # fix bug #113474 - no compiled kernel needed now
51 if use kernel_linux; then
52 get_running_version
53 fi
54 }
55
56 src_unpack() {
57 unpack ${A}
58
59
60 # Jari's patch to boost iterated key setup by factor of 128
61 EPATCH_OPTS="-p1 -d ${S}" epatch "${FILESDIR}"/${PN}-1.4.3-jari.patch
62
63 if use idea; then
64 ewarn "Please read http://www.gnupg.org/(en)/faq/why-not-idea.html"
65 mv "${WORKDIR}"/idea.c "${S}"/cipher/idea.c || \
66 ewarn "failed to insert IDEA module"
67 fi
68
69 if use ecc; then
70 epatch "${FILESDIR}"/${P}-ecc-helper.patch
71 EPATCH_OPTS="-p1 -d ${S}" epatch ${PN}-${ECCVER_GNUPG}-ecc${ECCVER}.diff
72 fi
73
74 # maketest fix
75 EPATCH_OPTS="-p1 -d ${S}" epatch "${FILESDIR}"/${PN}-1.4.3-selftest.patch
76
77 # install RU man page in right location
78 EPATCH_OPTS="-p1 -d ${S}" epatch "${FILESDIR}"/${PN}-1.4.3-badruman.patch
79
80 # keyserver fix
81 EPATCH_OPTS="-p1 -d ${S}" epatch "${FILESDIR}"/${PN}-1.4.3-keyserver.patch
82
83 cd "${S}"
84 # Fix PIC definitions
85 sed -i -e 's:PIC:__PIC__:' mpi/i386/mpih-{add,sub}1.S intl/relocatable.c
86 sed -i -e 's:if PIC:ifdef __PIC__:' mpi/sparc32v8/mpih-mul{1,2}.S
87 }
88
89 src_compile() {
90 # Certain sparc32 machines seem to have trouble building correctly with
91 # -mcpu enabled. While this is not a gnupg problem, it is a temporary
92 # fix until the gcc problem can be tracked down.
93 if [ "${ARCH}" == "sparc" ] && [ "${PROFILE_ARCH}" == "sparc" ]; then
94 filter-flags -mcpu=supersparc -mcpu=v8 -mcpu=v7
95 fi
96
97 # 'USE=static' support was requested in #29299
98 use static &&append-ldflags -static
99
100 append-ldflags $(bindnow-flags)
101
102 # fix compile problem on ppc64
103 use ppc64 && myconf="${myconf} --disable-asm"
104
105 # $(use_with caps capabilities) \
106 econf \
107 $(use_enable ldap) \
108 --enable-mailto \
109 --enable-hkp \
110 --enable-finger \
111 $(use_with !zlib included-zlib) \
112 $(use_with curl libcurl /usr) \
113 $(use_enable nls) \
114 $(use_enable bzip2) \
115 $(use_enable smartcard card-support) \
116 $(use_enable selinux selinux-support) \
117 --disable-capabilities \
118 $(use_with readline) \
119 $(use_with usb libusb /usr) \
120 $(use_enable static) \
121 $(use_enable X photo-viewers) \
122 --enable-static-rnd=linux \
123 --libexecdir="${EPREFIX}"/usr/libexec \
124 --enable-noexecstack \
125 ${myconf} || die
126 # this is because it will run some tests directly
127 gnupg_fixcheckperms
128 emake || die
129 }
130
131 src_install() {
132 gnupg_fixcheckperms
133 make DESTDIR="${EDEST}" install || die
134
135 # keep the documentation in /usr/share/doc/...
136 rm -rf "${D}/usr/share/gnupg/FAQ" "${D}/usr/share/gnupg/faq.html"
137
138 dodoc AUTHORS BUGS ChangeLog NEWS PROJECTS README THANKS \
139 TODO VERSION doc/{FAQ,HACKING,DETAILS,ChangeLog,OpenPGP,faq.raw}
140
141 docinto sgml
142 dodoc doc/*.sgml
143
144 dohtml doc/faq.html
145
146 exeinto /usr/libexec/gnupg
147 doexe tools/make-dns-cert
148
149 # install RU documentation in right location
150 if use linguas_ru
151 then
152 cp doc/gpg.ru.1 ${T}/gpg.1
153 doman -i18n=ru ${T}/gpg.1
154 fi
155
156 # Remove collissions
157 if use ppc-macos; then
158 rm ${D}/usr/lib/charset.alias ${D}/usr/share/locale/locale.alias
159 fi
160 }
161
162 gnupg_fixcheckperms() {
163 # GnuPG does weird things for testing that it build correctly
164 # as we as for the additional tests. It WILL fail with perms 770 :-(.
165 # See bug #80044
166 if has userpriv ${FEATURES}; then
167 einfo "Fixing permissions in check directory"
168 chown -R portage:portage ${S}/checks
169 chmod -R ugo+rw ${S}/checks
170 chmod ugo+rw ${S}/checks
171 fi
172 }
173
174 src_test() {
175 gnupg_fixcheckperms
176 einfo "Running tests"
177 emake check
178 ret=$?
179 if [ $ret -ne 0 ]; then
180 die "Some tests failed! Please report to the Gentoo Bugzilla"
181 fi
182 }
183
184 pkg_postinst() {
185 #if ! use kernel_linux || (! use caps && kernel_is lt 2 6 9); then
186 if ! use kernel_linux || kernel_is lt 2 6 9; then
187 chmod u+s,go-r ${ROOT}/usr/bin/gpg
188 einfo "gpg is installed suid root to make use of protected memory space"
189 einfo "This is needed in order to have a secure place to store your"
190 einfo "passphrases, etc. at runtime but may make some sysadmins nervous."
191 else
192 chmod u-s,go-r ${ROOT}/usr/bin/gpg
193 fi
194 echo
195 if use idea; then
196 einfo "-----------------------------------------------------------------------------------"
197 einfo "IDEA"
198 ewarn "you have compiled ${PN} with support for the IDEA algorithm, this code"
199 ewarn "is distributed under the GPL in countries where it is permitted to do so"
200 ewarn "by law."
201 einfo
202 einfo "Please read http://www.gnupg.org/(en)/faq/why-not-idea.html for more information."
203 einfo
204 ewarn "If you are in a country where the IDEA algorithm is patented, you are permitted"
205 ewarn "to use it at no cost for 'non revenue generating data transfer between private"
206 ewarn "individuals'."
207 einfo
208 einfo "Countries where the patent applies are listed here"
209 einfo "http://www.mediacrypt.com/_contents/10_idea/101030_ea_pi.asp"
210 einfo
211 einfo "Further information and other licenses are availble from http://www.mediacrypt.com/"
212 einfo "-----------------------------------------------------------------------------------"
213 fi
214 if use ecc; then
215 einfo
216 ewarn "The elliptical curves patch is experimental"
217 einfo "Further info available at http://alumnes.eps.udl.es/%7Ed4372211/index.en.html"
218 fi
219 #if use caps; then
220 # einfo
221 # ewarn "Capabilities code is experimental"
222 #fi
223 einfo
224 einfo "See http://www.gentoo.org/doc/en/gnupg-user.xml for documentation on gnupg"
225 einfo
226 }

  ViewVC Help
Powered by ViewVC 1.1.20