Bug 140767 - [new port] sysutils/libss
Summary: [new port] sysutils/libss
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Matthias Andree
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-22 06:20 UTC by Ben Kaduk
Modified: 2010-01-07 14:00 UTC (History)
0 users

See Also:


Attachments
file.shar (6.78 KB, text/plain)
2009-11-22 06:20 UTC, Ben Kaduk
no flags Details
e2fsprogs-libss.shar.txt (6.54 KB, text/plain; charset=us-ascii)
2009-11-24 03:47 UTC, Ben Kaduk
no flags Details
Makefile (1.06 KB, text/plain; charset=us-ascii)
2009-11-26 08:59 UTC, Matthias Andree
no flags Details
patch-lib-ss-Makefile.in (569 bytes, text/plain; charset=us-ascii)
2009-11-29 00:26 UTC, Ben Kaduk
no flags Details
e2fsprogs-libss.shar.txt (3.61 KB, TEXT/PLAIN; charset=US-ASCII)
2009-11-29 20:50 UTC, Ben Kaduk
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Kaduk 2009-11-22 06:20:01 UTC
libss is a library and supporting utilities to facilitate parsing command-line interfaces, inspired by the Multics SubSystem library.  The library is currently provided by e2fsprogs, heimdal, and krb4 (which is marked as BROKEN), but those are all rather heavyweight options, and I would like something more lightweight for another port I'm working on (the zephyr instant messaging system).  I note that there is a libss2 Debian package that draws on e2fsprogs as its source package, so there is some precedent.

I'm not entirely sure if sysutils/ is the right place for it, but the only other obvious candidate is devel/ ....

Fix: Patch attached with submission follows:
How-To-Repeat: n/a
Comment 1 Martin Wilke freebsd_committer freebsd_triage 2009-11-22 12:35:48 UTC
State Changed
From-To: open->feedback

would it not better to create a salve port direct from 
sysutils/e2fsprogs ?
Comment 2 Ben Kaduk 2009-11-24 03:47:23 UTC
On Mon, 23 Nov 2009, Benjamin Kaduk wrote:

> On Sun, 22 Nov 2009, miwi@freebsd.org wrote:
>> would it not better to create a salve port direct from
>> sysutils/e2fsprogs ?
>
> It probably would.  I guess I got distracted by reading
> the porter's handbook and didn't think about such things.
>
> I'll take a look and see how feasible it is (my first
> attempt has failed, but I haven't run into any walls, yet).

Okay, the attached slave port should work -- any comments?

Thanks,

Ben Kaduk
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2009-11-24 22:08:17 UTC
State Changed
From-To: feedback->open

feedback received.
Comment 4 Matthias Andree freebsd_committer freebsd_triage 2009-11-25 16:03:18 UTC
Responsible Changed
From-To: freebsd-ports-bugs->mandree

I'll take it.
Comment 5 Matthias Andree freebsd_committer freebsd_triage 2009-11-25 16:11:23 UTC
Hi Benjamin,

may I file (i. e. adjust the CATEGORY line) your new port into devel/
instead? If it's a command-line parsing _library_ it wouldn't seem a
system utility, right?

Thanks
Matthias

-- 
Matthias Andree
Comment 6 Ben Kaduk 2009-11-25 23:05:32 UTC
On Wed, 25 Nov 2009, Matthias Andree wrote:

> Hi Benjamin,
>
> may I file (i. e. adjust the CATEGORY line) your new port into devel/
> instead? If it's a command-line parsing _library_ it wouldn't seem a
> system utility, right?

Hi Matthias,

That seems reasonable; the mk_cmds and compile_et utilities that
go into usr/bin/ are just formatting-conversion tools to
facilitate the use of the libraries.

Thanks,

Ben Kaduk
Comment 7 Ben Kaduk 2009-11-26 07:19:06 UTC
I'll also note that there's a spurious commented line in the
second shar file that I attached:
#MAKE_ARGS=    LIB_SUBDIRS="lib/ss"

Sorry for not checking as carefully the second time around.

-Ben
Comment 8 Matthias Andree freebsd_committer freebsd_triage 2009-11-26 08:59:56 UTC
On Thu, Nov 26, 2009 at 02:19:06AM -0500, Benjamin Kaduk wrote:
> I'll also note that there's a spurious commented line in the
> second shar file that I attached:
> #MAKE_ARGS=    LIB_SUBDIRS="lib/ss"
> 
> Sorry for not checking as carefully the second time around.

That's not a big issue, however I am a bit concerned about other issues.

First of all, please start from the Makefile I'm attaching, it has minor
formatting adjustments just to please portlint^W^Wadhere to our formatting
policies.  Be sure to only have tabs between "VARIABLE=" and the value.


### 1. libcom_err vs. Kerberos (heimdal/krb*) ###

===>  Building package for e2fsprogs-libss-1.41.9
Creating package /usr/ports/packages/All/e2fsprogs-libss-1.41.9.tbz
Registering depends:.
Registering conflicts: heimdal-[0-9]* krb[45]-[0-9]* e2fsprogs-[0-9]*.
Creating bzip'd tar ball in '/usr/ports/packages/All/e2fsprogs-libss-1.41.9.tbz'
===> Checking pkg_info
e2fsprogs-libss-1.41.9 Command-line interface parsing library from e2fsprogs
===> Checking shared library dependencies
/lib/libc.so.7
/usr/lib/libcom_err.so.5

IF we install our own libcom_err, why does it use the system libcom_err from
/usr/lib?  OR: if we use the system libcom_err, why do we mark Kerberos 5
packages for conflicts?


### 2. e2fsprogs conflict ###

And why do we conflict with e2fsprogs? I'd like to avoid that if possible.
Unless the libss interfaces expose com_err functions, see the post-bild
section of sysutils/e2fsprogs for how to link com_err statically - this may
avoid this and the Kerberos issue (but needs testing).

If you need me to modify or split the master port, I'm open to doing that
if really needed.


### 3. NLS ###

Overriding NLS with WITH_NLS=no doesn't seem to work, because the master port
uses the OPTIONS= framework. We may need to:

  a. rename this to WITHOUT_NLS=yes (because that's what the master port checks)
  b. change the master port to read OPTIONS?= ...
  c. change your port to set OPTIONS= # (blank)

and see if that works.
Comment 9 Matthias Andree freebsd_committer freebsd_triage 2009-11-26 09:01:26 UTC
State Changed
From-To: open->feedback

Awaiting maintainer feedback.
Comment 10 Ben Kaduk 2009-11-29 00:26:54 UTC
> On Thu, Nov 26, 2009 at 02:19:06AM -0500, Benjamin Kaduk wrote:
>> I'll also note that there's a spurious commented line in the
>> second shar file that I attached:
>> #MAKE_ARGS=    LIB_SUBDIRS="lib/ss"
>>
>> Sorry for not checking as carefully the second time around.
>
> That's not a big issue, however I am a bit concerned about other issues.
>
> First of all, please start from the Makefile I'm attaching, it has minor
> formatting adjustments just to please portlint^W^Wadhere to our formatting
> policies.  Be sure to only have tabs between "VARIABLE=" and the value.

Hm, I don't remember portlint complaining, but I was kind of expecting
it to give more guidance on (e.g.) where to put section breaks.

>
>
> ### 1. libcom_err vs. Kerberos (heimdal/krb*) ###
>
> ===>  Building package for e2fsprogs-libss-1.41.9
> Creating package /usr/ports/packages/All/e2fsprogs-libss-1.41.9.tbz
> Registering depends:.
> Registering conflicts: heimdal-[0-9]* krb[45]-[0-9]* e2fsprogs-[0-9]*.
> Creating bzip'd tar ball in '/usr/ports/packages/All/e2fsprogs-libss-1.41.9.tbz'
> ===> Checking pkg_info
> e2fsprogs-libss-1.41.9 Command-line interface parsing library from e2fsprogs
> ===> Checking shared library dependencies
> /lib/libc.so.7
> /usr/lib/libcom_err.so.5
>
> IF we install our own libcom_err, why does it use the system libcom_err from
> /usr/lib?  OR: if we use the system libcom_err, why do we mark Kerberos 5
> packages for conflicts?
>

I'm not sure why it's finding the system libcom_err, there -- offhand, 
I would be inclined to blame the ld-elf.so.hints file, but I'm not 
entirely sure.  In any case, as per the following, that link appears
to be removable.

I do know that my original attempt at a port did not install any of the 
com_err stuff, and the packaging worked fine: however, when I tried to 
compile against the libss that was installed, the compilation errored out 
because ss.h includes <ss_err.h> which includes <et/com_err.h>, which is 
not present in the base system (only <com/err.h> is present in the base 
system).  I don't think I investigated patching ss_err.h to just include 
<com_err.h>, I just went straight to installing the e2fsprogs version.

I went back and looked at the com_err bits some more, and it turns out 
that I can patch lib/ss/Makefile.in to use the system's compile_et binary 
instead of e2fsprogs' lib/et/compile_et; the resulting ss_err.h header 
does not include a com_err header, so it is also possible to remove
the link agains libcom_err.so (yay!).
Unfortunately, my familiarity with the ports system is insufficient
to actually package this patch in a satisfactory way at the moment -- it 
looks like in the current Makefile, `make patch` is actually pulling
the patchfiles and post-patch from the master port, and is ignoring
anything I put in files/patch-foo .  The attached patch should be
all that is needed, if you can help me figure out the best way to package 
it.



Regarding the conflicts, I think that I actually only want to conflict 
with krb4 and heimdal, as they both actually install a libss.so .  (Of 
course, krb4 is marked as broken ....)  I did not have com_err in mind 
when writing adding those conflicts lines, though installing a 
libcom_err.so symlink would seem to conflict.


>
> ### 2. e2fsprogs conflict ###
>
> And why do we conflict with e2fsprogs? I'd like to avoid that if possible.
> Unless the libss interfaces expose com_err functions, see the post-bild
> section of sysutils/e2fsprogs for how to link com_err statically - this may
> avoid this and the Kerberos issue (but needs testing).
>
> If you need me to modify or split the master port, I'm open to doing that
> if really needed.
>

Looking back at this, I'm not actually sure why I added the conflict with 
e2fsprogs -- all I can think of is that I assumed that the full e2fsprogs 
package would install libss.so as well, but it clearly does not.
It should be fine to remove this conflict, as far as I know.


>
> ### 3. NLS ###
>
> Overriding NLS with WITH_NLS=no doesn't seem to work, because the master port
> uses the OPTIONS= framework. We may need to:
>
>  a. rename this to WITHOUT_NLS=yes (because that's what the master port checks)
>  b. change the master port to read OPTIONS?= ...
>  c. change your port to set OPTIONS= # (blank)
>
> and see if that works.

I could have sworn that I tried that ... in fact, I was cribbing
off of misc/e2fsprogs-libuuid which sets WITHOUT_NLS=yes, but
I seem to remember that not working.
I'll add that to my list of things to test, but I think (b) may be 
necessary.
[some time passes]
Nuking /var/db/ports/e2fsprogs/options and trying again, (a) does not 
work. Likewise, (c) does not work.  However, (b) in conjunction with (c) 
does work.  If you are willing to do (b), I would greatly appreciate it.








If you can help me figure out how to package this extra patch to 
lib/ss/Makefile.in (hm, is this what EXTRA_PATCHES would be for?),
then I'll re-run my tests and roll a new shar for you.


Many thanks,

Ben Kaduk
Comment 11 Ben Kaduk 2009-11-29 20:50:52 UTC
On Sat, 28 Nov 2009, Benjamin Kaduk wrote:

> On Thu, 26 Nov 2009, Matthias Andree wrote:
>
>> 
>> ### 1. libcom_err vs. Kerberos (heimdal/krb*) ###
>
> I went back and looked at the com_err bits some more, and it turns out that I 
> can patch lib/ss/Makefile.in to use the system's compile_et binary instead of 
> e2fsprogs' lib/et/compile_et; the resulting ss_err.h header does not include 
> a com_err header, so it is also possible to remove
> the link agains libcom_err.so (yay!).
> Unfortunately, my familiarity with the ports system is insufficient
> to actually package this patch in a satisfactory way at the moment -- it 
> looks like in the current Makefile, `make patch` is actually pulling
> the patchfiles and post-patch from the master port, and is ignoring
> anything I put in files/patch-foo .  The attached patch should be
> all that is needed, if you can help me figure out the best way to package it.
>

It would appear that I spoke too soon -- com_err is rather inscrutable, 
and not entirely standardized ...
Though the base system's compile_et does produce a header that does not 
#include <com_err.h>, it does still make call(s) to com_err routines, in 
particular, (const char *) error_message(long).  If that prototype is not 
present, gcc assumes an incorrect function signature, which results in 
segfaults in code that uses the ss library but does not manually #include 
<com_err.h>.  Since it seems that most versions of ss (if there are enough 
to say "most" about) link directly against com_err and include the com_err 
header in their header file (and thus, that users of ss do not expect to 
need to link directly against com_err), I have patched this port to also 
do so, but using the base system's com_err library and header.


>> 
>> ### 3. NLS ###
[the master port should probably set OPTIONS?=]

This issue remains unresolved.

>
>
> If you can help me figure out how to package this extra patch to 
> lib/ss/Makefile.in (hm, is this what EXTRA_PATCHES would be for?),
> then I'll re-run my tests and roll a new shar for you.

Looks like EXTRA_PATCHES did the trick -- I was just forgetting
that the master port unconditionally sets PATCH_STRIP, so I had
to add an extra component to my paths.



I believe that the attached shar file addresses all issues that have
been raised (modulo the disabling of NLS); please give it some review.

Thanks again, and sorry for all the back-and-forth -- this is my first
attempt at a port.

-Ben Kaduk
Comment 12 Matthias Andree freebsd_committer freebsd_triage 2009-12-07 22:43:43 UTC
State Changed
From-To: feedback->suspended

Committer waiting for Tinderbox access.
Comment 13 Matthias Andree freebsd_committer freebsd_triage 2010-01-07 12:38:17 UTC
Hi Ben,

(and sorry for the blank previous message).

Sorry it took so long to get back to your patch.

I needed to remove "@dirrmtry libdata/pkgconfig" from your pkg-plist
in order not to damage the system on uninstall of the package.

I am requesting mentor permission to commit the port.

Best regards
Matthias
Comment 14 Matthias Andree freebsd_committer freebsd_triage 2010-01-07 13:06:10 UTC
State Changed
From-To: suspended->open

Prepared for commit, but still waiting for mentor approval.
Comment 15 dfilter service freebsd_committer freebsd_triage 2010-01-07 13:48:50 UTC
mandree     2010-01-07 13:48:41 UTC

  FreeBSD ports repository

  Modified files:
    devel                Makefile 
  Added files:
    devel/e2fsprogs-libss Makefile pkg-descr pkg-plist 
    devel/e2fsprogs-libss/files fix-ss_err.h.sed 
                                patch-lib-ss-Makefile.in 
  Log:
  Add new devel/e2fsprogs-libss port, as slave to sysutils/e2fsprogs.
  
  pkg-descr: ----------------------------------------------------------
    This package includes a tool that parses a command table to generate a
    simple command-line interface parser, the include files needed to compile
    and use it, and the libraries needed to run programs that use it.
  
    It was originally inspired by the Multics SubSystem library.
  EOF------------------------------------------------------------------
  
  PR:           ports/140767
  Submitted by: Benjamin Kaduk <kaduk@mit.edu>
  Approved by:  garga (mentor)
  
  Revision  Changes    Path
  1.3752    +1 -0      ports/devel/Makefile
  1.1       +43 -0     ports/devel/e2fsprogs-libss/Makefile (new)
  1.1       +2 -0      ports/devel/e2fsprogs-libss/files/fix-ss_err.h.sed (new)
  1.1       +20 -0     ports/devel/e2fsprogs-libss/files/patch-lib-ss-Makefile.in (new)
  1.1       +5 -0      ports/devel/e2fsprogs-libss/pkg-descr (new)
  1.1       +12 -0     ports/devel/e2fsprogs-libss/pkg-plist (new)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 16 dfilter service freebsd_committer freebsd_triage 2010-01-07 13:51:17 UTC
mandree     2010-01-07 13:51:03 UTC

  FreeBSD ports repository

  Modified files:
    sysutils/e2fsprogs   Makefile 
  Log:
  Add new devel/e2fsprogs-libss port, as slave to sysutils/e2fsprogs.
  
  pkg-descr: ----------------------------------------------------------
    This package includes a tool that parses a command table to generate a
    simple command-line interface parser, the include files needed to compile
    and use it, and the libraries needed to run programs that use it.
  
    It was originally inspired by the Multics SubSystem library.
  EOF------------------------------------------------------------------
  
  PR:           ports/140767
  Submitted by: Benjamin Kaduk <kaduk@mit.edu>
  Approved by:  garga (mentor)
  
  Revision  Changes    Path
  1.61      +1 -1      ports/sysutils/e2fsprogs/Makefile
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 17 Matthias Andree freebsd_committer freebsd_triage 2010-01-07 13:52:31 UTC
State Changed
From-To: open->closed

New port added, with minor changes. Thanks!