Bug 277801 - security/kc: add new OPTION
Summary: security/kc: add new OPTION
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Zsolt Udvari
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-19 05:36 UTC by Daniel
Modified: 2024-08-26 18:25 UTC (History)
1 user (show)

See Also:


Attachments
Patch to enable YubiKey support (2.80 KB, patch)
2024-03-19 05:36 UTC, Daniel
no flags Details | Diff
pet portclippy, portlint; add TEST_TARGET (3.75 KB, patch)
2024-08-21 18:43 UTC, Zsolt Udvari
no flags Details | Diff
revert TEST_TARGET, remove PCRE support (3.67 KB, patch)
2024-08-22 16:42 UTC, Daniel
no flags Details | Diff
enable tests, remove PCRE (3.85 KB, patch)
2024-08-26 10:07 UTC, Daniel
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel 2024-03-19 05:36:32 UTC
Created attachment 249295 [details]
Patch to enable YubiKey support

This adds an option to build kc with YubiKey support.

I shortened the install message and updated it with information on YubiKey support. Everything that was there is in the Changelog where we are already pointing the users, and this way it doesn't spam the output while installing - i.e. other messages are obvious, too.

I also changed OPTIONS_RADIO to OPTIONS_SINGLE for _CLI, as far as I understood _SINGLE makes sure that there's only one option that can be selected, and these are mutually exclusive.
But if I'm being honest, I would have thought the same thing about _RADIO, am not really sure, I just went with what I read in the porter's handbook.
Comment 1 Zsolt Udvari freebsd_committer freebsd_triage 2024-08-21 18:43:25 UTC
Created attachment 252993 [details]
pet portclippy, portlint; add TEST_TARGET

Made some small modifications (change order, reduce tabs).
Added TEST_TARGET.

There is a notice:
Message from pcre-8.45_4:

--
===>   NOTICE:

This port is deprecated; you may wish to reconsider installing it:

EOLed by upstream, use devel/pcre2 instead.




An error:
Error: /usr/local/bin/kc is linked to /usr/local/lib/libscrypt.so which does not have a SONAME.  security/libscrypt needs to be fixed.


And one test failed:
regress/cmd_passwd.sh: typeset: not found


Could you please check these?
Comment 2 Daniel 2024-08-22 16:41:43 UTC
Hey Zsolt!

1) pcre support can be dropped, there's POSIX regex support in kc in lieu of pcre.

2) Not sure what to do with libscrypt, or what you're expecting me to do there.

3) regression tests need a shell that supports e.g. typeset. If we can't come up with a stable solution that makes sure running the test script (run_tests.sh) with $(shell) invokes a shell that does, then I suggest you remove TEST_TARGET.


Daniel
Comment 3 Daniel 2024-08-22 16:42:19 UTC
Created attachment 253022 [details]
revert TEST_TARGET, remove PCRE support
Comment 4 Zsolt Udvari freebsd_committer freebsd_triage 2024-08-22 17:42:13 UTC
(In reply to Daniel from comment #2)
1) Okay. Thanks.

2) It seems it's working. I'm not good in libraries, linking, etc., I don't know it is a (serious) problem or not.

3) Maybe bash? Change the shebang in cmd_passwd.sh and add bash to TEST_DEPENDS. I think it should work.
Comment 5 Daniel 2024-08-23 08:42:13 UTC
Well, it's not just cmd_passwd.sh, there's a bunch of other tests that make use of this.
Also, when invoked as a parameter to a shell - like we're doing here, that's why I alluded to the $(shell)-style invocation in the Makefile -, the shebang doesn't matter.
Plus I won't change something portable (e.g. /bin/sh) to something that may work on some OSes and definitely not on some others.
Comment 6 Zsolt Udvari freebsd_committer freebsd_triage 2024-08-23 09:00:46 UTC
(In reply to Daniel from comment #5)
Good idea!
Comment 7 Zsolt Udvari freebsd_committer freebsd_triage 2024-08-23 17:46:07 UTC
(In reply to Daniel from comment #5)
"Plus I won't change something portable (e.g. /bin/sh) to something that may work on some OSes and definitely not on some others."
Ah, understood what you said. I mean you modify only in FreeBSD ports with REINPLACE_CMD - not your (github) source code.
Comment 8 Daniel 2024-08-26 10:07:59 UTC
Created attachment 253103 [details]
enable tests, remove PCRE

I see your point.
Here's an updated diff with tests enabled in a slightly different way.
Comment 9 commit-hook freebsd_committer freebsd_triage 2024-08-26 18:25:02 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c89a37da755fc8aa59772f6be56b695999646df2

commit c89a37da755fc8aa59772f6be56b695999646df2
Author:     Daniel <leva@ecentrum.hu>
AuthorDate: 2024-08-26 18:17:23 +0000
Commit:     Zsolt Udvari <uzsolt@FreeBSD.org>
CommitDate: 2024-08-26 18:17:23 +0000

    security/kc: add YUBIKEY option

    Remove pcre support.
    Add TEST_DEPENDS and use bash instead of sh in tests.
    Shorten pkg-message.
    Switch to DISTVERSION.
    Pet portlint, portfmt.

    PR:             277801
    Approved by:    submitter is maintainer

 security/kc/Makefile    | 69 +++++++++++++++++++++++++++----------------------
 security/kc/pkg-message | 31 ++--------------------
 2 files changed, 40 insertions(+), 60 deletions(-)
Comment 10 Zsolt Udvari freebsd_committer freebsd_triage 2024-08-26 18:25:58 UTC
Committed, thanks!