Re: NEW: www/mandoc-cgi-0.1.3

2011-10-02 Thread Kristaps Dzonsons

On 02/10/2011 10:22, Marc Espie wrote:

On Sun, Oct 02, 2011 at 12:28:09AM +0200, Ingo Schwarze wrote:

  - The naming is terrible, one is not even versioned, but i will talk
to Kristaps to fix that before the next mandoc-tools release.


Bad Kristaps. ;-) Obviously not used to work as an upstream developer
for packagers.

In the meantime, use DIST_SUBDIR, as everyone who has to deal with unversioned
distfiles does...


Bad Krista--what!  That's me!  ;)  After Ingo's mail I've added the 
versioning, removed the libmutf8 dep, and fixed some additional stuff he 
asked for.  Feel free to write me directly for fixes and changes and 
I'll get them in as soon as possible.


Thanks!

Kristaps



Re: NEW: www/mandoc-cgi-0.1.3

2011-10-02 Thread Ingo Schwarze
Hi,

Marc Espie wrote on Sun, Oct 02, 2011 at 10:22:52AM +0200:
> On Sun, Oct 02, 2011 at 12:28:09AM +0200, Ingo Schwarze wrote:

>>  - The naming is terrible, one is not even versioned, but i will talk
>>to Kristaps to fix that before the next mandoc-tools release.

> Bad Kristaps. ;-) Obviously not used to work as an upstream developer
> for packagers.
> 
> In the meantime, use DIST_SUBDIR, as everyone who has to deal with unversioned
> distfiles does...

Thanks for the hint.

Is the following correct an wanted?

Yours,
  Ingo

-- 
The casual porter is the best frequent asker.


Index: guide.html
===
RCS file: /cvs/www/faq/ports/guide.html,v
retrieving revision 1.13
diff -u -r1.13 guide.html
--- guide.html  21 Nov 2010 10:26:03 -  1.13
+++ guide.html  2 Oct 2011 10:27:37 -
@@ -193,13 +193,17 @@
 Ports normally correspond to given versions of software. Once they are 
retrieved, files are checksummed and compared to the recorded
 checksum(s) in distinfo. So, to avoid confusion, DISTFILES and PATCHFILES 
should have clearly visible version numbers:
 don't retrieve foo-latest.tar.gz if it is a link to foo-1.0.5.tar.gz.
-If necessary, gently ask the original program author to make such
-distinctions clear.
+If one of these files is only available with an unnumbered name,
+gently ask the original program author to make such distinctions clear.
+In the meantime, if you must use an unnumbered distribution file,
+set DIST_SUBDIR to what a reasonable DISTNAME would be, like foo-1.0.5,
+such that different, identically named versions of the distfile do not
+clash on the distribution file mirrors.
 
 If a given port needs more than about 5 DISTFILES + PATCHFILES to work, use 
DIST_SUBDIR to avoid cluttering
 DISTDIR (/usr/ports/distfiles by default) too much.
-
-DIST_SUBDIR must not include version numbers. When the port is updated to a 
later version, some distfiles may not change, but will be
+In this case, DIST_SUBDIR must not include version numbers.  When the port
+is updated to a later version, some distfiles may not change, but will be
 refetched if DIST_SUBDIR is changed. Even if all distfiles change, it is 
easier for the user to track cruft.
 
 All DISTFILES and PATCHFILES don't necessarily come from the same set of 
MASTER_SITES. Supplementary sites can be



Re: NEW: www/mandoc-cgi-0.1.3

2011-10-02 Thread Marc Espie
On Sun, Oct 02, 2011 at 12:28:09AM +0200, Ingo Schwarze wrote:
>  - The naming is terrible, one is not even versioned, but i will talk
>to Kristaps to fix that before the next mandoc-tools release.

Bad Kristaps. ;-) Obviously not used to work as an upstream developer
for packagers.

In the meantime, use DIST_SUBDIR, as everyone who has to deal with unversioned
distfiles does...



NEW: www/mandoc-cgi-0.1.3

2011-10-01 Thread Ingo Schwarze
Hi,

here is a first draft port of the new system to search and display
manual pages online.  Kristaps has first presented this system
publicly during BSDCan 2011 in Ottawa.

The attached tarball contains three ports:

 * devel/libmutf8-0.2.3
   minimal library to validate UTF-8 encoded C strings

 * textproc/libhtml-0.3.3
   minimal C library for HTML and XHTML documents

 * www/mandoc-cgi-0.1.3
   search and display manual pages on the web

The first two are pure BUILD_DEPENDS for the latter.

Using the port requires using the very simple base system
patch i include below:  It enables building and installing the
mandocdb utility required to build the mandoc database
used by the CGI interface.

Apply the patch like this:

  cd /usr/src/usr.bin/mandoc/
  cvs up -dP
  patch < this.patch
  make cleandir
  make obj
  make depend
  make
  sudo make install

This doesn't require upgrading any other part of your system.
After that, build all three ports, install mandoc-cgi-0.1.3,
and follow the instructions in:
  /usr/local/share/doc/pkg-readmes/mandoc-cgi-0.1.3

For testing, try stuff like this:

 * Enter "/var/backups" as the search pattern,
   select "Paths" in the "Show only" box,
   and you see which tools populate that directory.
 * Enter "PAGER" and show only: "Environment Variables",
   and you see which utilities respect that variable.
 * Enter "EILSEQ" and show only: "Error codes"
   and you see which calls produce that obscure error code.
 * Enter "Gray" and show only: "Authors"
   and you see part of what Jonathan did.


Eventually, the plan is to use this to improve
  http://www.openbsd.org/cgi-bin/man.cgi

Obviously, it is not yet compatible enough; but if you don't need
backward compatibility, it's already usable, and i'd like to
get it in to tweak it in the tree.

Some aspects are ugly, but i don't see how to avoid them:
 - The www/mandoc-cgi port requires two distribution tarballs.
 - The naming is terrible, one is not even versioned, but i will talk
   to Kristaps to fix that before the next mandoc-tools release.
 - The port downloads and recompiles part of a different
   distribution of mandoc(1) than the one we have in base.
   However, i consider that better than reacharound from ports
   to /usr/src/usr.bin/mandoc, and the code is nearly identical.
 - The fixed paths and even more the stripping of /var/www/
   in mandoc-cgi.c are ugly hacks, this will be improved later.
 - The interface is not yet compatible with man.cgi;
   that will be worked on.

Comments?
  Ingo


Index: Makefile
===
RCS file: /cvs/src/usr.bin/mandoc/Makefile,v
retrieving revision 1.60
diff -u -p -r1.60 Makefile
--- Makefile18 Sep 2011 15:54:48 -  1.60
+++ Makefile1 Oct 2011 21:26:43 -
@@ -18,7 +18,12 @@ SRCS+=   main.c mdoc_term.c chars.c term.c
 SRCS+= mdoc_man.c
 SRCS+= html.c mdoc_html.c man_html.c out.c eqn_html.c
 SRCS+= term_ps.c term_ascii.c tbl_term.c tbl_html.c
+SRCS+= mandocdb.c
 
 PROG=  mandoc
+
+LINKS= ${BINDIR}/mandoc ${BINDIR}/mandocdb
+
+MAN=   mandoc.1 mandocdb.8
 
 .include 
Index: main.c
===
RCS file: /cvs/src/usr.bin/mandoc/main.c,v
retrieving revision 1.78
diff -u -p -r1.78 main.c
--- main.c  17 Sep 2011 14:45:22 -  1.78
+++ main.c  1 Oct 2011 21:26:44 -
@@ -57,6 +57,8 @@ structcurparse {
char  outopts[BUFSIZ]; /* buf of output opts */
 };
 
+int  mandocdb(int, char**);
+
 static int   moptions(enum mparset *, char *);
 static void  mmsg(enum mandocerr, enum mandoclevel,
const char *, int, int, const char *);
@@ -82,6 +84,9 @@ main(int argc, char *argv[])
progname = argv[0];
else
++progname;
+
+   if (0 == strncmp(progname, "mandocdb", 8))
+   return(mandocdb(argc, argv));
 
memset(&curp, 0, sizeof(struct curparse));
 
Index: mandocdb.c
===
RCS file: /cvs/src/usr.bin/mandoc/mandocdb.c,v
retrieving revision 1.2
diff -u -p -r1.2 mandocdb.c
--- mandocdb.c  17 Sep 2011 13:45:28 -  1.2
+++ mandocdb.c  1 Oct 2011 21:26:45 -
@@ -252,7 +252,7 @@ static  const pmdoc_nfmdocs[MDOC_MAX] 
 static const char   *progname;
 
 int
-main(int argc, char *argv[])
+mandocdb(int argc, char *argv[])
 {
struct mparse   *mp; /* parse sequence */
enum op  op; /* current operation */



mandoc-cgi-0.1.3.tgz
Description: application/tar-gz