Bug 191979 - new port: www/libevhtp - A more flexible replacement for libevent's httpd API
Summary: new port: www/libevhtp - A more flexible replacement for libevent's httpd API
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Some People
Assignee: John Marino
URL: https://github.com/ellzey/libevhtp
Keywords: easy
Depends on:
Blocks:
 
Reported: 2014-07-20 04:02 UTC by Jingfeng Yan
Modified: 2014-09-06 05:16 UTC (History)
1 user (show)

See Also:
yan_jingfeng: exp-run?


Attachments
shar-based port files (2.29 KB, application/x-shar)
2014-07-20 04:02 UTC, Jingfeng Yan
no flags Details
new shar file, remove one line from old Makefile (2.29 KB, application/x-shar)
2014-08-19 03:05 UTC, Jingfeng Yan
no flags Details
test log (62.24 KB, text/plain)
2014-08-19 03:06 UTC, Jingfeng Yan
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jingfeng Yan 2014-07-20 04:02:11 UTC
Created attachment 144806 [details]
shar-based port files

Port Overview

"Libevhtp was created as a replacement API for Libevent's current HTTP API. The reality of libevent's http interface is that it was created as a JIT server, meaning the developer never thought of it being used for creating a full-fledged HTTP service. Infact I am under the impression that the libevent http API was designed almost as an example of what you can do with libevent. It's not Apache in a box, but more and more developers are attempting to use it as so." 

Target usage:
seafile server
Comment 1 John Marino freebsd_committer freebsd_triage 2014-07-31 16:24:57 UTC
Can you provide test logs from poudriere or redports or at least the output from "make check-plist" followed by "make stage-qa" ?
Comment 2 John Marino freebsd_committer freebsd_triage 2014-07-31 16:38:25 UTC
If you choose poudriere, make sure you use either "poudriere testport" or "poudriere bulk -t" in order to enable stage-qa checks, thanks!
Comment 3 Jingfeng Yan 2014-08-13 01:49:42 UTC
Working on it.  Sorry for delaying because I am out of town for vacation.
Comment 4 Jingfeng Yan 2014-08-18 04:44:01 UTC
(In reply to Jingfeng Yan from comment #3)
> Working on it.  Sorry for delaying because I am out of town for vacation.

[jyan@sfv20z:/usr/ports/www/libevhtp] $ sudo make stage-qa
====> Running Q/A tests (stage-qa)
[jyan@sfv20z:/usr/ports/www/libevhtp] $ sudo make check-plist
====> 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)

Continue working on poudriere.  However, there is something that I need to learn first.  When using  poudriere, I found that most of INCLUDE PATH has extra prefix "/wrkdirs". However, I set some include path by using ${DESTDIR}/${PREFIX}/ (which originally refers to /usr/local/) will not have "/wrkdirs". Do I miss any thing there?  

In addition, for example, this port depends on other lib, where this dependency installed (in jail, or after build everything cleaned)?

Thank you.
Comment 5 John Marino freebsd_committer freebsd_triage 2014-08-18 06:19:33 UTC
I'm afraid I don't understand the question.  You shouldn't be worried about /wrkdirs at all.  Poudriere is just a build test tool (in this case); your port should have no knowledge of how it works.

Is your port hardcoding "/usr/local" ?
Comment 6 Jingfeng Yan 2014-08-18 16:04:08 UTC
No, I use ${DESTDIR}/${PREFIX}/include/...  But All the other CMAKE detected header paths are from /wrkdir/usr/local/...;  The only one that I manually added for event2 lib use

${DESTDIR}/${PREFIX}/include/event2

does not translated into /wrkdir/usr/local/include/event2, but usr/local/include/event2.
Comment 7 John Marino freebsd_committer freebsd_triage 2014-08-18 18:04:43 UTC
(In reply to Jingfeng Yan from comment #6)
> ${DESTDIR}/${PREFIX}/include/event2
> 
> does not translated into /wrkdir/usr/local/include/event2, but
> usr/local/include/event2.

That's correct.
You shouldn't be referencing anything in /wrkdirs outside of ${STAGEDIR}.
Comment 8 Jingfeng Yan 2014-08-19 03:05:40 UTC
Created attachment 146014 [details]
new shar file, remove one line from old Makefile

remove one line from old Makefile (it is not necessary to be there and cause test failure)
Comment 9 Jingfeng Yan 2014-08-19 03:06:51 UTC
Created attachment 146015 [details]
test log
Comment 10 Jingfeng Yan 2014-08-19 03:10:02 UTC
(In reply to John Marino from comment #7)
> (In reply to Jingfeng Yan from comment #6)
> > ${DESTDIR}/${PREFIX}/include/event2
> > 
> > does not translated into /wrkdir/usr/local/include/event2, but
> > usr/local/include/event2.
> 
> That's correct.
> You shouldn't be referencing anything in /wrkdirs outside of ${STAGEDIR}.

Remove the line for include path and lib path.  It seems that my old FreeBSD9.2 machine has something not in correct state. 

The new shar file is tested under pouderire, a clean installed VM (9.2, and 9.3) AMD 64.
Comment 11 John Marino freebsd_committer freebsd_triage 2014-08-19 06:16:52 UTC
Excellent, now it's patch-ready (ready for a committer to evaluate it and hopefully commit it)
Comment 12 John Marino freebsd_committer freebsd_triage 2014-08-19 09:47:39 UTC
careful, you are mixing up tabs and spaces in the makefile.

Tabs are always 8-characters log, and true tabs (not spaces).

Generally after a "=" character comes a tabs.

The columns are generally aligned at 2 tabs, sometimes 3 for things like option descriptions.
Comment 13 John Marino freebsd_committer freebsd_triage 2014-08-19 09:51:11 UTC
also don't forget to run portlint:

root@Niner:/home/marino/svnhub/freebsd-ports/www/libevhtp # portlint
WARN: Makefile: DISTNAME is ${PORTNAME}-${PORTVERSION} by default, you don't nee
d to define DISTNAME.
0 fatal errors and 1 warning found.


That just told you "don't define DISTNAME in this case"
Comment 14 John Marino freebsd_committer freebsd_triage 2014-08-19 09:52:25 UTC
your pkg-plist is only 5 lines long, so I'm going to move it into the makefile with PLIST_FILES= definition to eliminate pkg-plist completely.
Comment 15 John Marino freebsd_committer freebsd_triage 2014-08-19 10:09:35 UTC
Bad news, this failed on all 8 platforms I tested:

https://redports.org/buildarchive/20140819100230-61339/

(Ignore bogus 8.4/amd64 failure)

This is the port as tested:
https://redports.org/browser/jmarino/www/libevhtp

Failure is different on FreeBSD 8/9 than 10/11 so you have multiple problems.
Comment 16 John Marino freebsd_committer freebsd_triage 2014-08-19 10:11:45 UTC
This looks highly suspicious:
CMAKE_ARGS=     -DCMAKE_INCLUDE_PATH:PATH=${DESTDIR}/${PREFIX}/include/event2 \
	        -DCMAKE_LIBRARY_PATH:PATH=${DESTDIR}/${PREFIX}/lib/event2

You don't normally refer to DESTDIR especially for external includes.
Comment 17 John Marino freebsd_committer freebsd_triage 2014-08-19 10:13:21 UTC
FYI, in the makefile, it's called ${STAGEDIR} not ${DESTDIR} anyway.

If you pass it like this, DESTDIR evaluates to nothing, so you are left with /${PREFIX}/include/event2
Comment 18 John Marino freebsd_committer freebsd_triage 2014-08-19 10:14:39 UTC
my guess is that you forgot to add the LIB_DEPENDS of devel/libevent2
Comment 19 John Marino freebsd_committer freebsd_triage 2014-08-19 10:15:18 UTC
nevermind, you added it. :(
Comment 20 John Marino freebsd_committer freebsd_triage 2014-08-19 10:19:35 UTC
on FreeBSD 10 I got further.  I removed ${DESTDIR}/${PREFIX} from those CMAKE lines and it almost finished:

=======================================================================
====> Running Q/A tests (stage-qa)
====> Checking for pkg-plist issues (check-plist)
===> Parsing plist
===> Checking for items in STAGEDIR missing from pkg-plist
Error: Orphaned: include/onigposix.h
===> Checking for directories owned by MTREEs
===> Checking for directories handled by dependencies
===> Checking for items in pkg-plist which are not in STAGEDIR
===> Error: Plist issues found.
*** Error code 1

It's just missing an entry in PLIST_FILES
Comment 21 John Marino freebsd_committer freebsd_triage 2014-08-19 10:31:01 UTC
Better, that builds on FreeBSD 9, 10, and 11:
https://redports.org/buildarchive/20140819102500-97472/

FreeBSD 8 probably needs a new assembler (easier to ask for USE_GCC=yes I guess)
Comment 22 John Marino freebsd_committer freebsd_triage 2014-08-19 10:34:33 UTC
I'm just going to mark it broken on FreeBSD 8 for now.
Comment 23 commit-hook freebsd_committer freebsd_triage 2014-08-19 10:41:19 UTC
A commit references this bug:

Author: marino
Date: Tue Aug 19 10:40:59 UTC 2014
New revision: 365370
URL: http://svnweb.freebsd.org/changeset/ports/365370

Log:
  Add new port www/libevhtp

  PR:		191979
  Submitted by:	JingFeng Yan

  Libevhtp was created as a replacement API for Libevent's current HTTP API.
  The reality of libevent's http interface is that it was created as a JIT
  server, meaning the developer never thought of it being used for creating a
  full-fledged HTTP service. The maintainer is under the impression that the
  libevent http API was designed almost as an example of what you can do with
  libevent. It's not Apache in a box, but more and more developers are
  attempting to use it as such.

Changes:
  head/www/Makefile
  head/www/libevhtp/
  head/www/libevhtp/Makefile
  head/www/libevhtp/distinfo
  head/www/libevhtp/pkg-descr
Comment 24 John Marino freebsd_committer freebsd_triage 2014-08-19 10:44:15 UTC
I don't know how you could have tested with poudriere and passed honestly, nor why that missing file didn't show.  Something is wrong with your test setup.

Anyway, the port is in and works for FreeBSD 9+
Comment 25 Jingfeng Yan 2014-08-19 17:35:46 UTC
(In reply to John Marino from comment #24)
> I don't know how you could have tested with poudriere and passed honestly,
> nor why that missing file didn't show.  Something is wrong with your test
> setup.
> 
> Anyway, the port is in and works for FreeBSD 9+

Thousands of thanks for your help for my first port. :) I really appreciate your efforts and detail guidelines.  I will try on 8.4 according to your suggestion.
Comment 26 John Marino freebsd_committer freebsd_triage 2014-08-19 19:05:32 UTC
(In reply to Jingfeng Yan from comment #25)
> Thousands of thanks for your help for my first port. :) I really appreciate
> your efforts and detail guidelines.  I will try on 8.4 according to your
> suggestion.


You are welcome!  That's not bad for a first try, either.