summaryrefslogtreecommitdiff
blob: 453fcaa21ab9f32fa3dc8dc8fd3d6a37b2d42815 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=6
WANT_AUTOMAKE="1.13"

inherit autotools libtool

MY_PN="super-smack"
MY_P="${MY_PN}-${PV}"
DESCRIPTION="Benchmarking, stress testing, and load generation tool for MySQL & PostGreSQL"
HOMEPAGE="http://vegan.net/tony/supersmack/"
SRC_URI="mirror://gentoo/${MY_P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 ~ppc x86"
IUSE="+mysql postgres"
REQUIRED_USE="|| ( mysql postgres )"

COMMON_DEPEND="sys-libs/zlib:=
		mysql? ( dev-db/mysql-connector-c:= )
		postgres? ( dev-db/postgresql:*[server] )"
DEPEND="${COMMON_DEPEND} sys-devel/bison sys-devel/flex"
RDEPEND="${COMMON_DEPEND} mysql? ( virtual/mysql )"

S="${WORKDIR}/${MY_P}"

PATCHES=(
	"${FILESDIR}"/${PN}-1.2.destdir.patch
	"${FILESDIR}"/${PN}-1.3.amd64.patch
	"${FILESDIR}"/${PN}-1.3.gcc4.3.patch
	"${FILESDIR}"/${PN}-1.3-gen-data.patch
	"${FILESDIR}"/${PN}-1.3-automake-1.13.patch
)
DOCS=( CHANGES INSTALL MANUAL README TUTORIAL )

src_prepare() {
	# Clean up files so eautoreconf does not pick up any
	# deprecated autotools macros.
	rm acinclude.m4 aclocal.m4 acconfig.h config.status config.h || die
	mv configure.in configure.ac || die
	export CXXFLAGS+=" -std=gnu++98"
	default
	eautoreconf
	elibtoolize --patch-only
}

src_configure() {
	local myeconfargs=(
		$(usex mysql --with-mysql "")
		$(usex postgres --with-pgsql "")
		--with-datadir=/var/tmp/${MY_PN}
		--with-smacks-dir=/usr/share/${MY_PN}
	)
	econf "${myeconfargs[@]}"
}

src_install() {
	default
	keepdir /var/tmp/${MY_PN}
}

pkg_postinst() {
	elog "The gen-data binary is now installed as super-smack-gen-data"
}