LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1577|回复: 15

(已解决了)初次写ebuild,遇到问题,安装时不成功

[复制链接]
发表于 2008-5-12 20:53:02 | 显示全部楼层 |阅读模式
我照着HOWTO_Write_Ebuilds,自己试着写了一个ebuild,安装是出错了,安装不成功,找不到安装后的文件
http://zh.gentoo-wiki.com/index. ... A.E6.B8.85.E5.8D.95

这里是目录:
localhost dmlist # pwd
/usr/portage/local/myebuilds/app-portage/dmlist

这里是目录结构
localhost dmlist # ls -R
.:
dmlist-0.1.ebuild  files  Manifest

./files:
dmlist.gz  readme.gz

这是ebuild文件

localhost dmlist # cat dmlist-0.1.ebuild
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

DESCRIPTION="get the rstp of movies on school library"
HOMEPAGE=""
SRC_URI=""

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="x86"
IUSE="doc"

DEPEND=""
RDEPEND=""

#FILESDIR=/usr/portage/local/myebuilds/app-portage/dmlist/files
src_unpack()
{
        cp ${FILESDIR}/dmlist.gz ${S}
        gzip -d ${S}/dmlist.gz
       
}
src_install()
{
dosbin dmlist
if use doc;then
dodoc ${FILESDIR}/readme.gz
fi
}
生成清单:
ebuild dmlist-0.1.ebuild digest

然后emerge dmlist

localhost dmlist # emerge dmlist
Calculating dependencies... done!
>>> Verifying ebuild Manifests...

>>> Emerging (1 of 1) app-portage/dmlist-0.1 to /
* checking ebuild checksums ;-) ...                                                          [ ok ]
* checking auxfile checksums ;-) ...                                                         [ ok ]
* checking miscfile checksums ;-) ...                                                        [ ok ]
>>> Unpacking source...
gzip: /var/tmp/portage/app-portage/dmlist-0.1/work/dmlist-0.1/dmlist.gz: Not a directory
>>> Source unpacked.
>>> Compiling source in /var/tmp/portage/app-portage/dmlist-0.1/work ...
>>> Source compiled.
>>> Test phase [not enabled]: app-portage/dmlist-0.1

>>> Install dmlist-0.1 into /var/tmp/portage/app-portage/dmlist-0.1/image/ category app-portage
!!! dosbin: dmlist does not exist
>>> Completed installing dmlist-0.1 into /var/tmp/portage/app-portage/dmlist-0.1/image/

* checking 0 files for package collisions
>>> Merging app-portage/dmlist-0.1 to /
--- /usr/
--- /usr/sbin/
>>> Safely unmerging already-installed instance...
No package files given... Grabbing a set.
--- replaced dir /usr/sbin
--- replaced dir /usr
>>> Original instance of package unmerged safely.
>>> app-portage/dmlist-0.1 merged.

>>> No packages selected for removal by clean
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.
* GNU info directory index is up-to-date.

其中两句提示出错:
gzip: /var/tmp/portage/app-portage/dmlist-0.1/work/dmlist-0.1/dmlist.gz: Not a directory

!!! dosbin: dmlist does not exist

///dmlist找不到,这是为什么呢?


还有其中的FILESDIR要不要自己指定目录呢?
(我指定和不指定目录都试了一下,都是一样的错误)
照它的说明dosbin命令会将dmlist安装到/usr/sbin/中,但看了一下没有这个文件。
帮忙看一下谢谢。
 楼主| 发表于 2008-5-12 21:14:48 | 显示全部楼层
找到了FILESDIR的含义

http://devmanual.gentoo.org/ebuild-writing/variables/index.html

Predefined Read-Only Variables

The following variables are defined for you. You must not attempt to set them.
Variable         Purpose
P         Package name and version (excluding revision, if any), for example vim-6.3.
PN         Package name, for example vim.
PV         Package version (excluding revision, if any), for example 6.3.
PR         Package revision, or r0 if no revision exists.
PVR         Package version and revision, for example 6.3-r0, 6.3-r1.
PF         Package name, version and revision, for example vim-6.3-r1.
A         All the source files for the package (excluding those which are not available because of USE flags).
CATEGORY         Package's category, for example app-editors.
FILESDIR         Path to the ebuild's files/ directory, commonly used for small patches and files. Value: "${PORTDIR}/${CATEGORY}/${PN}/files".
WORKDIR         Path to the ebuild's root build directory. Value: "${PORTAGE_TMPDIR}/portage/${PF}/work".
T         Path to a temporary directory which may be used by the ebuild. Value: "${PORTAGE_TMPDIR}/portage/${PF}/temp".
D         Path to the temporary install directory. Value: "${PORTAGE_TMPDIR}/portage/${PF}/image".
ROOT         Path to the root directory. When not using ${D}, always prepend ${ROOT} to the path.
DISTDIR         Contains the path to the directory where all the files fetched for the package are stored.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-5-12 21:19:44 | 显示全部楼层
将ebuild添加了die "message"

localhost dmlist # cat dmlist-0.1.ebuild
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

DESCRIPTION="get the rstp of movies on school library"
HOMEPAGE=""
SRC_URI=""

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="x86"
IUSE="doc"

DEPEND=""
RDEPEND=""

#FILESDIR=/usr/portage/local/myebuilds/app-portage/dmlist/files
src_unpack()
{
        cp ${FILESDIR}/dmlist.gz ${S}
        gzip -d ${S}/dmlist.gz||die "unzip failed"
       
}
src_install()
{
dosbin dmlist||die "install failed"
if use doc;then
        dodoc ${FILESDIR}/readme.gz|| die "install doc failed"
fi
}


然后再emerge dmlist

出错:
localhost dmlist # emerge dmlist
Calculating dependencies... done!
>>> Verifying ebuild Manifests...

>>> Emerging (1 of 1) app-portage/dmlist-0.1 to /
* checking ebuild checksums ;-) ...                                                          [ ok ]
* checking auxfile checksums ;-) ...                                                         [ ok ]
* checking miscfile checksums ;-) ...                                                        [ ok ]
>>> Unpacking source...
gzip: /var/tmp/portage/app-portage/dmlist-0.1/work/dmlist-0.1/dmlist.gz: Not a directory
*
* ERROR: app-portage/dmlist-0.1 failed.
* Call stack:
*               ebuild.sh, line   49:  Called src_unpack
*             environment, line  143:  Called die
* The specific snippet of code:
*       gzip -d ${S}/dmlist.gz || die "unzip failed"
*  The die message:
*   unzip failed
*
* If you need support, post the topmost build error, and the call stack if relevant.
* A complete build log is located at '/var/tmp/portage/app-portage/dmlist-0.1/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/app-portage/dmlist-0.1/temp/environment'.
*

* Messages for package app-portage/dmlist-0.1:

*
* ERROR: app-portage/dmlist-0.1 failed.
* Call stack:
*               ebuild.sh, line   49:  Called src_unpack
*             environment, line  143:  Called die
* The specific snippet of code:
*       gzip -d ${S}/dmlist.gz || die "unzip failed"
*  The die message:
*   unzip failed
*
* If you need support, post the topmost build error, and the call stack if relevant.
* A complete build log is located at '/var/tmp/portage/app-portage/dmlist-0.1/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/app-portage/dmlist-0.1/temp/environment'.
*
这个出错提示看起来好熟悉!~
回复 支持 反对

使用道具 举报

发表于 2008-5-12 21:49:07 | 显示全部楼层
具体不懂。
但是我遇到改过别人的ebuild后要保证手动解压.tar.gz的路径与ebuild文件中的有关路径一致,不妨手动解压下你的源码压缩包,看下绝对目录。
回复 支持 反对

使用道具 举报

发表于 2008-5-13 00:27:00 | 显示全部楼层
gz不行,要是tar.gz
总之,一个原則,解压缩出来的一定要是一个目录
回复 支持 反对

使用道具 举报

发表于 2008-5-13 00:42:37 | 显示全部楼层
不得不说,那篇文章存在一定的问题
1. 源代码不应该放在filesdir里
2. 如果1成立,src_unpack函数完全可以不写,portage提供了默认实现

至少这不是典型的ebuild写法
我已经修改了那篇howto
http://zh.gentoo-wiki.com/index. ... 942&oldid=10941
http://zh.gentoo-wiki.com/index. ... 943&oldid=10942
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-5-13 11:11:10 | 显示全部楼层
照着你的修改改了下,还是有问题
已经将dmlist-0.1.tar.bz2 复制到/usr/portage/distfiles下

ebuild文件
localhost dmlist # cat dmlist-0.1.ebuild
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

DESCRIPTION="get the rstp of movies on school library"
HOMEPAGE=""
SRC_URI=""

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="x86"
IUSE="doc"

DEPEND=""
RDEPEND=""

#FILESDIR=/usr/portage/local/myebuilds/app-portage/dmlist/files
#src_unpack()
#{
        #cp ${FILESDIR}/dmlist.gz ${S}
        #gzip -d  ${S}/dmlist.gz||die "unzip failed"
       
#}
src_install()
{
dosbin dmlist||die "install failed"
if use doc;then
        dodoc readme|| die "install doc failed"
fi
}

安装时出错,提示如下

localhost dmlist # emerge  dmlist
Calculating dependencies... done!
>>> Verifying ebuild Manifests...

>>> Emerging (1 of 1) app-portage/dmlist-0.1 to /
* checking ebuild checksums ;-) ...                                      [ ok ]
* checking auxfile checksums ;-) ...                                     [ ok ]
* checking miscfile checksums ;-) ...                                    [ ok ]
>>> Unpacking source...
>>> Source unpacked.
>>> Compiling source in /var/tmp/portage/app-portage/dmlist-0.1/work ...
>>> Source compiled.
>>> Test phase [not enabled]: app-portage/dmlist-0.1

>>> Install dmlist-0.1 into /var/tmp/portage/app-portage/dmlist-0.1/image/ category app-portage
!!! dosbin: dmlist does not exist
*
* ERROR: app-portage/dmlist-0.1 failed.
* Call stack:
*               ebuild.sh, line   49:  Called src_install
*             environment, line  115:  Called die
* The specific snippet of code:
*       dosbin dmlist || die "install failed";
*  The die message:
*   install failed
*
* If you need support, post the topmost build error, and the call stack if relevant.
* A complete build log is located at '/var/tmp/portage/app-portage/dmlist-0.1/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/app-portage/dmlist-0.1/temp/environment'.
*

* Messages for package app-portage/dmlist-0.1:

*
* ERROR: app-portage/dmlist-0.1 failed.
* Call stack:
*               ebuild.sh, line   49:  Called src_install
*             environment, line  115:  Called die
* The specific snippet of code:
*       dosbin dmlist || die "install failed";
*  The die message:
*   install failed
*
* If you need support, post the topmost build error, and the call stack if relevant.
* A complete build log is located at '/var/tmp/portage/app-portage/dmlist-0.1/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/app-portage/dmlist-0.1/temp/environment'.
*
回复 支持 反对

使用道具 举报

发表于 2008-5-13 12:31:37 | 显示全部楼层
/var/tmp/portage/app-portage/dmlist-0.1/work
看看这里面到底有什么文件
tar tvf dmlist-0.1.tar.bz2
看看结果是什么
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-5-13 14:12:07 | 显示全部楼层
Post by zhllg;1849000
/var/tmp/portage/app-portage/dmlist-0.1/work
看看这里面到底有什么文件
tar tvf dmlist-0.1.tar.bz2
看看结果是什么


localhost files # tar tvf dmlist-0.1.tar.bz2
drwxr-xr-x root/root         0 2008-05-13 10:39 dmlist-0.1/
-rw-r--r-- root/root        12 2008-05-12 20:11 dmlist-0.1/readme
-rwxr-xr-x root/root       820 2008-05-12 20:05 dmlist-0.1/dmlist

ls /var/tmp/portage/app-portage/dmlist-0.1/work/     //为空
回复 支持 反对

使用道具 举报

发表于 2008-5-13 14:41:35 | 显示全部楼层
恐怕你还是需要在ebuild里写上SRC_URI
SRC_URI="http://abc.org/${P}.tar.bz2"
用这个试试
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表