[gap] Initial import.
Jerry James
jjames at fedoraproject.org
Thu Jan 12 14:51:26 UTC 2012
commit 574c3520e57cebd3d111f087cb00b5b804baca2c
Author: Jerry James <loganjerry at gmail.com>
Date: Thu Jan 12 07:51:11 2012 -0700
Initial import.
.gitignore | 1 +
gac.1.in | 71 ++++++++
gap-README.fedora | 65 ++++++++
gap-alias.patch | 231 ++++++++++++++++++++++++++
gap-crc.patch | 233 ++++++++++++++++++++++++++
gap-emacs.patch | 111 +++++++++++++
gap-env.patch | 27 +++
gap-help.patch | 44 +++++
gap-paths.patch | 73 +++++++++
gap-raw.patch | 20 +++
gap.1.in | 123 ++++++++++++++
gap.desktop | 11 ++
gap.el | 5 +
gap.spec | 421 ++++++++++++++++++++++++++++++++++++++++++++++++
gap.vim | 1 +
gap.xml | 7 +
sources | 1 +
update-gap-workspace | 36 ++++
update-gap-workspace.1 | 44 +++++
19 files changed, 1525 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..9593f6c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/gap4r4p12.tar.bz2
diff --git a/gac.1.in b/gac.1.in
new file mode 100644
index 0000000..5fa72dd
--- /dev/null
+++ b/gac.1.in
@@ -0,0 +1,71 @@
+.TH "GAC" "1" "@VERSION@" "GAP" "User Commands"
+.SH "NAME"
+gac \- Compile GAP input files
+.SH "SYNOPSIS"
+.B gac
+[\fI\-d\fP] [\fI\-c|\-C\fP] [\fI\-o <output>\fP] {\fI\-f<option>\fP}
+\fI<input>\fP ...
+.SH "DESCRIPTION"
+.PP
+GAC compiles GAP input files, which must be GAP source code (suffix '.g' or
+\'.gap'), C source code (suffix '.c'), or compiled code files (suffix '.o').
+.SH "OPTIONS"
+If neither \fI\-c\fP nor \fI\-C\fP is given, then gac compiles the code
+completely, producing a new kernel for static compilation or a dynamically
+loadable '.so' file for dynamic compilation.
+.TP
+\fB\-d\fP, \fB\-\-dynamic\fP
+Compile for dynamic loading.
+.TP
+\fB\-c\fP, \fB\-\-compile\fP
+Only compile the input files to '.o' object files, which must be further
+linked to make a static kernel or dynamically loadable module.
+.TP
+\fB\-C\fP, \fB\-\-create\-c\fP
+Only compile the input files to C code, which will require compilation and
+linking to be usable.
+.TP
+\fB\-r\fP
+Statically compiled files are assumed to be given by pathnames relative to the
+GAP root, and will be compiled for automatic loading when files are sought
+relative to the GAP root.
+.TP
+\fB\-o\fP, \fB\-\-output\fP \fI<output>\fP
+Set the name of the output file.
+.TP
+\fB\-ffast\-int\-arith\fP
+Emit code for arithmetic operations which works faster if both operands are
+small integers, and slower otherwise.
+.TP
+\fB\-ffast\-plain\-lists\fP
+Emit code for list access which works faster if the list is a plain list, and
+slower otherwise.
+.TP
+\fB\-ffast\-list\-funcs\fP
+Inline the list functions 'Add' and 'Length', for a small speed boost.
+.TP
+\fB\-fno\-check\-types\fP
+Emit no error checks for element types, which improves performance but may
+result in a crash if an error happens.
+.TP
+\fB\-fno\-check\-list\-elms\fP
+Emit no error checks for list access, which improves performance but may
+result in a crash if an error happens.
+.TP
+\fB\-p\fP \fI<option>\fP
+Pass the given option to the C compiler.
+.TP
+\fB\-P\fP \fI<option>\fP
+Pass the given option to the C linker.
+.TP
+\fB\-k\fP, \fB\-\-gap\-compiler\fP \fI<path>\fP
+Use the given path to find the GAP binary, instead of the default.
+.TP
+\fB\-i\fP, \fB\-\-gap\-include\fP \fI<path>\fP
+Use the given path to find the GAP header files, instead of the default.
+.TP
+\fB\-l\fP, \fB\-\-gap\-binary\fP \fI<path>\fP
+Use the given path to find the GAP binary directory, instead of the default.
+.SH "SEE ALSO"
+.PP
+\fIgap\fP(1), \fIupdate-gap-workspace\fP(1)
diff --git a/gap-README.fedora b/gap-README.fedora
new file mode 100644
index 0000000..909de71
--- /dev/null
+++ b/gap-README.fedora
@@ -0,0 +1,65 @@
+ GAP for Fedora
+ Based on "GAP for Debian" by Bill Allombert <ballombe at debian.org>
+
+
+GAP (http://www.gap-system.org) is a system for computational discrete
+algebra. Many add-on components ("packages") are available for GAP. Most of
+them not yet available from Fedora. However, they can be installed locally in
+any of the following locations:
+ - /usr/local/share/gap/pkg
+ - /usr/local/lib/gap/pkg
+ - ~/gap/pkg
+
+Some packages must be compiled. The necessary tools are available in the
+gap-devel package.
+
+Saved Workspaces, or How to make GAP start faster
+-------------------------------------------------
+
+GAP starts slowly because it needs to parse all the libraries installed at
+start up. To make GAP start faster, it is possible to save the GAP workspace
+and reload it at the next start up. To support this, Fedora provides a
+Debian-derived script, update-gap-workspace; see the the
+update-gap-workspace(1) manual page.
+
+Colors in the GAP shell
+-----------------------
+
+If you would like the GAP shell to display the prompt, input, etc. in color,
+you can try colorprompt.g by Frank Lübeck. Add this line to ~/.gaprc:
+
+ColorPrompt(true);
+
+See /usr/share/gap/lib/colorprompt.g for more information.
+
+Browsing GAP Documentation
+--------------------------
+
+By default, GAP will display documentation in a terminal. Other options are
+available. Insert one of the following into ~/.gaprc:
+
+SetHelpViewer("firefox"); # Displays HTML documentation in Firefox
+SetHelpViewer("konqueror"); # Displays HTML documentation in Konqueror
+SetHelpViewer("lynx"); # Displays HTML documentation in Lynx
+SetHelpViewer("w3m"); # Displays HTML documentation in w3m
+SetHelpViewer("xdvi"); # Displays DVI documentation in xdvi
+SetHelpViewer("xpdf"); # Displays PDF documentation in xpdf
+SetHelpViewer("xdghtml"); # Displays HTML documentation using xdg-open
+SetHelpViewer("xdgdvi"); # Displays DVI documentation using xdg-open
+SetHelpViewer("xdgpdf"); # Displays PDF documentation using xdg-open
+
+The last three are Fedora extensions. They use xdg-open to open the
+documentation files with the user's preferred applications.
+
+Large GAP libraries are compressed
+----------------------------------
+
+To save disk space, the largest GAP libraries are compressed with gzip. GAP
+automatically decompresses them.
+
+Supporting GAP
+--------------
+
+If you use GAP, please send a short note to support at gap-system.org stating you
+use the Fedora packages of GAP so the GAP team can keep track of the number of
+GAP users. This helps them obtain funding for the project.
diff --git a/gap-alias.patch b/gap-alias.patch
new file mode 100644
index 0000000..382f41f
--- /dev/null
+++ b/gap-alias.patch
@@ -0,0 +1,231 @@
+--- ./src/sysfiles.h.orig 2008-09-02 10:50:38.000000000 -0600
++++ ./src/sysfiles.h 2011-08-04 13:57:32.717487674 -0600
+@@ -46,7 +46,7 @@
+ extern Int SyFindOrLinkGapRootFile (
+ Char * filename,
+ Int4 crc_gap,
+- Char * result,
++ union StringOrInitInfo * result,
+ Int len );
+
+
+--- ./src/sysfiles.c.orig 2008-12-14 14:25:54.000000000 -0700
++++ ./src/sysfiles.c 2011-08-04 14:07:06.846239128 -0600
+@@ -191,7 +191,7 @@
+ Int SyFindOrLinkGapRootFile (
+ Char * filename,
+ Int4 crc_gap,
+- Char * result,
++ union StringOrInitInfo * result,
+ Int len )
+ {
+ UInt4 crc_dyn = 0;
+@@ -215,19 +215,19 @@
+ #endif
+
+ /* find the GAP file */
+- result[0] = '\0';
++ result->string[0] = '\0';
+ tmp = SyFindGapRootFile(filename);
+ if ( tmp ) {
+- SyStrncat( result, tmp, len );
++ SyStrncat( result->string, tmp, len );
+ name[0] = '\0';
+ SyStrncat( name, tmp, 255 );
+ }
+- if ( result[0] ) {
+- if ( SyIsReadableFile(result) == 0 ) {
++ if ( result->string[0] ) {
++ if ( SyIsReadableFile(result->string) == 0 ) {
+ found_gap = 1;
+ }
+ else {
+- result[0] = '\0';
++ result->string[0] = '\0';
+ }
+ }
+ if ( ! SyUseModule ) {
+@@ -389,11 +389,11 @@
+ if (found_dyn)
+ syUnloadLastModule ();
+ #endif
+- *(StructInitInfo**)result = info_sta;
++ result->info = info_sta;
+ return 2;
+ }
+ if ( found_gap && found_dyn ) {
+- *(StructInitInfo**)result = info_dyn;
++ result->info = info_dyn;
+ return 1;
+ }
+ if ( found_gap ) {
+@@ -404,11 +404,11 @@
+ if (found_dyn)
+ syUnloadLastModule ();
+ #endif
+- *(StructInitInfo**)result = info_sta;
++ result->info = info_sta;
+ return 2;
+ }
+ if ( found_dyn ) {
+- *(StructInitInfo**)result = info_dyn;
++ result->info = info_dyn;
+ return 1;
+ }
+ return 0;
+--- ./src/gap.c.orig 2007-10-04 09:05:16.000000000 -0600
++++ ./src/gap.c 2011-08-04 14:09:27.815182164 -0600
+@@ -1650,7 +1650,7 @@
+ StructInitInfo * info;
+ Int4 crc1;
+ Int4 crc2;
+- Char result[256];
++ union StringOrInitInfo result;
+ Int res;
+
+
+@@ -1670,7 +1670,7 @@
+
+ /* check if have a statically or dynamically loadable module */
+ crc1 = INT_INTOBJ(crc);
+- res = SyFindOrLinkGapRootFile(CSTR_STRING(filename), crc1, result, 256);
++ res = SyFindOrLinkGapRootFile(CSTR_STRING(filename), crc1, &result, 256);
+
+ /* not found */
+ if ( res == 0 ) {
+@@ -1685,7 +1685,7 @@
+ Pr( "#I READ_GAP_ROOT: loading '%s' dynamically\n",
+ (Int)CSTR_STRING(filename), 0L );
+ }
+- info = *(StructInitInfo**)result;
++ info = result.info;
+ res = info->initKernel(info);
+ UpdateCopyFopyInfo();
+ res = res || info->initLibrary(info);
+@@ -1703,7 +1703,7 @@
+ Pr( "#I READ_GAP_ROOT: loading '%s' statically\n",
+ (Int)CSTR_STRING(filename), 0L );
+ }
+- info = *(StructInitInfo**)result;
++ info = result.info;
+ res = info->initKernel(info);
+ UpdateCopyFopyInfo();
+ res = res || info->initLibrary(info);
+@@ -1721,15 +1721,15 @@
+
+ /* compute the crc value of the original and compare */
+ if ( SyCheckCompletionCrcComp ) {
+- crc2 = SyGAPCRC(result);
++ crc2 = SyGAPCRC(result.string);
+ if ( crc1 != crc2 ) {
+ return INTOBJ_INT(4);
+ }
+ }
+- /*CCC filename = NEW_STRING( SyStrlen(result) );
++ /*CCC filename = NEW_STRING( SyStrlen(result.string) );
+ SyStrncat( CSTR_STRING(filename), result, SyStrlen(result) );CCC*/
+- len = SyStrlen(result);
+- C_NEW_STRING(filename, len, result);
++ len = SyStrlen(result.string);
++ C_NEW_STRING(filename, len, result.string);
+
+ CompThenFuncs = NEW_PLIST( T_PLIST, COMP_THEN_OFFSET );
+ SET_LEN_PLIST( CompThenFuncs, COMP_THEN_OFFSET );
+--- ./src/system.h.orig 2007-10-06 16:53:20.000000000 -0600
++++ ./src/system.h 2011-08-04 14:04:52.971092306 -0600
+@@ -1105,6 +1105,10 @@
+
+ typedef StructInitInfo* (*InitInfoFunc)(void);
+
++union StringOrInitInfo {
++ Char string[256];
++ StructInitInfo * info;
++};
+
+ /****************************************************************************
+ **
+--- ./src/saveload.c.orig 2002-06-16 06:37:20.000000000 -0600
++++ ./src/saveload.c 2011-08-04 13:41:46.547763965 -0600
+@@ -37,6 +37,11 @@
+ #include "saveload.h" /* saving and loading */
+ #undef INCLUDE_DECLARATION_PART
+
++union double_bytes {
++ Double d;
++ UInt1 bytes[sizeof(Double)];
++};
++
+
+ /***************************************************************************
+ **
+@@ -438,19 +443,19 @@
+ void SaveDouble( Double d)
+ {
+ UInt i;
+- UInt1 buf[sizeof(Double)];
+- *(Double *)buf = d;
++ union double_bytes buf;
++ buf.d = d;
+ for (i = 0; i < sizeof(Double); i++)
+- SAVE_BYTE(buf[i]);
++ SAVE_BYTE(buf.bytes[i]);
+ }
+
+ Double LoadDouble( void)
+ {
+ UInt i;
+- UInt1 buf[sizeof(Double)];
++ union double_bytes buf;
+ for (i = 0; i < sizeof(Double); i++)
+- buf[i] = LOAD_BYTE();
+- return *(Double *)buf;
++ buf.bytes[i] = LOAD_BYTE();
++ return buf.d;
+ }
+
+ /***************************************************************************
+--- ./src/streams.c.orig 2008-09-02 10:52:34.000000000 -0600
++++ ./src/streams.c 2011-08-04 14:10:55.735229846 -0600
+@@ -316,13 +316,13 @@
+
+ Int READ_GAP_ROOT ( Char * filename )
+ {
+- Char result[256];
++ union StringOrInitInfo result;
+ Int res;
+ UInt type;
+ StructInitInfo * info;
+
+ /* try to find the file */
+- res = SyFindOrLinkGapRootFile( filename, 0L, result, 256 );
++ res = SyFindOrLinkGapRootFile( filename, 0L, &result, 256 );
+
+ /* not found */
+ if ( res == 0 ) {
+@@ -335,7 +335,7 @@
+ Pr( "#I READ_GAP_ROOT: loading '%s' dynamically\n",
+ (Int)filename, 0L );
+ }
+- info = *(StructInitInfo**)result;
++ info = result.info;
+ res = info->initKernel(info);
+ if (!SyRestoring) {
+ UpdateCopyFopyInfo();
+@@ -356,7 +356,7 @@
+ Pr( "#I READ_GAP_ROOT: loading '%s' statically\n",
+ (Int)filename, 0L );
+ }
+- info = *(StructInitInfo**)result;
++ info = result.info;
+ res = info->initKernel(info);
+ if (!SyRestoring) {
+ UpdateCopyFopyInfo();
+@@ -388,7 +388,7 @@
+ Pr( "#I READ_GAP_ROOT: loading '%s' as GAP file\n",
+ (Int)filename, 0L );
+ }
+- if ( OpenInput(result) ) {
++ if ( OpenInput(result.string) ) {
+ SySetBuffering(Input->file);
+ while ( 1 ) {
+ ClearError();
diff --git a/gap-crc.patch b/gap-crc.patch
new file mode 100644
index 0000000..d1bdb41
--- /dev/null
+++ b/gap-crc.patch
@@ -0,0 +1,233 @@
+--- lib/read3.co.orig 2008-12-15 08:56:40.000000000 -0700
++++ lib/read3.co 2011-12-30 15:39:05.989250432 -0700
+@@ -5172,7 +5172,7 @@ Unbind(RANK_FILTER_COUNT);
+ Unbind(COM_RESULT);
+ #E file="lib/grpnames.g"
+
+-#F file="lib/grpnames.gd" crc=115395428
++#F file="lib/grpnames.gd" crc=33537811
+ RANK_FILTER_LIST := [ 33223879, 16, 33223879, 16, 1, 0, 1, 0, 66060696, 21,
+ 993, 2, 1, 0, 33223879, 16, 33223879, 16, 1, 0, 1, 0, 65012480, 21, 993, 2,
+ 1, 0, 33223879, 16, 33223879, 16, 1, 0, 1, 0, 62915088, 21, 993, 2, 1, 0,
+@@ -5198,7 +5198,7 @@ RANK_FILTER_LIST := [ 33223879, 16, 332
+ RANK_FILTER_COUNT := 1;
+
+ #C load module, file, or complete
+-COM_RESULT := COM_FILE( "lib/grpnames.gd", 115395428 );
++COM_RESULT := COM_FILE( "lib/grpnames.gd", 33537811 );
+ if COM_RESULT = fail then
+ Error("cannot locate file \"lib/grpnames.gd\"");
+ elif COM_RESULT = 1 then
+@@ -6485,12 +6485,12 @@ Unbind(RANK_FILTER_COUNT);
+ Unbind(COM_RESULT);
+ #E file="lib/straight.gd"
+
+-#F file="lib/memory.gd" crc=-69936802
++#F file="lib/memory.gd" crc=-50727669
+ RANK_FILTER_LIST := [ 1985, 1, 1, 0, 1, 0, 56000950, 4, 993, 2, 1, 0 ];
+ RANK_FILTER_COUNT := 1;
+
+ #C load module, file, or complete
+-COM_RESULT := COM_FILE( "lib/memory.gd", -69936802 );
++COM_RESULT := COM_FILE( "lib/memory.gd", -50727669 );
+ if COM_RESULT = fail then
+ Error("cannot locate file \"lib/memory.gd\"");
+ elif COM_RESULT = 1 then
+@@ -8687,12 +8687,12 @@ Unbind(RANK_FILTER_COUNT);
+ Unbind(COM_RESULT);
+ #E file="lib/semiquo.gd"
+
+-#F file="lib/pager.gd" crc=120998950
++#F file="lib/pager.gd" crc=-28594049
+ RANK_FILTER_LIST := [ ];
+ RANK_FILTER_COUNT := 1;
+
+ #C load module, file, or complete
+-COM_RESULT := COM_FILE( "lib/pager.gd", 120998950 );
++COM_RESULT := COM_FILE( "lib/pager.gd", -28594049 );
+ if COM_RESULT = fail then
+ Error("cannot locate file \"lib/pager.gd\"");
+ elif COM_RESULT = 1 then
+@@ -8714,12 +8714,12 @@ Unbind(RANK_FILTER_COUNT);
+ Unbind(COM_RESULT);
+ #E file="lib/pager.gd"
+
+-#F file="lib/helpbase.gd" crc=-118849687
++#F file="lib/helpbase.gd" crc=-88527990
+ RANK_FILTER_LIST := [ ];
+ RANK_FILTER_COUNT := 1;
+
+ #C load module, file, or complete
+-COM_RESULT := COM_FILE( "lib/helpbase.gd", -118849687 );
++COM_RESULT := COM_FILE( "lib/helpbase.gd", -88527990 );
+ if COM_RESULT = fail then
+ Error("cannot locate file \"lib/helpbase.gd\"");
+ elif COM_RESULT = 1 then
+@@ -8767,12 +8767,12 @@ Unbind(RANK_FILTER_COUNT);
+ Unbind(COM_RESULT);
+ #E file="lib/helpbase.gd"
+
+-#F file="lib/helpview.gd" crc=8491351
++#F file="lib/helpview.gd" crc=-1578046
+ RANK_FILTER_LIST := [ ];
+ RANK_FILTER_COUNT := 1;
+
+ #C load module, file, or complete
+-COM_RESULT := COM_FILE( "lib/helpview.gd", 8491351 );
++COM_RESULT := COM_FILE( "lib/helpview.gd", -1578046 );
+ if COM_RESULT = fail then
+ Error("cannot locate file \"lib/helpview.gd\"");
+ elif COM_RESULT = 1 then
+@@ -8823,12 +8823,12 @@ Unbind(RANK_FILTER_COUNT);
+ Unbind(COM_RESULT);
+ #E file="lib/helpt2t.gd"
+
+-#F file="lib/helpdef.gd" crc=-55952681
++#F file="lib/helpdef.gd" crc=66735597
+ RANK_FILTER_LIST := [ ];
+ RANK_FILTER_COUNT := 1;
+
+ #C load module, file, or complete
+-COM_RESULT := COM_FILE( "lib/helpdef.gd", -55952681 );
++COM_RESULT := COM_FILE( "lib/helpdef.gd", 66735597 );
+ if COM_RESULT = fail then
+ Error("cannot locate file \"lib/helpdef.gd\"");
+ elif COM_RESULT = 1 then
+--- lib/read4.co.orig 2008-12-15 08:56:40.000000000 -0700
++++ lib/read4.co 2011-12-30 15:39:06.065250381 -0700
+@@ -84,12 +84,12 @@ Unbind(RANK_FILTER_COUNT);
+ Unbind(COM_RESULT);
+ #E file="lib/methwhy.g"
+
+-#F file="lib/pager.gi" crc=-122078620
++#F file="lib/pager.gi" crc=133116398
+ RANK_FILTER_LIST := [ ];
+ RANK_FILTER_COUNT := 1;
+
+ #C load module, file, or complete
+-COM_RESULT := COM_FILE( "lib/pager.gi", -122078620 );
++COM_RESULT := COM_FILE( "lib/pager.gi", 133116398 );
+ if COM_RESULT = fail then
+ Error("cannot locate file \"lib/pager.gi\"");
+ elif COM_RESULT = 1 then
+@@ -118,12 +118,12 @@ Unbind(RANK_FILTER_COUNT);
+ Unbind(COM_RESULT);
+ #E file="lib/pager.gi"
+
+-#F file="lib/helpbase.gi" crc=81259865
++#F file="lib/helpbase.gi" crc=-62250938
+ RANK_FILTER_LIST := [ ];
+ RANK_FILTER_COUNT := 1;
+
+ #C load module, file, or complete
+-COM_RESULT := COM_FILE( "lib/helpbase.gi", 81259865 );
++COM_RESULT := COM_FILE( "lib/helpbase.gi", -62250938 );
+ if COM_RESULT = fail then
+ Error("cannot locate file \"lib/helpbase.gi\"");
+ elif COM_RESULT = 1 then
+@@ -207,12 +207,12 @@ Unbind(RANK_FILTER_COUNT);
+ Unbind(COM_RESULT);
+ #E file="lib/helpt2t.gi"
+
+-#F file="lib/helpdef.gi" crc=92366536
++#F file="lib/helpdef.gi" crc=110442633
+ RANK_FILTER_LIST := [ ];
+ RANK_FILTER_COUNT := 1;
+
+ #C load module, file, or complete
+-COM_RESULT := COM_FILE( "lib/helpdef.gi", 92366536 );
++COM_RESULT := COM_FILE( "lib/helpdef.gi", 110442633 );
+ if COM_RESULT = fail then
+ Error("cannot locate file \"lib/helpdef.gi\"");
+ elif COM_RESULT = 1 then
+--- lib/read5.co.orig 2008-12-15 08:56:54.000000000 -0700
++++ lib/read5.co 2011-12-30 15:39:08.386248776 -0700
+@@ -4863,12 +4863,12 @@ Unbind(RANK_FILTER_COUNT);
+ Unbind(COM_RESULT);
+ #E file="lib/polyrat.gi"
+
+-#F file="lib/polyconw.gi" crc=-103456530
++#F file="lib/polyconw.gi" crc=-104825482
+ RANK_FILTER_LIST := [ ];
+ RANK_FILTER_COUNT := 1;
+
+ #C load module, file, or complete
+-COM_RESULT := COM_FILE( "lib/polyconw.gi", -103456530 );
++COM_RESULT := COM_FILE( "lib/polyconw.gi", -104825482 );
+ if COM_RESULT = fail then
+ Error("cannot locate file \"lib/polyconw.gi\"");
+ elif COM_RESULT = 1 then
+@@ -10743,7 +10743,7 @@ Unbind(RANK_FILTER_COUNT);
+ Unbind(COM_RESULT);
+ #E file="lib/grpprmcs.gi"
+
+-#F file="lib/grpnames.gi" crc=-100562243
++#F file="lib/grpnames.gi" crc=-3569340
+ RANK_FILTER_LIST := [ 29419057, 21, 29419057, 21, 29419057, 21, 29419057,
+ 21, 29419057, 21, 29419057, 21, 29419057, 21, 29419057, 21, 29419057, 21,
+ 29419057, 21, 29419057, 21, 29419057, 21, 29419057, 21, 29419057, 21,
+@@ -10752,7 +10752,7 @@ RANK_FILTER_LIST := [ 29419057, 21, 294
+ RANK_FILTER_COUNT := 1;
+
+ #C load module, file, or complete
+-COM_RESULT := COM_FILE( "lib/grpnames.gi", -100562243 );
++COM_RESULT := COM_FILE( "lib/grpnames.gi", -3569340 );
+ if COM_RESULT = fail then
+ Error("cannot locate file \"lib/grpnames.gi\"");
+ elif COM_RESULT = 1 then
+@@ -11617,7 +11617,7 @@ Unbind(RANK_FILTER_COUNT);
+ Unbind(COM_RESULT);
+ #E file="lib/grpmat.gi"
+
+-#F file="lib/grpffmat.gi" crc=-70944848
++#F file="lib/grpffmat.gi" crc=-126348146
+ RANK_FILTER_LIST := [ 65760937, 34, 57928553, 19, 65749777, 242, 65749777,
+ 242, 65749777, 242, 10987176, 246, 61964548, 248, 58412696, 30, 10987176,
+ 246, 58412696, 30, 61964548, 248, 10987176, 246, 61964548, 248, 10987176,
+@@ -11626,7 +11626,7 @@ RANK_FILTER_LIST := [ 65760937, 34, 579
+ RANK_FILTER_COUNT := 1;
+
+ #C load module, file, or complete
+-COM_RESULT := COM_FILE( "lib/grpffmat.gi", -70944848 );
++COM_RESULT := COM_FILE( "lib/grpffmat.gi", -126348146 );
+ if COM_RESULT = fail then
+ Error("cannot locate file \"lib/grpffmat.gi\"");
+ elif COM_RESULT = 1 then
+@@ -12793,7 +12793,7 @@ Unbind(RANK_FILTER_COUNT);
+ Unbind(COM_RESULT);
+ #E file="lib/adjoin.gi"
+
+-#F file="lib/semirel.gi" crc=82907093
++#F file="lib/semirel.gi" crc=-45125472
+ RANK_FILTER_LIST := [ 11831026, 13, 11831026, 13, 11831026, 13, 11831026,
+ 13, 11831026, 13, 62127694, 11, 47185096, 11, 57146508, 11, 49709012, 10,
+ 49709012, 10, 11819866, 15, 1, 0, 11819866, 15, 1, 0, 11819866, 15, 1, 0,
+@@ -12813,7 +12813,7 @@ RANK_FILTER_LIST := [ 11831026, 13, 118
+ RANK_FILTER_COUNT := 1;
+
+ #C load module, file, or complete
+-COM_RESULT := COM_FILE( "lib/semirel.gi", 82907093 );
++COM_RESULT := COM_FILE( "lib/semirel.gi", -45125472 );
+ if COM_RESULT = fail then
+ Error("cannot locate file \"lib/semirel.gi\"");
+ elif COM_RESULT = 1 then
+--- lib/read7.co.orig 2008-12-15 08:56:58.000000000 -0700
++++ lib/read7.co 2011-12-30 15:39:08.990248358 -0700
+@@ -2041,7 +2041,7 @@ Unbind(RANK_FILTER_COUNT);
+ Unbind(COM_RESULT);
+ #E file="lib/straight.gi"
+
+-#F file="lib/memory.gi" crc=-124009148
++#F file="lib/memory.gi" crc=52960952
+ RANK_FILTER_LIST := [ 1985, 1, 61553939, 107, 8193, 2, 1, 0, 1, 0, 61553939,
+ 107, 8194, 4, 24857226, 21, 61553939, 107, 61553939, 107, 61553939, 107,
+ 61553939, 107, 61553939, 107, 61553939, 107, 61553939, 107, 61553939, 107,
+@@ -2056,7 +2056,7 @@ RANK_FILTER_LIST := [ 1985, 1, 61553939
+ RANK_FILTER_COUNT := 1;
+
+ #C load module, file, or complete
+-COM_RESULT := COM_FILE( "lib/memory.gi", -124009148 );
++COM_RESULT := COM_FILE( "lib/memory.gi", 52960952 );
+ if COM_RESULT = fail then
+ Error("cannot locate file \"lib/memory.gi\"");
+ elif COM_RESULT = 1 then
diff --git a/gap-emacs.patch b/gap-emacs.patch
new file mode 100644
index 0000000..88b888b
--- /dev/null
+++ b/gap-emacs.patch
@@ -0,0 +1,111 @@
+--- ./etc/emacs/gap-process.el.orig 2005-05-08 01:44:58.000000000 -0600
++++ ./etc/emacs/gap-process.el 2011-08-04 15:25:18.327841875 -0600
+@@ -337,7 +337,9 @@
+ (unwind-protect
+ (progn
+ (with-output-to-temp-buffer "*Completions*"
+- (print-help-return-message))
++ (if (featurep 'xemacs)
++ (print-help-return-message)
++ (help-print-return-message)))
+ (set-process-filter process 'gap-completions-filter)
+ (process-send-string process (concat gap-completion-ident
+ "\t\t\C-x")))))))
+@@ -371,8 +373,10 @@
+ (unwind-protect
+ (progn
+ (with-output-to-temp-buffer "*Help*"
+- (print-help-return-message))
+- (set-process-filter process 'gap-help-filter)
++ (if (featurep 'xemacs)
++ (print-help-return-message)
++ (help-print-return-message)))
++ (set-process-filter process 'gap-help-filter)
+ (process-send-string process (concat "?" topic "\n"))))))
+
+ (defun get-start-process (progm &optional name dir args startfile)
+@@ -382,17 +386,17 @@
+ containing initial standard input to process."
+ (interactive)
+ (require 'comint)
+- (setq name (or name (file-name-nondirectory progm)))
+- (setq buffname (concat "*" name "*"))
+- (cond ((not (comint-check-proc buffname))
+- (let ((buff (get-buffer-create buffname)))
+- (set-buffer buff)
+- (switch-to-buffer buff)
+- (if dir (cd dir))
+- (apply 'make-comint name progm startfile args)))
+- (t
+- (switch-to-buffer buffname)
+- (get-buffer buffname))))
++ (let ((name (or name (file-name-nondirectory progm)))
++ (buffname (concat "*" name "*")))
++ (cond ((not (comint-check-proc buffname))
++ (let ((buff (get-buffer-create buffname)))
++ (set-buffer buff)
++ (switch-to-buffer buff)
++ (if dir (cd dir))
++ (apply 'make-comint name progm startfile args)))
++ (t
++ (switch-to-buffer buffname)
++ (get-buffer buffname)))))
+ (defun string-strip-chars (string strip)
+ "Take STRING and remove characters in STRIP"
+ (while (> (length strip) 0)
+--- ./etc/emacs/gap-mode.el.orig 2001-08-15 10:42:16.000000000 -0600
++++ ./etc/emacs/gap-mode.el 2011-08-04 15:29:19.482725282 -0600
+@@ -89,15 +89,6 @@
+ (autoload 'gap-complete "gap-process" nil t)
+
+
+-;;! Fix member function?!
+-(defun memberequal (x y)
+- "Like memq, but uses `equal' for comparison.
+-This is a subr in Emacs 19."
+- (while (and y (not (equal x (car y))))
+- (setq y (cdr y)))
+- y)
+-
+-
+ (defvar gap-indent-brackets t
+ "* Whether to check back for unclosed brackets in determining
+ indentation level. This is good for formatting lists and matrices.")
+@@ -445,12 +436,12 @@
+ (setq name (buffer-substring (match-beginning 2) (match-end 2)))
+ (goto-char (match-end 0)))
+ (t (error "gap-insert-local-variables incorrect code!")))
+- (if (not (memberequal name names))
++ (if (not (member name names))
+ (setq names (append names (list name))))))
+ (beginning-of-line)
+ (let (lnames)
+ (while (car names)
+- (if (memberequal (car names) formal)
++ (if (member (car names) formal)
+ (setq names (cdr names))
+ (setq lnames (append lnames (list (car names))))
+ (setq names (cdr names))))
+@@ -527,11 +518,11 @@
+ ;;! Now the indentation functions and variables
+ ;;
+
+-(setq gap-end-of-statement
++(defconst gap-end-of-statement
+ (concat "\\(;\\|\\<then\\>\\|\\<else\\>\\|\\<do\\>\\|"
+ "\\<repeat\\>\\|\\<function\\>.*(.*)\\)"))
+
+-(setq gap-increment-indentation-regexp (concat "^[ \t]*\\("
++(defconst gap-increment-indentation-regexp (concat "^[ \t]*\\("
+ "if\\>"
+ "\\|else\\>"
+ "\\|elif\\>"
+@@ -541,7 +532,7 @@
+ "\\|.*\\<function\\>"
+ "\\)"))
+
+-(setq gap-decrement-indentation-regexp (concat "^[ \t]*\\("
++(defconst gap-decrement-indentation-regexp (concat "^[ \t]*\\("
+ "fi\\>"
+ "\\|od\\>"
+ "\\|else\\>"
diff --git a/gap-env.patch b/gap-env.patch
new file mode 100644
index 0000000..e47aab5
--- /dev/null
+++ b/gap-env.patch
@@ -0,0 +1,27 @@
+--- ./src/system.c.orig 2008-12-15 06:08:32.000000000 -0700
++++ ./src/system.c 2011-12-30 16:42:48.444607336 -0700
+@@ -2042,6 +2042,7 @@ void InitSystem (
+ /* Char * ptr; */ /* pointer to the pre'malloc'ated */
+ /* Char * ptr1; */ /* more pre'malloc'ated */
+ Char * *ptrlist;
++ Char * envvar;
+ UInt i; /* loop variable */
+ Int res; /* return from option processing function */
+ #if SYS_MAC_MWC
+@@ -2299,6 +2300,16 @@ void InitSystem (
+
+ #endif
+
++ /* process environment variables */
++ envvar = getenv("GAP_DIR");
++ if (envvar == NULL)
++ envvar = "/usr/share/gap";
++ setGapRootPath(&envvar, NULL);
++ envvar = getenv("GAP_MEM");
++ if (envvar == NULL)
++ envvar = "32m";
++ storeMemory2(&envvar, &SyStorMin);
++
+ /* scan the command line for options */
+ while ( argc > 1 && argv[1][0] == '-' ) {
+
diff --git a/gap-help.patch b/gap-help.patch
new file mode 100644
index 0000000..a9fa093
--- /dev/null
+++ b/gap-help.patch
@@ -0,0 +1,44 @@
+--- ./lib/helpdef.gi.orig 2008-06-23 04:12:20.000000000 -0600
++++ ./lib/helpdef.gi 2011-12-30 15:24:46.334844855 -0700
+@@ -332,6 +332,11 @@ HELP_BOOK_HANDLER.default.ReadSix := fun
+ res.pdffile := ShallowCopy(fname);
+ Add(res.formats, "pdf");
+ fi;
++ fname{[Length(fname)-5..Length(fname)]} := "dvi.gz";
++ if IsExistingFile( fname ) = true then
++ res.dvifile := ShallowCopy(fname);
++ Add(res.formats, "dvi");
++ fi;
+ fi;
+ res.directories := Directory(fname{[1..Length(fname)-10]});
+ return res;
+--- ./lib/helpview.gi.orig 2005-04-20 05:38:02.000000000 -0600
++++ ./lib/helpview.gi 2011-12-30 15:30:48.173594656 -0700
+@@ -283,6 +283,27 @@ show := function(file)
+ end
+ );
+
++# View HTML, DVI, or PDF files with xdg-open, which opens documents with the
++# user's preferred application.
++HELP_VIEWER_INFO.xdghtml := rec(
++type := "url",
++show := function(url)
++ Exec(Concatenation("xdg-open \"", url, "\""));
++end
++);
++HELP_VIEWER_INFO.xdgdvi := rec(
++type := "dvi",
++show := function(file)
++ Exec(Concatenation("xdg-open \"", file, "\""));
++end
++);
++HELP_VIEWER_INFO.xdgpdf := rec(
++type := "pdf",
++show := function(file)
++ Exec(Concatenation("xdg-open \"", file, "\""));
++end
++);
++
+ #############################################################################
+ ##
+ #F SetHelpViewer(<viewer>): Set the viewer used for help
diff --git a/gap-paths.patch b/gap-paths.patch
new file mode 100644
index 0000000..56b6f1c
--- /dev/null
+++ b/gap-paths.patch
@@ -0,0 +1,73 @@
+--- ./configure.orig 2007-10-04 09:05:16.000000000 -0600
++++ ./configure 2012-01-03 16:55:54.417003009 -0700
+@@ -2764,7 +2764,7 @@ echo "${ECHO_T}no" >&6; }
+ fi
+
+
+-gapdir=`pwd`
++gapdir=/usr/share/gap
+ mkdir -p bin
+ ac_config_files="$ac_config_files Makefile sysinfo.gap:sysinfo.in bin/gap.sh:gap.shi"
+
+--- ./cnf/gac.in.orig 2006-03-05 06:37:06.000000000 -0700
++++ ./cnf/gac.in 2012-01-03 16:59:18.237794244 -0700
+@@ -51,16 +51,16 @@
+ ## The option '-P <option>' tells 'gac' to pass the option <option> to the
+ ## C linker.
+ ##
+-gap_bin=@gapbin@
++gap_bin=/usr/include/gap
+
+ if [ "X${gap_bin}" = "X$0" ]; then
+ gap_dir="../../";
+ gap_compiler="./gap";
+ gap_binary="./";
+ else
+- gap_dir="${gap_bin}/../..";
+- gap_compiler="${gap_bin}/gap";
+- gap_binary="${gap_bin}";
++ gap_dir=/usr/lib/gap;
++ gap_compiler=/usr/bin/gap;
++ gap_binary=${gap_dir}/bin/@gaparch@;
+ fi
+ gap_options=""
+ gap_include="${gap_dir}/src"
+@@ -111,9 +111,9 @@ gap_compile () {
+ ##
+ c_compile () {
+ echo ${c_compiler} $3 -o $1 -I${gap_dir} \
+- -I${gap_bin} -DCONFIG_H -c $2
++ -I${gap_bin} -I${gap_binary} -DCONFIG_H -c $2
+ ${c_compiler} $3 -o $1 -I${gap_dir} \
+- -I${gap_bin} -DCONFIG_H -c $2
++ -I${gap_bin} -I${gap_binary} -DCONFIG_H -c $2
+ }
+
+
+@@ -387,17 +387,17 @@ make_compstat () {
+ objects="${gactmp}/$$compstat.o ${objects}"
+ }
+
+-make_tmpdir () {
+- basetmp=${TMPDIR:-/tmp}; #honor the TMPDIR environment variable.
+- gactmp="$basetmp/gac$$";
+- mkdir "$gactmp" || exit 1;
+-}
++#make_tmpdir () {
++# basetmp=${TMPDIR:-/tmp}; #honor the TMPDIR environment variable.
++# gactmp="$basetmp/gac$$";
++# mkdir "$gactmp" || exit 1;
++#}
+
+ #On systems with mktemp(1) this function is better:
+-#make_tmpdir ()
+-#{
+-# gactmp=`mktemp -d -t "gacXXXXXXX"`;
+-#}
++make_tmpdir ()
++{
++ gactmp=`mktemp -d -t "gacXXXXXXX"`;
++}
+
+ #############################################################################
+ ##
diff --git a/gap-raw.patch b/gap-raw.patch
new file mode 100644
index 0000000..80ecd07
--- /dev/null
+++ b/gap-raw.patch
@@ -0,0 +1,20 @@
+--- ./src/sysfiles.c.orig 2008-12-14 14:25:54.000000000 -0700
++++ ./src/sysfiles.c 2011-12-30 15:12:00.360374500 -0700
+@@ -1523,7 +1523,7 @@ extern void syStopraw (
+ ** to cooked mode before stopping GAP and back to raw mode when continueing.
+ */
+
+-#if !SYS_IS_DARWIN && (SYS_BSD || SYS_MACH || HAVE_SGTTY_H)
++#if !HAVE_TERMIOS_H && !SYS_IS_DARWIN && (SYS_BSD || SYS_MACH || HAVE_SGTTY_H)
+
+ #ifndef SYS_SGTTY_H /* terminal control functions */
+ # include <sgtty.h>
+@@ -2072,7 +2072,7 @@ UInt syStartraw (
+ **
+ *f syStopraw( <fid> ) . . . . . . . . . . . . . . . . . . . . . . BSD/MACH
+ */
+-#if !SYS_IS_DARWIN && (SYS_BSD || SYS_MACH || HAVE_SGTTY_H)
++#if !HAVE_TERMIOS_H && !SYS_IS_DARWIN && (SYS_BSD || SYS_MACH || HAVE_SGTTY_H)
+
+ void syStopraw (
+ Int fid )
diff --git a/gap.1.in b/gap.1.in
new file mode 100644
index 0000000..ece7598
--- /dev/null
+++ b/gap.1.in
@@ -0,0 +1,123 @@
+.TH "GAP" "1" "@VERSION@" "GAP" "User Commands"
+.SH "NAME"
+gap \- Run the Groups, Algorithms and Programming system
+.SH "SYNOPSIS"
+.B gap
+[\fIOPTIONS\fP] [\fIFILES\fP]
+.SH "DESCRIPTION"
+.PP
+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.
+.SH "OPTIONS"
+Boolean options (b, e, p, q, r, A, D, M, N, O, T, X, and Y) toggle the current
+value each time they are used. Default actions are indicated first.
+.PP
+MEM options indicate a number of bytes. Larger units are indicated with
+trailing characters: 'k' for kilobytes, m for megabytes, and g for gigabytes.
+For example, '512k' means 512 kilobytes.
+.TP
+\fB\-a\fP \fIMEM\fP
+Set the amount of preallocated space.
+.TP
+\fB\-b\fP
+Disable/enable the banner.
+.TP
+\fB\-c\fP \fIMEM\fP
+Set the cache size.
+.TP
+\fB\-e\fP
+Disable/enable quitting on Ctrl-D.
+.TP
+\fB\-f\fP
+Force line editing.
+.TP
+\fB\-g\fP
+Show GASMAN messages. If this option is given once, then full garbage
+collections are shown. If it is given twice, all garbage collections are
+shown.
+.TP
+\fB\-h\fP
+Print a help message and exit.
+.TP
+\fB\-i\fP \fIFILE\fP
+Load an alternate init file.
+.TP
+\fB\-l\fP \fIPATHS\fP
+Set the GAP root paths. A leading semicolon means to append PATHS to the
+existing list of root paths. A trailing semicolon means to prepend PATHS.
+Otherwise, the list of root paths is replaced with PATHS.
+.TP
+\fB\-m\fP \fIMEM\fP
+Set the initial workspace size.
+.TP
+\fB\-n\fP
+Prevent line editing.
+.TP
+\fB\-o\fP \fIMEM\fP
+Set the hint for the maximal workspace size. GAP may allocate more.
+.TP
+\fB\-p\fP
+Enable/disable emitting extra commands to the output to tell a window handler
+what GAP is doing.
+.TP
+\fB\-q\fP
+Enable/disable quiet mode.
+.TP
+\fB\-r\fP
+Disable/enable reading of the .gaprc file.
+.TP
+\fB\-x\fP \fINUM\fP
+Set the window width to NUM columns.
+.TP
+\fB\-y\fP \fINUM\fP
+Set the window height to NUM rows.
+.TP
+\fB\-A\fP
+Disable/enable autoloading of GAP packages.
+.TP
+\fB\-B\fP \fINAME\fP
+Set the name of the current architecture.
+.TP
+\fB\-C\fP \fI<output>\fP \fI<input>\fP \fI<name>\fP
+Compile an input file with the given name into an output file.
+.TP
+\fB\-D\fP
+Enable/disable debugging the loading of library files.
+.TP
+\fB\-K\fP \fIMEM\fP
+Set the maximal workspace size. GAP never allocates more.
+.TP
+\fB\-L\fP \fIFILE\fP
+Restore a saved workspace.
+.TP
+\fB\-M\fP
+Disable/enable loading of compiled modules.
+.TP
+\fB\-N\fP
+Disable/enable check for completion files.
+.TP
+\fB\-O\fP
+Enable/disable compatibility with GAP 3, by causing false and fail to be the
+same value.
+.TP
+\fB\-R\fP
+Prevent restoring of workspace (causes -L to be ignored).
+.TP
+\fB\-T\fP
+Disable/enable break loop.
+.TP
+\fB\-U\fP \fIOPTIONS\fP
+Set the compile options for compiling GAP files.
+.TP
+\fB\-X\fP
+Enable/disable CRC while reading completion.
+.TP
+\fB\-Y\fP
+Enable/disable CRC while completing files.
+.SH "SEE ALSO"
+.PP
+\fIgac\fP(1), \fIupdate-gap-workspace\fP(1)
diff --git a/gap.desktop b/gap.desktop
new file mode 100644
index 0000000..65d1185
--- /dev/null
+++ b/gap.desktop
@@ -0,0 +1,11 @@
+
+[Desktop Entry]
+Name=GAP
+GenericName=Computational discrete algebra
+Comment=Groups, Algorithms, Programming
+Exec=gap %U
+Icon=/usr/share/icons/hicolor/32x32/gap.png
+Terminal=true
+Type=Application
+Categories=Education;Science;Math;
+MimeType=application/x-gap;
diff --git a/gap.el b/gap.el
new file mode 100644
index 0000000..794576d
--- /dev/null
+++ b/gap.el
@@ -0,0 +1,5 @@
+(autoload 'gap-mode "gap-mode" "Gap editing mode" t)
+(autoload 'gap "gap-process" "Run GAP in emacs buffer" t)
+(add-to-list 'auto-mode-alist '("\\.g$" . gap-mode))
+(add-to-list 'auto-mode-alist '("\\.gap$" . gap-mode))
+(setq gap-executable "/usr/bin/gap")
diff --git a/gap.spec b/gap.spec
new file mode 100644
index 0000000..0c9bc49
--- /dev/null
+++ b/gap.spec
@@ -0,0 +1,421 @@
+%global upstreamver 4r4p12
+%global gapdirname gap%(echo %upstreamver | cut -dp -f1)
+%global gapdir %{_datadir}/gap
+%global gaparchdir %{_prefix}/lib/gap
+%global icondir %{_datadir}/icons/hicolor
+
+Name: gap
+Version: %(echo %upstreamver | sed -r "s/r|p/./g")
+Release: 3%{?dist}
+Summary: Computational discrete algebra
+
+Group: Applications/Engineering
+License: GPLv2+
+URL: http://www.gap-system.org/
+Source0: ftp://ftp.gap-system.org/pub/gap/gap4/tar.bz2/%{name}%{upstreamver}.tar.bz2
+Source1: gap-README.fedora
+Source2: update-gap-workspace
+Source3: gap.xml
+Source4: gap.desktop
+Source5: gap.el
+Source6: gap.1.in
+Source7: gac.1.in
+Source8: update-gap-workspace.1
+Source9: gap.vim
+# This patch from Debian rearranges some paths to match Linux conventions.
+Patch0: gap-paths.patch
+# This patch from Debian makes GAP use termios controls instead of BSD ioctls
+# to manage a raw terminal.
+Patch1: gap-raw.patch
+# This patch applies a change from Debian to allow help files to be in gzip
+# compressed DVI files, and also adds support for viewing with xdg-open.
+Patch2: gap-help.patch
+# This patch will not be sent upstream. It fixes some CRCs after converting
+# the source files from ISO8859-1 to UTF-8 and applying the previous patches.
+Patch3: gap-crc.patch
+# This patch will not be sent upstream. It makes the main binary read the
+# environment variables now read by gap.sh, so we can dispose of the shell
+# script and run the actual binary directly.
+Patch4: gap-env.patch
+# This patch was sent upstream 4 Aug 2011. It fixes several places where the
+# sources violate ANSI C alias analysis rules.
+Patch5: gap-alias.patch
+# This patch was sent upstream 4 Aug 2011. It fixes some cosmetic issues in
+# the Emacs Lisp sources.
+Patch6: gap-emacs.patch
+
+BuildRequires: desktop-file-utils
+BuildRequires: netpbm-progs
+BuildRequires: emacs
+BuildRequires: xemacs
+
+Requires: %{name}-libs = %{version}-%{release}
+Requires: %{name}-core%{?_isa} = %{version}-%{release}
+Requires: %{name}-online-help = %{version}-%{release}
+Requires: %{name}-prim-groups = %{version}-%{release}
+Requires: %{name}-small-groups = %{version}-%{release}
+Requires: %{name}-trans-groups = %{version}-%{release}
+
+%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 a metapackage that requires the standard GAP components.
+
+%package libs
+Summary: Essential GAP libraries
+Group: Applications/Engineering
+BuildArch: noarch
+
+%description libs
+This package contains the essential GAP libraries: lib and grp.
+
+%package core
+Summary: GAP core components
+Group: Applications/Engineering
+Requires: %{name}-libs = %{version}-%{release}
+# The gap binary executes gunzip
+Requires: gzip
+Requires: hicolor-icon-theme
+
+%description core
+This package contains the core GAP system.
+
+%package online-help
+Summary: Online help for GAP
+Group: Documentation
+Requires: %{name}-core = %{version}-%{release}
+BuildArch: noarch
+
+%description online-help
+This package contains the documentation in TeX format needed for GAP's
+online help system.
+
+%package devel
+Summary: GAP compiler and development files
+Group: Development/Languages
+Requires: %{name}-core%{?isa} = %{version}-%{release}
+Requires: gcc
+
+%description devel
+This package contains the GAP compiler (gac) and the header files necessary
+for developing GAP programs.
+
+%package prim-groups
+Summary: Database of primitive groups for GAP
+Group: Applications/Engineering
+Requires: %{name}-core = %{version}-%{release}
+BuildArch: noarch
+
+%description prim-groups
+This package contains a database of primitive groups for GAP.
+
+%package small-groups
+Summary: Database of small groups for GAP
+Group: Applications/Engineering
+Requires: %{name}-core = %{version}-%{release}
+BuildArch: noarch
+
+%description small-groups
+This package contains a database of groups of small order for GAP. The
+database includes the group data and identification routines for groups
+of order up to 2000.
+
+%package trans-groups
+Summary: Database of transitive groups for GAP
+Group: Applications/Engineering
+Requires: %{name}-core = %{version}-%{release}
+BuildArch: noarch
+
+%description trans-groups
+This package contains a database of transitive groups for GAP.
+
+%package vim
+Summary: Edit GAP files with VIM
+Group: Applications/Engineering
+Requires: %{name}-core = %{version}-%{release}, vim-filesystem
+BuildArch: noarch
+
+%description vim
+This package provides VIM add-on files to support editing GAP sources.
+Both syntax highlighting and indentation are supported.
+
+%package emacs
+Summary: Edit GAP files with Emacs
+Group: Applications/Engineering
+Requires: %{name}-core = %{version}-%{release}
+Requires: emacs(bin) >= %{_emacs_version}
+BuildArch: noarch
+
+%description emacs
+This package provides Emacs add-on files to support editing GAP sources
+and running GAP from within Emacs.
+
+%package emacs-el
+Summary: Emacs Lisp source files for GAP
+Group: Applications/Engineering
+Requires: %{name}-emacs = %{version}-%{release}
+BuildArch: noarch
+
+%description emacs-el
+Emacs Lisp source files for GAP. This package is not needed to use the
+GAP Emacs support.
+
+%package xemacs
+Summary: Edit GAP files with XEmacs
+Group: Applications/Engineering
+Requires: %{name}-core = %{version}-%{release}
+Requires: xemacs(bin) >= %{_xemacs_version}, xemacs-packages-base
+BuildArch: noarch
+
+%description xemacs
+This package provides XEmacs add-on files to support editing GAP sources
+and running GAP from within XEmacs.
+
+%package xemacs-el
+Summary: XEmacs Lisp source files for GAP
+Group: Applications/Engineering
+Requires: %{name}-xemacs = %{version}-%{release}
+BuildArch: noarch
+
+%description xemacs-el
+XEmacs Lisp source files for GAP. This package is not needed to use the
+GAP XEmacs support.
+
+%prep
+%setup -q -n %{gapdirname}
+%patch0
+%patch1
+%patch2
+%patch3
+%patch4
+%patch5
+%patch6
+
+# Replace the CFLAGS
+sed -i "s|gp_cv_cflags=\"-Wall -g -O2\"|gp_cv_cflags='$RPM_OPT_FLAGS -DSYS_DEFAULT_PATHS=\\\\\"%{gapdir}\\\\\"'|" \
+ cnf/configure.out
+
+# Fix file encodings
+for f in description4r4p6 etc/gap*.vim etc/README.vim-utils lib/colorprompt.g \
+ lib/grpffmat.gi lib/grpnames.gd lib/grpnames.gi lib/helpbase.* \
+ lib/helpdef.* lib/helpview.* lib/memory.* lib/pager.* \
+ lib/polyconw.gi lib/semirel.gi small/README; do
+ iconv -f iso8859-1 -t utf-8 $f > $f.new
+ touch -f $f $f.new
+ mv -f $f.new $f
+done
+
+# Get the README
+cp -p %{SOURCE1} README.fedora
+
+%build
+%configure
+make %{?_smp_mflags} compile
+
+# Compress help files
+find doc -name \*.dvi -o -name \*.toc | xargs gzip --best
+
+# Compress large group files
+find -O3 small -mindepth 2 -type f | xargs gzip --best -f
+gzip --best prim/grps/*.g trans/*.grp
+
+%install
+# Get the value of the GAParch variable
+source ./sysinfo.gap
+
+# Install the binaries
+mkdir -p $RPM_BUILD_ROOT%{_bindir}
+cp -p bin/$GAParch/gap $RPM_BUILD_ROOT%{_bindir}
+cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}
+sed -e "s|@gaparch@|$GAParch|" \
+ -e "s| -DSYS_DEFAULT_PATHS=\\\"/usr/share/gap\\\"||" \
+ bin/$GAParch/gac > $RPM_BUILD_ROOT%{_bindir}/gac
+chmod a+x $RPM_BUILD_ROOT%{_bindir}/ga*
+
+# Install the data
+mkdir -p $RPM_BUILD_ROOT%{gapdir}/etc
+cp -a grp lib prim small trans tst $RPM_BUILD_ROOT%{gapdir}
+cp -p etc/debug* $RPM_BUILD_ROOT%{gapdir}/etc
+
+# Install the arch-specific files
+mkdir -p $RPM_BUILD_ROOT%{gaparchdir}
+cp -p sysinfo.gap $RPM_BUILD_ROOT%{gaparchdir}
+
+# Create the system workspace, initially empty
+mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}
+touch $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/workspace
+
+# Install the header and object files where the GAP compiler can find them
+mkdir -p $RPM_BUILD_ROOT%{gaparchdir}/src
+cp -p src/*.h bin/$GAParch/config.h $RPM_BUILD_ROOT%{gaparchdir}/src
+mkdir -p $RPM_BUILD_ROOT%{gaparchdir}/bin/$GAParch
+cp -p bin/$GAParch/*.o $RPM_BUILD_ROOT%{gaparchdir}/bin/$GAParch
+
+# Make an empty directory to hold the GAP packages
+mkdir -p $RPM_BUILD_ROOT%{gapdir}/pkg
+
+# Intall the documentation
+cp -a doc $RPM_BUILD_ROOT%{gapdir}
+rm -f $RPM_BUILD_ROOT%{gapdir}/doc/manualindex
+rm -fr $RPM_BUILD_ROOT%{gapdir}/doc/test
+
+# Install the icon
+mkdir -p $RPM_BUILD_ROOT%{icondir}/32x32
+bmptopnm bin/gapicon.bmp | pnmtopng -compression=9 \
+ > $RPM_BUILD_ROOT%{icondir}/32x32/gap.png
+
+# Install the MIME type
+mkdir -p $RPM_BUILD_ROOT%{_datadir}/mime/packages
+cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_datadir}/mime/packages
+
+# Install the desktop file
+mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
+desktop-file-install --mode=644 --dir=$RPM_BUILD_ROOT%{_datadir}/applications \
+ %{SOURCE4}
+
+# Install the VIM support
+mkdir -p $RPM_BUILD_ROOT%{_datadir}/vim/vimfiles/indent
+cp -p etc/gap_indent.vim $RPM_BUILD_ROOT%{_datadir}/vim/vimfiles/indent
+mkdir -p $RPM_BUILD_ROOT%{_datadir}/vim/vimfiles/syntax
+cp -p etc/gap.vim $RPM_BUILD_ROOT%{_datadir}/vim/vimfiles/syntax
+mkdir -p $RPM_BUILD_ROOT%{_datadir}/vim/vimfiles/ftdetect
+cp -p %{SOURCE9} $RPM_BUILD_ROOT%{_datadir}/vim/vimfiles/ftdetect
+
+# Install the Emacs support
+mkdir -p $RPM_BUILD_ROOT%{_emacs_sitelispdir}
+cp -p etc/emacs/gap*.el $RPM_BUILD_ROOT%{_emacs_sitelispdir}
+pushd $RPM_BUILD_ROOT%{_emacs_sitelispdir}
+%{_emacs_bytecompile} gap*.el
+popd
+mkdir -p $RPM_BUILD_ROOT%{_emacs_sitestartdir}
+cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_emacs_sitestartdir}
+
+# Install the XEmacs support
+mkdir -p $RPM_BUILD_ROOT%{_xemacs_sitelispdir}
+cp -p etc/emacs/gap*.el $RPM_BUILD_ROOT%{_xemacs_sitelispdir}
+pushd $RPM_BUILD_ROOT%{_xemacs_sitelispdir}
+%{_xemacs_bytecompile} gap*.el
+popd
+mkdir -p $RPM_BUILD_ROOT%{_xemacs_sitestartdir}
+cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_xemacs_sitestartdir}
+
+# Install the man pages
+mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
+sed "s|@VERSION@|%{version}|" %{SOURCE6} > $RPM_BUILD_ROOT%{_mandir}/man1/gap.1
+sed "s|@VERSION@|%{version}|" %{SOURCE7} > $RPM_BUILD_ROOT%{_mandir}/man1/gac.1
+cp -p %{SOURCE8} $RPM_BUILD_ROOT%{_mandir}/man1
+
+%post core
+update-mime-database %{_datadir}/mime &>/dev/null ||:
+touch --no-create %{icondir} >&/dev/null ||:
+update-desktop-database %{_datadir}/applications &>/dev/null ||:
+%{_bindir}/update-gap-workspace
+
+%postun core
+update-mime-database %{_datadir}/mime &>/dev/null ||:
+touch --no-create %{icondir} >&/dev/null ||:
+%{_bindir}/gtk-update-icon-cache %{icondir} >&/dev/null ||:
+update-desktop-database %{_datadir}/applications &>/dev/null ||:
+
+%posttrans
+%{_bindir}/gtk-update-icon-cache %{icondir} >&/dev/null ||:
+
+%posttrans prim-groups -p %{_bindir}/update-gap-workspace
+
+%postun prim-groups -p %{_bindir}/update-gap-workspace
+
+%posttrans small-groups -p %{_bindir}/update-gap-workspace
+
+%postun small-groups -p %{_bindir}/update-gap-workspace
+
+%posttrans trans-groups -p %{_bindir}/update-gap-workspace
+
+%postun trans-groups -p %{_bindir}/update-gap-workspace
+
+%check
+sed -e "s|^GAP_DIR=.*|GAP_DIR=$RPM_BUILD_ROOT%{gapdir}|" \
+ -e "s|\$GAP_DIR/bin/\$GAP_PRG|$RPM_BUILD_ROOT%{_bindir}/gap|" \
+ -i bin/gap.sh
+make testinstall
+
+%files
+# No files in the metapackage
+
+%files libs
+%doc etc/GPL
+%dir %{gapdir}
+%{gapdir}/grp/
+%{gapdir}/lib/
+
+%files core
+%doc README README.fedora description*
+%{_bindir}/gap
+%{_bindir}/update-gap-workspace
+%dir %{gaparchdir}
+%{gaparchdir}/sysinfo.gap
+%{gapdir}/pkg/
+%{_mandir}/man1/gap.1*
+%{_mandir}/man1/update-gap-workspace.1*
+%{_datadir}/applications/gap.desktop
+%{_datadir}/mime/packages/gap.xml
+%{icondir}/32x32/gap.png
+%dir %{_localstatedir}/lib/%{name}/
+%verify(user group mode) %{_localstatedir}/lib/%{name}/workspace
+
+%files online-help
+%{gapdir}/doc/
+
+%files devel
+%{_bindir}/gac
+%{gaparchdir}/bin/
+%{gaparchdir}/src/
+%{gapdir}/tst/
+%{_mandir}/man1/gac.1*
+
+%files prim-groups
+%{gapdir}/prim/
+
+%files small-groups
+%doc small/README
+%{gapdir}/small/
+
+%files trans-groups
+%{gapdir}/trans/
+
+%files vim
+%{gapdir}/etc/
+%{_datadir}/vim/vimfiles/ftdetect/gap.vim
+%{_datadir}/vim/vimfiles/indent/gap_indent.vim
+%{_datadir}/vim/vimfiles/syntax/gap.vim
+
+%files emacs
+%doc etc/emacs/gap-mode.doc
+%{_emacs_sitelispdir}/gap*.elc
+%{_emacs_sitestartdir}/gap.el
+
+%files emacs-el
+%{_emacs_sitelispdir}/gap*.el
+
+%files xemacs
+%doc etc/emacs/gap-mode.doc
+%{_xemacs_sitelispdir}/gap*.elc
+%{_xemacs_sitestartdir}/gap.el
+
+%files xemacs-el
+%{_xemacs_sitelispdir}/gap*.el
+
+%changelog
+* Wed Jan 11 2012 Jerry James <loganjerry at gmail.com> - 4.4.12-3
+- Fix problems found on review
+
+* Tue Jan 3 2012 Jerry James <loganjerry at gmail.com> - 4.4.12-2
+- Mimic Debian's subpackage structure
+
+* Wed Oct 12 2011 Jerry James <loganjerry at gmail.com> - 4.4.12-1
+- Initial RPM
diff --git a/gap.vim b/gap.vim
new file mode 100644
index 0000000..780c008
--- /dev/null
+++ b/gap.vim
@@ -0,0 +1 @@
+autocmd BufRead,BufNewFile *.g,*.gi,*.gd set filetype=gap
diff --git a/gap.xml b/gap.xml
new file mode 100644
index 0000000..5262a46
--- /dev/null
+++ b/gap.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
+ <mime-type type="application/x-gap">
+ <comment>GAP input</comment>
+ <glob pattern="*.gap"/>
+ </mime-type>
+</mime-info>
diff --git a/sources b/sources
index e69de29..ad45820 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+2808c00e85e98843bb0e1a62c33ad5f0 gap4r4p12.tar.bz2
diff --git a/update-gap-workspace b/update-gap-workspace
new file mode 100755
index 0000000..263be34
--- /dev/null
+++ b/update-gap-workspace
@@ -0,0 +1,36 @@
+#!/bin/sh
+#
+# Script borrowed from Debian. Thanks to the Debian packagers.
+
+set -e
+
+GAP="/usr/bin/gap"
+
+if ! test -x "$GAP"; then
+ exit 0;
+fi
+
+if test `id -u` = 0; then
+ WORKSPACE=/var/lib/gap/workspace
+else
+ WORKSPACE=$HOME/gap/workspace
+fi
+
+case $1 in
+delete) echo -n "Deleting GAP workspace $WORKSPACE.gz: "
+ rm -f $WORKSPACE.gz
+ echo "done.";;
+''|update) echo -n "Updating GAP workspace $WORKSPACE.gz: "
+ rm -f $WORKSPACE.gz
+ mkdir -p `dirname $WORKSPACE`
+ echo 'SaveWorkspace("'$WORKSPACE'");' | $GAP -q -r -R >/dev/null
+ gzip --best $WORKSPACE
+ echo "done.";;
+*)
+ echo "$0 update"
+ echo " Update GAP workspace in $WORKSPACE.gz"
+ echo
+ echo "$0 delete"
+ echo " Delete GAP workspace in $WORKSPACE.gz"
+ ;;
+esac
diff --git a/update-gap-workspace.1 b/update-gap-workspace.1
new file mode 100644
index 0000000..a8ff9ef
--- /dev/null
+++ b/update-gap-workspace.1
@@ -0,0 +1,44 @@
+.TH "UPDATE-GAP-WORKSPACE" "1" "July 2003" "GAP" "User Commands"
+.SH "NAME"
+update-gap-workspace \- manage a GAP workspace.
+.SH "SYNOPSIS"
+\&update-gap-workspace
+.PP
+\&update-gap-workspace update
+.IP
+Create or update the GAP workspace.
+.PP
+\&update-gap-workspace delete
+.IP
+Delete the GAP workspace.
+.SH "DESCRIPTION"
+At start up, GAP load all libraries and packages available on the system.
+This take several seconds. To save time, GAP can store the result of
+this initialisation in a `workspace'.
+.I update-gap-workspace
+help to manage such workspaces.
+.I update-gap-workspace
+can be run as root to manage the system-wide workspace.
+.I update-gap-workspace
+can be run as a normal user. In this case the workspace is stored in
+$HOME/gap/workspace.gz.
+.PP
+Note that you need to rebuild the workspace each time GAP packages are
+added, removed or updated. To automate that task, if the system-wide
+workspace exists, it is automatically updated whenever a GAP-related
+Debian package is installed or upgraded.
+.PP
+The gap script will automatically load such workspace at start up.
+.SH "FILES"
+.I /var/lib/gap/workspace.gz:
+.RS
+The system-wide GAP workspace.
+.RE
+.I $HOME/gap/workspace.gz:
+.RS
+The user-specific GAP workspace.
+.SH "SEE ALSO"
+.I gap(1),
+.I The \`SaveWorkspace' function in the GAP manual.
+.SH "AUTHOR"
+Bill Allombert <ballombe at debian.org>
More information about the scm-commits
mailing list