Bug 754245 - Review Request: ocaml-menhir - LR(1) parser generator for OCaml
Summary: Review Request: ocaml-menhir - LR(1) parser generator for OCaml
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Scott Tsai
QA Contact: Fedora Extras Quality Assurance
Depends On:
Blocks: 768538
TreeView+ depends on / blocked
Reported: 2011-11-15 20:28 UTC by Jerry James
Modified: 2011-12-30 22:57 UTC (History)
3 users (show)

Fixed In Version: ocaml-menhir-20111019-2.fc16
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2011-12-30 22:57:56 UTC
Type: ---
scottt.tw: fedora-review+
gwync: fedora-cvs+

Attachments (Terms of Use)
Make it possible to build "demos/" outside of menhir source (1.94 KB, patch)
2011-12-17 01:05 UTC, Scott Tsai
no flags Details | Diff
Make it possible to build demos outside of menhir source (4.28 KB, patch)
2011-12-17 01:35 UTC, Scott Tsai
no flags Details | Diff

Description Jerry James 2011-11-15 20:28:23 UTC
Spec URL: http://jjames.fedorapeople.org/ocaml-menhir/ocaml-menhir.spec
SRPM URL: http://jjames.fedorapeople.org/ocaml-menhir/ocaml-menhir-20111019-1.fc16.src.rpm
Description: Menhir is a LR(1) parser generator for the Objective Caml programming language.  That is, Menhir compiles LR(1) grammar specifications down to OCaml code.

Comment 1 Scott Tsai 2011-12-17 00:37:39 UTC
I have some problems with how menhir is split into three packages:

1. /usr/bin/manhir and /usr/share/menhir/standard.mly should be in the same package.

From the menhir manual:
"5.1 Splitting specifications over multiple files
This mechanism is, in fact, how Menhir’s standard library (§5.4) is made available: even though its name does not appear on the command line, it is automatically joined with the user’s explicitly-provided grammar specifications, making the standard library’s definitions globally visible."

See also section 5.4 "The standard library" and the --no-stdlib and --stdlib options.
This is also how Debian does it:

2. Note that compiling code generated with "menhir --table" requires menhirLib
From the menhir Manual:
"When --table is used ... These tables are not quite stand-alone: they are exploited by an interpreter, which is shipped as part of the support library MenhirLib. For this reason, when --table is used, MenhirLib must be made visible to the Objective Caml compilers, and must be linked into your executable program. The --suggest-* switches, described above, help do this."

I can see how separating "files required to run the parser generator" from "files required to compile the generated parser source" can make sense similar to how some projects ships C files generated from bison but then does separating ocaml-menhir from ocaml-menhir-devel make sense?

3. The Fedora OCaml packaging guidlines (http://fedoraproject.org/wiki/Packaging:OCaml) suggest that:
*.cmi should be in the main package (you're placing it in -devel)
*.o should be in the -devel package (you're placing it in main)

4. The "demos" code you placed in -devel requires the "menhir" binary and should be in the same package. (It's also what Debian does)
You also didn't remove the generated .ml (and .mli and .mli.d derived from them).

Try "make clean" under the demos/ directory.

5. For the "demos" directory, I have a patch that will make it build outside of the menhir source tree. This makes the example code easier to use for the Fedora user.

6. Stylistically, I suggest your use %{_buildroot} instead of $RPM_BUILD_ROOT.
Since you're relying new rpmbuild features like "no defattr" "no %clean section" anyway.

Comment 2 Scott Tsai 2011-12-17 00:38:36 UTC

Comment 3 Scott Tsai 2011-12-17 01:05:18 UTC
Created attachment 548031 [details]
Make it possible to build "demos/" outside of menhir source

Comment 4 Scott Tsai 2011-12-17 01:35:06 UTC
Created attachment 548042 [details]
Make it possible to build demos outside of menhir source

Update patch to fix the OMakefile's as well

Comment 5 Jerry James 2011-12-19 18:01:36 UTC

Thanks for all the comments.  I have reduced the number of packages from 3 to 2, and have followed Debian in the selection of files for the two packages.  Also, thank you very much for the useful patch.  I have added it to the package.

As for this comment:
> 6. Stylistically, I suggest your use %{_buildroot} instead of $RPM_BUILD_ROOT.
> Since you're relying new rpmbuild features like "no defattr" "no %clean
> section" anyway.

I don't understand why you seem to be linking %{buildroot} with "new rpmbuild features".  Both it and $RPM_BUILD_ROOT have been around for a long time.  (For example, see http://www.redhat.com/archives/rpm-list/2002-July/msg00121.html.)  In any case, all of my other spec files use $RPM_BUILD_ROOT, so for the sake of maintaining a consistent style across the packages I maintain, I prefer to stick with $RPM_BUILD_ROOT.

New URLs:

Comment 6 Scott Tsai 2011-12-20 01:11:14 UTC
1. For the License fields, I think we should make
  ocaml-menhir: QPL with exceptions and (LGPLv2+ with exceptions)
  ocaml-menhir-devel: LGPLv2+ with exceptions
the wording of the former I copied from Fedora's main ocaml package.
Those are my best guesses after reviewing the LICENSE file and copyright headers is source. I'm not comfortable playing copyright lawyer but the licensing related questions in Fedora's package review checklist sort of forces the issue.

2. I suggested you get rid of the "OMake cache" files:
by modifying the SPEC somewhat like this:
  -# Remove some hidden files
  +# Remove OMake generated files in the upstream tarball
   rm -f demos/calc/.omakedb*
  +rm -f demos/calc/*.omc
the *.omc and .omakedb files are generated when you run omake and were clearly shipped in the upstream tarball by mistake.

Regarding $RPM_BUILD_ROOT vs. %{buildroot}, it's certainly fine to use you're preferred style. From reading the Fedora package review list this week, the later is getting popular in new package submissions. I've always used RPM_BUILD_ROOT but %{buildroot} grew on me as it makes the lines shorter.

Formal review assuming the license field changes were made:

Package Review

- = N/A
x = Pass
! = Fail
? = Not evaluated

==== Generic ====
[x]: MUST Package is licensed with an open-source compatible license and meets
     other legal requirements as defined in the legal section of Packaging
[x]: MUST Package successfully compiles and builds into binary rpms on at
     least one supported architecture.

rawhide koji scratch build:

[x]: MUST All build dependencies are listed in BuildRequires, except for any
     that are listed in the exceptions section of Packaging Guidelines.
[x]: MUST Buildroot is not present
     Note: Unless packager wants to package for EPEL5 this is fine
[x]: MUST Package contains no bundled libraries.
[x]: MUST Changelog in prescribed format.
[x]: MUST Package has no %clean section with rm -rf %{buildroot} (or $RPM_BUILD_ROOT)
     Note: Clean would be needed if support for EPEL is required
[x]: MUST Sources contain only permissible code or content.
[x]: MUST Each %files section contains %defattr if rpm < 4.4
     Note: Note: defattr macros not found. They would be needed for EPEL5
[x]: MUST Macros in Summary, %description expandable at SRPM build time.
[x]: MUST Package requires other packages for directories it uses.
[x]: MUST Package uses nothing in %doc for runtime.
[x]: MUST Package is not known to require ExcludeArch.
[x]: MUST Permissions on files are set properly.
[x]: MUST Package does not contain duplicates in %files.
[x]: MUST Spec file lacks Packager, Vendor, PreReq tags.
[x]: MUST Package does not run rm -rf %{buildroot} (or $RPM_BUILD_ROOT) at the
     beginning of %install.
     Note: rm -rf would be needed if support for EPEL5 is required
[x]: MUST If (and only if) the source package includes the text of the
     license(s) in its own file, then that file, containing the text of the
     license(s) for the package is included in %doc.
[x]: MUST License field in the package spec file matches the actual license.
[x]: MUST License file installed when any subpackage combination is installed.
[x]: MUST Package consistently uses macros (instead of hard-coded directory names).
[x]: MUST Package meets the Packaging Guidelines.
[x]: MUST Package is named according to the Package Naming Guidelines.
[x]: MUST Package does not generates any conflict.
[x]: MUST Package obeys FHS, except libexecdir and /usr/target.
[x]: MUST Package must own all directories that it creates.
[x]: MUST Package does not own files or directories owned by other packages.
[x]: MUST Package installs properly.
[x]: MUST Requires correct, justified where necessary.
[ ]: MUST Rpmlint output is silent.
The only warning regarding menhir-ocamldep not having a manual page shouldn't block this.

rpmlint ocaml-menhir-devel-20111019-2.fc17.x86_64.rpm

ocaml-menhir-devel.x86_64: W: no-documentation
1 packages and 0 specfiles checked; 0 errors, 1 warnings.

rpmlint ocaml-menhir-20111019-2.fc17.src.rpm

1 packages and 0 specfiles checked; 0 errors, 0 warnings.

rpmlint ocaml-menhir-20111019-2.fc17.x86_64.rpm

ocaml-menhir.x86_64: W: no-manual-page-for-binary menhir-ocamldep
1 packages and 0 specfiles checked; 0 errors, 1 warnings.

[x]: MUST Sources used to build the package match the upstream source, as
     provided in the spec URL.
/home/scottt/work/ocaml-menhir/menhir-20111019.tar.gz :
  MD5SUM this package     : 03ea68c0148142c801d3c0fd3b96ba51
  MD5SUM upstream package : 03ea68c0148142c801d3c0fd3b96ba51

[x]: MUST Spec file is legible and written in American English.
[x]: MUST Spec file name must match the spec package %{name}, in the format
[-]: MUST Package contains a SysV-style init script if in need of one.
[x]: MUST File names are valid UTF-8.
[x]: SHOULD Reviewer should test that the package builds in mock.
[-]: SHOULD If the source package does not include license text(s) as a
     separate file from upstream, the packager SHOULD query upstream to
     include it.
[x]: SHOULD Dist tag is present.
[x]: SHOULD No file requires outside of /etc, /bin, /sbin, /usr/bin,
[x]: SHOULD Final provides and requires are sane (rpm -q --provides and rpm -q --requires).
[x]: SHOULD Package functions as described.
[x]: SHOULD Package does not include license text files separate from upstream.
[x]: SHOULD Patches link to upstream bugs/comments/lists or are otherwise justified.
[ ]: SHOULD SourceX / PatchY prefixed with %{name}.
This is fine.
     Note: Source0:
     (menhir-%{version}.tar.gz) Patch0: 0001-Makfile-use-menhir-ocamldep-
     instead-of-ocamldep.wra.patch (0001-Makfile-use-menhir-ocamldep-instead-
[x]: SHOULD SourceX is a working URL.
[x]: SHOULD Description and summary sections in the package spec file contains
     translations for supported Non-English languages, if available.
[x]: SHOULD Package should compile and build into binary rpms on all supported
[-]: SHOULD %check is present and all tests pass.
[x]: SHOULD Packages should try to preserve timestamps of original installed
[x]: SHOULD Spec use %global instead of %define.


Comment 7 Jerry James 2011-12-20 20:22:50 UTC
Scott, thank you very much for the thorough review.  I have changed the license field as you indicated, and have also removed the other OMake files.  The results are available to see at the previous URLs.

I'll need you to set the fedora-review flag to + before I can proceed.  Thanks again.

Comment 8 Scott Tsai 2011-12-21 01:04:00 UTC

Comment 9 Jerry James 2011-12-21 14:44:51 UTC
New Package SCM Request
Package Name: ocaml-menhir
Short Description: LR(1) parser generator for OCaml
Owners: jjames
Branches: f16

Comment 10 Gwyn Ciesla 2011-12-21 15:08:04 UTC
Git done (by process-git-requests).

Comment 11 Fedora Update System 2011-12-21 16:03:46 UTC
ocaml-menhir-20111019-2.fc16 has been submitted as an update for Fedora 16.

Comment 12 Fedora Update System 2011-12-22 22:48:11 UTC
ocaml-menhir-20111019-2.fc16 has been pushed to the Fedora 16 testing repository.

Comment 13 Fedora Update System 2011-12-30 22:57:56 UTC
ocaml-menhir-20111019-2.fc16 has been pushed to the Fedora 16 stable repository.

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