Opened 11 years ago
Last modified 11 years ago
#41734 new submission
Port file for bitpocket
Reported by: | cedric.simillion@… | Owned by: | macports-tickets@… |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.2.1 |
Keywords: | Cc: | ||
Port: | bitpocket |
Description
Hi there!
I have ported the bitpocket tool, a small but smart script that does 2-way directory synchronisation, to OS X and create a port file. I have tested the port on my own system and everything seems to be working fine. I did disable the checksum phase though, as the source is downloaded from a git repository and I could not find any instructions on how to calculate checksums for this type of download. Let me know if doing so is acceptable or not.
Kind regards, Cedric
Attachments (2)
Change History (4)
Changed 11 years ago by cedric.simillion@…
Attachment: | patch-bin-bitpocket.diff added |
---|
comment:1 follow-up: 2 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)
Thanks. Some observations:
- Checksums are only used when fetching a distfile, not when fetching from a repository. You should virtually never need to override a port's checksum phase.
- Fetching from the head of a repository is not ok; you must fetch a specific commit or tag, so that the build is reproducible. You've set the version field to "1.0.0", so you should fetch whatever tag or commit corresponds to that version number, however I'm not sure if that version really exists: I only see a tag "v0.1.0" made two years ago. Have the developers not released a new version since then? Perhaps they should be encouraged to do so.
- Is there a reason why you need to fetch from git, and cannot fetch a tarball instead? The most common reason to need to fetch from git is if this project uses submodules. Does it?
- Does this program really use git at runtime, or did you only add the git-core dependency because you're fetching the source from git? If the latter, remove the dependency; MacPorts automatically adds fetch dependencies as needed.
- Since this project is hosted at github, consider using the github portgroup and its "github.setup" procedure. See other ports that use this portgroup for examples of how to use it. Using this portgroup will fetch a tarball by default, set up the livecheck, etc.
- Overriding the configure phase is wrong; if there is no configure step, use "use_configure no".
- Overriding the build phase with an empty block is usually only done for ports that don't build anything. Is that the case here? Is bitpocket composed entirely of non-compiled files, such as shell scripts? If so, add "supported_archs noarch".
- Overriding the test phase is unnecessary, since it's disabled by default.
- The ${prefix} variable already begins with a slash; don't put an extra slash in front of it.
comment:2 Changed 11 years ago by cedric.simillion@…
Replying to ryandesign@…:
Thanks a lot for your input and sorry for the late reply, I had a busy week! :-)
Thanks. Some observations:
- Checksums are only used when fetching a distfile, not when fetching from a repository. You should virtually never need to override a port's checksum phase.
I removed the checksum overriding
- Fetching from the head of a repository is not ok; you must fetch a specific commit or tag, so that the build is reproducible. You've set the version field to "1.0.0", so you should fetch whatever tag or commit corresponds to that version number, however I'm not sure if that version really exists: I only see a tag "v0.1.0" made two years ago. Have the developers not released a new version since then? Perhaps they should be encouraged to do so.
No, they did not release a new version, the most recent commit is from 8 months ago. I modified to port file to use this specific commit. I've kept the version field in the port file to 1.0.0 as I am not sure what the actual version of the git repo is.
- Is there a reason why you need to fetch from git, and cannot fetch a tarball instead? The most common reason to need to fetch from git is if this project uses submodules. Does it?
It does not use submodules, but AFAIK, there is no tarball available containing the latest download.
- Does this program really use git at runtime, or did you only add the git-core dependency because you're fetching the source from git? If the latter, remove the dependency; MacPorts automatically adds fetch dependencies as needed.
Yes, bitpocket does (optionally) use git, so it's a bona fide runtime dependency.
- Since this project is hosted at github, consider using the github portgroup and its "github.setup" procedure. See other ports that use this portgroup for examples of how to use it. Using this portgroup will fetch a tarball by default, set up the livecheck, etc.
Thanks for the tip. I tried using the github.setup routine, but this only seems to be fetching a tarball. As mentioned, there is no tarball available.
- Overriding the configure phase is wrong; if there is no configure step, use "use_configure no".
OK, done that.
- Overriding the build phase with an empty block is usually only done for ports that don't build anything. Is that the case here? Is bitpocket composed entirely of non-compiled files, such as shell scripts? If so, add "supported_archs noarch".
Bitpocket is indeed entirely non-compiled. In fact, it's just a fancy bash script. The reason that I am submitting it as a Portfile is that it needs some patching in order to work on OS X
- Overriding the test phase is unnecessary, since it's disabled by default.
OK, removed the test phase overriding
- The ${prefix} variable already begins with a slash; don't put an extra slash in front of it.
Oops, fixed!
patch file