Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

Need help on making an ebuild for a python app

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
9 posts • Page 1 of 1
Author
Message
drseergio
Apprentice
Apprentice
Posts: 236
Joined: Wed Sep 28, 2005 12:45 pm

Need help on making an ebuild for a python app

  • Quote

Post by drseergio » Wed Mar 04, 2009 2:30 pm

Hello, I am trying to make an ebuild for calibre book management software. So far, I have this:

Code: Select all

# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-text/calibre/calibre-0.4.77.ebuild,v 1.1 2008/07/17 01:18:59 flameeyes Exp $

NEED_PYTHON=2.5

inherit distutils eutils fdo-mime

MY_P="${P/_p/-p}"
S="${WORKDIR}/${MY_P}"

DESCRIPTION="Ebook management application."
HOMEPAGE="http://calibre.kovidgoyal.net"
SRC_URI="http://calibre.kovidgoyal.net/downloads/${MY_P}.tar.gz"

LICENSE="GPL-2"

KEYWORDS="~amd64 ~x86"

SLOT="0"

IUSE=""

RDEPEND=">=dev-python/imaging-1.1.6
	>=dev-libs/libusb-0.1.12
	>=dev-python/PyQt4-4.4.2
	>=app-text/unrtf-0.20.1
	>=dev-python/mechanize-0.1.11
	>=media-gfx/imagemagick-6.3.5
	>=dev-python/dbus-python-0.82.2
	>=app-text/convertlit-1.8
	>=dev-python/lxml-2.0.5
	=dev-python/cython-0.9.6.10b
	=dev-python/beautifulsoup-3.0.5
	dev-python/ttfquery
	dev-python/genshi"

DEPEND="${RDEPEND}
	dev-python/setuptools
	>=gnome-base/librsvg-2.0.0
	>=x11-misc/xdg-utils-1.0.2-r2
	sys-apps/help2man"

src_compile() {
        python setup.py build || die "pre-build failed"
}

src_install() {
	sudo python setup.py install || die "post-installation failed."
}

pkg_postinst() {
	fdo-mime_desktop_database_update
	fdo-mime_mime_database_update
	distutils_pkg_postinst
}
The problem is that python purges the application each time it does a cleanup effectively removing the application. I suppose I am not doing the installation src_install() right. The source package has this in its setup instructions:

Code: Select all

wget -O- http://calibre.kovidgoyal.net/downloads/calibre-0.4.142.tar.gz | tar xvz 
cd calibre*
python setup.py build && sudo python setup.py install
sudo calibre_postinstall
I've looked through other python-based applications' ebuilds but cannot figure out how should I proceed with this one. Any ideas?
Top
node_one
Apprentice
Apprentice
Posts: 165
Joined: Mon Apr 07, 2008 6:05 pm

  • Quote

Post by node_one » Wed Mar 04, 2009 10:37 pm

What happens when you remove src_compile() and src_install() and use the default ones?
Top
drseergio
Apprentice
Apprentice
Posts: 236
Joined: Wed Sep 28, 2005 12:45 pm

  • Quote

Post by drseergio » Thu Mar 05, 2009 11:19 am

Great, thank you for pointing out :oops: . It almost works now. Actually I have just dropped previously used functions from the ebuild, though only one issue remains:

Code: Select all

ACCESS DENIED  open_wr:   /usr/share/icons/hicolor/.xdg-icon-resource-dummy
touch: cannot touch `/usr/share/icons/hicolor/.xdg-icon-resource-dummy': Permission denied
ACCESS DENIED  open_wr:   /usr/share/icons/hicolor/.xdg-icon-resource-dummy
touch: cannot touch `/usr/share/icons/hicolor/.xdg-icon-resource-dummy': Permission denied
ACCESS DENIED  open_wr:   /usr/share/icons/hicolor/.xdg-icon-resource-dummy
touch: cannot touch `/usr/share/icons/hicolor/.xdg-icon-resource-dummy': Permission denied
ACCESS DENIED  open_wr:   /usr/share/icons/hicolor/.xdg-icon-resource-dummy
touch: cannot touch `/usr/share/icons/hicolor/.xdg-icon-resource-dummy': Permission denied
ACCESS DENIED  open_wr:   /usr/kde/3.5/share/mimelnk/application/x-sony-bbeb.desktop
/usr/bin/xdg-mime: line 977: /usr/kde/3.5/share/mimelnk/application/x-sony-bbeb.desktop: Permission denied
Could not setup desktop integration. Error:
Command 'xdg-mime install calibre-mimetypes' returned non-zero exit status 1
Trying to setup udev rules...
ACCESS DENIED  open_wr:   /etc/udev/rules.d/95-calibre.rules
How can I grant the ebuild privilege rights in accessing files/folders? If I have used sudo it would have worked just fine.
Top
alistair
Retired Dev
Retired Dev
User avatar
Posts: 869
Joined: Fri Jul 15, 2005 12:53 am

  • Quote

Post by alistair » Fri Mar 06, 2009 12:02 am

drseergio wrote:If I have used sudo it would have worked just fine.
Never Ever Ever Ever use sudo in an ebuild. portage drops privileges for a reason. When you do a src_install you don't actually install files directly into / they actually go into ${D}. See ebuild variables. It is then emerges responsibility to install them into /.

In which phase are there errors happening? src_install?
______________
Help the gentoo-java project. Visit Gentoo Java Project

what good are admin powers if you don't abuse them for personal gain - mark_alec
Top
node_one
Apprentice
Apprentice
Posts: 165
Joined: Mon Apr 07, 2008 6:05 pm

  • Quote

Post by node_one » Fri Mar 06, 2009 1:50 am

From what I know, you can override the sandbox, but I would not do that. I am assuming this is happening during src_install. Look in the setup.py file and see where it is trying to use xdg-mime. There may be an option you can pass through distutils_src_install that will skip that part of setup.py. Otherwise, you may have to make a diff or sed patch to remove that part of the setup.py and use doins/newins to install those files.
Top
drseergio
Apprentice
Apprentice
Posts: 236
Joined: Wed Sep 28, 2005 12:45 pm

  • Quote

Post by drseergio » Fri Mar 06, 2009 8:56 pm

Yes, during src_install. What should I do about the above-mentioned errors?
Top
drseergio
Apprentice
Apprentice
Posts: 236
Joined: Wed Sep 28, 2005 12:45 pm

  • Quote

Post by drseergio » Fri Mar 06, 2009 10:26 pm

The problem turned out to be related to old files from the install having root privileges. Now, the problem is a bit different. The setup.py that is supplied with the application makes a call to a /usr/bin/calibre_postinstall but the problem is that at that point portage does not yet copy all the files to their locations so that fails. Is there a good way around that?
Top
node_one
Apprentice
Apprentice
Posts: 165
Joined: Mon Apr 07, 2008 6:05 pm

  • Quote

Post by node_one » Sun Mar 08, 2009 2:10 pm

That depends. If /usr/bin/calibre_postinstall can be called directly and work within the sandbox then maybe do that. Otherwise you may have to patch and/or implement all of the functionality of that script yourself. However, I noticed that [bug=258938]Bug 258938[/bug] is already open on this issue. You can get a lot of help from there.
Top
melbaum
n00b
n00b
Posts: 35
Joined: Thu Jul 01, 2004 9:50 pm

ebuild on portage but it doesn't work

  • Quote

Post by melbaum » Tue Apr 07, 2009 7:49 pm

This may be a return to square 1. There's an ebuild in portage for calibre-0.4.77. It lists KEYWORDS only for ~amd64 though, so I can't try it. The latest source version from kovidgoyal is 0.5.5, but that needs python 2.6, which is still masked for gentoo. Does anyone here know why the strange keywords, or how to skirt the restriction and give it a try?
Top
Post Reply

9 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic