/[gentoo-x86]/net-libs/osptoolkit/osptoolkit-3.5.0.ebuild
Gentoo

Contents of /net-libs/osptoolkit/osptoolkit-3.5.0.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Wed Aug 24 19:12:28 2011 UTC (2 years, 10 months ago) by maekke
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +2 -2 lines
x86 stable, bug #378757

(Portage version: 2.1.10.11/cvs/Linux x86_64)

1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-libs/osptoolkit/osptoolkit-3.5.0.ebuild,v 1.3 2011/08/11 15:40:26 chainsaw Exp $
4
5 EAPI="2"
6
7 inherit eutils multilib toolchain-funcs
8
9 S_DATE="20090302"
10
11 DESCRIPTION="Open Settlement Protocol development kit"
12 HOMEPAGE="http://www.transnexus.com/OSP%20Toolkit/OSP%20Toolkit%20Documents/OSP%20Toolkit%20Documents.htm"
13 SRC_URI="mirror://sourceforge/osp-toolkit/OSPToolkit-${PV}.tar.gz"
14
15 LICENSE="BSD"
16 SLOT="0"
17 KEYWORDS="amd64 x86"
18 IUSE=""
19
20 RDEPEND="dev-libs/openssl"
21 DEPEND="${RDEPEND}"
22
23 S="${WORKDIR}"/TK-${PV//./_}-${S_DATE}
24
25 # TODO:
26 # generate a shared lib
27
28 # NOTES:
29 # osptest isn't a test that can be used for src_test, it's part of the toolkit
30
31 src_prepare() {
32 # remove -O and use users CFLAGS, see bug 241034
33 sed -i -e "s/ -O//" -e "s/^CFLAGS =/CFLAGS +=/" src/Makefile test/Makefile \
34 enroll/Makefile || die "patching Makefiles failed"
35
36 # use users LDFLAGS
37 sed -i -e "s:LFLAGS:LDFLAGS:" test/Makefile \
38 || die "patching test/Makefile failed"
39 sed -i -e "s:\(\$(LIBS\):\$(LDFLAGS) \1:" enroll/Makefile \
40 || die "patching enroll/Makefile failed"
41
42 # change lib dir to $(get_libdir)
43 sed -i -e "s:\$(INSTALL_PATH)/lib:\$(INSTALL_PATH)/$(get_libdir):" \
44 src/Makefile || die "patching src/Makefile failed"
45
46 # test.cfg is located in /etc/${PN}/test.cfg
47 sed -i -e \
48 "s:\(^#define CONFIG_FILENAME.*\"\).*\(test.cfg\"\):\1/etc/${PN}/\2:" \
49 test/test_app.c || die "patching test/test_app.c failed"
50
51 # configure enroll.sh
52 sed -i -e "s:^\(OPENSSL_CONF\).*:\1=/etc/${PN}/openssl.cnf:" \
53 -e "s:^\(RANDFILE\).*:\1=\/etc/${PN}/.rnd:" \
54 bin/enroll.sh || die "patching bin/enroll.sh failed"
55
56 # change enroll path
57 sed -i -e "s:^\(enroll\):/usr/lib/${PN}/\1:" \
58 bin/enroll.sh || die "patching bin/enroll.sh failed"
59 }
60
61 src_compile() {
62 local my_cc=$(tc-getCC)
63
64 emake -C src CC="${my_cc}" build || die "emake libosp failed"
65 emake -C enroll CC="${my_cc}" linux || die "emake enroll failed"
66 emake -C test CC="${my_cc}" linux || die "emake test failed"
67 }
68
69 src_install() {
70 local ospdir="/usr/$(get_libdir)/${PN}"
71
72 emake -C src INSTALL_PATH="${D}"/usr install || die "emake install failed"
73
74 insinto /etc/${PN}
75 doins bin/test.cfg bin/.rnd bin/openssl.cnf || die "doins failed"
76
77 # install enroll and enroll.sh in lib dir to prevent executing them
78 dodir ${ospdir}
79 exeinto ${ospdir}
80 doexe bin/enroll bin/enroll.sh || die "doexe failed"
81
82 # use the symlink to execute enroll.sh
83 dosym ${ospdir}/enroll.sh /usr/bin/ospenroll || die "dosym failed"
84
85 newbin bin/test_app osptest || die "newbin failed"
86
87 dodoc README.txt RELNOTES.txt || die "dodoc failed"
88 }
89
90 pkg_postinst() {
91 elog "OSP test application is now available with 'osptest' command"
92 elog "OSP enroll application is now available with 'ospenroll' command"
93 elog "ospenroll is using /etc/${PN}/openssl.cnf as an openssl configuration"
94 }

  ViewVC Help
Powered by ViewVC 1.1.20