summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKacper Kowalik <xarthisius@gentoo.org>2011-01-23 10:32:25 +0000
committerKacper Kowalik <xarthisius@gentoo.org>2011-01-23 10:32:25 +0000
commit6c9fad1016eacbd2c87be202f6dc791ec97dfbd3 (patch)
tree00573e51f3420ab1a89b46077c33155d9c46a0d7
parentMarked ~ppc-macos and ~x86-solaris (diff)
downloadgentoo-2-6c9fad1016eacbd2c87be202f6dc791ec97dfbd3.tar.gz
gentoo-2-6c9fad1016eacbd2c87be202f6dc791ec97dfbd3.tar.bz2
gentoo-2-6c9fad1016eacbd2c87be202f6dc791ec97dfbd3.zip
Make static libs optional and don't build them with -fPIC. Drop no-net2 flag as currently net-libs/libnet:1.0 doesn't produce shared libs. Prepared for addition of USE=net2, initial fix for compilation with libnet-1.0. Thanks to Angelos for help. Clean ebuild. Drop old.
(Portage version: 2.2.0_alpha16/cvs/Linux x86_64)
-rw-r--r--dev-libs/libmix/ChangeLog14
-rw-r--r--dev-libs/libmix/files/libmix-2.05-autotools.patch108
-rw-r--r--dev-libs/libmix/files/libmix-2.05-gentoo.patch283
-rw-r--r--dev-libs/libmix/files/libmix-2.05-libnet.patch27
-rw-r--r--dev-libs/libmix/libmix-2.05-r4.ebuild34
-rw-r--r--dev-libs/libmix/libmix-2.05-r5.ebuild49
6 files changed, 371 insertions, 144 deletions
diff --git a/dev-libs/libmix/ChangeLog b/dev-libs/libmix/ChangeLog
index 67448b793b93..111d573daa31 100644
--- a/dev-libs/libmix/ChangeLog
+++ b/dev-libs/libmix/ChangeLog
@@ -1,6 +1,16 @@
# ChangeLog for dev-libs/libmix
-# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-libs/libmix/ChangeLog,v 1.13 2010/08/09 15:50:28 hwoarang Exp $
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/libmix/ChangeLog,v 1.14 2011/01/23 10:32:25 xarthisius Exp $
+
+*libmix-2.05-r5 (23 Jan 2011)
+
+ 23 Jan 2011; Kacper Kowalik <xarthisius@gentoo.org> -libmix-2.05-r4.ebuild,
+ +libmix-2.05-r5.ebuild, -files/libmix-2.05-autotools.patch,
+ +files/libmix-2.05-gentoo.patch, +files/libmix-2.05-libnet.patch:
+ Make static libs optional and don't build them with -fPIC. Drop no-net2 flag
+ as currently net-libs/libnet:1.0 doesn't produce shared libs. Prepared for
+ addition of USE=net2, initial fix for compilation with libnet-1.0. Thanks to
+ Angelos for help. Clean ebuild. Drop old.
09 Aug 2010; Markos Chandras <hwoarang@gentoo.org> libmix-2.05-r4.ebuild:
Add --libdir paramteter on econf. Fixes bug #331515
diff --git a/dev-libs/libmix/files/libmix-2.05-autotools.patch b/dev-libs/libmix/files/libmix-2.05-autotools.patch
deleted file mode 100644
index 9f273dfc5f1d..000000000000
--- a/dev-libs/libmix/files/libmix-2.05-autotools.patch
+++ /dev/null
@@ -1,108 +0,0 @@
---- Makefile.in.orig 2003-01-02 17:52:41.000000000 +0100
-+++ Makefile.in 2010-03-20 22:10:42.000000000 +0100
-@@ -1,6 +1,6 @@
--INSTALL_INCLUDES_IN = /usr/include
--INSTALL_LIBRARY_IN = /usr/lib
--INSTALL_MANPAGE_IN = /usr/local/man
-+includedir = /usr/@includedir@
-+libdir = @libdir@
-+mandir = @mandir@
-
- # Compiler to produce C/C++ libraries with (autodetected)
- GCC = @CCAUTO@
-@@ -11,6 +11,7 @@
- INSTALL = @INSTALL@
-
- CFLAGS = @CFLAGS@
-+LDFLAGS = @LDFLAGS@
- CLIB = @CLIB@
-
- AESOBJ = aes/aes.o aes/cast-256.o aes/mars.o aes/saferp.o aes/twofish.o aes/rijndael.o aes/md5.o
-@@ -29,14 +30,14 @@
- @echo ""
-
- libmix.so: mix/net.h ${AESOBJ} ${NETOBJ} ${MISCOBJ}
-- ${GCC} ${CFLAGS} -shared ${AESOBJ} ${NETOBJ} ${MISCOBJ} -o libmix.so ${CLIB}
-+ ${GCC} ${CFLAGS} -shared ${AESOBJ} ${NETOBJ} ${MISCOBJ} -o libmix.so ${LDFLAGS} -Wl,-soname,libmix.so.0 ${CLIB}
-
- libmix.a: mix/net.h ${AESOBJ} ${NETOBJ} ${MISCOBJ}
- ${AR} -cr libmix.a ${AESOBJ} ${NETOBJ} ${MISCOBJ}
- ${RANLIB} libmix.a
-
- libmix++.so: mix/net.h ${AESOBJPP} ${NETOBJPP} ${MISCOBJPP}
-- ${GPP} ${CFLAGS} -shared ${AESOBJPP} ${NETOBJPP} ${MISCOBJPP} -o libmix++.so ${CLIB}
-+ ${GPP} ${CFLAGS} -shared ${AESOBJPP} ${NETOBJPP} ${MISCOBJPP} -o libmix++.so -Wl,-soname,libmix++.so.0 ${LDFLAGS} ${CLIB}
-
- libmix++.a: mix/net.h ${AESOBJPP} ${NETOBJPP} ${MISCOBJPP}
- ${AR} -cr libmix++.a ${AESOBJPP} ${NETOBJPP} ${MISCOBJPP}
-@@ -116,25 +117,25 @@
- ${GCC} ${CFLAGS} -c misc/exclude.c -o misc/exclude.o
-
- install: mix/mix.h mix/net.h mix/aes.h mix/misc.h libmix.so libmix.a
-- ${INSTALL} -d ${INSTALL_INCLUDES_IN}/mix/
-- ${INSTALL} -d ${INSTALL_LIBRARY_IN}/
-- ${INSTALL} -d ${INSTALL_MANPAGE_IN}/man3/
-- ${INSTALL} -m 0644 libmix.3 ${INSTALL_MANPAGE_IN}/man3/libmix.3
-- ${INSTALL} -m 0644 mix/misc.h ${INSTALL_INCLUDES_IN}/mix/misc.h
-- ${INSTALL} -m 0644 mix/net.h ${INSTALL_INCLUDES_IN}/mix/net.h
-- ${INSTALL} -m 0644 mix/aes.h ${INSTALL_INCLUDES_IN}/mix/aes.h
-- ${INSTALL} -m 0644 mix/mix.h ${INSTALL_INCLUDES_IN}/mix/mix.h
-- ${INSTALL} -m 0644 mix/lmconfig.h ${INSTALL_INCLUDES_IN}/mix/lmconfig.h
-- ${INSTALL} -m 0755 libmix.so ${INSTALL_LIBRARY_IN}/libmix.so
-- ${INSTALL} -m 0755 libmix.a ${INSTALL_LIBRARY_IN}/libmix.a
-- ${INSTALL} -m 0755 libmix++.so ${INSTALL_LIBRARY_IN}/libmix++.so
-- ${INSTALL} -m 0755 libmix++.a ${INSTALL_LIBRARY_IN}/libmix++.a
-+ ${INSTALL} -d $(DESTDIR)/$(includedir)/mix/
-+ ${INSTALL} -d $(DESTDIR)/$(libdir)/
-+ ${INSTALL} -d $(DESTDIR)/$(mandir)/man3/
-+ ${INSTALL} -m 0644 libmix.3 $(DESTDIR)/$(mandir)/man3/libmix.3
-+ ${INSTALL} -m 0644 mix/misc.h $(DESTDIR)/$(includedir)/mix/misc.h
-+ ${INSTALL} -m 0644 mix/net.h $(DESTDIR)/$(includedir)/mix/net.h
-+ ${INSTALL} -m 0644 mix/aes.h $(DESTDIR)/$(includedir)/mix/aes.h
-+ ${INSTALL} -m 0644 mix/mix.h $(DESTDIR)/$(includedir)/mix/mix.h
-+ ${INSTALL} -m 0644 mix/lmconfig.h $(DESTDIR)/$(includedir)/mix/lmconfig.h
-+ ${INSTALL} -m 0755 libmix.so $(DESTDIR)/$(libdir)/libmix.so
-+ ${INSTALL} -m 0755 libmix.a $(DESTDIR)/$(libdir)/libmix.a
-+ ${INSTALL} -m 0755 libmix++.so $(DESTDIR)/$(libdir)/libmix++.so
-+ ${INSTALL} -m 0755 libmix++.a $(DESTDIR)/$(libdir)/libmix++.a
- @echo ""
- @echo "Installation complete."
- @echo ""
-
- uninstall:
-- rm -fr /usr/include/mix /usr/lib/libmix* /usr/local/man/man3/libmix.3
-+ rm -fr $(includedir)/mix $(libdir)/libmix* $(mandir)/man3/libmix.3
-
- cleanobj:
- rm -f ${AESOBJPP} ${NETOBJPP} ${MISCOBJPP} ${AESOBJ} ${NETOBJ} ${MISCOBJ} */core */*~ core *~ *.o libtest
---- configure.in.orig 2002-05-19 10:59:20.000000000 +0200
-+++ configure.in 2010-03-20 22:18:22.000000000 +0100
-@@ -4,7 +4,7 @@
- AC_CONFIG_HEADER(mix/lmconfig.h)
-
- compileas="0"
--net2="1"
-+net2="0"
-
- dnl AC_ARG_WITH(libraries-as-c,
- dnl [ --with-libraries-as-c Generate LibMix binaries with GCC ],
-@@ -36,7 +36,7 @@
- AC_PROG_CC
- AC_MSG_CHECKING(accepted compiler flags)
- if test $ac_cv_prog_gcc = yes; then
-- CCOPTS='-I. -Wall -O3 -funroll-loops -ansi -D_LIBMIX_'
-+ CCOPTS='-I. -Wall -fPIC -ansi -D_LIBMIX_'
- AC_MSG_RESULT(GNU CC/ANSI (good))
- else
- CCOPTS='-I. -D_LIBMIX_'
-@@ -74,6 +74,10 @@
- AC_SUBST(CXAUTO)
- AC_SUBST(AR)
- AC_SUBST(CLIB)
-+AC_SUBST(LDFLAGS)
-+AC_SUBST(libdir)
-+AC_SUBST(mandir)
-+AC_SUBST(includedir)
- AC_CHECK_PROGS(AR, ar, @true)
- AC_PROG_RANLIB
- AC_PROG_INSTALL
diff --git a/dev-libs/libmix/files/libmix-2.05-gentoo.patch b/dev-libs/libmix/files/libmix-2.05-gentoo.patch
new file mode 100644
index 000000000000..a013bd7cc6de
--- /dev/null
+++ b/dev-libs/libmix/files/libmix-2.05-gentoo.patch
@@ -0,0 +1,283 @@
+Fix install paths, respect user flags, build shared libs with -fPIC,
+make static libs optional, convert use "--with/without-net2" instead
+"--without-no-net2"
+
+http://bugs.gentoo.org/show_bug.cgi?id=268444
+
+Thanks to Doktor Notor <notordoktor@gmail.com>
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -1,16 +1,16 @@
+-INSTALL_INCLUDES_IN = /usr/include
+-INSTALL_LIBRARY_IN = /usr/lib
+-INSTALL_MANPAGE_IN = /usr/local/man
+-
+-# Compiler to produce C/C++ libraries with (autodetected)
+-GCC = @CCAUTO@
+-GPP = @CXAUTO@
++includedir = /usr/@includedir@
++libdir = @libdir@
++mandir = @mandir@
++BUILD_STATIC = @BUILD_STATIC@
+
+ RANLIB = @RANLIB@
+ AR = @AR@
+ INSTALL = @INSTALL@
+
+ CFLAGS = @CFLAGS@
++CXXFLAGS = @CXXFLAGS@
++LDFLAGS = @LDFLAGS@
++CCOPTS = @CCOPTS@
+ CLIB = @CLIB@
+
+ AESOBJ = aes/aes.o aes/cast-256.o aes/mars.o aes/saferp.o aes/twofish.o aes/rijndael.o aes/md5.o
+@@ -21,120 +19,80 @@
+ NETOBJPP = net/net++.o net/net2++.o
+ MISCOBJPP = misc/misc++.o misc/exclude++.o
+
+-all: libmix.a libmix.so libmix++.a libmix++.so
++OBJS_C = $(AESOBJ) $(NETOBJ) $(MISCOBJ)
++OBJS_PP = $(AESOBJPP) $(NETOBJPP) $(MISCOBJPP)
++
++OBJS_C_A = $(OBJS_C:%.o=%.lo)
++OBJS_PP_A = $(OBJS_PP:%.o=%.lo)
++
++TARGETS = libmix.so libmix++.so
++ifdef BUILD_STATIC
++TARGETS += libmix.a libmix++.a
++endif
++
++all: $(TARGETS)
+ @echo ""
+ @echo Check the install location in the Makefile, and type 'make install'.
+ @echo You may also want to run './libtest' to see all functions work reliably.
+ @echo "Attention: libmix for C++ is now called libmix++[.so|.a]. The original libmix.[so|.a] name will be a plain C library."
+ @echo ""
+
+-libmix.so: mix/net.h ${AESOBJ} ${NETOBJ} ${MISCOBJ}
+- ${GCC} ${CFLAGS} -shared ${AESOBJ} ${NETOBJ} ${MISCOBJ} -o libmix.so ${CLIB}
++libmix.so: mix/net.h $(OBJS_C)
++ $(CC) $(CFLAGS) $(LDFLAGS) -shared $(OBJS_C) -o libmix.so -Wl,-soname,libmix.so.0 $(CLIB)
+
+-libmix.a: mix/net.h ${AESOBJ} ${NETOBJ} ${MISCOBJ}
+- ${AR} -cr libmix.a ${AESOBJ} ${NETOBJ} ${MISCOBJ}
++libmix.a: mix/net.h $(OBJS_C_A)
++ ${AR} -cr libmix.a $(OBJS_C_A)
+ ${RANLIB} libmix.a
+
+-libmix++.so: mix/net.h ${AESOBJPP} ${NETOBJPP} ${MISCOBJPP}
+- ${GPP} ${CFLAGS} -shared ${AESOBJPP} ${NETOBJPP} ${MISCOBJPP} -o libmix++.so ${CLIB}
++libmix++.so: mix/net.h $(OBJS_PP)
++ $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJ_PP) -o libmix++.so -Wl,-soname,libmix++.so.0 $(CLIB)
+
+-libmix++.a: mix/net.h ${AESOBJPP} ${NETOBJPP} ${MISCOBJPP}
+- ${AR} -cr libmix++.a ${AESOBJPP} ${NETOBJPP} ${MISCOBJPP}
++libmix++.a: mix/net.h $(OBJS_PP_A)
++ ${AR} -cr libmix++.a $(OBJS_PP_A)
+ ${RANLIB} libmix++.a
+
+ libtest: libtest.o
+- ${GPP} ${CFLAGS} -static -I. -L. libtest++.o -o libtest -lmix++ @LIBS@ ${CLIB}
++ $(CXX) $(CXXFLAGS) $(CCOPTS) -static -I. -L. libtest++.o -o libtest -lmix++ ${CLIB}
+
+ libtest.o:
+- ${GPP} ${CFLAGS} -c libtest.c -o libtest.o
+- ${GPP} ${CFLAGS} -c libtest.c -o libtest++.o
+-
+-aes/aes++.o:
+- ${GPP} ${CFLAGS} -c aes/aes.c -o aes/aes++.o
+-
+-aes/cast-256++.o:
+- ${GPP} ${CFLAGS} -c aes/cast-256.c -o aes/cast-256++.o
+-
+-aes/mars++.o:
+- ${GPP} ${CFLAGS} -c aes/mars.c -o aes/mars++.o
+-
+-aes/saferp++.o:
+- ${GPP} ${CFLAGS} -c aes/saferp.c -o aes/saferp++.o
+-
+-aes/twofish++.o:
+- ${GPP} ${CFLAGS} -c aes/twofish.c -o aes/twofish++.o
+-
+-aes/rijndael++.o:
+- ${GPP} ${CFLAGS} -c aes/rijndael.c -o aes/rijndael++.o
+-
+-aes/md5++.o:
+- ${GPP} ${CFLAGS} -c aes/md5.c -o aes/md5++.o
+-
+-net/net++.o:
+- ${GPP} ${CFLAGS} -c net/net.c -o net/net++.o
+-
+-net/net2++.o:
+- ${GPP} ${CFLAGS} -c net/net2.c -o net/net2++.o
+-
+-misc/misc++.o:
+- ${GPP} ${CFLAGS} -c misc/misc.c -o misc/misc++.o
+-
+-misc/exclude++.o:
+- ${GPP} ${CFLAGS} -c misc/exclude.c -o misc/exclude++.o
+-
+-aes/aes.o:
+- ${GCC} ${CFLAGS} -c aes/aes.c -o aes/aes.o
+-
+-aes/cast-256.o:
+- ${GCC} ${CFLAGS} -c aes/cast-256.c -o aes/cast-256.o
+-
+-aes/mars.o:
+- ${GCC} ${CFLAGS} -c aes/mars.c -o aes/mars.o
+-
+-aes/saferp.o:
+- ${GCC} ${CFLAGS} -c aes/saferp.c -o aes/saferp.o
+-
+-aes/twofish.o:
+- ${GCC} ${CFLAGS} -c aes/twofish.c -o aes/twofish.o
+-
+-aes/rijndael.o:
+- ${GCC} ${CFLAGS} -c aes/rijndael.c -o aes/rijndael.o
+-
+-aes/md5.o:
+- ${GCC} ${CFLAGS} -c aes/md5.c -o aes/md5.o
+-
+-net/net.o:
+- ${GCC} ${CFLAGS} -c net/net.c -o net/net.o
+-
+-net/net2.o:
+- ${GCC} ${CFLAGS} -c net/net2.c -o net/net2.o
++ $(CC) $(CCOPTS) $(CFLAGS) -c libtest.c -o libtest.o
++ $(CXX) $(CCOPTS) $(CXXFLAGS) -c libtest.c -o libtest++.o
+
+-misc/misc.o:
+- ${GCC} ${CFLAGS} -c misc/misc.c -o misc/misc.o
+
+-misc/exclude.o:
+- ${GCC} ${CFLAGS} -c misc/exclude.c -o misc/exclude.o
++%++.o: %.c
++ $(CXX) $(CCOPTS) $(CXXFLAGS) -fPIC -c $< -o $@
+
+-install: mix/mix.h mix/net.h mix/aes.h mix/misc.h libmix.so libmix.a
+- ${INSTALL} -d ${INSTALL_INCLUDES_IN}/mix/
+- ${INSTALL} -d ${INSTALL_LIBRARY_IN}/
+- ${INSTALL} -d ${INSTALL_MANPAGE_IN}/man3/
+- ${INSTALL} -m 0644 libmix.3 ${INSTALL_MANPAGE_IN}/man3/libmix.3
+- ${INSTALL} -m 0644 mix/misc.h ${INSTALL_INCLUDES_IN}/mix/misc.h
+- ${INSTALL} -m 0644 mix/net.h ${INSTALL_INCLUDES_IN}/mix/net.h
+- ${INSTALL} -m 0644 mix/aes.h ${INSTALL_INCLUDES_IN}/mix/aes.h
+- ${INSTALL} -m 0644 mix/mix.h ${INSTALL_INCLUDES_IN}/mix/mix.h
+- ${INSTALL} -m 0644 mix/lmconfig.h ${INSTALL_INCLUDES_IN}/mix/lmconfig.h
+- ${INSTALL} -m 0755 libmix.so ${INSTALL_LIBRARY_IN}/libmix.so
+- ${INSTALL} -m 0755 libmix.a ${INSTALL_LIBRARY_IN}/libmix.a
+- ${INSTALL} -m 0755 libmix++.so ${INSTALL_LIBRARY_IN}/libmix++.so
+- ${INSTALL} -m 0755 libmix++.a ${INSTALL_LIBRARY_IN}/libmix++.a
++%++.lo: %.c
++ $(CXX) $(CCOPTS) $(CXXFLAGS) -c $< -o $@
++
++%.o: %.c
++ $(CC) $(CCOPTS) $(CFLAGS) -fPIC -c $< -o $@
++
++%.lo: %.c
++ $(CC) $(CCOPTS) $(CFLAGS) -c $< -o $@
++
++install: mix/mix.h mix/net.h mix/aes.h mix/misc.h $(TARGETS)
++ ${INSTALL} -d $(DESTDIR)/$(includedir)/mix/
++ ${INSTALL} -d $(DESTDIR)/$(libdir)/
++ ${INSTALL} -d $(DESTDIR)/$(mandir)/man3/
++ ${INSTALL} -m 0644 libmix.3 $(DESTDIR)/$(mandir)/man3/libmix.3
++ ${INSTALL} -m 0644 mix/misc.h $(DESTDIR)/$(includedir)/mix/misc.h
++ ${INSTALL} -m 0644 mix/net.h $(DESTDIR)/$(includedir)/mix/net.h
++ ${INSTALL} -m 0644 mix/aes.h $(DESTDIR)/$(includedir)/mix/aes.h
++ ${INSTALL} -m 0644 mix/mix.h $(DESTDIR)/$(includedir)/mix/mix.h
++ ${INSTALL} -m 0644 mix/lmconfig.h $(DESTDIR)/$(includedir)/mix/lmconfig.h
++ ${INSTALL} -m 0755 libmix.so $(DESTDIR)/$(libdir)/libmix.so
++ ${INSTALL} -m 0755 libmix++.so $(DESTDIR)/$(libdir)/libmix++.so
++ifdef BUILD_STATIC
++ ${INSTALL} -m 0755 libmix.a $(DESTDIR)/$(libdir)/libmix.a
++ ${INSTALL} -m 0755 libmix++.a $(DESTDIR)/$(libdir)/libmix++.a
++endif
+ @echo ""
+ @echo "Installation complete."
+ @echo ""
+
+ uninstall:
+- rm -fr /usr/include/mix /usr/lib/libmix* /usr/local/man/man3/libmix.3
++ rm -fr $(includedir)/mix $(libdir)/libmix* $(mandir)/man3/libmix.3
+
+ cleanobj:
+ rm -f ${AESOBJPP} ${NETOBJPP} ${MISCOBJPP} ${AESOBJ} ${NETOBJ} ${MISCOBJ} */core */*~ core *~ *.o libtest
+--- a/configure.in
++++ b/configure.in
+@@ -4,7 +4,6 @@
+ AC_CONFIG_HEADER(mix/lmconfig.h)
+
+ compileas="0"
+-net2="1"
+
+ dnl AC_ARG_WITH(libraries-as-c,
+ dnl [ --with-libraries-as-c Generate LibMix binaries with GCC ],
+@@ -24,30 +23,33 @@
+ dnl ]
+ dnl )
+
+-AC_ARG_WITH(no-net2,
+- [ --with-no-net2 Don't use net2 functions, don't require libnet/libpcap.],
+- [
+- if test "x$withval" != "$xno" ; then
+- net2="0"
+- fi
+- ]
+-)
++AC_ARG_WITH([net2],
++ AS_HELP_STRING([--with-net2], [Use net2 functions from libnet/libpcap.]))
++AS_IF([test "x$with_net2" = "xyes"], [
++ AC_DEFINE(LM_USE_NET2)
++ CLIB="-lnet-1.0 -lpcap"
++])
++
++AC_ARG_ENABLE([static],
++ AS_HELP_STRING([--enable-static], [Build static libs]))
++AS_IF([test "x$enable_static" = "xyes"], [
++ BUILD_STATIC=1
++ AC_SUBST(BUILD_STATIC)
++])
+
+ AC_PROG_CC
+ AC_MSG_CHECKING(accepted compiler flags)
+ if test $ac_cv_prog_gcc = yes; then
+- CCOPTS='-I. -Wall -O3 -funroll-loops -ansi -D_LIBMIX_'
++ CCOPTS='-I. -Wall -ansi -D_LIBMIX_'
+ AC_MSG_RESULT(GNU CC/ANSI (good))
+ else
+ CCOPTS='-I. -D_LIBMIX_'
+ AC_MSG_RESULT(crappy :P)
+ fi
+- CFLAGS="$CCOPTS"
+
+ AC_PROG_CXX
+
+ CXAUTO="null"
+-CLIB=""
+
+ CCAUTO=$CC
+ CXAUTO=$CXX
+@@ -60,10 +62,6 @@
+ dnl CXAUTO=$CXX
+ dnl fi
+
+-if test $net2 = "1"; then
+- AC_DEFINE(LM_USE_NET2)
+- CLIB="-lnet -lpcap"
+-fi
+
+ if test $CXAUTO = "null"; then
+ AC_MSG_ERROR( *** Please use either ./configure --with-libraries-as-c
+@@ -74,6 +72,11 @@
+ AC_SUBST(CXAUTO)
+ AC_SUBST(AR)
+ AC_SUBST(CLIB)
++AC_SUBST(LDFLAGS)
++AC_SUBST(libdir)
++AC_SUBST(mandir)
++AC_SUBST(includedir)
++AC_SUBST(CCOPTS)
+ AC_CHECK_PROGS(AR, ar, @true)
+ AC_PROG_RANLIB
+ AC_PROG_INSTALL
diff --git a/dev-libs/libmix/files/libmix-2.05-libnet.patch b/dev-libs/libmix/files/libmix-2.05-libnet.patch
new file mode 100644
index 000000000000..a9866e221580
--- /dev/null
+++ b/dev-libs/libmix/files/libmix-2.05-libnet.patch
@@ -0,0 +1,27 @@
+--- a/mix/net.h.in
++++ b/mix/net.h.in
+@@ -78,11 +78,11 @@
+ #endif
+ #ifdef __cplusplus
+ extern "C" {
+-#include <libnet.h>
++#include <libnet-1.0.h>
+ #include <pcap.h>
+ }
+ #else
+-#include <libnet.h>
++#include <libnet-1.0.h>
+ #include <pcap.h>
+ #endif
+
+--- a/net/net2.c
++++ b/net/net2.c
+@@ -260,7 +260,7 @@
+ lm_libpcap_init();
+
+ rawpacket = (unsigned char *)pcap_next(pcap_fd, &hdr);
+- (char *)rawpacket += pcap_l2offset;
++ *rawpacket += pcap_l2offset;
+
+ ih = (struct lmip *)rawpacket;
+ switch(ih->pro)
diff --git a/dev-libs/libmix/libmix-2.05-r4.ebuild b/dev-libs/libmix/libmix-2.05-r4.ebuild
deleted file mode 100644
index 2b749073cbe3..000000000000
--- a/dev-libs/libmix/libmix-2.05-r4.ebuild
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright 1999-2010 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-libs/libmix/libmix-2.05-r4.ebuild,v 1.2 2010/08/09 15:50:28 hwoarang Exp $
-
-EAPI="2"
-inherit autotools eutils
-
-DESCRIPTION="Programs Crypto/Network/Multipurpose Library"
-HOMEPAGE="http://mixter.void.ru/"
-SRC_URI="http://mixter.void.ru/${P/.}.tgz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
-IUSE="no-net2"
-
-DEPEND="!no-net2? ( virtual/libpcap net-libs/libnet )"
-
-S=${WORKDIR}/${PN}-v${PV}
-
-src_prepare() {
- epatch "${FILESDIR}"/${P}-fix-pattern.patch
- epatch "${FILESDIR}"/${P}-autotools.patch
- eautoreconf
-}
-
-src_configure() {
- econf --libdir=/usr/$(get_libdir) $(use_with no-net2) || die "econf failed"
-}
-
-src_install() {
- emake DESTDIR="${D}" install || die "install failed"
- dodoc CHANGES
-}
diff --git a/dev-libs/libmix/libmix-2.05-r5.ebuild b/dev-libs/libmix/libmix-2.05-r5.ebuild
new file mode 100644
index 000000000000..f9c308e1d8ec
--- /dev/null
+++ b/dev-libs/libmix/libmix-2.05-r5.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/libmix/libmix-2.05-r5.ebuild,v 1.1 2011/01/23 10:32:25 xarthisius Exp $
+
+EAPI="2"
+
+inherit autotools base multilib toolchain-funcs
+
+DESCRIPTION="Programs Crypto/Network/Multipurpose Library"
+HOMEPAGE="http://mixter.void.ru/"
+SRC_URI="http://mixter.void.ru/${P/.}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE="static-libs"
+#IUSE="net2 static-libs"
+
+#DEPEND="net2? ( virtual/libpcap net-libs/libnet:1.0 )"
+#RDEPEND="${DEPEND}"
+
+S=${WORKDIR}/${PN}-v${PV}
+
+PATCHES=(
+ "${FILESDIR}"/${P}-fix-pattern.patch
+ "${FILESDIR}"/${P}-gentoo.patch
+ "${FILESDIR}"/${P}-libnet.patch
+)
+
+DOCS=( CHANGES )
+
+pkg_setup() {
+ tc-export CC CXX
+}
+
+src_prepare(){
+ base_src_prepare
+ eautoreconf
+}
+
+# net-libs/libnet doesn't provide shared libs, cannot be used currently
+
+src_configure() {
+ econf \
+ --libdir=/usr/$(get_libdir) \
+ $(use_enable static-libs static) \
+ --without-net2
+# $(use_with net2)
+}