Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 480348 - net-libs/libsodium-0.4.2 - P(ortable|ackageable) NaCl-based crypto library
Summary: net-libs/libsodium-0.4.2 - P(ortable|ackageable) NaCl-based crypto library
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Default Assignee for New Packages
URL: https://github.com/jedisct1/libsodium/
Whiteboard:
Keywords: EBUILD
Depends on:
Blocks:
 
Reported: 2013-08-09 11:50 UTC by lalebarde
Modified: 2014-08-24 10:48 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
libsodium-0.4.2.ebuild (libsodium-0.4.2.ebuild,876 bytes, text/plain)
2013-08-09 11:50 UTC, lalebarde
Details
ChangeLog (ChangeLog,627 bytes, text/plain)
2013-08-09 11:52 UTC, lalebarde
Details
libsodium-0.4.2.ebuild with test useflag (libsodium-0.4.2.ebuild,1.57 KB, text/plain)
2013-08-09 12:13 UTC, lalebarde
Details
libsodium-0.4.2.ebuild (libsodium-0.4.2.ebuild,620 bytes, text/plain)
2013-08-09 14:04 UTC, lalebarde
Details
net-libs/libsodium-9999.ebuild Live ebuild (libsodium-9999.ebuild,830 bytes, text/plain)
2013-08-10 13:46 UTC, lalebarde
Details

Note You need to log in before you can comment on or make changes to this bug.
Description lalebarde 2013-08-09 11:50:53 UTC
Created attachment 355474 [details]
libsodium-0.4.2.ebuild

dev-libs/libsodium-0.4.2 ebuild submission in replacement of net-libs/nacl-0_p20110221 which is from the obsolete upstream site http://nacl.cr.yp.to/ (last version dated 2011-02-21)

New site is https://github.com/jedisct1/libsodium/ and is active (last release dated 2013-07-08)

I changed net-libs to dev-libs since it is more than a library for network communications : encryption, decryption, signatures, etc.

From upstream :
"Comparison with vanilla NaCl

Sodium does not ship C++ bindings. These might be part of a distinct package.

The default public-key signature system in NaCl was a prototype that shouldn't be used any more.

Sodium ships with the SUPERCOP reference implementation of Ed25519, and uses this system by default for crypto_sign* operations.

For backward compatibility, the previous system is still compiled in, as crypto_sign_edwards25519sha512batch*."
Comment 1 lalebarde 2013-08-09 11:52:10 UTC
Created attachment 355476 [details]
ChangeLog
Comment 2 lalebarde 2013-08-09 12:13:45 UTC
Created attachment 355478 [details]
libsodium-0.4.2.ebuild with test useflag

added tests before install, with the test useflag
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2013-08-09 13:08:05 UTC
Comment on attachment 355476 [details]
ChangeLog

That's wrong in multiple ways.
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2013-08-09 13:21:57 UTC
Comment on attachment 355478 [details]
libsodium-0.4.2.ebuild with test useflag

># Copyright 1999-2013 Gentoo Foundation
># Distributed under the terms of the GNU General Public License v2
># $Header: /var/cvsroot/gentoo-x86/dev-libs/libsodium/libsodium-0.4.2.ebuild,v 0.4.2 2013/08/09 11:47:52 xmw Exp $
>
>EAPI=5
>
>inherit flag-o-matic

This isn't needed (see below).

>DESCRIPTION="NaCl (pronounced \"salt\") is a new easy-to-use high-speed software library for network communication, encryption, decryption, signatures, etc."

This doesn't appear to describe libsodium, but net-libs/nacl. Also, it's too long.

>HOMEPAGE="https://github.com/jedisct1/libsodium/"
>SRC_URI="https://download.libsodium.org/libsodium/releases/${P}.tar.gz"
>RESTRICT="mirror"

Why do you restrict mirroring?

>LICENSE="ISC license"

LICENSE should be a space separated list of the names of specific license files stored in $PORTDIR/licenses/

>DEPEND=""
>RDEPEND="${DEPEND}"

When these are empty, there is no need to set them.

>src_prepare() {
>	filter-flags "-O*"
>	append-cflags -O3 -fomit-frame-pointer -funroll-loops
>	append-cxxflags -O3 -fomit-frame-pointer -funroll-loops
>}

Why are you deliberately breaking our expectation of the build system respecting CFLAGS?

>src_configure() {
>    econf \
>        $(use_enable test)
>}
>
>if use test ; then
>	src_test() {
>		if emake -j1 check -n &> /dev/null; then

I haven't tried this out, but it doesn't seem useful to throw away the output.

>			vecho ">>> Test phase [check]: ${CATEGORY}/${PF}"
>			if ! emake -j1 check; then
>				hasq test $FEATURES && die "Make check failed. See above for details."
>				hasq test $FEATURES || eerror "Make check failed. See above for details."
>			fi
>		elif emake -j1 test -n &> /dev/null; then
>			vecho ">>> Test phase [test]: ${CATEGORY}/${PF}"
>			if ! emake -j1 test; then
>				hasq test $FEATURES && die "Make test failed. See above for details."
>				hasq test $FEATURES || eerror "Make test failed. See above for details."
>			fi
>		else
>			vecho ">>> Test phase [none]: ${CATEGORY}/${PF}"
>		fi
>	}
>fi

This looks much too complicated. It needs at least a description of why the default doesn't work.

>src_install() {
>    emake DESTDIR="${D}" install

With EAPI=5, you should call "default" instead.

>    dodoc NEWS README

Set DOCS=( NEWS README ) in the global scope, then remove src_install() entirely and the default src_install will do everything you explicitly described.
Comment 5 lalebarde 2013-08-09 13:44:49 UTC
(In reply to Jeroen Roovers from comment #4)
> >inherit flag-o-matic
> 
> This isn't needed (see below).
Only "inherit flag-o-matic" ? or more ? I am not an ebuild expert.
> 
> >DESCRIPTION="NaCl (pronounced \"salt\") is a new easy-to-use high-speed software library for network communication, encryption, decryption, signatures, etc."
> 
> This doesn't appear to describe libsodium, but net-libs/nacl. Also, it's too
> long.
That's libsodium upstream description. I agree it recalls unappropriatly nacl. As it is too long, "new easy-to-use high-speed software library for network communication, encryption, decryption, signatures, etc." would be enough.
> 
> >HOMEPAGE="https://github.com/jedisct1/libsodium/"
> >SRC_URI="https://download.libsodium.org/libsodium/releases/${P}.tar.gz"
> >RESTRICT="mirror"
> 
> Why do you restrict mirroring?
I always do that for my own overlay as it avoids waiting 15' for the official mirrors to time-out. Can be removed if it is better before putting it in an overlay.
> 
> >LICENSE="ISC license"
> 
> LICENSE should be a space separated list of the names of specific license
> files stored in $PORTDIR/licenses/
ok, so ISC
> 
> >DEPEND=""
> >RDEPEND="${DEPEND}"
> 
> When these are empty, there is no need to set them.
ok, will remove them
> 
> >src_prepare() {
> >	filter-flags "-O*"
> >	append-cflags -O3 -fomit-frame-pointer -funroll-loops
> >	append-cxxflags -O3 -fomit-frame-pointer -funroll-loops
> >}
> 
> Why are you deliberately breaking our expectation of the build system
> respecting CFLAGS?
sorry, I kept what I could from the nacl ebuild. I will remove that and check it works.
> 
> >src_configure() {
> >    econf \
> >        $(use_enable test)
> >}
> >
> >if use test ; then
> >	src_test() {
> >		if emake -j1 check -n &> /dev/null; then
> 
> I haven't tried this out, but it doesn't seem useful to throw away the
> output.
That is copy/paste from the Gentoo Dev Guide : http://devmanual.gentoo.org/ebuild-writing/functions/src_test/index.html
> 
> >			vecho ">>> Test phase [check]: ${CATEGORY}/${PF}"
> >			if ! emake -j1 check; then
> >				hasq test $FEATURES && die "Make check failed. See above for details."
> >				hasq test $FEATURES || eerror "Make check failed. See above for details."
> >			fi
> >		elif emake -j1 test -n &> /dev/null; then
> >			vecho ">>> Test phase [test]: ${CATEGORY}/${PF}"
> >			if ! emake -j1 test; then
> >				hasq test $FEATURES && die "Make test failed. See above for details."
> >				hasq test $FEATURES || eerror "Make test failed. See above for details."
> >			fi
> >		else
> >			vecho ">>> Test phase [none]: ${CATEGORY}/${PF}"
> >		fi
> >	}
> >fi
> 
> This looks much too complicated. It needs at least a description of why the
> default doesn't work.
Same remark. It is a copy past of the default from the guide, embraced in "if use test ... fi". If it is done by default, we can remove all of it.
> 
> >src_install() {
> >    emake DESTDIR="${D}" install
> 
> With EAPI=5, you should call "default" instead.
This is from another Gentoo Dev Guide (http://devmanual.gentoo.org/quickstart/) which may be deprecated. Please, provide me with the full corrected line, I can't figure out what you want here.
> 
> >    dodoc NEWS README
> 
> Set DOCS=( NEWS README ) in the global scope, then remove src_install()
> entirely and the default src_install will do everything you explicitly
> described.
ok, will be modified.

When I have your answers, I will perform the updates, tests, and upload.

Thanks for your help.

Cheers,

Laurent.
Comment 6 lalebarde 2013-08-09 14:04:14 UTC
Created attachment 355490 [details]
libsodium-0.4.2.ebuild

Corrections from comments #4 & #5.
Incredibly simple. Thanks a lot Jeroen.
Comment 7 lalebarde 2013-08-10 13:46:22 UTC
Created attachment 355608 [details]
net-libs/libsodium-9999.ebuild Live ebuild

This is a live ebuild that builds from the git repository, compatible with releases for easier maintenance.
Comment 8 Manuel Rüger (RETIRED) gentoo-dev 2014-08-24 10:48:14 UTC
Already in tree.