It would be better for all of us if you sent a complete port rather than just a Makefile, since our feedback on the Makefile could very well change other parts of a port (like, especially the pkg/PLIST).

Indeed, some of Klemens's feedback will change the resulting package.

~Brian

On 12/1/18 4:58 PM, Klemens Nanni wrote:
On Sat, Dec 01, 2018 at 04:24:26PM -0500, Charles A Daniels wrote:
This is my first time porting, so apologies in advance for anything I
might have missed. I've been working on a port of pcalc
(https://github.com/vapier/pcalc), and I think it's nearly ready,
however there are few remaining bits that I would appreciate some
guidance on before the port is ready to be committed.

More general feedback on style or adherence to best practice is welcome
also, as I hope to package some other software in the near future.
See http://openbsd.org/faq/ports/guide.html for extensive information.

The current state of my Makefile follows, annotated with comments
Answers inline.

regarding issues I would like help with. As it stands, the port works,

and the package can be built and installed, but the tests do

not work.
That's good, I suggest working through the feedback, cross-checking
with other ports on topics you're unsure about and then send a proper
tarball to the list so other people can test, once you're confident
things work as expected.


# $OpenBSD: Makefile.template,v 1.78 2018/07/09 15:00:06 jca Exp $
# TODO: does the above need to be modified?
No, CVS takes care of that.

V = 4
COMMENT = Programmers calculator, command line utility.
DISTNAME = pcalc-${V}
PKGNAME = pcalc-$V
These are the same, thus PKGNAME is redundant.
If the version is not used anywhere else, just drop V as well and use
`DISTNAME =     pcalc-4' directly.

GH_ACCOUNT =    vapier
GH_PROJECT =    pcalc
GH_TAGNAME =    v4
Either DISTNAME or GH_* is used, never both (is Makefile.template not
clear enough about that?).

Since their github offers unstable, automatically generated release
tarballs only and the sourceforge page has no tarballs, GH_* should be
used.

CATEGORIES = math
HOMEPAGE = http://pcalc.sourceforge.net/
"NOTE: Moved to ..."
Since we're using GH_*, HOMEPAGE can now be dropped as well as the ports
framework will already set it to their github page.

MAINTAINER = Charles Daniels <[email protected]>
Glad to see you want to take care of the package and ensure it will stay
up to date.

# TODO: is this the correct way to indicate licensing?
# License is GPLv2 only
Yes, `# GPLv2' is fine, but you can double check if it's GPLv2+ or
GPLv3(+) really.

# TODO: can GPLv2 packages be distributed on the CDROM?
Yes.

PERMIT_PACKAGE_CDROM =    Yes

WANTLIB = c m

# TODO: flex is also used - pretty sure this is part of the bison package?
No, you can check with `pkg_info -L bison'. flex(1) is in base.

BUILD_DEPENDS = devel/bison

# TODO: I think this is the "hardcoded paths" that portcheck reports - do
# these need to be changed?
Yes, use ${LOCALBASE} here. Just look at how other ports do it and
check bsd.port.mk(5) what this variable means.

MAKE_FLAGS = BINDIR=/usr/local/bin/
FAKE_FLAGS = BINDIR=/usr/local/bin/
TEST_FLAGS = BINDIR=/usr/local/bin/

USE_GMAKE =        Yes

# TODO: currently broken, throws the error
#
#    Provide an AUTOCONF_VERSION environment variable, please
There are numerous examples in the tree that handle various different
autoconf/automake use cases. I suggest checking them to see how it
works.

# Not sure what the most correct way to handle this is, it doesn't look like
# there is a 'TEST_ENV', and even if so, how to determine the
There is TEST_ENV as per bsd.port.mk(5).

AUTOCONF_VERSION
# value?
TEST_TARGET = check test

# TODO: do I need to explicitly add autoconf to TEST_DEPENDS?
No.

.include <bsd.port.mk>

Reply via email to