summaryrefslogtreecommitdiff
blob: 86d9c840546460e9c1b82544fed4d9a650507863 (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
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-sound/digitaldj/digitaldj-0.7.5.ebuild,v 1.4 2006/10/23 11:11:01 vivo Exp $

DESCRIPTION="A SQL-based mp3-player frontend designed to work with Grip"
HOMEPAGE="http://www.nostatic.org/ddj/"
SRC_URI="mirror://sourceforge/ddj/${P}.tar.gz"
LICENSE="GPL-1"
SLOT="0"
#-amd64: 0.7.3-r1: segfault when "attempt to configure database->yes"
KEYWORDS="~alpha -amd64 ~hppa ~ppc ~sparc ~x86"
IUSE="lirc"
DEPEND="dev-db/mysql
	lirc? ( app-misc/lirc )
	gnome-base/libghttp
	media-libs/gdk-pixbuf
	media-sound/grip
	>=x11-libs/gtk+-1.2"

inherit eutils

src_unpack() {
	unpack ${A}
	cd "${S}"
	# CLK_TCK -> CLOCKS_PER_SEC
	epatch "${FILESDIR}/${PN}-remove_obsolete_CLK_TCK.patch"
}

src_compile() {
	econf `use_enable lirc` || die
	emake || die
}

src_install() {
	einstall
	dodoc AUTHORS ChangeLog README
}

pkg_postinst() {
	einfo "To create the DDJ database run"
	einfo " emerge --config =${CATEGORY}/${PF}"
}

pkg_config() {
	local sql=`mktemp digitaldj.XXXXXXXXXX` || die "mktemp failed"
	echo 'CREATE DATABASE IF NOT EXISTS ddj_mp3;' >> ${sql}
	echo 'GRANT SELECT, INSERT, UPDATE, DELETE ON ddj_mp3.* TO ddj@localhost;' >> ${sql}
	echo 'USE ddj_mp3;' >> ${sql}
	sed -e 's/^\(CREATE TABLE\)/\1 IF NOT EXISTS/g' ${ROOT}/usr/share/digitaldj/0-2.sql >> ${sql}
	less ${sql}
	echo "Type in your MySQL root password:"
	mysql -u root -p < ${sql}
	rm -f ${sql}
}