LinuxSir.cn,穿越时空的Linuxsir!

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

[共享]qsopcast 的 ebuild(ebuild 制作学习)

[复制链接]
发表于 2008-4-26 15:49:04 | 显示全部楼层 |阅读模式
没事干制作了一个 ebuild。有什么问题,欢迎大家指教:
  1. # Copyright 2008 SecludedSage
  2. # Distributed under the terms of the GNU General Public License v2
  3. # $Header: $
  4. inherit eutils
  5. DESCRIPTION="A QT GUI FrontEnd of SopCast"
  6. SRC_URI="http://qsopcast.googlecode.com/files/qsopcast-0.3.5.tar.bz2"
  7. HOMEPAGE="http://code.google.com/p/qsopcast/"
  8. KEYWORDS="~x86"
  9. IUSE="doc"
  10. LICENSE="GPL-2"
  11. SLOT="0"
  12. RESTRICT="mirror"
  13. DEPEND="=x11-libs/qt-3*
  14.         media-libs/alsa-lib"
  15. src_compile() {
  16.         if has unmerge-orphans ${FEATURES}; then
  17.                 die "Please FEATURES="-unmerge-orphans" emerge qsopcast"
  18.         fi
  19.         cd ./src
  20.         qmake || die "qmake failed"
  21.         emake || die "emake failed"
  22. }
  23. src_install() {
  24.         cd ./src
  25.         einstall || die "einstall failed"
  26.         if use doc; then
  27.                 dodoc ../README ../COPYING ../AUTHORS || die "installing docs failed"
  28.         fi
  29. }
复制代码
发表于 2008-4-26 16:15:39 | 显示全部楼层
要是能加到gentoo-china里就好了
回复 支持 反对

使用道具 举报

发表于 2008-4-26 21:08:53 | 显示全部楼层
qsopcast在gentoo bugzilla有ebuild,我在老帖子中提过:
http://bugs.gentoo.org/show_bug.cgi?id=181134
  1. # Copyright 1999-2007 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. # $Header: $
  4. inherit eutils kde-functions
  5. DESCRIPTION="A QT front-end for SopCast P2P Internet TV"
  6. HOMEPAGE="http://qsopcast.googlecode.com/"
  7. SRC_URI="http://qsopcast.googlecode.com/files/${P}.tar.bz2"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="~amd64 ~x86"
  11. IUSE=""
  12. DEPEND=">=media-tv/sopcast-1.0.2
  13.         media-libs/alsa-lib
  14.         net-misc/curl"
  15. RDEPEND="${DEPEND}"
  16. # append suitable QT libs to dependencies via automagic kde-functions
  17. need-qt 3
  18. S=${WORKDIR}/${P}/src/
  19. MY_ICON=sopcast-logo.gif
  20. MY_TEMP_ICON=${S}/../${MY_ICON}
  21. MY_ICON_TARGET=/usr/share/pixmaps
  22. src_unpack() {
  23.         unpack ${A} || die "Failed to unpack ${A}"
  24.         # patch some QT and other file locations to more Gentooish ones
  25.         sed -e s+/usr/local+/usr+ -i ${S}/${PN}.pro
  26.         # get the icon file (TODO: maybe the icon could be distributed in files/ or maybe wget could be used?)
  27.         einfo "Downloading the icon ..."
  28.         curl http://www.sopcast.org/images/sopcast-log.gif > ${MY_TEMP_ICON}
  29. }
  30. src_compile() {
  31.         eqmake3 || die "qmake failed"
  32.         emake || die "emake failed"
  33. }
  34. src_install() {
  35.         INSTALL_ROOT=${D} emake install || die "emake install failed"
  36.         # the manual labour part: the SopCast icon which isn't packaged with qsopcast
  37.         insinto ${MY_ICON_TARGET}
  38.         doins ${MY_TEMP_ICON}
  39.         make_desktop_entry qsopcast "QSopCast - P2P Internet TV Viewer" ${MY_ICON_TARGET}/${MY_ICON}
  40. }
复制代码

对比一下

建议:写ebuild之前先去bugzilla找一找,如果确实没有(有些ebuild藏得较深,不容易搜出来)可以直接在那里提交。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-4-26 21:16:49 | 显示全部楼层
谢谢楼上提示。
回复 支持 反对

使用道具 举报

发表于 2008-4-26 21:46:07 | 显示全部楼层
呵呵,最近ebuild很火阿
大家加油阿
回复 支持 反对

使用道具 举报

发表于 2008-4-27 10:58:44 | 显示全部楼层
Post by zhou3345;1842899
qsopcast在gentoo bugzilla有ebuild,我在老帖子中提过:
http://bugs.gentoo.org/show_bug.cgi?id=181134


  1. # Copyright 1999-2007 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. # $Header: $

  4. inherit eutils kde-functions

  5. DESCRIPTION="A QT front-end for SopCast P2P Internet TV"
  6. HOMEPAGE="http://qsopcast.googlecode.com/"
  7. SRC_URI="http://qsopcast.googlecode.com/files/${P}.tar.bz2"

  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="~amd64 ~x86"
  11. IUSE=""

  12. DEPEND=">=media-tv/sopcast-1.0.2
  13.         media-libs/alsa-lib
  14.         net-misc/curl"

  15. RDEPEND="${DEPEND}"

  16. # append suitable QT libs to dependencies via automagic kde-functions
  17. need-qt 3

  18. S=${WORKDIR}/${P}/src/
  19. MY_ICON=sopcast-logo.gif
  20. MY_TEMP_ICON=${S}/../${MY_ICON}
  21. MY_ICON_TARGET=/usr/share/pixmaps


  22. src_unpack() {
  23.         unpack ${A} || die "Failed to unpack ${A}"
  24.         # patch some QT and other file locations to more Gentooish ones
  25.         sed -e s+/usr/local+/usr+ -i ${S}/${PN}.pro

  26.         # get the icon file (TODO: maybe the icon could be distributed in files/ or maybe wget could be used?)
  27.         einfo "Downloading the icon ..."
  28.         curl http://www.sopcast.org/images/sopcast-log.gif > ${MY_TEMP_ICON}
  29. }

  30. src_compile() {
  31.         eqmake3 || die "qmake failed"
  32.         emake || die "emake failed"
  33. }

  34. src_install() {
  35.         INSTALL_ROOT=${D} emake install || die "emake install failed"
  36.         # the manual labour part: the SopCast icon which isn't packaged with qsopcast
  37.         insinto ${MY_ICON_TARGET}
  38.         doins ${MY_TEMP_ICON}
  39.         make_desktop_entry qsopcast "QSopCast - P2P Internet TV Viewer" ${MY_ICON_TARGET}/${MY_ICON}
  40. }

复制代码


对比一下

建议:写ebuild之前先去bugzilla找一找,如果确实没有(有些ebuild藏得较深,不容易搜出来)可以直接在那里提交。


个人觉得,将

  1. MY_ICON=sopcast-logo.gif
  2. MY_TEMP_ICON=${S}/../${MY_ICON}
  3. MY_ICON_TARGET=/usr/share/pixmaps
复制代码

放到preinst里是不是能更清晰一些呢?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-4-27 11:51:48 | 显示全部楼层
KenShinXF: 大家写 ebuild 可以补充 Portage 的不足。不过最近 gentoo-china 动静不大。
sephinroth: 我不觉得,Portage 中的 ebuild 几乎是所有的变量预定义放在最前面。在过程中很少有变量的定义。
回复 支持 反对

使用道具 举报

发表于 2008-7-18 10:28:15 | 显示全部楼层
现在还有bug吗?能使用了吗?
回复 支持 反对

使用道具 举报

发表于 2008-7-18 10:50:57 | 显示全部楼层
我用gmlive 。。

nslive找不到下载。。郁闷

gentoo-source-2.6.26 and firefox3.0.1出来喽..U
回复 支持 反对

使用道具 举报

发表于 2008-7-18 11:54:18 | 显示全部楼层
nslive网站挂了,这里有人上传了。
http://www.linuxsir.cn/bbs/thread272832.html
回复 支持 反对

使用道具 举报

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

本版积分规则

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