--- /usr/portage/app-mobilephone/smstools/smstools-2.2.1-r2.ebuild	2006-06-15 22:52:19.000000000 +1000
+++ /usr/local/portage/app-mobilephone/smstools/smstools-2.2.1-r2.ebuild	2006-06-21 17:22:48.000000000 +1000
@@ -10,8 +10,11 @@
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="~x86 ~amd64"
-IUSE=""
-RDEPEND="virtual/libc"
+IUSE="debug stats"
+DEPEND="stats? (dev-libs/mm)"
+RDEPEND="virtual/libc \
+		sys-process/procps \
+		${DEPEND}"
 
 S=${WORKDIR}/${PN}
 
@@ -24,6 +27,14 @@
 	unpack ${A}
 	cd ${S}
 	epatch ${FILESDIR}/${PV}-skip-dirlock.patch
+	
+	if use debug; then
+		sed -i -e "s:# CFLAGS += -ggdb -O0:CFLAGS += -ggdb -O0:" ${S}/src/Makefile
+	fi
+	
+	if use stats; then
+		sed -i -e "s:CFLAGS += -D NOSTATS:#CFLAGS += -D NOSTATS:" ${S}/src/Makefile
+	fi                            
 }
 
 src_compile() {