Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Can someone check my first ebuild ?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Myu
Apprentice
Apprentice


Joined: 22 Oct 2014
Posts: 164
Location: Belgium

PostPosted: Wed Oct 22, 2014 7:42 am    Post subject: [Solved] Can someone check my first ebuild ? Reply with quote

Hi all,

I've been happilly running gentoo since more than one year and I've been thinking with the idea of getting more involved so I'm learning about ebuilds, who knows, maybe I can learn enough to help in the future.

The issue that I have with my first ebuild is that I've been forced to modify the source archive "master.zip" but unzipping it, modifying the folder name to bashcheck-9999 and rezip ip to get it installed.

Code:

zip -r master.zip bashcheck-9999/
updating: bashcheck-9999/ (stored 0%)
  adding: bashcheck-9999/bashcheck (deflated 69%)


I'm pretty sure it is not a normal behaviour but can someone pinpoint my error ? If I don't copy the master.zip on /usr/portage/distfiles, the manifest isn't created

Also, license should be CC0 but I dunno how the ebuild handle it...

Code:

# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI="5"

SLOT="0"

DESCRIPTION="Check for shellshock vulnerabilities"
HOMEPAGE="https://github.com/hannob/bashcheck"
SRC_URI="https://github.com/hannob/bashcheck/archive/master.zip"
LICENSE="MIT"
KEYWORDS="~amd64"

src_install() {
dobin bashcheck
}


Any info is welcome, have a nice day ! :mrgreen:

Edit : Typos


Last edited by Myu on Wed Oct 22, 2014 1:23 pm; edited 1 time in total
Back to top
View user's profile Send private message
Freeky
Tux's lil' helper
Tux's lil' helper


Joined: 11 Mar 2011
Posts: 129
Location: Novosibirsk, Russia

PostPosted: Wed Oct 22, 2014 9:03 am    Post subject: Reply with quote

You can use git-r3.eclass instead getting snapshot.
Code:
inherit git-r3
See for more information: http://devmanual.gentoo.org/eclass-reference/git-r3.eclass/index.html

Try it:
Code:
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI="5"

SLOT="0"
inherit git-r3

DESCRIPTION="Check for shellshock vulnerabilities"
HOMEPAGE="https://github.com/hannob/bashcheck"
SRC_URI="https://github.com/hannob/bashcheck.git"
LICENSE="MIT"
KEYWORDS="~x86 ~amd64"

src_install() {
dobin bashcheck
}
Back to top
View user's profile Send private message
nativemad
Developer
Developer


Joined: 30 Aug 2004
Posts: 918
Location: Switzerland

PostPosted: Wed Oct 22, 2014 9:06 am    Post subject: Reply with quote

Hi Myu,

Github also offers these download archives as tar.gz archives.... Using them will have the positive effect that you don't have to depend on the zip package also!

Then it is possible to rename a downloaded file on the fly... no need to copy! ;-)
Code:

        SRC_URI="https://github.com/hannob/bashcheck/archive/master.tar.gz -> ${P}.tar.gz"


HTH
_________________
Power to the people!


Last edited by nativemad on Wed Oct 22, 2014 11:08 am; edited 2 times in total
Back to top
View user's profile Send private message
Myu
Apprentice
Apprentice


Joined: 22 Oct 2014
Posts: 164
Location: Belgium

PostPosted: Wed Oct 22, 2014 9:46 am    Post subject: Reply with quote

Hi Freeky, nativemad,

Thanks for your replies, it's appreciated !

So, with the git method, it works well with a slight modification (needed to set the EGIT_REPO_URI apparently)

bashcheck-9999.ebuild

Code:

# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI="5"

SLOT="0"
inherit git-r3

DESCRIPTION="Check for shellshock vulnerabilities"
HOMEPAGE="https://github.com/hannob/bashcheck"
EGIT_REPO_URI="https://github.com/hannob/bashcheck.git"
LICENSE="MIT"
KEYWORDS="~x86 ~amd64"

src_install() {
dobin bashcheck
}


Apparently I can get rid of the SRC_URI if I use EGIT_REPO_URI but I dunno if it's a "best practice" or not.

I've tried with the .tar.gz method but I've been blocked because there's a master.tar.gz on the Gentoo repos and so it doesn't fetch the one I've specified on SRC_URI, perhaps can I bypass it?

I'll continue practicing with more complex ones.

Oh and while I have a Gentoo Dev on the thread, can you tell me if the project needs ebuilds maintainers ? Perhaps simple ones for now but still ... I'm willing to learn.

Cheers
Back to top
View user's profile Send private message
nativemad
Developer
Developer


Joined: 30 Aug 2004
Posts: 918
Location: Switzerland

PostPosted: Wed Oct 22, 2014 11:07 am    Post subject: Reply with quote

Myu wrote:

Apparently I can get rid of the SRC_URI if I use EGIT_REPO_URI but I dunno if it's a "best practice" or not.

You should not use git to fetch normal sources in numbered ebuilds... And mostly the 9999 version is just a copy of the latest version with a bit of code like the one here.
TL/DR: it's ok to leave SRC_URI away in 9999 ebuilds, but do not use a cvs/svn/git repo if possible otherwise.
Myu wrote:

I've tried with the .tar.gz method but I've been blocked because there's a master.tar.gz on the Gentoo repos and so it doesn't fetch the one I've specified on SRC_URI, perhaps can I bypass it?

what?? Probably there is such a file in your local distfiles?? - I had a little typo that i corrected now in my first code snippet in the post above, but...
Code:
# ebuild /usr/portage/app-misc/bashcheck/bashcheck-1.0.ebuild digest
>>> Downloading 'http://distfiles.gentoo.org/distfiles/bashcheck-1.0.tar.gz'
--2014-10-22 15:21:20--  http://distfiles.gentoo.org/distfiles/bashcheck-1.0.tar.gz
Resolving distfiles.gentoo.org... 64.50.236.52, 216.165.129.135, 156.56.247.195, ...
Connecting to distfiles.gentoo.org|64.50.236.52|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2014-10-22 15:21:21 ERROR 404: Not Found.

>>> Downloading 'https://github.com/hannob/bashcheck/archive/master.tar.gz'
--2014-10-22 15:21:21--  https://github.com/hannob/bashcheck/archive/master.tar.gz
Resolving github.com... 192.30.252.130
Connecting to github.com|192.30.252.130|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/hannob/bashcheck/tar.gz/master [following]
--2014-10-22 15:21:21--  https://codeload.github.com/hannob/bashcheck/tar.gz/master
Resolving codeload.github.com... 192.30.252.146
Connecting to codeload.github.com|192.30.252.146|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4808 (4.7K) [application/x-gzip]
Saving to: '/usr/portage/distfiles/bashcheck-1.0.tar.gz'

100%[=============================================================================================================================================================>] 4,808       --.-K/s   in 0.001s 

2014-10-22 15:21:22 (3.08 MB/s) - '/usr/portage/distfiles/bashcheck-1.0.tar.gz' saved [4808/4808]

>>> Creating Manifest for /usr/portage/app-misc/bashcheck

Myu wrote:

Oh and while I have a Gentoo Dev on the thread, can you tell me if the project needs ebuilds maintainers ? Perhaps simple ones for now but still ... I'm willing to learn.


Yes of course, Gentoo in general can always use more devs!! :P
There are different ways to get there......

Cheers
_________________
Power to the people!
Back to top
View user's profile Send private message
Myu
Apprentice
Apprentice


Joined: 22 Oct 2014
Posts: 164
Location: Belgium

PostPosted: Wed Oct 22, 2014 11:50 am    Post subject: Reply with quote

Quote:
You should not use git to fetch normal sources in numbered ebuilds... And mostly the 9999 version is just a copy of the latest version with a bit of code like the one here.
TL/DR: it's ok to leave SRC_URI away in 9999 ebuilds, but do not use a cvs/svn/git repo if possible otherwise.


That's good to know, makes perfect sense of course.
How would you number a small ebuild like this one though since the coder didn't put a version number ?

Quote:
what?? Probably there is such a file in your local distfiles?? - I had a little typo that i corrected now in my first code snippet in the post above, but...


Yes it was an issue on my end indeed .. oops :D

I've been able to make and install an ebuild with the .tar.gz retrieved from github although I've been force to hardcode S="${WORKDIR}/bashcheck-master" since, I can indeed rename the archive name on the fly but the folder name inside the archive aren't changed.
Pretty sure there should be a way around it but I guess i didn't read it yet.

Code:
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI="5"

SLOT="0"

DESCRIPTION="Check for shellshock vulnerabilities"
HOMEPAGE="https://github.com/hannob/bashcheck"
SRC_URI="https://github.com/hannob/bashcheck/archive/master.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/bashcheck-master"
LICENSE="MIT"
KEYWORDS="~x86 ~amd64"

src_install() {
dobin bashcheck
}



Thanks for the info for the dev application (and for the whole assistance), I'll go back to my readings and tests for now but if I feel confident enough I might just as well try =)

Cheers
Back to top
View user's profile Send private message
nativemad
Developer
Developer


Joined: 30 Aug 2004
Posts: 918
Location: Switzerland

PostPosted: Wed Oct 22, 2014 1:18 pm    Post subject: Reply with quote

Myu wrote:

How would you number a small ebuild like this one though since the coder didn't put a version number ?

If you always fetch the current upstream head like you do it here, then it is 9999 - as it also can break at any time...
Another way would be to fetch a specific state/commit... Then you name it with a date - see the various selinux ebuilds for example.
Myu wrote:

I've been able to make and install an ebuild with the .tar.gz retrieved from github although I've been force to hardcode S="${WORKDIR}/bashcheck-master" since, I can indeed rename the archive name on the fly but the folder name inside the archive aren't changed.
Pretty sure there should be a way around it but I guess i didn't read it yet.

Nono, adjusting ${S} is the way to go here! :P
This happens quite a lot... Upstream tarballs have a version number in the name but in the archive it doesn't or it has a different name or sub-subfolders in it....
Myu wrote:

Thanks for the info for the dev application (and for the whole assistance), I'll go back to my readings and tests for now but if I feel confident enough I might just as well try =)

Cool, glad i could help.
Good luck and always remember to have fun! :-)
_________________
Power to the people!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum