Bug 189222 - New port: comms/owfs, software for communicating with Dallas/Maxim 1-Wire network
Summary: New port: comms/owfs, software for communicating with Dallas/Maxim 1-Wire net...
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: John Marino
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-02 10:50 UTC by Johan Ström
Modified: 2014-08-16 09:41 UTC (History)
1 user (show)

See Also:


Attachments
owfs.shar (14.13 KB, text/plain)
2014-05-02 10:50 UTC, Johan Ström
no flags Details
owfs-2.9p5.patch (701 bytes, patch)
2014-05-07 21:14 UTC, Johan Strom
no flags Details | Diff
owfs-2.9p5-plist.patch (1.03 KB, patch)
2014-05-13 20:08 UTC, Johan Strom
no flags Details | Diff
owfs 2.9p5 with stagefixes (16.88 KB, text/plain)
2014-08-10 19:40 UTC, Johan Ström
no flags Details
poudriere testport logfile (506.08 KB, text/plain)
2014-08-10 19:41 UTC, Johan Ström
no flags Details
owfs 2.9p5 with stagefixes+pythonfix (16.91 KB, text/plain)
2014-08-15 12:02 UTC, Johan Ström
no flags Details
owfs 2.9p5 with stagefixes+pythonfix+cleanups (16.39 KB, text/plain)
2014-08-15 14:25 UTC, Johan Ström
no flags Details
owfs 2.9p5 with stagefixes+pythonfix+cleanups+new options (15.12 KB, text/plain)
2014-08-15 20:36 UTC, Johan Ström
no flags Details
poudriere testport logfile (58.37 KB, text/plain)
2014-08-15 20:45 UTC, Johan Ström
no flags Details
owfs 2.9p5, strip-fix (15.12 KB, text/plain)
2014-08-15 22:49 UTC, Johan Ström
no flags Details
owfs 2.9p5, patch+strip-fix (11.18 KB, text/plain)
2014-08-16 08:43 UTC, Johan Ström
no flags Details
owfs 2.9p5, patch+strip+postpre-fix (11.15 KB, text/plain)
2014-08-16 09:01 UTC, Johan Ström
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Johan Ström 2014-05-02 10:50:07 UTC
	OWFS -- 1-Wire file system.
	OWFS is an easy way to use the powerful 1-wire system of Dallas/Maxim.

	OWFS is a simple and flexible program to monitor and control the physical
	environment. You can write scripts to read temperature, flash lights, write
	to an LCD, log and graph, ...

	WWW: http://www.owfs.org/

Build succesfull on at least FreeBSD 8.4, 9.2, 10.0. Not actually tested on 10.0 though.
Some options are known not to build at all, those are marked BROKEN.
Comment 1 Johan Strom 2014-05-07 21:14:54 UTC
Attached is patch for Makefile & distinfo, to build owfs 2.9p5 instead 
of p4. The updated version has important fixes.
Comment 2 Johan Strom 2014-05-13 20:08:09 UTC
Missing pkg-plist patch for 2.9p5; make package failed.

Comment 3 John Marino freebsd_committer freebsd_triage 2014-08-07 14:59:58 UTC
Hi, if you are still interested in having this port in FreeBSD, it may (or may not) need to be reworked to support stage, and it may need updating to other newer conventions such as "USES" which is expanding all time.
For staging, see http://lists.freebsd.org/pipermail/freebsd-ports-announce/2014-May/000080.html


Additionally, you need to provide some sort of quality assurance.    
In order of preference, we are looking for:

1) "poudriere testport" or "poudriere bulk -t" logs
2) Redports or tinderbox logs
3) at least this: https://www.freebsd.org/doc/en/books/porters-handbook/porting-testing.html

Please provide an updated shar file and attach a test log.  Alternatively, please indicate if you are no longer interested in having this software in the Ports Collection and that we can close the PR.

Thanks!
Comment 4 Johan Ström 2014-08-10 19:40:01 UTC
Created attachment 145621 [details]
owfs 2.9p5 with stagefixes
Comment 5 Johan Ström 2014-08-10 19:41:37 UTC
Created attachment 145622 [details]
poudriere testport logfile

Port now updated with full stage support and deprecated MANX removed.

Also attached is output of 'poudriere testport -n' command executed on a FreeBSD 9.2-amd64 machine. The port builds fine on FreeBSD 10.0 as well.
Comment 6 Johan Ström 2014-08-10 19:43:15 UTC
Note: the two patch-files shall be ignored. Seems I'm not able to remove them.
Comment 7 John Marino freebsd_committer freebsd_triage 2014-08-10 19:44:19 UTC
Thanks, moving to stage-ready.
Next committer, note comment 6
Comment 8 Johan Ström 2014-08-12 07:13:44 UTC
Found an additional problem, the build failed with an updated ports tree. Seems bsd.python.mk was removed just a day or so ago.

Tried to attach an updated .shar but I just keep getting Internal Server Error... The Makefile should be patched accordingly, tested on FreeBSD 9.2:


--- owfs-a/Makefile     2014-08-12 09:13:00.633966176 +0200
+++ owfs-b/Makefile     2014-08-12 09:13:05.830968397 +0200
@@ -172,8 +172,7 @@
 .endif
 
 .if ${PORT_OPTIONS:MOWPYTHON}
-USE_PYTHON=yes
-.include "${PORTSDIR}/Mk/bsd.python.mk"
+USES+=python
 SWIG=1
 CONFIGURE_ARGS+=               --enable-owpython
 PLIST_SUB+=    OWPYTHON=""
Comment 9 John Marino freebsd_committer freebsd_triage 2014-08-15 11:38:15 UTC
i'm the next committer. :(
Comment 10 John Marino freebsd_committer freebsd_triage 2014-08-15 11:50:48 UTC
since this shar is also created badly and there's a mistake in Makefile, can you generate a new shar with the correction please?
Comment 11 Johan Ström 2014-08-15 12:02:08 UTC
Created attachment 145815 [details]
owfs 2.9p5 with stagefixes+pythonfix

Updated shar with proper root & python-fix applied!
Comment 12 Johan Ström 2014-08-15 14:25:39 UTC
Created attachment 145822 [details]
owfs 2.9p5 with stagefixes+pythonfix+cleanups

Updated with further cleanups (indentation, whitespace, pkg-plist order, some dead stuff removed)
Comment 13 John Marino freebsd_committer freebsd_triage 2014-08-15 14:53:24 UTC
/me is trembling..
Comment 14 John Marino freebsd_committer freebsd_triage 2014-08-15 14:58:45 UTC
The good news: portlint is happy
The bad news: You are using the old OPTIONS style.  You can really shorten the makefile with :

<OPTIONNAME>_CONFIGURE_WITH
<OPTIONNAME>_CONFIGURE_ENABLE
<OPTIONNAME>_LIB_DEPENDS
<OPTIONNAME>_RUN_DEPENDS
<OPTIONNAME>_USES

etc

read this page from top to bottom:
https://www.freebsd.org/doc/en/books/porters-handbook/makefile-options.html

Then I think you will see how to significantly reduce the size of the makefile.  It's a lot of work so I'll leave it for you.  Ask if you have any questions. 

( another learning opportunity )
Comment 15 John Marino freebsd_committer freebsd_triage 2014-08-15 14:59:39 UTC
don't forget OPTIONS_SUB either
Comment 16 Johan Ström 2014-08-15 15:01:04 UTC
Yeah, enough of my beginner misstakes for you today.. ;) Thank you, will look into it and update accordingly!
Comment 17 Johan Ström 2014-08-15 20:36:29 UTC
Created attachment 145838 [details]
owfs 2.9p5 with stagefixes+pythonfix+cleanups+new options
Comment 18 Johan Ström 2014-08-15 20:45:26 UTC
Created attachment 145839 [details]
poudriere testport logfile

There, updated the port with new-style options.

Please let me know of any further improvements which can be made, I'm sure there are some.. :)
Comment 19 John Marino freebsd_committer freebsd_triage 2014-08-15 20:55:50 UTC
I see a bunch of similar patches like:
X-__version__ = '0.0-%s' % '$Id$'.split( )[ 2 ]
X+__version__ = '0.0'

Surely you could add a post-patch target and used ${REINPLACE_CMD} -e '<regex>' <list of files> and change all of those without a patch.  I suspect you can.
Generally when you have a repetitive and simple change like this, used sed -i (which is what ${REINPLACE_CMD} is)

I think you can eliminate a bunch of patches with that.
Comment 20 John Marino freebsd_committer freebsd_triage 2014-08-15 20:59:36 UTC
The options stuff looks a lot better, don't you think?

The other thing that stands out just from looking at the shar is the amount of STRIP_CMD you have having to use.

Did you check the makefile to see if it defines "install-strip" target?  If it does, just add "INSTALL_TARGET=install-strip" and you can get rid of all those post-install strip targets.

if not, there may be another way e.g. patching the makefile but I'd have to look
Comment 21 Johan Ström 2014-08-15 22:49:17 UTC
Created attachment 145846 [details]
owfs 2.9p5, strip-fix
Comment 22 Johan Ström 2014-08-15 22:51:50 UTC
(In reply to John Marino from comment #19)
> I see a bunch of similar patches like:
> X-__version__ = '0.0-%s' % '$Id$'.split( )[ 2 ]
> X+__version__ = '0.0'
> 
> Surely you could add a post-patch target and used ${REINPLACE_CMD} -e
> '<regex>' <list of files> and change all of those without a patch.  I
> suspect you can.
> Generally when you have a repetitive and simple change like this, used sed
> -i (which is what ${REINPLACE_CMD} is)
> 
> I think you can eliminate a bunch of patches with that.

In theory it would be cleaner, but looking closer there was actually some difference between the patches. Adding to that, escaping issues ($Id$ and " vs ' and so on..) made me give up on moving it into post-patch.
Besides, this patch is temporary and is fixed in trunk, thus will be removed on next release.

(In reply to John Marino from comment #20)
> The options stuff looks a lot better, don't you think?

Very much so :) 

> 
> The other thing that stands out just from looking at the shar is the amount
> of STRIP_CMD you have having to use.
> 
> Did you check the makefile to see if it defines "install-strip" target?  If
> it does, just add "INSTALL_TARGET=install-strip" and you can get rid of all
> those post-install strip targets.
> 
> if not, there may be another way e.g. patching the makefile but I'd have to
> look

INSTALL_TARGET=install-strip did the trick, except for the Perl and Python .so's. Those are still stripped manually in the updated shar.
Comment 23 John Marino freebsd_committer freebsd_triage 2014-08-16 07:23:42 UTC
(In reply to johan from comment #22)
> (In reply to John Marino from comment #19)
> > I see a bunch of similar patches like:
> > X-__version__ = '0.0-%s' % '$Id$'.split( )[ 2 ]
> > X+__version__ = '0.0'
> > 

> In theory it would be cleaner, but looking closer there was actually some
> difference between the patches. Adding to that, escaping issues ($Id$ and "
> vs ' and so on..) made me give up on moving it into post-patch.
> Besides, this patch is temporary and is fixed in trunk, thus will be removed
> on next release.

I looked again, the last 7 patches are identical.
I'll try making it working, eliminating 7 patches is no small thing.
Comment 24 John Marino freebsd_committer freebsd_triage 2014-08-16 07:28:44 UTC
after exploring the shar, I see this is a single combined patch.
Even if I leave it this way, I have to remove all that git "diff" "Index" lines, they don't belong here.

Normally it's one patch per file changed, but having many patches in one file is okay, and some people think this should be the new norm (I'm not one of those though)
Comment 25 John Marino freebsd_committer freebsd_triage 2014-08-16 08:04:02 UTC
This line eliminates 8 patches:

post-patch:
        ${REINPLACE_CMD} \
                -e "s/^\(__version__ = '[[:digit:]]\.[[:digit:]]\).*/\1'/" \
                ${WRKSRC}/module/swig/python/unittest/*.py \
                ${WRKSRC}/module/ownet/python/ownet/__init__.py
Comment 26 John Marino freebsd_committer freebsd_triage 2014-08-16 08:15:11 UTC
Here's the full block.
When the next release comes, you just remove it.  Now there are no patches.



# These __version__ fixes should be unnecessary on next release
post-patch:
        @${REINPLACE_CMD} \
                -e "s/^\(__version__ = '[[:digit:]]\.[[:digit:]]\).*/\1'/" \
                ${WRKSRC}/module/swig/python/unittest/*.py \
                ${WRKSRC}/module/ownet/python/ownet/__init__.py
        @${REINPLACE_CMD} -e "s/\(__version__ =\).*/\1 '1.9'/" \
                ${WRKSRC}/module/ownet/python/ownet/connection.py
        @${REINPLACE_CMD} -e "s/\(__version__ = .*\) [+].*/\1/" \
                ${WRKSRC}/module/swig/python/ow/__init__.py
Comment 27 John Marino freebsd_committer freebsd_triage 2014-08-16 08:20:13 UTC
(In reply to johan from comment #22)
> INSTALL_TARGET=install-strip did the trick, except for the Perl and Python
> .so's. Those are still stripped manually in the updated shar.

I grepped for install-strip, it's not anywhere in the new shar.  (??)
Comment 28 John Marino freebsd_committer freebsd_triage 2014-08-16 08:26:58 UTC
it builds cleanly though, I need to diff those two shars to see what changed

====> Running Q/A tests (stage-qa)
====> Checking for pkg-plist issues (check-plist)
===> Parsing plist
===> Checking for items in STAGEDIR missing from pkg-plist
===> Checking for directories owned by MTREEs
===> Checking for directories handled by dependencies
===> Checking for items in pkg-plist which are not in STAGEDIR
===> No pkg-plist issues found (check-plist)
====>> Checking for staging violations... done
Comment 29 John Marino freebsd_committer freebsd_triage 2014-08-16 08:29:40 UTC
(In reply to John Marino from comment #28)
> it builds cleanly though, I need to diff those two shars to see what changed


Nothing.  attachment 145838 [details] and attachment 145846 [details] are identical.  Now I'm really confused.
Comment 30 Johan Ström 2014-08-16 08:43:21 UTC
Created attachment 145857 [details]
owfs 2.9p5, patch+strip-fix

(In reply to John Marino from comment #26)
> Here's the full block.
> When the next release comes, you just remove it.  Now there are no patches.
> 
> 
> 
> # These __version__ fixes should be unnecessary on next release
> post-patch:
>         @${REINPLACE_CMD} \
>                 -e "s/^\(__version__ = '[[:digit:]]\.[[:digit:]]\).*/\1'/" \
>                 ${WRKSRC}/module/swig/python/unittest/*.py \
>                 ${WRKSRC}/module/ownet/python/ownet/__init__.py
>         @${REINPLACE_CMD} -e "s/\(__version__ =\).*/\1 '1.9'/" \
>                 ${WRKSRC}/module/ownet/python/ownet/connection.py
>         @${REINPLACE_CMD} -e "s/\(__version__ = .*\) [+].*/\1/" \
>                 ${WRKSRC}/module/swig/python/ow/__init__.py

Great, thanks!

(In reply to John Marino from comment #29)
> (In reply to John Marino from comment #28)
> > it builds cleanly though, I need to diff those two shars to see what changed
> 
> 
> Nothing.  attachment 145838 [details] and attachment 145846 [details] are
> identical.  Now I'm really confused.

I guess I did a bit too much of porting yesterday as well, must have attached the old file... 
There, the updated one, including patch cleanup.
Comment 31 John Marino freebsd_committer freebsd_triage 2014-08-16 08:52:48 UTC
Alright, I see two things.

1) Your targets are split up.  Post patch and pre-configure should be near the bottom.  You put all the targets at the end.

2) What is the reason for <bsd.port.pre.mk> and <bsd.port.post.mk>?  I don't see one.  

3) That's wrong anyway because you have <bsd.port.options.mk>.  Only in very rare cases do you use both.

so #1 is a style thing, #2 and #3 are probably plain wrong.
Comment 32 Johan Ström 2014-08-16 09:01:12 UTC
Created attachment 145859 [details]
owfs 2.9p5, patch+strip+postpre-fix

There, cleaned up order of targets.

Hm, I think pre was used before when I first loaded bsd.options.mk, then added USES+=tcl if TCL option was checked. And then I included bsd.pre.mk to obtain TCL_LIBDIR which was added to configure args.
No longer required with opt_USES, cleaned up!
Comment 33 commit-hook freebsd_committer freebsd_triage 2014-08-16 09:16:11 UTC
A commit references this bug:

Author: marino
Date: Sat Aug 16 09:15:19 UTC 2014
New revision: 365069
URL: http://svnweb.freebsd.org/changeset/ports/365069

Log:
  Add new port comms/owfs

  PR:		189222
  Submitted by:	Johan (stromnet.se)

  OWFS -- 1-Wire file system.
  OWFS is an easy way to use the powerful 1-wire system of Dallas/Maxim.
  OWFS is a simple and flexible program to monitor and control the physical
  environment. You can write scripts to read temperature, flash lights, write
  to an LCD, log and graph, ...

Changes:
  head/comms/Makefile
  head/comms/owfs/
  head/comms/owfs/Makefile
  head/comms/owfs/Makefile.options
  head/comms/owfs/distinfo
  head/comms/owfs/pkg-descr
  head/comms/owfs/pkg-plist
Comment 34 John Marino freebsd_committer freebsd_triage 2014-08-16 09:18:28 UTC
Ok, for the next release, I'll recommend that you move Makefile.options back into makefiles, and don't list the options one per line.  Put as many on a line as you can and wrap before 80 columns

Once you do that, the Makefile.options really isn't that long and it makes everything in place and more readable.

Anyway, congrats, you have your port!
Comment 35 Johan Ström 2014-08-16 09:41:54 UTC
(In reply to John Marino from comment #34)
> Ok, for the next release, I'll recommend that you move Makefile.options back
> into makefiles, and don't list the options one per line.  Put as many on a
> line as you can and wrap before 80 columns
> 
> Once you do that, the Makefile.options really isn't that long and it makes
> everything in place and more readable.

Makes sense, will do!

> 
> Anyway, congrats, you have your port!

Yay! Thanks for your efforts on this one too :)