Bug 273260 - www/hs-gitit: Restore and update to 0.15.1.1
Summary: www/hs-gitit: Restore and update to 0.15.1.1
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Robert Clausecker
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-21 10:48 UTC by Johannes 5
Modified: 2023-09-24 19:01 UTC (History)
1 user (show)

See Also:


Attachments
www/hs-gitit: Restore and update to 0.15.1.1 (145.38 KB, patch)
2023-08-21 10:48 UTC, Johannes 5
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes 5 2023-08-21 10:48:52 UTC
Created attachment 244247 [details]
www/hs-gitit: Restore and update to 0.15.1.1

gitit is a pandoc based wiki software written in Haskell. It uses
flat file content, version controlled by git, darcs, or mercurial.

www/hs-gitit 0.12.2.1_3 was expired on 2018-10-23 [1].
The attached patch restores and updates the gitit port to 0.15.1.1.
The patch is also available at ...

	<ftp://wrap7.free.de/pub/patch/hs-gitit.patch.20230820>
	MD5 (hs-gitit.patch.20230820) = fa2fc9a8aa81d6bf128747c2e161dcc6

... and adds the following features:

- Enable DocBook as a source format.
- Generation of the initial wiki pages (Front Page, User’s Guide, Help)
  now uses pandoc's extended Markdown. This fixes
  - Help.page generation if DocBook is the wiki's default format
  - using the patch's added help contents for the DocBook format.
- OPTION EXPORTS to re-enable exporting wiki pages in many formats.
  - This non-default OPTION reverts [2] - use with care.
  - Add boolean attribute "exports" to gitit's configuration file.
  - Add attribute "pdf-engine" to gitit's configuration file.
- An rc.d script to run multiple wiki instances in parallel.

Output from poudriere testport on 13.2-STABLE amd64 is available: [3].
% portlint -A
WARN: Makefile: PLUGINS is listed in OPTIONS_DEFINE, but no PORT_OPTIONS:MPLUGINS appears.
0 fatal errors and 1 warning found.

If someone else (e.g. haskell@) wants to take maintainership then
please go ahead:-) I'm neither a cabal user nor a Haskell programmer -
I was just lucky when producing this port: using make-use-cabal
immediately after the release of gitit 0.15.1.1. A few days before that
(with 0.15.1.0) make-use-cabal had sent me to cabal hell;-(

Thank you for considering this patch!
Johannes

[1] <https://cgit.freebsd.org/ports/commit/www/hs-gitit?id=8e9a7e6ae177f3564836ad6a0737c36eb9d60870>
[2] <https://github.com/jgm/gitit/commit/eed32638f4f6e3b2f4b8a9a04c4b72001acf9ad8>
[3] <http://mesh-j-3.free.de/poudriere/hs-gitit/0.15.1.1/>
Comment 1 Robert Clausecker freebsd_committer freebsd_triage 2023-09-22 15:27:54 UTC
Thank you for your submission.  I'm sorry for the slow processing.
Port looks ok, but I wonder if you need

    @dir /var/gitit

or something so the rc script works.
Currently doing a build test.
Comment 2 Johannes 5 2023-09-23 15:05:28 UTC
(In reply to Robert Clausecker from comment #1)

> Thank you for your submission.  I'm sorry for the slow processing.

Don't worry. You're talking about *weeks* - but my effort of restoring
www/hs-gitit has been overdue for *years*-)

> Port looks ok, but I wonder if you need
>     @dir /var/gitit
> or something so the rc script works.

Oops, I didn't check that case (i.e. variable gitit_instance_chdir not
set by the user) because I've been using multiple instances with
seperate user ids and instance directories all the time, e.g.:

% cat /usr/local/etc/rc.conf.d/gitit/COMMON 
# gitit defaults:
gitit_enable="YES"
gitit_cfg=
#gitit_runuser="gitit"
gitit_chdir="/var/gitit"
gitit_config="wikidata/_NOWIKI/gitit.conf"
gitit_supervise="YES"
gitit_locale="de_DE.UTF-8"
gitit_flags="+RTS -I0 -RTS"

% cat /usr/local/etc/rc.conf.d/gitit/gitit
# ~gitit/wiki
#gitit_gitit_enable="NO"
gitit_cfg="${gitit_cfg} gitit"
gitit_gitit_runuser="gitit"
gitit_gitit_chdir="/home/gitit/public_html/wiki"
gitit_gitit_port="5005"

Hence my rc.d/gitit is tailored to this (multi-instance) usage.
Unfortunately, an effective solution for the simple&single instance
case would require more work, e.g.:

# /usr/local/etc/rc.d/gitit onestart
Starting gitit.
chgrp: gitit: illegal group name

To give the user of the package an out of the box experience like ...

  pkg install -y hs-gitit && \
  /usr/local/etc/rc.d/gitit onestart && \
  mybrowser http://127.0.0.1:5001/

... then package installation had to accomplish (at least) the
following:

- add user and group gitit
  - by adding USER=/GROUP=gitit to the port's Makefile
- create a base directory for the wiki instance
  - using pkg-plist
  - in /var or in /home?
  - give it to the gitit user and group
- create a configuration file in that directory
  - gitit --print-default-config > gitit.conf
  - which contains "address: 0.0.0.0" or "... 127.0.0.1"?
  - give it to the gitit user and group
- rc.d/gitit (one)start will try to initialize the instance, which
  requires the availability of either git, darcs, or hg
  - which DVCS ist used for the instance is defined in its config file
    ("repository-type: ...")
  - make the package's default DVCS selectable using a port's OPTION?

If you think that "out of the box" would help to make gitit more
attractive to potential users, then I'm certainly willing to work on
it. If you have any other / additional suggestions, please let me know.

Otherwise a pkg-message with suitable instructions (rc.conf, adduser,
mkdir, chown, httpd.conf?, ...) might suffice. In this case 
"@dir /var/gitit" should probably be added for the simple&single use
case as well.

> Currently doing a build test.

Did all go well? I'm sorry that I can supply poudriere output only for
13.2-STABLE/amd64 currently.

Muito obrigado! (<= EuroBSDCon 2023 took place in Coimbra.pt:)
Johannes
Comment 3 Robert Clausecker freebsd_committer freebsd_triage 2023-09-23 15:17:05 UTC
(In reply to Johannes 5 from comment #2)

Hi Johannes,

You can do it either way.  If you want the "user must set it up him/herself"
route, then please document the steps that need to be done and add a pkg-message
so the user is informed that it's not an out-of-the-box experience.  You should
then also probably remove the gitit user name from the rc.d script so there's no
confusion as to why it doesn't exist.
Comment 4 commit-hook freebsd_committer freebsd_triage 2023-09-24 19:00:10 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7fa7c89ce00609a13b933c096eda065d3eb578c7

commit 7fa7c89ce00609a13b933c096eda065d3eb578c7
Author:     Johannes 5 Joemann <joemann@beefree.free.de>
AuthorDate: 2023-08-20 18:16:05 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-09-24 18:57:13 +0000

    www/hs-gitit: Restore and update to 0.15.1.1

    Gitit is a wiki program written in Haskell. It uses Happstack for the
    web server and pandoc for markup processing. Pages and uploaded files
    are stored in a git, darcs, or mercurial repository and may be
    modified either by using the VCS's command-line tools or through
    the wiki's web interface. By default, pandoc's extended version of
    markdown is used as a markup language, but reStructuredText, LaTeX,
    HTML, DocBook, or Emacs Org-mode markup can also be used. Gitit can
    be configured to display TeX math (using texmath) and highlighted
    source code (using highlighting-kate).

    Other features include

     * plugins: dynamically loaded page transformations written in
       Haskell (see "Network.Gitit.Interface")
     * categories
     * caching
     * Atom feeds (site-wide and per-page)
     * a library, "Network.Gitit", that makes it simple to include
       a gitit wiki in any happstack application

    WWW: https://github.com/jgm/gitit

    PR:             273260

 MOVED                                              |   1 -
 www/Makefile                                       |   1 +
 www/hs-gitit/Makefile (new)                        | 244 +++++++
 www/hs-gitit/distinfo (new)                        | 513 ++++++++++++++
 .../files/extra-patch-data_default.conf (new)      |  22 +
 www/hs-gitit/files/extra-patch-exports (new)       | 612 +++++++++++++++++
 .../extra-patch-src_Network_Gitit_Config.hs (new)  |  22 +
 .../extra-patch-src_Network_Gitit_Export.hs (new)  |  31 +
 .../extra-patch-src_Network_Gitit_Layout.hs (new)  |  11 +
 .../extra-patch-src_Network_Gitit_Types.hs (new)   |  15 +
 www/hs-gitit/files/gitit.in (new +x)               | 236 +++++++
 ...s_filestore-0.6.5_Data_FileStore_Darcs.hs (new) |  22 +
 ...h-__cabal__deps_pandoc-3.1.4_pandoc.cabal (new) |  11 +
 www/hs-gitit/files/patch-data_markup.DocBook (new) | 748 +++++++++++++++++++++
 .../files/patch-data_markupHelp_DocBook (new)      | 125 ++++
 www/hs-gitit/files/patch-gitit.cabal (new)         |  31 +
 .../patch-src_Network_Gitit_Initialize.hs (new)    |  14 +
 .../files/patch-src_Network_Gitit_Util.hs (new)    |  10 +
 www/hs-gitit/pkg-descr (new)                       |  19 +
 www/hs-gitit/pkg-plist (new)                       |  71 ++
 20 files changed, 2758 insertions(+), 1 deletion(-)
Comment 5 Robert Clausecker freebsd_committer freebsd_triage 2023-09-24 19:01:28 UTC
Thank you for your contribution.