michael@30: ## michael@30: ## gnupg.spec -- OpenPKG RPM Package Specification michael@286: ## Copyright (c) 2000-2010 OpenPKG Foundation e.V. michael@30: ## michael@30: ## Permission to use, copy, modify, and distribute this software for michael@30: ## any purpose with or without fee is hereby granted, provided that michael@30: ## the above copyright notice and this permission notice appear in all michael@30: ## copies. michael@30: ## michael@30: ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED michael@30: ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF michael@30: ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. michael@30: ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR michael@30: ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@30: ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@30: ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF michael@30: ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND michael@30: ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, michael@30: ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT michael@30: ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF michael@30: ## SUCH DAMAGE. michael@30: ## michael@30: michael@30: # package information michael@30: Name: gnupg michael@30: Summary: GNU Privacy Guard michael@30: URL: http://www.gnupg.org/ michael@30: Vendor: Werner Koch michael@30: Packager: OpenPKG Foundation e.V. michael@30: Distribution: OpenPKG Community michael@30: Class: PLUS michael@30: Group: PGP michael@30: License: GPL michael@462: Version: 2.0.19 michael@462: Release: 20120800 michael@30: michael@30: # package options michael@462: %option with_setuid yes michael@462: %option with_curl yes michael@462: %option with_ldap no michael@462: %option with_idea no michael@30: michael@30: # list of sources michael@30: Source0: ftp://ftp.gnupg.org/gcrypt/gnupg/gnupg-%{version}.tar.bz2 michael@30: Patch0: gnupg.patch michael@30: michael@30: # build information michael@462: BuildPreReq: OpenPKG, openpkg >= 20100101, make michael@462: PreReq: OpenPKG, openpkg >= 20100101, pinentry michael@286: BuildPreReq: gcrypt >= 1.2.3, libksba >= 1.0.2, libassuan >= 2.0.0, gpg-error >= 1.4 michael@286: PreReq: gcrypt >= 1.2.3, libksba >= 1.0.2, libassuan >= 2.0.0, gpg-error >= 1.4 michael@30: BuildPreReq: zlib, bzip2, readline, pth, libiconv michael@30: PreReq: zlib, bzip2, readline, pth, libiconv michael@30: %if "%{with_curl}" == "yes" michael@30: BuildPreReq: curl, openssl michael@30: PreReq: curl, openssl michael@30: %endif michael@30: %if "%{with_ldap}" == "yes" michael@30: BuildPreReq: openldap, openssl michael@30: PreReq: openldap, openssl michael@30: %endif michael@107: %if "%{with_idea}" == "yes" michael@107: BuildPreReq: gcrypt::with_idea michael@107: PreReq: gcrypt::with_idea michael@107: %endif michael@30: michael@30: %description michael@30: GnuPG (GNU Privacy Guard) is a GNU utility for encrypting data and michael@30: creating digital signatures. GnuPG has advanced key management michael@30: capabilities and is compliant with the proposed OpenPGP Internet michael@30: standard described in RFC2440. Since GnuPG doesn't use any patented michael@30: algorithm, it is not compatible with any version of PGP2 (PGP2.x michael@30: uses only IDEA, patented worldwide). michael@30: michael@30: %track michael@30: prog gnupg = { michael@30: version = %{version} michael@30: url = ftp://ftp.gnupg.org/gcrypt/gnupg/ michael@30: regex = gnupg-(2\.__VER__)\.tar\.(gz|bz2) michael@30: } michael@30: michael@30: %prep michael@30: %setup -q -n gnupg-%{version} michael@30: %patch -p0 michael@30: chmod a+rx scripts/install-sh michael@30: %{l_shtool} subst \ michael@30: -e 's;PRINTABLE_OS_NAME;"%{l_openpkg_release}";g' \ michael@30: g10/armor.c michael@30: michael@30: %build michael@30: # configure program michael@30: export LIBS="" michael@31: case "%{l_platform -t}" in michael@31: *-sunos* ) LIBS="$LIBS -lsocket -lnsl" ;; michael@31: esac michael@30: echo "int main(int argc, char *argv[]) { return 0; }" >dummy.c michael@30: for lib in termcap termlib curses ncurses; do michael@30: rc=0; %{l_cc} -o dummy dummy.c -l$lib >/dev/null 2>&1 || rc=1 michael@30: if [ $rc -eq 0 ]; then LIBS="$LIBS -l$lib"; break; fi michael@30: done michael@30: %if "%{with_curl}" == "yes" || "%{with_ldap}" == "yes" michael@30: LIBS="$LIBS -lssl -lcrypto" michael@30: %endif michael@30: %if "%{with_curl}" == "yes" michael@30: LIBS="$LIBS -lz" michael@30: %endif michael@30: LIBS="$LIBS -liconv" michael@30: export CC="%{l_cc}" michael@30: export CFLAGS="%{l_cflags -O}" michael@30: export CPPFLAGS="%{l_cppflags}" michael@107: %if "%{with_idea}" == "yes" michael@107: export CPPFLAGS="-DUSE_IDEA $CPPFLAGS" michael@107: %endif michael@30: export LDFLAGS="%{l_ldflags}" michael@30: ./configure \ michael@30: --prefix=%{l_prefix} \ michael@30: --libexecdir=%{l_prefix}/libexec/gnupg \ michael@30: --mandir=%{l_prefix}/man \ michael@30: --infodir=%{l_prefix}/info \ michael@30: --with-zlib=%{l_prefix} \ michael@30: --with-bzip2=%{l_prefix} \ michael@30: --with-readline=%{l_prefix} \ michael@30: --with-libiconv-prefix=%{l_prefix} \ michael@30: --with-gpg-error-prefix=%{l_prefix} \ michael@30: --with-libgcrypt-prefix=%{l_prefix} \ michael@30: --with-libassuan-prefix=%{l_prefix} \ michael@30: --with-ksba-prefix=%{l_prefix} \ michael@30: --with-pth-prefix=%{l_prefix} \ michael@30: --with-agent-pgm=%{l_prefix}/bin/gpg-agent \ michael@30: --with-pinentry-pgm=%{l_prefix}/bin/pinentry \ michael@30: --with-dirmngr-pgm=%{l_prefix}/bin/dirmngr \ michael@30: %if "%{with_curl}" == "yes" michael@30: --with-libcurl=%{l_prefix} \ michael@30: %else michael@30: --without-libcurl \ michael@30: %endif michael@30: --without-libintl-prefix \ michael@30: --disable-nls \ michael@30: --disable-scdaemon \ michael@30: --enable-generic \ michael@30: --enable-finger \ michael@30: --enable-hkp \ michael@30: %if "%{with_ldap}" == "yes" michael@30: --enable-ldap \ michael@30: %else michael@30: --disable-ldap \ michael@30: %endif michael@30: %if "%{with_curl}" == "yes" michael@30: --with-libcurl=%{l_prefix} \ michael@30: %else michael@30: --without-libcurl \ michael@30: %endif michael@30: --enable-exec \ michael@30: --enable-keyserver-helpers \ michael@30: --with-mailprog="%{l_prefix}/sbin/sendmail" \ michael@30: --disable-mailto michael@30: michael@30: # build program michael@462: %{l_make} %{l_mflags -O} michael@30: michael@30: %install michael@30: # install program michael@462: %{l_make} %{l_mflags} install DESTDIR="$RPM_BUILD_ROOT" michael@30: michael@462: # provide unversioned names michael@462: ln $RPM_BUILD_ROOT%{l_prefix}/bin/gpg2 \ michael@462: $RPM_BUILD_ROOT%{l_prefix}/bin/gpg michael@462: ln $RPM_BUILD_ROOT%{l_prefix}/bin/gpgv2 \ michael@462: $RPM_BUILD_ROOT%{l_prefix}/bin/gpgv michael@462: ln $RPM_BUILD_ROOT%{l_prefix}/man/man1/gpg2.1 \ michael@462: $RPM_BUILD_ROOT%{l_prefix}/man/man1/gpg.1 michael@462: ln $RPM_BUILD_ROOT%{l_prefix}/man/man1/gpgv2.1 \ michael@462: $RPM_BUILD_ROOT%{l_prefix}/man/man1/gpgv.1 michael@30: michael@30: # strip down and post-adjust installation files michael@30: strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true michael@30: strip $RPM_BUILD_ROOT%{l_prefix}/libexec/gnupg/* 2>/dev/null || true michael@30: rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir michael@30: rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/scdaemon.1 michael@30: mv $RPM_BUILD_ROOT%{l_prefix}/bin/gpgsm-gencert.sh \ michael@30: $RPM_BUILD_ROOT%{l_prefix}/bin/gpgsm-gencert michael@30: mv $RPM_BUILD_ROOT%{l_prefix}/man/man1/gpgsm-gencert.sh.1 \ michael@30: $RPM_BUILD_ROOT%{l_prefix}/man/man1/gpgsm-gencert.1 michael@30: michael@30: # determine installation files michael@30: %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ michael@30: %{l_files_std} \ michael@373: %if "%{with_setuid}" == "yes" michael@462: '%attr(4755,%{l_susr},%{l_mgrp}) %{l_prefix}/bin/gpg' \ michael@30: '%attr(4755,%{l_susr},%{l_mgrp}) %{l_prefix}/bin/gpg2' michael@373: %else michael@462: '%attr(0755,%{l_susr},%{l_mgrp}) %{l_prefix}/bin/gpg' \ michael@373: '%attr(0755,%{l_susr},%{l_mgrp}) %{l_prefix}/bin/gpg2' michael@373: %endif michael@30: michael@30: %files -f files michael@30: michael@30: %clean michael@30: