Bug 200040 - [PATCH] www/zope213: fails to start using pkg-message instructions
Summary: [PATCH] www/zope213: fails to start using pkg-message instructions
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Ruslan Makhmatkhanov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-08 01:11 UTC by Jason Unovitch
Modified: 2018-09-17 14:25 UTC (History)
2 users (show)

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


Attachments
www/zope213 patch to resolve the issues I opened the PR for (5.67 KB, patch)
2015-05-08 01:23 UTC, Jason Unovitch
no flags Details | Diff
Poudriere testport build logs from 10.1-RELEASE amd64 (320.52 KB, text/x-log)
2015-05-08 01:23 UTC, Jason Unovitch
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Unovitch freebsd_committer 2015-05-08 01:11:30 UTC
www/zope213 currently does not provide enough information to start Zope by default.  The pkg-message currently instructs the user to execute the following command:

/usr/local/bin/mkzopeinstance --dir <INSTANCEDIR>

Assuming the user start Zope afterwards, it will start and die because firstly the effective-user is not set and even it it were the permissions on var and log are incorrect.  If the user installs the package they are either stuck with needing implied knowledge on Zope to fix it, run things in debug mode and stumble through the errors as I did, or lastly look at what `make instance` in the port is doing.  This can be very confusing for a new user and a prior topic I saw went unanswered [Ref 1]. Another mailing list topic indicates that it should be easy and just work [Ref 2].

[1] https://lists.freebsd.org/pipermail/freebsd-zope/2014-May/000283.html

[2] https://lists.freebsd.org/pipermail/freebsd-zope/2013-November/000169.html
"What's plonectl? In FreeBSD it have no individual start-up script - you 
just starting zope with plone installed.
Just start it with `service zope213 start` and add zope213_enable="YES" 
in /etc/rc.conf to survive the reboot. That's all."
Comment 1 Jason Unovitch freebsd_committer 2015-05-08 01:23:09 UTC
Created attachment 156487 [details]
www/zope213 patch to resolve the issues I opened the PR for

Summary
- Clean up port and remove `make instance` functionality that duplicates native Zope tool functionality
- Standardize and ensure pkg-message instructions correctly set up Zope
- Make Portlint and Poudriere testport clean
- Set NO_ARCH

Details:
1.  The `make instance` functionality has been removed to remove duplication with what is is the pkg-message.  This one I need the most feedback on as I wanted to start with the patch that provides the simplest and cleanest solution to the problem.  If the maintainer would like this functionality, I will be glad to revise the patch.

2.  Currently, the legacy method of cat'ing pkg-message is used and there are 3 pkg-message files: 
  package-pkg-message.in (displayed after package install)
  instance-message.in (displayed after instance creation)
  pkg-message.in (displayed after post install (port?))

This consolidates the messages into one and removes the interesting Makefile logic required to display them originally.

3.  Portlint originally flagged this which was cleaned up with the pkg-message handling fixes:
WARN: Makefile: [120]: do not use muted INSTALL_foo commands (i.e., those that start with '@').  These should be printed.
0 fatal errors and 1 warning found.

4.  NO_ARCH was added per Poudriere given that this is all Python files.
Comment 2 Jason Unovitch freebsd_committer 2015-05-08 01:23:45 UTC
Created attachment 156488 [details]
Poudriere testport build logs from 10.1-RELEASE amd64
Comment 3 commit-hook freebsd_committer 2015-07-03 21:11:31 UTC
A commit references this bug:

Author: rm
Date: Fri Jul  3 21:11:17 UTC 2015
New revision: 391274
URL: https://svnweb.freebsd.org/changeset/ports/391274

Log:
  www/zope213: make this port usable when installed from packages

  Both ports users and package users now follow uniform procedure of creating
  application instance.

  Summary:
  - Clean up port and remove `make instance` functionality that duplicates native
    Zope tool functionality
  - Standardize and ensure pkg-message instructions correctly set up Zope
  - Make Portlint and Poudriere testport clean
  - Set NO_ARCH

  PR:		200040
  Submitted by:	Jason Unovitch <jason.unovitch@gmail.com>
  MFH:		2015Q3

Changes:
  head/www/zope213/Makefile
  head/www/zope213/files/instance-message.in
  head/www/zope213/files/package-pkg-message.in
  head/www/zope213/files/pkg-message.in
  head/www/zope213/files/zope.conf_changes
Comment 4 Ruslan Makhmatkhanov freebsd_committer 2015-07-03 21:13:06 UTC
Committed, thanks a lot!
Comment 5 commit-hook freebsd_committer 2015-07-14 19:56:16 UTC
A commit references this bug:

Author: rm
Date: Tue Jul 14 19:55:38 UTC 2015
New revision: 392069
URL: https://svnweb.freebsd.org/changeset/ports/392069

Log:
  MFH: r391274

  www/zope213: make this port usable when installed from packages

  Both ports users and package users now follow uniform procedure of creating
  application instance.

  Summary:
  - Clean up port and remove `make instance` functionality that duplicates native
    Zope tool functionality
  - Standardize and ensure pkg-message instructions correctly set up Zope
  - Make Portlint and Poudriere testport clean
  - Set NO_ARCH

  PR:		200040
  Submitted by:	Jason Unovitch <jason.unovitch@gmail.com>
  Approved by:    ports-secteam (feld)

Changes:
_U  branches/2015Q3/
  branches/2015Q3/www/zope213/Makefile
  branches/2015Q3/www/zope213/files/instance-message.in
  branches/2015Q3/www/zope213/files/package-pkg-message.in
  branches/2015Q3/www/zope213/files/pkg-message.in
  branches/2015Q3/www/zope213/files/zope.conf_changes
Comment 6 leeb 2018-09-16 18:38:38 UTC
This fails on 11.2-RELEASE-p3, it looks like a missing dependency www/py-html5lib (see below for full transcript).
After installing that second package, I was able to install and onestart the service successfully.

#pkg install plone
#root@freebsd:/ # /usr/local/bin/mkzopeinstance --dir /usr/local/www/Zope213/
Traceback (most recent call last):
  File "/usr/local/bin/mkzopeinstance", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3095, in <module>
    @_call_aside
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3079, in _call_aside
    f(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3108, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 570, in _build_master
    ws.require(__requires__)
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 888, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 774, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'html5lib>=0.999999999' distribution was not found and is required by mechanize

root@freebsd:/ # pkg install www/py-html5lib
root@freebsd:/ # /usr/local/bin/mkzopeinstance --dir /usr/local/www/Zope213/
Please choose a username and password for the initial user.
These will be the credentials you use to initially manage
your new Zope instance.

Username:
Comment 7 Ruslan Makhmatkhanov freebsd_committer 2018-09-17 14:25:17 UTC
This is definitely not a zope issue, because zope itself doesn't depend on html5lib:

[rm@smsh-zfs Zope2-2.13.24]> grep -ri html5 .
[rm@smsh-zfs Zope2-2.13.24]> 

The problem is somewhere in plone dependencies. I'll try to figure it out.