Bug 626666 - Review Request: groonga - An Embeddable Fulltext Search Engine
Summary: Review Request: groonga - An Embeddable Fulltext Search Engine
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Mamoru TASAKA
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-08-24 04:09 UTC by Daiki Ueno
Modified: 2010-10-28 06:23 UTC (History)
4 users (show)

Fixed In Version: groonga-1.0.2-7.fc14
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-10-07 03:36:17 UTC
Type: ---
Embargoed:
mtasaka: fedora-review+
petersen: fedora-cvs+


Attachments (Terms of Use)

Description Daiki Ueno 2010-08-24 04:09:43 UTC
Spec URL: http://ueno.fedorapeople.org/groonga/groonga.spec
SRPM URL: http://ueno.fedorapeople.org/groonga/groonga-0.7.6-1.fc13.src.rpm
Description:
Groonga is an embeddable full-text search engine library.  It can
integrate with DBMS and scripting languages to enhance their search
functionality.  It also provides a standalone data store server based
on relational data model.

Comment 1 Daiki Ueno 2010-10-01 06:43:23 UTC
1.0.2 was recently released and one of the upstream authors kindly provided updated spec, though he is not willing to maintain it in Fedora because of lack of time.  Anyway here it is:

Spec URL: http://ueno.fedorapeople.org/groonga/groonga.spec
SRPM URL: http://ueno.fedorapeople.org/groonga/groonga-1.0.2-1.fc13.src.rpm

P.S.
I added i18n-bugs to Cc because groonga provides special search functionality for Japanese text.

Comment 2 Mamoru TASAKA 2010-10-01 18:54:28 UTC
Some notes (checked 1.0.2-2)

* BR
  - Looking into bindings/ directory, it seems that some languages bindings
    are available for this package (python, php, and also perhaps ruby?).
    Would you try to enable these bindings?

* License
-------------------------------------------------------------------
doc/ja/README	says LGPLv2

BSD
doc/ja/html/_static/

MIT or GPLv2
doc/ja/html/_static/jquery.js
resource/admin_html/css/ui-lightness/jquery-ui-1.8.1.custom.css
resource/admin_html/js/jquery-1.4.2.min.js
------------------------------------------------------------------
  - So -libs license should be "LGPLv2 and (MIT or GPLv2)" and -doc license
    should be "LGPLv2 and BSD".

* Timestamps
  - Please consider to use
-------------------------------------------------------------------
make install DESTDIR=$RPM_BUILD_ROOT INSTALL~="install -p"
-------------------------------------------------------------------
    to keep timestamps on installed files as much as possible.
    This method usually works for Makefiles generated by recent autotool
    scripts.

* Macros
  - Please use macros for standard directories. /var should be %_var or
    %_localstatedir, /usr/sbin should be %_sbin, and etc
    https://fedoraproject.org/wiki/Packaging/RPMMacros

* SysV script related issues
  - Please use %{_initddir} (/etc/rc.d/init.d) instead of %_sysconfdir/init.d
    https://fedoraproject.org/wiki/Packaging/SysVInitScript#Initscripts_on_the_filesystem

  - For registering groonga user or group, please follow
    https://fedoraproject.org/wiki/Packaging/UsersAndGroups
    ! Note
      The current way of yours is anyway confusing because doing 
      'echo "Unexpected error adding group \"groonga\". Aborting installation."'
      does not actually abort installation (because $ echo foo will perhaps exit
      with status 0).

-------------------------------------------------------------------
	/usr/sbin/useradd -r -s /sbin/nologin -c 'groonga' \
		-d %{_localstatedir}/lib/groonga --create-home \
-------------------------------------------------------------------
    - $ env LANG=C man useradd says "--create-home" will copy files in skeleton
      directory into the created home directory. Is it needed?
    - And anyway %_localstatedir/lib/groonga must also be listed in %files
      entry, so I don't think --create-home option is needed here.

  - The lines
-------------------------------------------------------------------
%post
/bin/mkdir -p /var/run/groonga
/bin/chown -R groonga:groonga /var/run/groonga
-------------------------------------------------------------------
    is wrong. In this case, the directory %_localstatedir/run/%name must be
    registered in %files entry with proper %attr added.

-------------------------------------------------------------------
%post munin-plugins
/usr/sbin/munin-node-configure --shell --remove-also | grep -e 'groonga_' | sh
[ -f /var/lock/subsys/munin-node ] && \
	/sbin/service munin-node restart > /dev/null 2>&1
-------------------------------------------------------------------
  - Some Requires(post) is required here (Requires(post): munin-node)
  - Doesn't munin-node service support condrestart?

  - We don't usually call userdel / groupdel on scriptlets:
    https://fedoraproject.org/wiki/Packaging/UsersAndGroups

  - Would you explain why this is needed?
--------------------------------------------------------------------
%postun munin-plugins
if [ $1 -eq 0 ]; then
	rm %{_sysconfdir}/munin/plugins/groongar_* > /dev/null 2>&1
--------------------------------------------------------------------

  - By the way calling /sbin/service or /sbin/chkconfig or getent or
    so requires writing Proper "Requires(foo): bar"s. Please
    refer to:
    https://fedoraproject.org/wiki/Packaging/UsersAndGroups
    https://fedoraproject.org/wiki/Packaging/SysVInitScript#Initscripts_in_spec_file_scriptlets

* %files
  - We now prefer to use %defattr(-,root,root,-)

  - Files under %_mandir (note: please use %_mandir instead of %_datadir/man) are
    automatically marked as %doc, so there is no need to write explicit %doc attribute
    for %_mandir/foo.

  - Please take care of directory ownership issue.
    https://fedoraproject.org/wiki/Packaging/Guidelines#File_and_Directory_Ownership
    https://fedoraproject.org/wiki/Packaging/UnownedDirectories

    ! The point is that when installing a (binary) rpm creates some new directories,
      the created directories should also be owned by the (just installed) rpm.
      For example, when installing groonga-libs rpm, installing
      %_libdir/groonga/modules/suggest/suggest.so (on i686)
      newly creates the following directories:
--------------------------------------------------------------
%_libdir/%name
%_libdir/%name/modules
%_libdir/%name/modules/suggest
--------------------------------------------------------------
      so -libs subpackage should also own these directories. Also please refer to
      https://fedoraproject.org/wiki/Packaging/UnownedDirectories#Common_Mistakes

    ! Instead if the needed directories for a rpm are already created by the packages
      which the rpm depends on, the rpm (to be newly installed) should not own the
      directory.
      For example the directory %_sysconfdir/munin/plugin-conf.d is already owned by
      munin-node, so -munin-plugins subpackage should not own this directory itself.

Comment 3 Daiki Ueno 2010-10-04 08:10:17 UTC
Thanks.  Updated:
Spec URL: http://ueno.fedorapeople.org/groonga/groonga.spec
SRPM URL: http://ueno.fedorapeople.org/groonga/groonga-1.0.2-3.fc13.src.rpm

Mostly fixed the issues except:

(In reply to comment #2)
> Some notes (checked 1.0.2-2)
> 
> * BR
>   - Looking into bindings/ directory, it seems that some languages bindings
>     are available for this package (python, php, and also perhaps ruby?).
>     Would you try to enable these bindings?

This seems not that easy.  Since currently those bindings are not under groonga build infrastructure, building those bindings requires groonga-devel already installed on the system (or a patch to do that).  Any ideas?

Comment 4 Mamoru TASAKA 2010-10-04 08:53:39 UTC
(In reply to comment #3)
> > * BR
> >   - Looking into bindings/ directory, it seems that some languages bindings
> >     are available for this package (python, php, and also perhaps ruby?).
> >     Would you try to enable these bindings?
> 
> This seems not that easy.  Since currently those bindings are not under groonga
> build infrastructure, building those bindings requires groonga-devel already
> installed on the system (or a patch to do that).  Any ideas?

I guess setting CFLAGS / LDFLAGS will workaround this.
I just tried python bindings and something like:
--------------------------------------------------------
 1210  pushd bindings/python/ql/
 1212  python setup.py config
 1219  mkdir groonga
 1220  pushd groonga/
 1221  ln -sf ../../../../groonga.h 
 1222  popd
 1223  python setup.py build
 1226  sed -i.cflgs -e 's|^cflags =.*|cflags = []|' setup.py 
 1230  CFLAGS=-I. LDFLAGS=-L../../../lib/.libs python setup.py build
 1231  popd
--------------------------------------------------------
makes build succeed. (I am not familiar with php).

Maybe ruby is needed to build test suite?

Comment 5 Daiki Ueno 2010-10-04 09:57:31 UTC
(In reply to comment #4)

> > This seems not that easy.  Since currently those bindings are not under groonga
> > build infrastructure, building those bindings requires groonga-devel already
> > installed on the system (or a patch to do that).  Any ideas?
> 
> I guess setting CFLAGS / LDFLAGS will workaround this.

Aha, this works.

I was also worried about $RPM_BUILD_ROOT/{%_libdir} path is embedded in *.so, but it seems not the case.  Updated (with Python and PHP binding):

Spec URL: http://ueno.fedorapeople.org/groonga/groonga.spec
SRPM URL: http://ueno.fedorapeople.org/groonga/groonga-1.0.2-4.fc13.src.rpm

> Maybe ruby is needed to build test suite?

Looks so.

Comment 6 Mamoru TASAKA 2010-10-04 17:46:08 UTC
Assigning.

Comment 7 Mamoru TASAKA 2010-10-04 18:58:06 UTC
For -4:

* More directory ownership / %files issue
  - For -munin-plugins subpackage:
    - The directory %_sysconfdir/munin/plugin-conf.d is already owned by
      munin-node, -munin-plugins Requires munin-node, so -munin-plugins
      subpackage should not own this directory itself.

    - Same for %_datadir/munin. This directory is already owned by
      munin.

  - For -doc subpackage
    - Installing -doc subpackage creates the directory %{_datadir}/groonga/
      and %{_datadir}/groonga/. While %_datadir/groonga is owned by -libs
      subpackage, currently -doc subpackage does not have Requires: -libs.

      So technically -doc subpackage can be installed without -libs subpackage
      being installed, and it leaves the directory %_datadir/groonga
      directory unowned by any packages.

  - For main package
    - Main package has scriptlets:
-------------------------------------------------------------
getent passwd groonga >/dev/null || \
       useradd -r -g groonga -d %{_localstatedir}/lib/groonga -s /sbin/nologin \
-------------------------------------------------------------
      It seems that the directory %_localstatedir/lib/groonga should be owned
      by main package.
      ! By the way, looking at groonga sysv script, it seems
        the following directories also needs creating beforehand?
-------------------------------------------------------------
/var/lib/groonga/db
/var/log/groonga
-------------------------------------------------------------

* SysV initscript issue
-------------------------------------------------------------
groonga.i686: W: service-default-enabled /etc/rc.d/init.d/groonga
-------------------------------------------------------------
  - Please modify the sysv script to be installed so that the service
    is not enabled by default (modify # chkconfig: line and # Default-Start:
    line)
    https://fedoraproject.org/wiki/Packaging/SysVInitScript#.23_chkconfig:_line

* build issue
  - Please move "build process" to %build section (i.e. invoke "gcc"
    or so in %build) and only do "install process" or so in %install
    section _if possible_.

* Python subpackage
  - F-14 uses python 2.7, not python 2.6.x. So %files list in python-%{name}
    needs fixing.
  - F-13+ also ships python3. So please write "python2-devel" for BuildRequires:
    https://fedoraproject.org/wiki/Packaging/Python#BuildRequires

* Naming
  - Well, I am not sure if we should name python binding as python-%{name}
    or %{name}-python. Actually there are many packages which are named as %{name}-python,
    and python-%{name}...

    https://fedoraproject.org/wiki/Packaging/NamingGuidelines#Addon_Packages_.28python_modules.29
    says:
--------------------------------------------------------------
Packages of python modules (thus *they rely on python as a parent*) use a slightly 
different naming scheme
--------------------------------------------------------------
    I think python binding package does not rely on python as a parent, it is a 
    binding package of groonga for python. So usually I think for binding packages
    like this case, we should name as %{name}-python (same for php).

Comment 8 Daiki Ueno 2010-10-05 05:59:01 UTC
Thanks.  Updated:

Spec URL: http://ueno.fedorapeople.org/groonga/groonga.spec
SRPM URL: http://ueno.fedorapeople.org/groonga/groonga-1.0.2-5.fc13.src.rpm

While the SRPM created on F-13, I confirmed it building on F-14 with local mock.

Comment 9 Mamoru TASAKA 2010-10-05 18:59:44 UTC
For -6:

* For python binding
  - Well, F-13/12 still uses python 2.6 so rebuilding -6 fails on F-13/12.
    I forgot that we usually define %python_sitearch as written on:
    https://fedoraproject.org/wiki/Packaging/Python#Macros

    Please use %python_sitearch macro written here.

* More directory ownership issue
---------------------------------------------------------------
%files munin-plugins
%{_datadir}/munin/*
---------------------------------------------------------------
  - Now with this the directory /usr/share/munin/plugins is owned by 
    groonga-munin-plugins. However this directory is also owned by
    munin-node, so groonga-munin-plugins should not own this directory
    itself.

* For php bindings
  - Fedora specific compilation flags are not correctly honored:
----------------------------------------------------------------
   613  + popd
   614  ~/build/BUILD/groonga-1.0.2/bindings/php
   615  + sed -i.ldflags -e 's|PHP_ADD_LIBRARY_WITH_PATH(groonga, .*)|PHP_ADD_LIBRARY(groonga, GROONGA_SHARED_LIBADD)|' config.m4
   616  + phpize
   727  + make -j16
   728  /bin/sh /builddir/build/BUILD/groonga-1.0.2/bindings/php/libtool --mode=compile cc  -I. -I/builddir/build/BUILD/groonga-1.0.2/bindings/php -DPHP_ATOM_INC -I/builddir/build/BUILD/groonga-1.0.2/bindings/php/include -I/builddir/build/BUILD/groonga-1.0.2/bindings/php/main -I/builddir/build/BUILD/groonga-1.0.2/bindings/php -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/builddir/build/BUILD/groonga-1.0.2/bindings/php/include  -DHAVE_CONFIG_H  -I.   -c /builddir/build/BUILD/groonga-1.0.2/bindings/php/groonga.c -o groonga.lo 
----------------------------------------------------------------

* groonga service
  - On F-14, when I installed groonga{-libs,,-tokenizer-mecab}
    and try activating groonga service, I get:
----------------------------------------------------------------
[root@localhost ~]# service groonga start
Starting groonga: cgroup controller and pathparsing failed
                                                           [失敗]
----------------------------------------------------------------
    Would you know why this is happening?

Comment 10 Daiki Ueno 2010-10-06 04:59:45 UTC
Thanks.  Fixed the issues:
Spec URL: http://ueno.fedorapeople.org/groonga/groonga.spec
SRPM URL: http://ueno.fedorapeople.org/groonga/groonga-1.0.2-6.fc13.src.rpm

(In reply to comment #9)

> * groonga service
>   - On F-14, when I installed groonga{-libs,,-tokenizer-mecab}
>     and try activating groonga service, I get:
> ----------------------------------------------------------------
> [root@localhost ~]# service groonga start
> Starting groonga: cgroup controller and pathparsing failed
>                                                            [失敗]
> ----------------------------------------------------------------
>     Would you know why this is happening?

There seems to be a confusion about Unix group and cgroup in initscript.  I simply removed the code in the current SRPM, since the user can specify it in /ets/sysconfig/groonga.

Comment 11 Mamoru TASAKA 2010-10-06 18:30:53 UTC
Okay. For -6:

* %files
  - %install says:
-----------------------------------------------------------
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/groonga/db
-----------------------------------------------------------
    Maybe it is better that also %dir %{_localstatedir}/lib/groonga/db
    is added to %files list for main package.

* Macros
------------------------------------------------------------
/usr/sbin/munin-node-configure --shell --remove-also | grep -e 'groonga_' | sh
------------------------------------------------------------
  - Please use %{_sbindir} for /usr/sbin

------------------------------------------------------------
    This directory (groonga) is APPROVED by mtasaka
------------------------------------------------------------

Comment 12 Daiki Ueno 2010-10-07 01:36:22 UTC
Thanks for the review, Tasaka-san.

New Package SCM Request
=======================
Package Name: groonga
Short Description: An Embeddable Fulltext Search Engine
Owners: ueno
Branches: f14 f13
InitialCC: i18n-team

Comment 13 Jens Petersen 2010-10-07 02:50:50 UTC
Git done (by process-git-requests).

Comment 14 Fedora Update System 2010-10-07 03:35:15 UTC
groonga-1.0.2-7.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/groonga-1.0.2-7.fc14

Comment 15 Fedora Update System 2010-10-07 03:35:22 UTC
groonga-1.0.2-7.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/groonga-1.0.2-7.fc13

Comment 16 Daiki Ueno 2010-10-07 03:36:17 UTC
Thanks.

Comment 17 Fedora Update System 2010-10-27 22:52:15 UTC
groonga-1.0.2-7.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 18 Fedora Update System 2010-10-28 06:23:14 UTC
groonga-1.0.2-7.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.