Bug 756635 - Review Request: gap - Computational discrete algebra
Summary: Review Request: gap - Computational discrete algebra
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Scott Tsai
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 769450
TreeView+ depends on / blocked
 
Reported: 2011-11-24 04:57 UTC by Jerry James
Modified: 2012-01-23 21:58 UTC (History)
4 users (show)

Fixed In Version: gap-4.4.12-3.fc16
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-01-23 21:58:17 UTC
Type: ---
scottt.tw: fedora-review+
loganjerry: fedora-cvs+


Attachments (Terms of Use)
vim filetype detection plugin for gap (58 bytes, application/octet-stream)
2012-01-10 21:57 UTC, Scott Tsai
no flags Details

Description Jerry James 2011-11-24 04:57:16 UTC
Spec URL: http://jjames.fedorapeople.org/gap/gap.spec
SRPM URL: http://jjames.fedorapeople.org/gap/gap-4.4.12-1.fc16.src.rpm
Description: GAP is a system for computational discrete algebra, with particular emphasis on Computational Group Theory.  GAP provides a programming language, a library of thousands of functions implementing algebraic algorithms written in the GAP language as well as large data libraries of algebraic objects.  GAP is used in research and teaching for studying groups and their representations, rings, vector spaces, algebras, combinatorial structures, and more.

This is one of the components of SAGE.

Comment 1 Scott Tsai 2011-12-21 19:59:17 UTC
This turned out to be a somewhat difficult review. Problems:

1. gac can't find config.h. Try:
  gac tst/testall.g
gac will try to run:
  gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DSYS_DEFAULT_PATHS="/usr/share/gap" -o /tmp/gac31213/31213_testall.o -I/usr/share/gap -I/usr/bin -DCONFIG_H -c /tmp/gac31213/31213_testall.c
Which fails with:
  In file included from /usr/share/gap/src/compiled.h:8:0,
       from /tmp/gac31213/31213_testall.c:2:
  /usr/share/gap/src/system.h:30:20: fatal error: config.h: No such file or directory

Since config.h is found at:
  /usr/share/gap/bin/x86_64-unknown-linux-gnu-gcc/config.h
Patching /usr/bin/gac like this works:
  --- /usr/bin/gac.orig  2011-12-22 02:54:52.249442817 +0800
  +++ /usr/bin/gac  2011-12-22 02:55:01.465442409 +0800
  @@ -111,9 +111,9 @@
   ##
   c_compile () {
       echo ${c_compiler}  $3 -o $1 -I${gap_dir} \
  -         -I${gap_bin} -DCONFIG_H -c $2
  +         -I${gap_binary} -DCONFIG_H -c $2
       ${c_compiler} $3 -o $1 -I${gap_dir} \
  -         -I${gap_bin} -DCONFIG_H -c $2
  +         -I${gap_binary} -DCONFIG_H -c $2
   }

2. You're not shipping sysinfo.gap. This will break compilation of external GAP packages. http://www.gap-system.org/Manuals/doc/htm/ext/CHAP004.htm says:
"We suggest that your GAP package contains a file configure which is called with the path of the GAP root directory as parameter. This file then will read sysinfo.gap and set up everything for compiling under the given architecture (for example creating a Makefile from Makefile.in ... The standard GAP distribution contains a GAP package ``example'' whose installation script shows an example way of how to do this."

I think this shows that we want something like a "GAP packaging template" that is tested to work with this base GAP package. Time permitting, picking one noarch and one arch specific package from http://www.gap-system.org/Packages/packages.html
and try packaging them should produce a workable GAP packaging template ^_^
(I'm half joking. Obviously time and effort is an issue)

Debian does have a GAP packaing policy: http://scottt.tw/debian/gap-policy.txt
(I extracted it from Debian's gap-doc package for convenience)
I don't think we need to follow their naming policy or placing arch specific and noarch files separately in /usr/lib/gap and /usr/share/gap but it's worth reading. Debian's gap-dev has a very different file layout:
  http://packages.debian.org/sid/amd64/gap-dev/filelist
Placing arch specific files in /usr/lib does get rid of one rpmlint warning but in Fedora at least ngspice also places native .o files in /usr/share. I think keeping your exiting file layout is fine if it's possible to build other GAP packages.

Debian only has core gap packaged. Frank Lübeck's gapsync binary distribution:
http://www.math.rwth-aachen.de:8001/RsyncLinuxGAP/index.html
(linked to from the upstream GAP download page so hopefully somewhat sensible)
has packages distributed upstream installed. I placed the shell scripts he used to build for x86 and x86_64 here:
  http://scottt.tw/gapsync/InstForRsync32
  http://scottt.tw/gapsync/InstForRsync64
He statically links everything though.
(I havn't read the scripts. Just googled around for how people package GAP)

3. The upstream gap download page (http://www.gap-system.org/Download/index.html) suggests running:
  gap> tst := Filename( DirectoriesLibrary("tst"), "testall.g" );  
  gap> Read(tst);
as a simple self test after installation but
  gap> DirectoriesLibrary("tst");
fails looking for /usr/share/gap/tst

4. The emacs packaging guidelines suggest you change the Requires and BuildRequires like this:
  @@ -29,8 +29,8 @@ Patch2:         gap-emacs.patch

   BuildRequires:  desktop-file-utils
   BuildRequires:  netpbm-progs
  -BuildRequires:  emacs-nox
  -BuildRequires:  xemacs-devel xemacs-packages-base
  +BuildRequires:  emacs
  +BuildRequires:  xemacs

   Requires:       gzip

  @@ -65,7 +65,7 @@ Both syntax highlighting and indentation are supported.
   %package emacs
   Summary:        Edit GAP files with Emacs
   Group:          Applications/Engineering
  -Requires:       %{name} = %{version}-%{release}, emacs(bin)
  +Requires:       %{name} = %{version}-%{release}, emacs(bin) >= %{_emacs_version}
   BuildArch:      noarch

   %description emacs
  @@ -86,7 +86,7 @@ GAP Emacs support.
   Summary:        Edit GAP files with XEmacs
   Group:          Applications/Engineering
   Requires:       %{name} = %{version}-%{release}
  -Requires:       xemacs(bin), xemacs-packages-base
  +Requires:       xemacs(bin) >= %{_xemacs_version}
   BuildArch:      noarch
See: http://fedoraproject.org/wiki/Packaging:Emacs#Package_Requires
I've verified that those BuildRequires do work in mock build

5. For updating the icon cache, the packaging guidelines recommends:
  %post
  /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :

  %postun
  if [ $1 -eq 0 ] ; then
      /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
      /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
  fi

  %posttrans
  /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
which is marginally more efficient on package updates as gtk-udpate-icon-cache is only run once. See: http://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Icon_Cache

6. debugvim.txt is shipped twice:
  /usr/share/gap/etc/debugvim.txt (in gap)
  /usr/share/doc/gap-vim-4.4.12/debugvim.txt (in gap-vim)
you should remove the latter since it's related to /usr/share/gap/etc/debug.vim

7. Personally, I recommend adding a comment before "Requires gzip":
  +# /usr/bin/gap requires gunzip
   Requires:       gzip

Comment 2 Jerry James 2011-12-21 20:54:06 UTC
Scott, thanks again for a careful review.  I didn't realize Debian had a GAP package.  I'm going to go through their package and guidelines before I do anything else, then update this package.  It may take me a couple of days to fix all the issues you identified.

Comment 3 Jerry James 2012-01-04 00:15:41 UTC
So it was more than just a couple of days...

I believe I have all of these issues sorted out.  I have mostly copied Debian's package layout.  Note that Debian doesn't ship the test files, so your 3rd point applies to them, also.  Nevertheless, I included those files in -devel, on the theory that they can then be used for package tests.

I did not split out a -small-groups-extra package because, frankly, I found it confusing and because the gzipped files aren't all *that* large (< 26 Mbytes for the entire collection).  Also, I did not create a separate -doc subpackage like Debian because the online help can look for those files, too.  I lumped them all into -online-help.

New URLs:
http://jjames.fedorapeople.org/gap/gap.spec
http://jjames.fedorapeople.org/gap/gap-4.4.12-2.fc16.src.rpm

Comment 4 Scott Tsai 2012-01-10 21:57:56 UTC
Created attachment 551952 [details]
vim filetype detection plugin for gap

Comment 5 Scott Tsai 2012-01-10 21:59:15 UTC
Sorry for the delay for this review:
1. gap-core should own /usr/lib/gap/ (%{gaparchdir}) since it owns /usr/lib/gap/sysinfo.gap

2. For gap-vim, since you're not shipping README.vim-utils I recommend you ship the attached gap.vim as /usr/share/vimfiles/ftdetect/gap.vim. Otherwise the user would have to know to manually ":set filetype=vim" to activate the VIM sytnax hightlighting and indentation plugins.
Hopefully the *.g, *.gi, *.gd file extensions are not used by other file types.

3. Placing "README.fedora" in gap-libs and placing "description4r4p10" in gap-core seems a bit strange to me. Maybe move "README" and "README.fedora" to gap-core? (not critical)

4. Since Fedora packaging lack Debian's "recommand" and "suggest" functionality, I'm not sure splitting out the prim, small and trans group subpackages is really a good idea but I'll leave it to your disgression.

5. I was able to build and load the "Example" package from http://www.gap-system.org/Packages/packages.html sucessfully.

Formal Package Review
==============

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


==== C/C++ ====
[x]: MUST Header files in -devel subpackage, if present.
[x]: MUST Package does not contain any libtool archives (.la)
[x]: MUST Package does not contain kernel modules.
[x]: MUST Package contains no static executables.
[x]: MUST Rpath absent or only used for internal libs.
[x]: MUST Package is not relocatable.


==== 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
     Guidelines.
[x]: MUST Package successfully compiles and builds into binary rpms on at
     least one supported architecture.
[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 contains a properly installed %{name}.desktop using desktop-
     file-install file if it is a GUI application.
[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.
[x]: MUST Rpmlint output is silent.
rpmlit warnings and errors are all justified:

incorrect-fsf-address is not a bit deal
	rpmlint gap-libs-4.4.12-2.fc17.noarch.rpm

	gap-libs.noarch: E: incorrect-fsf-address /usr/share/doc/gap-libs-4.4.12/GPL
	1 packages and 0 specfiles checked; 1 errors, 0 warnings.


no-documentation is fine for gap-emacs-el
	rpmlint gap-emacs-el-4.4.12-2.fc17.noarch.rpm

	gap-emacs-el.noarch: W: no-documentation
	1 packages and 0 specfiles checked; 0 errors, 1 warnings.


/usr/lib/sysinfo.gap is non-binary and it's fine
	rpmlint gap-core-4.4.12-2.fc17.x86_64.rpm

	gap-core.x86_64: W: only-non-binary-in-usr-lib
	gap-core.x86_64: E: zero-length /var/lib/gap/workspace
	1 packages and 0 specfiles checked; 1 errors, 1 warnings.



Though gap.x86_64 is empty, it can't be noarch since it depends on gap-core.
Those are not really spelling errors.
no-documentation is fine for gap.
	rpmlint gap-4.4.12-2.fc17.x86_64.rpm

	gap.x86_64: W: spelling-error %description -l en_US combinatorial -> combination
	gap.x86_64: W: spelling-error %description -l en_US metapackage -> meta package, meta-package, prepackage
	gap.x86_64: E: no-binary
	gap.x86_64: W: no-documentation
	1 packages and 0 specfiles checked; 1 errors, 3 warnings.


no-documentation is fine for gap-prim-groups.
	rpmlint gap-prim-groups-4.4.12-2.fc17.noarch.rpm

	gap-prim-groups.noarch: W: no-documentation
	1 packages and 0 specfiles checked; 0 errors, 1 warnings.


no-documentation is fine for gap-prim-groups.
	gap-trans-groups.noarch: W: no-documentation
	1 packages and 0 specfiles checked; 0 errors, 1 warnings.


no-documentation is fine for gap-small-groups.
	rpmlint gap-small-groups-4.4.12-2.fc17.noarch.rpm

	gap-small-groups.noarch: W: no-documentation
	1 packages and 0 specfiles checked; 0 errors, 1 warnings.


no-documentation is fine for gap-vim.
	rpmlint gap-vim-4.4.12-2.fc17.noarch.rpm

	gap-vim.noarch: W: no-documentation
	1 packages and 0 specfiles checked; 0 errors, 1 warnings.


%{_prefix}/lib/gap is not really a harcoded-library-path.
update-gap-workspace having 0755 permissionin the src rpm is fine.
Those are not really spelling errors.
	rpmlint gap-4.4.12-2.fc17.src.rpm

	gap.src: W: spelling-error %description -l en_US combinatorial -> combination
	gap.src: W: spelling-error %description -l en_US metapackage -> meta package, meta-package, prepackage
	gap.src: W: strange-permission update-gap-workspace 0755L
	gap.src:4: E: hardcoded-library-path in %{_prefix}/lib/gap
	1 packages and 0 specfiles checked; 1 errors, 3 warnings.


no-documentation is fine for gap-xemacs-el
	rpmlint gap-xemacs-el-4.4.12-2.fc17.noarch.rpm

	gap-xemacs-el.noarch: W: no-documentation
	1 packages and 0 specfiles checked; 0 errors, 1 warnings.



no-documentation is fine for gap-online-help
answers.tex being empty is a bit perculiar but it's like that in the upstream tarball.
	rpmlint gap-online-help-4.4.12-2.fc17.noarch.rpm

	gap-online-help.noarch: W: no-documentation
	gap-online-help.noarch: E: zero-length /usr/share/gap/doc/tut/answers.tex
	1 packages and 0 specfiles checked; 1 errors, 1 warnings.


[x]: MUST Sources used to build the package match the upstream source, as
     provided in the spec URL.
update-gap-workspace :
  MD5SUM this package     : d4a980c11de9b52b865e1eb8922ee884
  MD5SUM upstream package : upstream source not found
gap.xml :
  MD5SUM this package     : ee18c6f9efe9bf6b505ecef15eb6f137
  MD5SUM upstream package : upstream source not found
/home/scottt/work/gap/gap4r4p12.tar.bz2 :
  MD5SUM this package     : 2808c00e85e98843bb0e1a62c33ad5f0
  MD5SUM upstream package : 2808c00e85e98843bb0e1a62c33ad5f0
gap-README.fedora :
  MD5SUM this package     : 678ca9de660d5fa489de82e4db9f7e8e
  MD5SUM upstream package : upstream source not found
gap.1.in :
  MD5SUM this package     : 92d1bc5e0acd996c650170bcb2583e35
  MD5SUM upstream package : upstream source not found
gac.1.in :
  MD5SUM this package     : 379c8943fdce42bdd8302420153b8d4f
  MD5SUM upstream package : upstream source not found
gap.desktop :
  MD5SUM this package     : a97be403c8b9aa74cc8cdea5488f9666
  MD5SUM upstream package : upstream source not found
gap.el :
  MD5SUM this package     : e28f5579433842bb3e73b1a8120bc72b
  MD5SUM upstream package : upstream source not found
update-gap-workspace.1 :
  MD5SUM this package     : e5644d608a5f88272a844d7867567fbd
  MD5SUM upstream package : upstream source not found

[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
     %{name}.spec.
[-]: 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,
     /usr/sbin.
[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.
[x]: SHOULD Scriptlets must be sane, if used.
[x]: SHOULD SourceX / PatchY prefixed with %{name}.
     Note: Source1: gap-README.fedora (gap-README.fedora) Source2: update-gap-
     workspace (update-gap-workspace) Source3: gap.xml (gap.xml) Source4:
     gap.desktop (gap.desktop) Source5: gap.el (gap.el) Source6: gap.1.in
     (gap.1.in) Source7: gac.1.in (gac.1.in) Source8: update-gap-workspace.1
     (update-gap-workspace.1) Patch0: gap-paths.patch (gap-paths.patch)
     Patch1: gap-raw.patch (gap-raw.patch) Patch2: gap-help.patch (gap-
     help.patch) Patch3: gap-crc.patch (gap-crc.patch) Patch4: gap-env.patch
     (gap-env.patch) Patch5: gap-alias.patch (gap-alias.patch) Patch6: gap-
     emacs.patch (gap-emacs.patch)
[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
     architectures.
[x]: SHOULD %check is present and all tests pass.
[x]: SHOULD Packages should try to preserve timestamps of original installed
     files.
[x]: SHOULD Spec use %global instead of %define.

I'll approve this as soon as you fix points one and two above.

Comment 6 Jerry James 2012-01-12 03:05:35 UTC
(In reply to comment #5)
> Sorry for the delay for this review:

No problem.  I've been quite busy with the mass rebuild for F17 anyway.  You've done a lot of work on this review, and I appreciate it a lot.

> 1. gap-core should own /usr/lib/gap/ (%{gaparchdir}) since it owns
> /usr/lib/gap/sysinfo.gap

Done.

> 2. For gap-vim, since you're not shipping README.vim-utils I recommend you ship
> the attached gap.vim as /usr/share/vimfiles/ftdetect/gap.vim. Otherwise the
> user would have to know to manually ":set filetype=vim" to activate the VIM
> sytnax hightlighting and indentation plugins.
> Hopefully the *.g, *.gi, *.gd file extensions are not used by other file types.

Thank you.  I've added this.

> 3. Placing "README.fedora" in gap-libs and placing "description4r4p10" in
> gap-core seems a bit strange to me. Maybe move "README" and "README.fedora" to
> gap-core? (not critical)

Good point.  I have moved the READMEs to gap-core.

> 4. Since Fedora packaging lack Debian's "recommand" and "suggest"
> functionality, I'm not sure splitting out the prim, small and trans group
> subpackages is really a good idea but I'll leave it to your disgression.

I think this is still a good idea considering the size of those packages.  However, to address the point that we have no way to recommend them, I made the gap metapackage Require all 3 of these.  That way, somebody you does "yum install gap" will get them all, and others can be more selective.

> 5. I was able to build and load the "Example" package from
> http://www.gap-system.org/Packages/packages.html sucessfully.

Great!

[snip]

> I'll approve this as soon as you fix points one and two above.

New URLs:
http://jjames.fedorapeople.org/gap/gap.spec
http://jjames.fedorapeople.org/gap/gap-4.4.12-3.fc16.src.rpm

Comment 7 Scott Tsai 2012-01-12 03:16:36 UTC
(In reply to comment #6)
Bravo, this was one tough package!

APPROVED.

Comment 8 Jerry James 2012-01-12 03:35:00 UTC
New Package SCM Request
=======================
Package Name: gap
Short Description: Computational discrete algebra
Owners: jjames
Branches: f16
InitialCC:

Comment 9 Gwyn Ciesla 2012-01-12 11:17:59 UTC
Git done (by process-git-requests).

Comment 10 Jerry James 2012-01-12 15:15:43 UTC
It appears that the F16 branch was not created:

[jamesjer@diannao gap]$ fedpkg switch-branch f16
Could not execute switch branch: Could not create branch f16

Comment 11 Rex Dieter 2012-01-12 15:28:17 UTC
git branch -a
lists
remotes/origin/f16

for me, and 

fedpkg switch-branch f16

works too... odd.

Comment 12 Jerry James 2012-01-12 15:40:00 UTC
Hmmmm, git branch -a lists it for me too, but fedpkg switch-branch is steadfastly refusing to work.

I nuked the entire directory and did a fresh fedpkg clone, and now it works.  Weird.  I guess I can live with not knowing what happened as long as it works now. :-)

I'll turn the cvs flag off.

Comment 13 Fedora Update System 2012-01-12 15:59:39 UTC
gap-4.4.12-3.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/gap-4.4.12-3.fc16

Comment 14 Fedora Update System 2012-01-14 03:58:46 UTC
gap-4.4.12-3.fc16 has been pushed to the Fedora 16 testing repository.

Comment 15 Fedora Update System 2012-01-23 21:58:17 UTC
gap-4.4.12-3.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.