View previous topic :: View next topic |
Author |
Message |
fangorn Veteran
Joined: 31 Jul 2004 Posts: 1886
|
Posted: Thu Apr 18, 2013 2:54 am Post subject: [Solved] live ebuild without SVN or EGIT eclass |
|
|
Hi,
I have a set of perl scripts that I want to install with a live-ebuild each. It is just "download the most recent version and copy".
But I am struggling with the source file Manifest that checks (at least) file size and hash.
I know it is just a case of ebuild <package> digest, but I want to spare my users that hassle.
What trick are the EGIT and ESVN? eclasses using that they just download the source, configure and compile?
This is what I have until now:
Code: | EAPI=4
DESCRIPTION="Script to repackage media sources into multiple container formats"
HOMEPAGE="http://fangornsrealm.eu/"
SRC_URI="http://progs.fangornsrealm.eu/${PN}/${PN}"
LICENSE="GPL-2 or newer"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="aac flac matroska mp4 ogm ts subtitles dvd"
RDEPEND="
>=dev-lang/perl-5.10
dev-perl/XML-Simple
dev-perl/File-HomeDir
media-video/mplayer[encode,x264]
media-video/ffmpeg[x264,encode,mp3]
>=media-libs/toolbox_fangorn-1.0.0
aac? ( media-sound/neroaac )
flac? ( media-libs/flac )
matroska? ( media-video/mkvtoolnix )
mp4? ( >=media-video/gpac-0.4.5[a52,aac,ffmpeg,jpeg,png,truetype] )
ogm? ( media-sound/ogmtools
media-sound/vorbis-tools[kate,nls] )
ts? ( media-video/tsmuxer )
dvd? ( media-video/dvdauthor
media-video/mjpegtools[png]
media-gfx/imagemagick[png,truetype]
media-libs/avi2mkv_dvd_modules )
subtitles? ( media-video/bdsup2sub
media-video/subp2pgm[png]
app-text/tesseract[png] )
"
DEPEND=""
src_unpack () {
:
mkdir -p ${S}
cp ${PORTAGE_TMPDIR}/portage/${CATEGORY}/${PF}/distdir/${PN} ${S}
}
src_prepare() {
:
}
src_configure () {
:
}
src_compile () {
:
}
src_test () {
:
}
src_install() {
mkdir -p ${D}/usr/bin
cp ${S}/${PN} ${D}/usr/bin
chmod a+x ${D}/usr/bin/${PN}
} |
Thanks for your hints.
fangorn _________________ Video Encoding scripts collection | Project page
Last edited by fangorn on Sat Apr 20, 2013 8:00 am; edited 1 time in total |
|
Back to top |
|
|
Dominique_71 Veteran
Joined: 17 Aug 2005 Posts: 1877 Location: Switzerland (Romandie)
|
Posted: Thu Apr 18, 2013 11:40 am Post subject: |
|
|
If your source is a tarball, you wont need the subversion or git.2 eclass. The tarball location must be in SRC_URI, which is not the case now. The ebuild will not be a live ebuild and you have to keyword it.
If your source is some svn repository, you need "inherit subversion" and to use ESVN_REPO_URI instead of SRC_URI. The same apply to git with the git-2 eclass. In both cases, the ebuild will use KEYWORD="".
Also, if you don't need some sections (like src_prepare in your example), you can just remove them from the ebuild. This is for that we have EAPI, to simplify the ebuilds. _________________ "Confirm You are a robot." - the singularity |
|
Back to top |
|
|
Dominique_71 Veteran
Joined: 17 Aug 2005 Posts: 1877 Location: Switzerland (Romandie)
|
Posted: Thu Apr 18, 2013 11:51 am Post subject: |
|
|
And you don't have to create ${S} or to unpack ${SRC_URI}, portage will do this for you, but it must be able to find it. So, you have to put it in SRC_URI. And yes, if your ebuild is not part of an overlay, the user will have to digest it in any case. _________________ "Confirm You are a robot." - the singularity |
|
Back to top |
|
|
Dominique_71 Veteran
Joined: 17 Aug 2005 Posts: 1877 Location: Switzerland (Romandie)
|
|
Back to top |
|
|
fangorn Veteran
Joined: 31 Jul 2004 Posts: 1886
|
Posted: Thu Apr 18, 2013 3:48 pm Post subject: |
|
|
Thanks for the reply.
The program is a simple perl script that is hosted uncompressed. The ebuild is just to easily install the dependencies.
As I am actively developing these scripts I don't find the time to update all ebuilds to new versions every few days.
So I want to have ebuilds that do not require to know the script for installation.
That is about it. _________________ Video Encoding scripts collection | Project page |
|
Back to top |
|
|
Dominique_71 Veteran
Joined: 17 Aug 2005 Posts: 1877 Location: Switzerland (Romandie)
|
Posted: Fri Apr 19, 2013 10:18 am Post subject: |
|
|
If you don't want to re-digest the ebuild every time you made a change to some script, the only solution is to use a repository like svn or git. _________________ "Confirm You are a robot." - the singularity |
|
Back to top |
|
|
steveL Watchman
Joined: 13 Sep 2006 Posts: 5153 Location: The Peanut Gallery
|
Posted: Fri Apr 19, 2013 2:13 pm Post subject: |
|
|
For the specific situation you outline, I'd do an ebuild that (in src_unpack so you don't get the default) simply uses curl or wget to download the file to "$S", and not have anything in SRC_URI at all.
That way, whenever you emerge it, it simply copies the latest version, and portage makes sure the dependencies are in place. So you only have to digest the ebuild once, when you first put it in the local overlay.
And on subsequent modifications to the ebuild, of course, but not to the underlying script.
It's already keyworded, so user has to unmask it. You don't even need to stick with a 9999 vcs ebuild id: a later version of the ebuild might have updated dependencies, for example (and you might download a matching script version using PV.)
Bear in mind this is not acceptable for general ebuilds: just for your situation, on a private network. (And Gentoo is perfect for that sort of thing.) |
|
Back to top |
|
|
fangorn Veteran
Joined: 31 Jul 2004 Posts: 1886
|
Posted: Fri Apr 19, 2013 2:31 pm Post subject: |
|
|
Thanks, that is the solution I was looking for.
I know my ebuilds will never make it into official portage like that, but that is not the intention anyway.
For other OSes I use a different approach. Just the fact that I develop on Gentoo makes me want to
give back to the Community. And it just does not get more easy than
emerge xyz _________________ Video Encoding scripts collection | Project page |
|
Back to top |
|
|
steveL Watchman
Joined: 13 Sep 2006 Posts: 5153 Location: The Peanut Gallery
|
Posted: Fri Apr 19, 2013 4:01 pm Post subject: |
|
|
fangorn wrote: | Thanks, that is the solution I was looking for. |
You're welcome :) If it works, mark the post 'solved' (edit the subject of original post) so others know you don't need help on it.
Quote: | I know my ebuilds will never make it into official portage like that, but that is not the intention anyway.
For other OSes I use a different approach. Just the fact that I develop on Gentoo makes me want to
give back to the Community. And it just does not get more easy than
emerge xyz |
Heh indeed. And there's nothing to stop you releasing the script as an ebuild later, when you have a version you're happy for others to test, with a SRC_URI in it.
You're right Gentoo is lovely for development; as well as being such a stable base, you always have source code for everything, and the entire *nix landscape is transparent to you. Plus if you make it past ebuild QA, your work is much more likely to be suitable for other distributions and systems (especially so for compiled software, which is the hardest to do right if you're a beginner to packaging.) _________________
creaker wrote: | systemd. It is a really ass pain |
update - "a most excellent portage wrapper"
#friendly-coders -- We're still here for you™ ;) |
|
Back to top |
|
|
Dominique_71 Veteran
Joined: 17 Aug 2005 Posts: 1877 Location: Switzerland (Romandie)
|
Posted: Fri Apr 19, 2013 4:12 pm Post subject: |
|
|
Nice to see it is another solution
fangorn wrote: | And it just does not get more easy than
emerge xyz |
It is also why I like gentoo. Fvwm is much like this. You can update your configuration and when done, a simple command will restart fvwm with your updated configuration. You can even bind this command to a menu or a key combination. This work even in the case of a monster configuration like fvwm-crystal. I am preparing a new release for it, and in order to test the modifications in a real life situation, all I have to do is
move the updated config files to my local repository
update the ChangeLog
svn ci
emerge fvwm-crystal
Main menu -> restart fvwm-crystal
And it work. Even the sound from the music I am listening will not be influenced. _________________ "Confirm You are a robot." - the singularity |
|
Back to top |
|
|
fangorn Veteran
Joined: 31 Jul 2004 Posts: 1886
|
Posted: Sat Apr 20, 2013 8:01 am Post subject: |
|
|
Works like a charm. Thanks Again.
All people interested can find the now working ebuilds on my project page. (See my Signature) _________________ Video Encoding scripts collection | Project page |
|
Back to top |
|
|
|