Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ebuild para MUTE File Sharing
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Spanish
View previous topic :: View next topic  
Author Message
dongeo
n00b
n00b


Joined: 27 Oct 2004
Posts: 33

PostPosted: Wed Dec 14, 2005 9:25 pm    Post subject: ebuild para MUTE File Sharing Reply with quote

Buenas, ayer me entretuve aprendiendo a crear ebuilds, y cree este para instalar MUTE, un programa p2p anónimo, con encriptación de datos e ips.
En teoría sirve para x86 y ppc, pero en ppc no he podido probarlo a ver si alguien se anima.
Si tienes la use X te instalara la versión gráfica con GUI traducido según tu LINGUAS y creando el acceso directo para tu escritorio. Si no te instalara el modo consola.
Es el primer ebuild que creo así que ya sabéis, quiero comentarios sobretodo de los que ya tengáis más experiencia. Funcionar funciona pero quizá haya cosas que no van donde deberían o algo así, no se. Que os parece?

Por cierto, no se como debería etiquetar esto :?.

Instrucciones:

Lo primero crear los directorios necesarios.
Code:
su
mkdir -p /usr/local/portage/net-p2p/mute-net/files


Luego añadimos la variable PORTDIR_OVERLAY a nuestro make.conf si es que no la teniamos ya.
Code:
echo 'PORTDIR_OVERLAY="/usr/local/portage"' >> /etc/make.conf


Creamos el archivo /usr/local/portage/net-p2p/mute-net/mute-net-0.4.1.ebuild con un editor de texto y pegamos en su interior el ebuil.

/usr/local/portage/net-p2p/mute-net/mute-net-0.4.1.ebuild
Code:
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit eutils toolchain-funcs

DESCRIPTION="Peer-to-peer network that provides easy search-and-download functionality while also protecting your privacy"

HOMEPAGE="http://mute-net.sourceforge.net/"

SRC_URI="http://dl.sourceforge.net/sourceforge/${PN}/MUTE_fileSharing-${PV}_UnixSource.tar.gz"

LICENSE="GPL-2"

SLOT="0"

KEYWORDS="~x86 ~ppc"

IUSE="X"

DEPEND="X? ( >=x11-libs/wxGTK-2.4.2 )"

S=${WORKDIR}/MUTE_fileSharing-${PV}_UnixSource

src_unpack()
{
   unpack ${A} || die "unpack failed"
   if [ "`gcc-version`" == "3.4" ] ; then
      ewarn "Compile MUTE crypto++ with GCC 3.4"
      ewarn "Here's a patch to allow compilation of the crypto++"
      ewarn "version used in MUTE under GCC 3.4. This patch"
      ewarn "represents the minimum number of changes to ensure"
      ewarn "compilation, but seems to provide a fully-functional"
      ewarn "build (with successful file transfer, stability of the"
      ewarn "application over many hours, etc). Enjoy!"
      cd ${S}/MUTE
      epatch ${FILESDIR}/MUTE-crypto++-GCC-3.4-compilation.patch || die "epatch failed"
   fi
}

src_compile() {
   if useq x86 ; then
      echo 1 > cmd
   elif useq ppc ; then
      echo 2 > cmd
   else
      die "Can't determine the archiquecture x86 or ppc"
   fi

        if useq X ; then
      einfo "Compiling GUI interface"
                echo -e /usr/bin/wx-config\\n1\\n >> cmd
        else
      einfo "Compiling text mode"
                echo -e \\n2\\n >> cmd
        fi

   ./runToBuild < cmd || die "Build failed"
}

src_install() {
   mkdir -p ${D}/usr/share ${D}/usr/bin || die

   if useq X ; then
      cp -Rpf MUTE_GUI_fileSharing ${D}/usr/share/${PN} || die
      cat ${FILESDIR}/${PN} | grep -v "only4text" > ${D}/usr/bin/${PN} || die
      make_desktop_entry mute-net "MUTE File Sharing" || eerror "make_desktop_entry fail"
   else
      cp -Rpf MUTE_text_fileSharing ${D}/usr/share/${PN} || die
      cat ${FILESDIR}/${PN} | grep -v only4GUI > ${D}/usr/bin/${PN} || die
   fi

   chmod +x ${D}/usr/bin/${PN} || die

   if useq X ; then
      strip-linguas pt ca cs da nl es fr gl de he hu it no ru sv en
      lang=`echo ${LINGUAS} | cut -d " " -f 1`
      if [ -z $lang ] ; then
         lang=en
      fi
      einfo "Setting language ${lang}"
      cp -Rpf MUTE/otherApps/fileSharing/userInterface/languages/* ${D}/usr/share/${PN}/languages || die
      case "${lang}" in
         pt)   echo Brazilian_Portuguese > ${D}/usr/share/${PN}/settings/language.ini ;;
         ca)   echo Catalan > ${D}/usr/share/${PN}/settings/language.ini ;;
         cs)   echo Czech > ${D}/usr/share/${PN}/settings/language.ini ;;
         nl)   echo Dutch > ${D}/usr/share/${PN}/settings/language.ini ;;
         es)   echo Espanol2 > ${D}/usr/share/${PN}/settings/language.ini ;;
         fr)   echo Franscais > ${D}/usr/share/${PN}/settings/language.ini ;;
         gl)   echo Galego > ${D}/usr/share/${PN}/settings/language.ini ;;
         de)   echo Deutsch > ${D}/usr/share/${PN}/settings/language.ini ;;
         he)   echo Hebrew > ${D}/usr/share/${PN}/settings/language.ini ;;
         hu)   echo Hungarian > ${D}/usr/share/${PN}/settings/language.ini ;;
         it)   echo Italiano > ${D}/usr/share/${PN}/settings/language.ini ;;
         no)   echo Norwegian > ${D}/usr/share/${PN}/settings/language.ini ;;
         ru)   echo Russian > ${D}/usr/share/${PN}/settings/language.ini ;;
         sv)   echo Swedish > ${D}/usr/share/${PN}/settings/language.ini ;;
      esac
   fi
}

pkg_postinst() {
   einfo "You can change language editing language.ini or in settings GUI tab"
   einfo "You can change the port editind port.ini file."
   echo
   einfo "On first run a .mute subdir will be created on a HOME user directori."
   einfo "MUTE.log and settings subdir with configuration files can found in .mute subir."
   einfo "By default downloaded files hare in a subir on .mute directori."
   echo
   einfo "Visit these webs for more info:"
   einfo "http://mute-net.sourceforge.net"
   einfo "http://www.mymute.info"
   einfo "http://www.planetpeer.de/wiki/index.php"
}


Hacemos lo mismo con el script de inicio /usr/local/portage/net-p2p/mute-net/files/mute-net
Code:
#!/bin/bash

## Create user config dir if not exist
if [ ! -d ${HOME}/.mute ]
then
   mkdir ${HOME}/.mute
   cp -R /usr/share/mute-net/languages ${HOME}/.mute # only4GUI
   cp -R /usr/share/mute-net/settings ${HOME}/.mute
   mkdir -p ${HOME}/.mute/files
fi

## Execute mute-net
cd ${HOME}/.mute
/usr/share/mute-net/fileSharingMUTE   # only4GUI
/usr/share/mute-net/textFileSharingMUTE   # only4text


Y por ultimo nos descargamos un patch para poder compilarlo con GCC 3.4
Entramos aqui y nos descargamos el fichero MUTE-crypto++-GCC-3.4-compilation.patch y lo guardamos en /usr/local/portage/net-p2p/mute-net/files

Ahora creamos las sumas
Code:
cd /usr/local/portage/net-p2p/mute-net
ebuild mute-net-0.4.1.ebuild digest


Y ya podemos instalar
Code:
echo "net-p2p/mute-net ~x86" >> /etc/portage/package.keywords
emerge mute-net
Back to top
View user's profile Send private message
feivelda
Guru
Guru


Joined: 21 Feb 2005
Posts: 480
Location: Frankfurt, Germany

PostPosted: Sat Dec 24, 2005 3:52 pm    Post subject: Reply with quote

Sorry, I'm not from spain :D
But can you help me? I'm writing a ebuild for kommute, thread is here
Back to top
View user's profile Send private message
LinuxBlues
l33t
l33t


Joined: 26 Mar 2005
Posts: 892

PostPosted: Sat Dec 24, 2005 6:20 pm    Post subject: Reply with quote

Échale un vistazo a bugzilla, no vayas a duplicar esfuerzos innecesariamente:

Request for an ebuild for "MUTE"
Back to top
View user's profile Send private message
alexlm78
Veteran
Veteran


Joined: 08 Dec 2003
Posts: 1265
Location: Guatemala,Guatemala

PostPosted: Mon Dec 26, 2005 1:57 pm    Post subject: Reply with quote

dongeo wrote:
Es el primer ebuild que creo así que ya sabéis, quiero comentarios sobretodo de los que ya tengáis más experiencia. Funcionar funciona pero quizá haya cosas que no van donde deberían o algo así, no se. Que os parece?


Cool, lo revisamos y te digo que encuentro.
_________________
"This is a different kind of world, you need a different kind of software"

Linux User# 315201
100% Chapin hecho en Guatemala
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Spanish All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum