Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 223339

Summary: www-apps/cgit-9999
Product: Gentoo Linux Reporter: Christoph Brill (egore) (RESIGNED) <egore>
Component: New packagesAssignee: Lance Albertson (RETIRED) <ramereth>
Status: RESOLVED FIXED    
Severity: normal CC: bertrand, bugs, duncan, flameeyes, hans, matthew.m.mccormick, nakal, oahong, pva, yang
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://hjemli.net/git/cgit/
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: www-apps/cgit-9999
files/postinstall-en.txt
www-apps/cgit-9999.ebuild
Adapted the ebuild for latest stable version v0.8.1
cgitrc
Sample cgitrc with fixed typo
Bumped (with small modification) for cgit-0.8.1.1
www-apps/cgit-0.8.2
ebuild for 0.8.2.1 version with few improvements
Now right ebuild
Postinstall with warning about possible configs
ebuild with data/binary split via USE-flags
valid metadata.xml with use descriptions

Description Christoph Brill (egore) (RESIGNED) 2008-05-23 12:03:23 UTC
a fast web-interface for git repositories
Comment 1 Christoph Brill (egore) (RESIGNED) 2008-05-23 12:05:46 UTC
Created attachment 154057 [details]
www-apps/cgit-9999
Comment 2 Christoph Brill (egore) (RESIGNED) 2008-05-23 12:06:01 UTC
Created attachment 154059 [details]
files/postinstall-en.txt
Comment 3 Christoph Brill (egore) (RESIGNED) 2008-05-23 12:07:26 UTC
Diego, according to [1] this might be interesting for you. Please review/test.

[1] http://blog.flameeyes.eu/articles/tag/git
Comment 4 Christoph Brill (egore) (RESIGNED) 2008-05-23 12:12:33 UTC
Created attachment 154061 [details]
www-apps/cgit-9999.ebuild

Logo path was wrong
Comment 5 Thomas Green 2008-10-18 12:46:41 UTC
Created attachment 168914 [details]
Adapted the ebuild for latest stable version v0.8.1
Comment 6 Thomas Green 2008-10-18 12:50:09 UTC
Created attachment 168916 [details]
cgitrc

Upstream no longer includes an example cgitrc separately, they have cgitrc.5.txt including an example which I have tweaked slightly and attached.
Comment 7 Thomas Green 2009-01-28 12:13:38 UTC
Created attachment 179954 [details]
Sample cgitrc with fixed typo
Comment 8 Thomas Green 2009-01-28 12:14:38 UTC
Created attachment 179956 [details]
Bumped (with small modification) for cgit-0.8.1.1
Comment 9 Thomas Green 2009-02-02 14:04:27 UTC
Created attachment 180693 [details]
www-apps/cgit-0.8.2
Comment 10 Yang Zhao 2009-03-08 23:13:30 UTC
The various paths used by cgit are set at compile time, which would make using webapp inappropriate. In fact, this makes compiling using portage a poor choice in general.
Comment 11 Petr Polezhaev 2009-06-12 19:31:48 UTC
Created attachment 194444 [details]
ebuild for 0.8.2.1 version with few improvements

Following README file any existing into portage git could be used. So i've replaced GIT_V initialization with `git --version` check.

(Anyway, we are depending on git, yes? Actually we shouldn't, we need only sources, but portageq calls not allowed into global scope. Maybe EAPI=3 will fix this)

Also, we should use `need_httpd_fcgi` or `need_httpd_cgi`, but they are completelly broken and unconditionally depending on local httpd server, which is incorrect for many fast-cgi setups. So we're missing them for now.

There is two config files. One global: /etc/cgitrc
Second is local for every webapp-config setup: ${MY_APPDIR}/conf/cgitrc. It should be specified with CGIT_CONFIG enviromental variable within spawner or httpd server config. It's probably useless for most setups, but such option can't be just lost.

Also:
cgit.cgi was moved into MY_CGIBINDIR, where it should be.

I really don't know what to do with webapp-config - it refuses to work if no httpd servers installed.
Comment 12 Petr Polezhaev 2009-06-12 19:34:26 UTC
Created attachment 194445 [details]
Now right ebuild

Argg... Sorry, I've forgoten to pull git changes.
Comment 13 Petr Polezhaev 2009-06-12 19:36:53 UTC
Created attachment 194446 [details]
Postinstall with warning about possible configs

Maybe it should be rewritten by someone with better English
Comment 14 Petr Polezhaev 2009-06-12 21:06:44 UTC
Created attachment 194448 [details]
ebuild with data/binary split via USE-flags

Futher improvements (or complexifications). I don't know for good this changes or for evil, I'm just adopting it for my needs - I have nginx on one host and repositories on another - trying to save normal-setup compatibility.

Now ebuild supports bare-data or bare-binary installations via 'standalone' (only binary /usr/bin/cgit.cgi) and 'dataonly' (only data into webapp structure). If no of this flags specified it should install both binary and data in webapp structure.

With no 'standalone' flag ebuild depends on httpd server.
'dataonly' flag actually skips any kind of compilation, so git sources unneeded

If no 'dataonly' flag specified - documentation for /etc/cgitrc or analogs (cgitrc.5.txt) installed via dodoc.

TODO: maybe it will be usefull to ship different postinst files for with/without dataonly installations , but it's not so critical...

Normal setup isn't tested, so if anybody will use this ebuild for normal installation (without splitting), please, comment it's workability.

In reply to comment #10:
No, most of valuable compile-time options could be overridden via /etc/cgitrc config file. If any really valuable option left compile-time only - it could be implemented via savedconfig.eclass framework.
Comment 15 Petr Polezhaev 2009-06-12 21:07:24 UTC
Created attachment 194449 [details]
valid metadata.xml with use descriptions
Comment 16 nakal 2009-11-25 21:16:29 UTC
ebuild works well for latest 0.8.3. I would like to suggest that the cgit ebuild should install the binary cgit.cgi into a web application directory. I don't know where gentoo installs such kind of things. Together with this binary the default cgit.css should be installed, too.

To improve the usability, the ebuild should also suggest to put something like

"cgit.cgi --scan-tree=/gitrepo-parent-path > /etc/cgitrepos"

into a cron table and use "include=/etc/cgitrepos" in cgitrc. This way it's simpler and more convenient. You don't need to update your cgitrc every time you add a new repository.
Comment 17 Lance Albertson (RETIRED) gentoo-dev 2010-02-23 23:00:50 UTC
*cgit-0.8.3.1 (20 Feb 2010)

  20 Feb 2010; Lance Albertson <ramereth@gentoo.org> +cgit-0.8.3.1.ebuild,
  +files/cgitrc, +files/postinstall-en.txt, +metadata.xml:
  Initial ebuild

  Thanks to everyone who helped in #223339 for contributing to the ebuild.

---

I decided to keep with the KISS principles and used one of the earlier versions of the ebuild without the split standalone use flags. I just couldn't see a valid justification for it and it just made things more confusing than they needed to be. Plus, having to deal with slots of the cgi all the time would be annoying. Thanks for all your input!
Comment 18 Bertrand Jacquin 2010-03-09 21:26:14 UTC
There is a missing dependency on app-text/docbook-xsl-stylesheets overwise you'll get this error :

make -j1 man-doc
a2x -f manpage cgitrc.5.txt
/usr/bin/asciidoc:9: DeprecationWarning: The popen2 module is deprecated.  Use the subprocess module.
  import sys, os, re, time, traceback, tempfile, popen2, codecs, locale
I/O error : Attempt to load network entity http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
warning: failed to load external entity "http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"
compilation error: file /etc/asciidoc/docbook-xsl/manpage.xsl line 13 element import
xsl:import : unable to load http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
a2x: failed: xsltproc  --stringparam callout.graphics 0         --stringparam navig.graphics 0         --stringparam admon.textlabel 1         --stringparam admon.graphics 0 --nonet         "/etc/asciidoc/docbook-xsl/manpage.xsl" "/var/tmp/portage/www-apps/cgit-0.8.3.1/work/cgit-0.8.3.1/cgitrc.5.xml"
make: *** [man-doc] Error 1
Comment 19 Danil Kutkevich 2010-04-07 10:57:21 UTC
(In reply to comment #18)
> There is a missing dependency on app-text/docbook-xsl-stylesheets overwise
> you'll get this error :

Same problem. When trying to compile with doc USE flag an error occurs.
Installation app-text/docbook-xsl-stylesheets helps.