Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 151633 - New package: cryptokit (cryptographic library for ocaml)
Summary: New package: cryptokit (cryptographic library for ocaml)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Default Assignee for New Packages
URL: http://caml.inria.fr
Whiteboard:
Keywords: EBUILD
: 198468 (view as bug list)
Depends on:
Blocks: 198470
  Show dependency tree
 
Reported: 2006-10-16 13:34 UTC by joes5532
Modified: 2007-11-10 15:40 UTC (History)
2 users (show)

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


Attachments
ocaml-cryptokit-1.3.ebuild (ocaml-cryptokit-1.3.ebuild,1.28 KB, text/plain)
2006-10-16 13:35 UTC, joes5532
Details
cryptokit-1.3-gentoo.patch (cryptokit-1.3-gentoo.patch,710 bytes, patch)
2007-03-16 04:34 UTC, joes5532
Details | Diff
cryptokit-1.3.ebuild (cryptokit-1.3.ebuild,1.38 KB, text/plain)
2007-03-16 04:34 UTC, joes5532
Details
cryptokit-1.3.ebuild (cryptokit-1.3.ebuild,1.41 KB, text/plain)
2007-11-09 11:07 UTC, Pierre Clairambault
Details
cryptokit-gentoo.patch (cryptokit-gentoo.patch,995 bytes, patch)
2007-11-09 11:08 UTC, Pierre Clairambault
Details | Diff
META (META,168 bytes, text/plain)
2007-11-09 11:08 UTC, Pierre Clairambault
Details

Note You need to log in before you can comment on or make changes to this bug.
Description joes5532 2006-10-16 13:34:21 UTC
This is an ebuild I made about a year ago, based off of a FreeBSD ports package.  It's been kicking around in my /usr/local/portage for long enough.  This is very simple, and just installs the cryptokit library for Objective Caml.  Let me know how it works!

Cheers,
Jeff
Comment 1 joes5532 2006-10-16 13:35:13 UTC
Created attachment 99828 [details]
ocaml-cryptokit-1.3.ebuild
Comment 2 Alexandre Buisse (RETIRED) gentoo-dev 2006-10-16 15:05:06 UTC
Some remarks on your ebuild:

- we try to avoid as much as possible using executables like sed or cut in global scope (here in SRC_P). In this case, it would be better to use the versionator eclass.
- there is no need for the SRC_A variable, it would be more clear to add the ".tar.gz" suffix directly in SRC_URI.
- the declaration of S should be quoted.
- why do you test for makeopt like this, and fail if it doesn't exist? If for some obscure reason it isn't installed anymore, the Makefile will die nicely, so 'emake allopt || die "make allopt failed"' is a much shorter way to write the same thing.
- the einfo should go either in pkg_preinst or pkg_postinst.
- I think the message in einfo is unclear. If it is required, it means that the software will fail without it...
- Is the stuff in src_install with `ocamlc -g -where` really needed? If yes, a better option would be to fix the Makefile itself and have a standard "make DESTDIR="${D}" install"
- we do not install the LICENSE files, as they are already in /usr/portage/licence.


Please provide an updated ebuild and I'll probably add it to the tree.
Comment 3 joes5532 2006-10-17 13:04:06 UTC
Thank you for the feedback.  Two responses though, starting with this comment:

> - why do you test for makeopt like this, and fail if it doesn't exist? If for
> some obscure reason it isn't installed anymore, the Makefile will die nicely,
> so 'emake allopt || die "make allopt failed"' is a much shorter way to write
> the same thing.

I'm not testing for makeopt, but for the presence of the ocamlopt executable.  Here is what the README for cryptokit says:

  - If the Objective Caml native-code compiler is available on your platform
    (look for the "ocamlopt" executable), do "make allopt".

Secondly:

> - Is the stuff in src_install with `ocamlc -g -where` really needed? If yes, a
> better option would be to fix the Makefile itself and have a standard "make
> DESTDIR="${D}" install"

The problem here is that the Makefile calculates INSTALLDIR=`ocamlc -g -where` as the install path.  However, this needs to be prefixed with ${D}, which is why I overrode it in the ebuild.  I'd rather not start tinkering with the Makefile since I am not the maintainer of the library, but if you know of a better way to do this I'll fix it.

By the way, I renamed the ebuild to just 'cryptokit' since that's really what the name of it is, rather than ocaml-cryptokit (plus it means the 'ocaml-' part doesn't have to be stripped off for the SRC_URI...but if it did is there an eclass like versionator that can chop up the ${PN} var?).

Once I hear back on these few things I'll upload the latest.

Thanks,
Jeff
Comment 4 Alexandre Buisse (RETIRED) gentoo-dev 2006-10-17 15:35:23 UTC
My bad, I meant "test for ocamlopt", not "test for makeopt". My point being that as cryptokit depends on dev-lang/ocaml, which installs ocamlopt, it's not the ebuild job to test whether it exists or not, as it *will* exist unless the system is seriously broken or root did "rm /usr/bin/ocamlopt"...

As for remark 2, Makefiles generally have some PREFIX variable that is used for this kind of things. We generally prefer patching build systems to exhibit a sane behaviour, rather than having ugly workarounds in the ebuild itself. If you don't see any easy way to fix this one, then we can consider keeping the `ocamlc -g -where` but I'd really rather not. The fact that neither you nor I is upstream shouldn't matter, as it's the distribution job to patch packages so that they can be installed correctly.

'cryptokit' also seems better to me, as 'dev-ml/ocaml-cryptokit' is a bit redundant. versionator.eclass can not manage such changes but there wouldn't be much point in trying to be generic, since the name of the ebuild is not expected to change, so a simple MY_PN="cryptokit" would be enough. In case such replacements are needed, bash syntax ${PN/ocaml-/} would be preferred.
Comment 5 joes5532 2006-10-18 21:17:56 UTC
So if I write a patch for the Makefile and include that with the ebuild will it suffice?

(In reply to comment #4)
> As for remark 2, Makefiles generally have some PREFIX variable that is used for
> this kind of things. We generally prefer patching build systems to exhibit a
> sane behaviour, rather than having ugly workarounds in the ebuild itself. If
> you don't see any easy way to fix this one, then we can consider keeping the
> `ocamlc -g -where` but I'd really rather not. The fact that neither you nor I
> is upstream shouldn't matter, as it's the distribution job to patch packages so
> that they can be installed correctly.
Comment 6 Alexandre Buisse (RETIRED) gentoo-dev 2006-10-19 02:11:42 UTC
Yes, you need to add it to the files/ directory. Then you can apply it using epatch, provided by the eutils eclass, during src_unpack.
Comment 7 joes5532 2007-03-16 04:34:10 UTC
Created attachment 113433 [details, diff]
cryptokit-1.3-gentoo.patch

This is a patch to fix the Makefile for gentoo installs.
Comment 8 joes5532 2007-03-16 04:34:43 UTC
Created attachment 113434 [details]
cryptokit-1.3.ebuild
Comment 9 joes5532 2007-03-16 04:35:49 UTC
I've finally gotten around to fixing the ebuild and creating a Makefile patch for this package.  Please have a look and test it out, thanks!
Comment 10 Jakub Moc (RETIRED) gentoo-dev 2007-11-08 18:39:45 UTC
*** Bug 198468 has been marked as a duplicate of this bug. ***
Comment 11 Pierre Clairambault 2007-11-09 11:07:02 UTC
Created attachment 135564 [details]
cryptokit-1.3.ebuild

Sorry for the duplicate. Here is a revised version of the ebuild above which installs the library via ocamlfind, rather than just copying files. It is cleaner, and ensures the package is found with "ocamlfind query cryptokit", which is needed  by the compile process of www-servers/ocsigen-0.99.3 .
Comment 12 Pierre Clairambault 2007-11-09 11:08:03 UTC
Created attachment 135565 [details, diff]
cryptokit-gentoo.patch

Matching version of the patch to the Makefile.
Comment 13 Pierre Clairambault 2007-11-09 11:08:32 UTC
Created attachment 135567 [details]
META

META file for "ocamlfind install"
Comment 14 Alexis Ballier gentoo-dev 2007-11-10 15:40:39 UTC
added, thanks