You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
99 lines
2.7 KiB
99 lines
2.7 KiB
8 years ago
|
# Copyright 1999-2017 Gentoo Foundation
|
||
11 years ago
|
# Distributed under the terms of the GNU General Public License v2
|
||
9 years ago
|
# $Id$
|
||
11 years ago
|
|
||
8 years ago
|
EAPI=6
|
||
11 years ago
|
|
||
8 years ago
|
inherit toolchain-funcs
|
||
11 years ago
|
|
||
8 years ago
|
S_DATE="20161107"
|
||
11 years ago
|
|
||
|
DESCRIPTION="Open Settlement Protocol development kit"
|
||
|
HOMEPAGE="http://www.transnexus.com/OSP%20Toolkit/OSP%20Toolkit%20Documents/OSP%20Toolkit%20Documents.htm"
|
||
|
SRC_URI="mirror://sourceforge/osp-toolkit/OSPToolkit-${PV}.tar.gz"
|
||
|
|
||
|
LICENSE="BSD"
|
||
|
SLOT="0"
|
||
|
KEYWORDS="~amd64 ~x86"
|
||
|
IUSE=""
|
||
|
|
||
8 years ago
|
RDEPEND="dev-libs/openssl:0="
|
||
11 years ago
|
DEPEND="${RDEPEND}"
|
||
|
|
||
8 years ago
|
S=${WORKDIR}/TK-${PV//./_}-${S_DATE}
|
||
11 years ago
|
|
||
|
# TODO:
|
||
|
# generate a shared lib
|
||
|
|
||
|
# NOTES:
|
||
|
# osptest isn't a test that can be used for src_test, it's part of the toolkit
|
||
|
|
||
8 years ago
|
PATCHES=(
|
||
|
"${FILESDIR}"/${PN}-4.13.0-gcc5.patch
|
||
|
)
|
||
|
|
||
11 years ago
|
src_prepare() {
|
||
8 years ago
|
default
|
||
|
|
||
11 years ago
|
# remove -O and use users CFLAGS, see bug 241034
|
||
|
sed -i -e "s/ -O//" -e "s/^CFLAGS =/CFLAGS +=/" src/Makefile test/Makefile \
|
||
|
enroll/Makefile || die "patching Makefiles failed"
|
||
|
|
||
|
# use users LDFLAGS
|
||
|
sed -i -e "s:LFLAGS:LDFLAGS:" test/Makefile \
|
||
|
|| die "patching test/Makefile failed"
|
||
|
sed -i -e "s:\(\$(LIBS\):\$(LDFLAGS) \1:" enroll/Makefile \
|
||
|
|| die "patching enroll/Makefile failed"
|
||
|
|
||
|
# change lib dir to $(get_libdir)
|
||
|
sed -i -e "s:\$(INSTALL_PATH)/lib:\$(INSTALL_PATH)/$(get_libdir):" \
|
||
|
src/Makefile || die "patching src/Makefile failed"
|
||
|
|
||
|
# test.cfg is located in /etc/${PN}/test.cfg
|
||
|
sed -i -e \
|
||
|
"s:\(^#define CONFIG_FILENAME.*\"\).*\(test.cfg\"\):\1/etc/${PN}/\2:" \
|
||
|
test/test_app.c || die "patching test/test_app.c failed"
|
||
|
|
||
|
# configure enroll.sh
|
||
|
sed -i -e "s:^\(OPENSSL_CONF\).*:\1=/etc/${PN}/openssl.cnf:" \
|
||
|
-e "s:^\(RANDFILE\).*:\1=\/etc/${PN}/.rnd:" \
|
||
|
bin/enroll.sh || die "patching bin/enroll.sh failed"
|
||
|
|
||
|
# change enroll path
|
||
|
sed -i -e "s:^\(enroll\):/usr/lib/${PN}/\1:" \
|
||
|
bin/enroll.sh || die "patching bin/enroll.sh failed"
|
||
|
}
|
||
|
|
||
|
src_compile() {
|
||
8 years ago
|
emake CC="$(tc-getCC)" AR="$(tc-getAR)" -C src build
|
||
|
emake CC="$(tc-getCC)" AR="$(tc-getAR)" -C enroll linux
|
||
|
emake CC="$(tc-getCC)" AR="$(tc-getAR)" -C test linux
|
||
11 years ago
|
}
|
||
|
|
||
|
src_install() {
|
||
8 years ago
|
emake -C src INSTALL_PATH="${ED%/}"/usr install
|
||
11 years ago
|
|
||
8 years ago
|
local DOCS=( README.txt RELNOTES.txt )
|
||
|
einstalldocs
|
||
11 years ago
|
|
||
|
insinto /etc/${PN}
|
||
8 years ago
|
doins bin/test.cfg bin/.rnd bin/openssl.cnf
|
||
11 years ago
|
|
||
|
# install enroll and enroll.sh in lib dir to prevent executing them
|
||
8 years ago
|
local ospdir=/usr/$(get_libdir)/${PN}
|
||
11 years ago
|
dodir ${ospdir}
|
||
|
exeinto ${ospdir}
|
||
8 years ago
|
doexe bin/enroll bin/enroll.sh
|
||
11 years ago
|
|
||
|
# use the symlink to execute enroll.sh
|
||
8 years ago
|
dosym ${ospdir}/enroll.sh /usr/bin/ospenroll
|
||
11 years ago
|
|
||
8 years ago
|
newbin bin/test_app osptest
|
||
11 years ago
|
}
|
||
|
|
||
|
pkg_postinst() {
|
||
|
elog "OSP test application is now available with 'osptest' command"
|
||
|
elog "OSP enroll application is now available with 'ospenroll' command"
|
||
|
elog "ospenroll is using /etc/${PN}/openssl.cnf as an openssl configuration"
|
||
|
}
|