Bug 222699 - devel/viewvc: install without apache and lighttpd?
Summary: devel/viewvc: install without apache and lighttpd?
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Olli Hauer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-30 12:43 UTC by Zsolt Udvari
Modified: 2017-10-01 16:05 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (ohauer)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zsolt Udvari 2017-09-30 12:43:30 UTC
I'm using nginx web server and I think devel/viewvc should have on option about other web server than apache and lighttpd.
Comment 1 Olli Hauer freebsd_committer 2017-10-01 12:18:04 UTC
Perhaps the description of the of the option WEBSRV "Enable web server support" is a little bit misleading and should be changed to "Depend on the listed webservers"

In case you disable WEBSRV completely you are free to run viewvc with own limited webserver support from the viewvc rc script or in your case nginx the only downside is the dependency on that webserver is not registered in the package.

In case you have a small config sample for nginx we can also add it to the pkg-message.
Comment 2 Zsolt Udvari 2017-10-01 12:39:57 UTC
Hm, maybe I do it something wrong:

# make showconfig
===> The following configuration options are available for viewvc-1.1.26:
     WEBSRV=on: Enable web server support
     APMOD=off: depend on optional Apache module
     SVN=on: Subversion support
     MYSQL=off: Bonsai-like repository query facilities
====> Enable web server support: you have to select exactly one of them
     APACHE=on: Apache server support
     LIGHTTPD=off: Lighttpd server support
====> depend on optional Apache module: you have to select exactly one of them
     MODPYTHON33=off: Add mod_python33 to the list of package dependencies
     MODPYTHON35=off: Add mod_python35 to the list of package dependencies
     MODWSGI=off: Add mod_wsgi to the list of package dependencies
===> Use 'make config' to modify these settings

# make run-depends-list
/usr/ports/devel/py-subversion
/usr/ports/lang/python27
/usr/ports/textproc/py-pygments
/usr/ports/www/apache24

# make config

# make showconfig
===> The following configuration options are available for viewvc-1.1.26:
     WEBSRV=off: Enable web server support
     APMOD=off: depend on optional Apache module
     SVN=on: Subversion support
     MYSQL=off: Bonsai-like repository query facilities
====> Enable web server support: you have to select exactly one of them
     APACHE=off: Apache server support
     LIGHTTPD=off: Lighttpd server support
====> depend on optional Apache module: you have to select exactly one of them
     MODPYTHON33=off: Add mod_python33 to the list of package dependencies
     MODPYTHON35=off: Add mod_python35 to the list of package dependencies
     MODWSGI=off: Add mod_wsgi to the list of package dependencies
===> Use 'make config' to modify these settings

# make run-depends-list
/usr/ports/devel/py-subversion
/usr/ports/lang/python27                                                                                                                            
/usr/ports/textproc/py-pygments                                                                                                                     
/usr/ports/www/apache24      


Note that in the second case the WEBSRV (and APACHE too) is off but viewvc depends on www/apache24.


A simple nginx configuration to use viewvc:

server {
    location ~ ^/viewvc.cgi$ {
      fastcgi_pass unix:/var/run/fcgiwrap/fcgiwrap.sock;
      fastcgi_param DOCUMENT_ROOT $document_root;
      fastcgi_param SCRIPT_FILENAME /usr/local/viewvc/bin/cgi/viewvc.cgi;
    }
    location ~ ^/$ {
      rewrite .* http://$host/viewvc.cgi;
      break;
    }
    location ^~ /templates {
    }
    location ~ /(.+)$ {
      fastcgi_pass unix:/var/run/fcgiwrap/fcgiwrap.sock;
      fastcgi_param DOCUMENT_ROOT $document_root;
      fastcgi_param SCRIPT_FILENAME /usr/local/viewvc/bin/cgi/viewvc.cgi;
      fastcgi_param PATH_INFO $1;
      fastcgi_param QUERY_STRING $query_string;
    }
}

Of course can use proxy_pass if viewvc is running as daemon.
Comment 3 Zsolt Udvari 2017-10-01 12:47:27 UTC
One more question: I see that similar projects (devel/cgit, devel/websvn, devel/gitlist, ...) install files into WWWDIR. Maybe viewvc should install into WWWDIR too?
Comment 4 Zsolt Udvari 2017-10-01 13:13:50 UTC
I did a poudriere bulk:

$ pkg query -F viewvc-1.1.26.txz "%Ok %Ov"                                                                                                          
WEBSRV off                                                                                                                                          
APMOD off                                                                                                                                           
SVN on                                                                                                                                              
MYSQL off                                                                                                                                           
APACHE off                                                                                                                                          
LIGHTTPD off                                                                                                                                        
MODPYTHON33 off                                                                                                                                     
MODPYTHON35 off                                                                                                                                     
MODWSGI off

$ pkg query -F viewvc-1.1.26.txz "%do"                                                                                                              
www/apache24                                                                                                                                        
textproc/py-pygments                                                                                                                                
devel/py-subversion                                                                                                                                 
lang/python27
Comment 5 Olli Hauer freebsd_committer 2017-10-01 13:52:12 UTC
Hm, seems there has something changed in the dependency checking.

I've tried your example config and it seems the APACHE flag is cleared only after running 'make config' a second time even it should not be used in the Makefile.

Do you have different poudriere builds or just one?
In case of one you can check it the option is really disabled in etc/poudriere.d/options/devel_viewvc/options.
The exact place for your poudriere options directory should be shown during the poudriere run in my jenkins log it is this line
--> [00:00:02] Copying /var/db/ports from: /usr/local/etc/poudriere.d/options
[00:00:02] Appending to make.conf: /usr/local/etc/poudriere.d/make.conf
Comment 6 Zsolt Udvari 2017-10-01 15:19:03 UTC
(In reply to Olli Hauer from comment #5)
I checked the Makefile. Do I see right the APACHE and LIGHTTPD option causes only a run-time dependency? So no other building option, no plus installed file?

But I don't understand if APACHE=off (query "%Ok - %Ov") why wants apache24 (query "%do")? Second build is same.
Comment 7 Olli Hauer freebsd_committer 2017-10-01 15:47:39 UTC
In the port we try the following.
iff WEBSRV=on honor APACHE and LIGHTTP
additional
iff APACHE=on honor MODPYTHON33 MODPYTHON35 MODWSGI

or
iff WEBSRV=on automatically disable APACHE, LIGHTTP, MODPYTHON33 MODPYTHON35 MODWSGI

It seems this is no longer written to the options file the way it worked some years ago.
In my tests (make rmconfig ; make config ; cat /var/db/ports/devel_viewvc/options)
OPTIONS_FILE_UNSET+=APACHE was only set after disabling WEBSRV saving the options and running make config a second time.
After the second time apache was set to UNSET and no longer a dependency.

Will do some tests the next days, perhaps going back to the old $PORT_OPTIONS:MAPACHE} notation instead APACHE_USE ... will bring back the old dependency handling
Comment 8 Zsolt Udvari 2017-10-01 16:05:15 UTC
(In reply to Olli Hauer from comment #7)
"or
iff WEBSRV=on automatically disable"
WEBSRV=off, imho :)

Does the WEBSRV is needed? I think can remove the whole WEBSRV-infrastructure is unnecessary.
Almost all web-application doesn't have a dependency to a webserver only the needed PHP/python/Ruby/... modules.

I think your idea would be useful when the ports system would support a "provide"-flag, for example apache/lighttpd/nginx/... would provide a "webserver" flag, mplay/vlc/smplayer/... would provide a "mediaplayer" flag, firefox/chrome/opera/... provide a "browser", etc.
And in this case devel/viewvc, mail/roundcube requires (or suggests) a "webserver".