|
|
上网找了一个,试了一下,管用,就是启动之后不是"systray"
试着改了一下,还是一样。于是自己写了一个最简单的,就是安装的时候要这样:FEATURES="-sandbox" emerge g2ipmsg
http://www.linuxsir.cn/bbs/printthread.php?t=323860&pp=40
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
inherit eutils
#g2ipmsg 是基于GTK+的局域网聊天工具 可以跟Windows版的飞鸽传书一起使用
#可聊天及传输文件等
#http://www.lanqq.com/soft/lanqq/setup.rar 发布正式版懒QQ(LanQQ) V3.1版本
#(飞鸽传书的升级版本 for windows)
#http://www.azhi.net/IPMsg/ 飞鸽传书windows版最新版下载地址
DESCRIPTION="This is a pop up style LAN Messenger for multi platforms." # 这是对你的软件包进行的简短说明
HOMEPAGE="http://www.ipmsg.org/index.html.en" # 这个就没什么好说的了,如果你在某个站点发布你的软件,那在这里加上网站的链接就是了
SRC_URI="http://www.ipmsg.org/archive/${P}.tar.gz" # 这个地址应该指向该软件包可以下载的链接,由于我们把它放入树中了,这里就留空
#http://www.ipmsg.org/archive/g2ipmsg-0.9.5.tar.gz
SLOT="0" # 通常这里写成0就可以了,这主要用于GCC,emacs这类可以多版本共存的软件包
#IUSE="ext-charcode ssl applet systray doc" # 这里设置USE标记,较为复杂,这里就只加一个doc作例子了
IUSE="linguas_zh_CN ssl applet systray doc" # 这里设置USE标记,较为复杂,这里就只加一个doc作例子了
LICENSE="GPL-2" # 我们痛恨但又不可避免的软件许可
KEYWORDS="x86 amd64" #这只是个简单的脚本,所以在各种架构上都应该是可以正常运行的,不过,我们只想在x86上测试它
#并且所有起始的ebuild都应该先进行测试,所以只写上~x86
DEPEND="gnome-base/libgnomeui \
dev-libs/glib \
ssl? ( dev-libs/openssl ) \
applet? ( >=gnome-base/gnome-panel-2 ) \
dev-util/pkgconfig \
>=dev-util/intltool-0.33 \
>=x11-libs/gtk+-2.10.14"
#RDEPEND=""
RESTRICT="mirror" #for local overlay
src_unpack() # 这个函数用于解压源代码
{
#当前ebuild可以不用声明此函数 但为了学习而显示一些变量而用的
# ${S}是src_unpack函数起始执行的地方,由emerge系统自动创建
#cp ${FILESDIR}/unmask.gz ${S}
#FILESDIR这个变量指明了我们存放该包的路径也就是
#/usr/portage/local/myebuilds/app-portage/unmask/files
#gzip -d ${S}/unmask.gz
einfo "Start src_unpack()"
einfo "${P}"
einfo "\$\{S\}=${S}"
einfo "\$\{D\}=${D}"
einfo "\$\{FILESDIR\}=${FILESDIR}"
unpack ${A}
cd "${S}"
#epatch "${FILESDIR}/${P}.diff" #暂时不用留着吧
#以下几行主要应对0.9.5版本 configure --with-ext-charcode=CP936无效的问题
sed -i 's/CP932/CP936/g' configure.in
sed -i 's/CP932/CP936/g' configure
#sed -i 's/CP932/CP936/g' config.h #多此一举 这个文件是configure生成的
#反正不考虑其他字符集所以全改为CP936
}
#show_econf_err()
#{
# einfo "econf faile by show_econf_err()"
# if use applet; then
# einfo "try to use USE="-applet" emerge foo"
# fi
#}
#
src_compile()
{
#if !use systray; then
# econf --disable-systray || die "econf failed"
#else
# econf --enable-systray || die "econf failed"
#fi
#econf $(use_enable systray) \
# $(use_enable applet) \
# $(use_with ext-charcode) \
# $(use_with ssl) || die "econf failed"
local myconf
myconf="`use_enable systray` \
`use_enable applet` \
`use_with ssl`"
if use linguas_zh_CN ; then
myconf="$myconf --with-ext-charcode=CP936"
fi
einfo " myconf = ${myconf}"
econf ${myconf} || die "=================econf failed============="
emake || die "emake failed"
# --with-ext-charcode External character code setting(CP936(Simplified
}
# src_compile() { } #如果你需要编译什么东西,就在这个函数中完成.
src_install()
{
einfo "Start src_install()"
#dosbin unmask
# 使用dosbin将目标程序安装到/usr/sbin/目录,相应的,如果要安装到/usr/bin,可以使用dobin,这是ebuild本身提供的几个简单的安装函数,可以在man 5 ebuild中查到它们
if use doc; then
einfo "the USE="doc""
einfo "cp `ls ${FILESDIR}` to ${D}"
#如果使用doc这个USE标记,我们就把readme也复制进去.
#dodoc ${FILESDIR}/readme.gz
# dodoc也是ebuild脚本所提供的一个安装文档的函数,它会自动创建/usr/share/doc/${PF}并且将文档安装进去
else
einfo "the USE="-doc""
einfo "show files === `ls ${FILESDIR}` ===="
fi
GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 emake DESTDIR="${D}" install || die "emake install failed" #
#推荐使用 make DESTDIR="${D}" install 方式
#GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 #解决sandbox出错的题,之前要FEATURES=-sandbox emerge g2ipmsg的问题
#GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 einstall || die "einstall failed"
#einstall用于对付不正常Makefile
}
#------------------ 一个使用第三方ebuild的示例---------------------------
#sudo mkdir /usr/local/myportage/net-misc/g2ipmsg/files -p
#cd /usr/local/myportage/net-misc/g2ipmsg/files
#--------------------
#add PORTDIR_OVERLAY to /etc/make.conf
#PORTDIR_OVERLAY="/usr/local/myportage"
#PORTDIR_OVERLAY="${PORTDIR_OVERLAY} /usr/portage/local/layman/gentoo-china"
#sudo sh -c "echo net-misc/g2ipmsg >> /etc/portage/package.keywords"
#sudo sh -c 'echo "net-misc/g2ipmsg ssl applet doc systray >> /etc/portage/package.use'
#不用这一步
#sudo ebuild ./g2ipmsg-0.9.5.ebuild digest
#sudo sh -c "USE=doc emerge g2ipmsg"
#cat /var/lib/portage/world | grep g2ipmsg
#---------------------------------------------
#test for ebuild
#repoman scan
#repoman full
#---------------------------------------------
#==========联系方式==========
# mailto: 3444542@163.com
# QQ: 3444542
# gmail: zlbgps@gmail.com
# irc: irc.freenode.org/#gentoo-cn GunsNRose
# blog: http://hi.baidu.com/3444542/blog
#============================
#--------------------------------------------------------------------------------
#========== g2ipmsg configure --help的一些参数==================
#Optional Features:
# --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
# --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
# --enable-maintainer-mode enable make rules and dependencies not useful
# (and sometimes confusing) to the casual installer
# --disable-dependency-tracking speeds up one-time build
# --enable-dependency-tracking do not reject slow dependency extractors
# --enable-systray build g2ipmsg application as systray support [default yes]
# --disable-schemas-install Disable the schemas installation
# --enable-applet trun on building applet version [default yes]
#
#Optional Packages:
# --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
# --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
# --with-ssl=PATH where to look for OpenSSL, PATH points to the
# OpenSSL installation (default: /usr/local/ssl)
# --without-ssl disable OpenSSL
# --with-ext-charcode External character code setting(CP936(Simplified
# Chinese), CP932(Japanese Windows ShiftJIS))
# [default=CP932]
# --with-gconf-source=sourceaddress Config database for installing schema files.
# --with-gconf-schema-file-dir=dir Directory for installing schema files.
#--------------------------------------------------------------------------------
我自己写的这个,最简单,就是按照README安装三步来的:
localhost g2ipmsg # cat g2ipmsg-0.9.5.ebuild
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
DESCRIPTION="g2ipmsg"
HOMEPAGE=""
#SRC_URI=""
SRC_URI="http://www.ipmsg.org/archive/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="x86"
IUSE="doc"
DEPEND=""
RDEPEND=""
src_unpack(){
if [ "${A}" != "" ];then
echo "unpack ${A}"
echo ""
unpack ${A} ||die "unpack failed"
fi
cd "${S}"||die "cd ${S} failed"
}
src_compile(){
econf --prefix=/usr --sysconfdir=/etc --enable-systray||die "econf failed"
if [ -f Makefile ]||[ -f GNUmakefile ]||[ -f makefile ];then
emake||die "emake failed"
fi
}
src_install(){
#emake DESTDIR="${D}" install ||die "einstall failed"
einstall ||die "einstall failed"
dodoc README ||die "dodoc failed"
} |
|