diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6225908 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +Yap-5.1.3.tar.gz +chr_translate_bootstrap1.pl +chr_translate_bootstrap2.pl +chr_translate.pl +guard_entailment.pl +/yap-6.2.0.tar.gz +/yap-6.2.2.tar.gz diff --git a/Yap-5.1.3-soname.patch b/Yap-5.1.3-soname.patch new file mode 100644 index 0000000..d05937a --- /dev/null +++ b/Yap-5.1.3-soname.patch @@ -0,0 +1,42 @@ +diff -up Yap-5.1.3/Makefile.in.soname Yap-5.1.3/Makefile.in +--- Yap-5.1.3/Makefile.in.soname 2009-06-15 22:12:57.000000000 +0200 ++++ Yap-5.1.3/Makefile.in 2009-06-15 21:59:18.000000000 +0200 +@@ -578,16 +578,16 @@ startup: yap@EXEC_SUFFIX@ $(PL_SOURCES) + -rm -f startup + echo "bootstrap('$(srcdir)/pl/init.yap'). module(user). save_program(startup)." | @CROSS_SIMULATOR@ ./yap -b $(srcdir)/pl/boot.yap + +-yap@EXEC_SUFFIX@: $(HEADERS) yap.o @YAPLIB@.5.1.3 +- $(MPI_CC) $(STANDARD_CFLAGS) $(LDFLAGS) -o yap yap.o @YAPLIB@.5.1.3 $(LIBS) @MPI_LIBS@ ++yap@EXEC_SUFFIX@: $(HEADERS) yap.o @YAPLIB@ ++ $(MPI_CC) $(STANDARD_CFLAGS) $(LDFLAGS) -o yap yap.o @YAPLIB@ $(LIBS) @MPI_LIBS@ + + libYap.a: $(LIB_OBJECTS) + -rm -f libYap.a + $(AR) rc libYap.a $(LIB_OBJECTS) + $(RANLIB) libYap.a + +-@DYNYAPLIB@.5.1.3: $(LIB_OBJECTS) +- @DYNLIB_LD@ -Wl,-soname=@YAPLIB@.5.1.3 -o @YAPLIB@.5.1.3 $(LIB_OBJECTS) $(LIBS) $(LDFLGS) ++@DYNYAPLIB@: $(LIB_OBJECTS) ++ @DYNLIB_LD@ -o @YAPLIB@ $(LIB_OBJECTS) $(LIBS) $(LDFLGS) + + install: install_bin install_data + +@@ -598,7 +598,7 @@ install_unix: startup libYap.a + $(INSTALL_PROGRAM) -m 755 yap@EXEC_SUFFIX@ $(DESTDIR)$(BINDIR)/yap + mkdir -p $(DESTDIR)$(YAPLIBDIR) + $(INSTALL_DATA) startup $(DESTDIR)$(YAPLIBDIR)/startup +- @INSTALL_DLLS@ $(INSTALL_DATA) -m 755 @YAPLIB@.5.1.3 $(DESTDIR)$(LIBDIR) ++ @INSTALL_DLLS@ $(INSTALL_DATA) -m 755 @YAPLIB@ $(DESTDIR)$(LIBDIR) + mkdir -p $(DESTDIR)$(SHAREDIR)/Yap + mkdir -p $(DESTDIR)$(SHAREDIR)/Yap/pl + mkdir -p $(DESTDIR)$(SHAREDIR)/Yap/swi +@@ -643,7 +643,7 @@ install_win32: startup + (cd library/tries; make install) + @ENABLE_CPLINT@ (cd cplint; make install) + +-install_library: @YAPLIB@.5.1.3 ++install_library: @YAPLIB@ + mkdir -p $(DESTDIR)$(INCLUDEDIR) + for h in $(HEADERS); do $(INSTALL) $$h $(DESTDIR)$(INCLUDEDIR); done + diff --git a/Yap-noni386.patch b/Yap-noni386.patch new file mode 100644 index 0000000..ce01f3f --- /dev/null +++ b/Yap-noni386.patch @@ -0,0 +1,11 @@ +--- Yap-4.5.5/H/absmi.h.noni386 2005-06-18 15:52:24.000000000 +0200 ++++ Yap-4.5.5/H/absmi.h 2005-06-18 15:52:34.000000000 +0200 +@@ -282,7 +282,7 @@ + + #define CACHE_A1() (SREG = (CELL *)ARG1) + +-#define CACHED_A1() ((CELL)SREG) ++#define CACHED_A1() SREG + + #endif /* S_IN_MEM */ + diff --git a/dead.package b/dead.package deleted file mode 100644 index 9ed1316..0000000 --- a/dead.package +++ /dev/null @@ -1 +0,0 @@ -Fails to build with GCC 7, upstream does not respond (bug #1421711). diff --git a/sources b/sources new file mode 100644 index 0000000..cf4d846 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +5010225464ffe8b2aa3e0bca9d935937 yap-6.2.2.tar.gz diff --git a/yap-6.2.0-Do-not-install-README-etc.patch b/yap-6.2.0-Do-not-install-README-etc.patch new file mode 100644 index 0000000..b5a4b57 --- /dev/null +++ b/yap-6.2.0-Do-not-install-README-etc.patch @@ -0,0 +1,26 @@ +From d9acef3be4ca926d0f138184535e3f16b15d6045 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Wed, 22 Dec 2010 09:31:28 +0100 +Subject: [PATCH] Do not install README etc. + +--- + Makefile.in | 3 --- + 1 files changed, 0 insertions(+), 3 deletions(-) + +diff --git a/Makefile.in b/Makefile.in +index 522ac0a..8f37d05 100755 +--- a/Makefile.in ++++ b/Makefile.in +@@ -554,9 +554,6 @@ install_unix: startup.yss libYap.a + mkdir -p $(DESTDIR)$(SHAREDIR)/Yap + mkdir -p $(DESTDIR)$(SHAREDIR)/Yap/pl + mkdir -p $(DESTDIR)$(DOCSDIR) +- $(INSTALL) $(srcdir)/Artistic $(DESTDIR)$(DOCSDIR) +- $(INSTALL) $(srcdir)/README $(DESTDIR)$(DOCSDIR) +- $(INSTALL) $(srcdir)/COPYING $(DESTDIR)$(DOCSDIR) + for f in $(PL_SOURCES); do $(INSTALL) $$f $(DESTDIR)$(SHAREDIR)/Yap/pl; done + @INSTALL_DLLS@ (cd packages/PLStream; $(MAKE) install) + @INSTALL_DLLS@ (cd library/lammpi; $(MAKE) install) +-- +1.7.3.4 + diff --git a/yap-6.2.0-Do-not-install-info-dir-index.patch b/yap-6.2.0-Do-not-install-info-dir-index.patch new file mode 100644 index 0000000..6cc701d --- /dev/null +++ b/yap-6.2.0-Do-not-install-info-dir-index.patch @@ -0,0 +1,32 @@ +From 07a8f2b1e905d9133c057d2a2d83a2b7a5bb44ba Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Wed, 22 Dec 2010 10:59:06 +0100 +Subject: [PATCH] Do not install info dir index + +--- + Makefile.in | 2 -- + 1 files changed, 0 insertions(+), 2 deletions(-) + +diff --git a/Makefile.in b/Makefile.in +index c513d0c..cbdfcaf 100755 +--- a/Makefile.in ++++ b/Makefile.in +@@ -717,7 +717,6 @@ install_info: + gzip --quiet --force $(DESTDIR)$(INFODIR)/yap.info*; \ + fi \ + fi; \ +- $(INSTALL_INFO) --quiet --section "Programming Languages" yap.info $(DESTDIR)$(INFODIR)/dir; \ + cd $(srcdir)/LGPL/pillow/doc ; \ + $(INSTALL_DATA) pillow_doc.info $(DESTDIR)$(INFODIR); \ + if test -e $(DESTDIR)$(INFODIR)/emacs.bz2; then \ +@@ -727,7 +726,6 @@ install_info: + gzip --quiet --force $(DESTDIR)$(INFODIR)/pillow_doc.info; \ + fi \ + fi; \ +- $(INSTALL_INFO) --quiet --section "Programming Languages" --entry="`cat pillow_doc.infoindex`" --info-dir=$(DESTDIR)$(INFODIR) pillow_doc.info + + install_docs: + $(MAKE) pdf +-- +1.7.3.4 + diff --git a/yap-6.2.0-Install-directory-for-info-pages.patch b/yap-6.2.0-Install-directory-for-info-pages.patch new file mode 100644 index 0000000..cbe8fb5 --- /dev/null +++ b/yap-6.2.0-Install-directory-for-info-pages.patch @@ -0,0 +1,24 @@ +From d6ce7191c9dcac1681a2b29d68db0858133405c3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Tue, 21 Dec 2010 11:31:37 +0100 +Subject: [PATCH] Install directory for info pages + +--- + Makefile.in | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +diff --git a/Makefile.in b/Makefile.in +index 5fbf662..522ac0a 100755 +--- a/Makefile.in ++++ b/Makefile.in +@@ -711,6 +711,7 @@ yap.dll: libYap.a + + install_info: + $(MAKE) info; \ ++ mkdir -p $(DESTDIR)$(INFODIR); \ + $(INSTALL) yap.info* $(DESTDIR)$(INFODIR); \ + if test -e $(DESTDIR)$(INFODIR)/emacs.bz2; then \ + bzip2 --quiet --force $(DESTDIR)$(INFODIR)/yap.info*; \ +-- +1.7.3.4 + diff --git a/yap-6.2.0-Install-http-CSS-files-into-PLTARGET.patch b/yap-6.2.0-Install-http-CSS-files-into-PLTARGET.patch new file mode 100644 index 0000000..6b3f949 --- /dev/null +++ b/yap-6.2.0-Install-http-CSS-files-into-PLTARGET.patch @@ -0,0 +1,30 @@ +From 1ea44f8db749d81a790c55d63bfa4c1dbd5cb211 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Tue, 21 Dec 2010 12:59:55 +0100 +Subject: [PATCH] Install http CSS files into PLTARGET + +--- + packages/http/Makefile.in | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/packages/http/Makefile.in b/packages/http/Makefile.in +index 8609697..1c3dbda 100755 +--- a/packages/http/Makefile.in ++++ b/packages/http/Makefile.in +@@ -111,11 +111,11 @@ install: $(LIBPL) $(SOLIBS) + $(INSTALL_PROGRAM) $(SOLIBS) $(BINTARGET) + mkdir -p $(PLTARGET) + mkdir -p $(PLTARGET)/web/icons +- mkdir -p $(DESTDIR)$(LIBDIR)/web/css ++ mkdir -p $(PLTARGET)/web/css + $(INSTALL_DATA) $(LIBPL) $(PLTARGET) + $(INSTALL_DATA) $(srcdir)/README $(PLTARGET) + $(INSTALL_DATA) $(srcdir)/web/icons/*.png $(PLTARGET)/web/icons +- $(INSTALL_DATA) $(srcdir)/web/css/*.css $(DESTDIR)$(LIBDIR)/web/css ++ $(INSTALL_DATA) $(srcdir)/web/css/*.css $(PLTARGET)/web/css + $(PL) -f none -g make -t halt + + ln-install: $(LIBPL) +-- +1.7.3.4 + diff --git a/yap-6.2.0-Install-info-pages-non-executable.patch b/yap-6.2.0-Install-info-pages-non-executable.patch new file mode 100644 index 0000000..44b2837 --- /dev/null +++ b/yap-6.2.0-Install-info-pages-non-executable.patch @@ -0,0 +1,34 @@ +From 84f7e2e5ac18dd130d1656b677d40ebdd7cda9a1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Wed, 22 Dec 2010 10:18:17 +0100 +Subject: [PATCH] Install info pages non-executable + +--- + Makefile.in | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Makefile.in b/Makefile.in +index 8f37d05..c513d0c 100755 +--- a/Makefile.in ++++ b/Makefile.in +@@ -709,7 +709,7 @@ yap.dll: libYap.a + install_info: + $(MAKE) info; \ + mkdir -p $(DESTDIR)$(INFODIR); \ +- $(INSTALL) yap.info* $(DESTDIR)$(INFODIR); \ ++ $(INSTALL_DATA) yap.info* $(DESTDIR)$(INFODIR); \ + if test -e $(DESTDIR)$(INFODIR)/emacs.bz2; then \ + bzip2 --quiet --force $(DESTDIR)$(INFODIR)/yap.info*; \ + else \ +@@ -719,7 +719,7 @@ install_info: + fi; \ + $(INSTALL_INFO) --quiet --section "Programming Languages" yap.info $(DESTDIR)$(INFODIR)/dir; \ + cd $(srcdir)/LGPL/pillow/doc ; \ +- $(INSTALL) pillow_doc.info $(DESTDIR)$(INFODIR); \ ++ $(INSTALL_DATA) pillow_doc.info $(DESTDIR)$(INFODIR); \ + if test -e $(DESTDIR)$(INFODIR)/emacs.bz2; then \ + bzip2 --quiet --force $(DESTDIR)$(INFODIR)/pillow_doc.info; \ + else \ +-- +1.7.3.4 + diff --git a/yap-6.2.0-Locate-mysql-by-mysql_config.patch b/yap-6.2.0-Locate-mysql-by-mysql_config.patch new file mode 100644 index 0000000..ae81528 --- /dev/null +++ b/yap-6.2.0-Locate-mysql-by-mysql_config.patch @@ -0,0 +1,25 @@ +From 131213c12d09cdce8a56b5148ce753b0f5ae8e77 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Tue, 21 Dec 2010 10:32:02 +0100 +Subject: [PATCH] Locate mysql by mysql_config + +--- + configure.in | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/configure.in b/configure.in +index 4ce9538..80208e5 100755 +--- a/configure.in ++++ b/configure.in +@@ -665,7 +665,7 @@ then + if test "$yap_cv_mysql" = yes + then + YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_MYSQL" +- LIBS="$LIBS -L${yap_cv_myddas}/lib/mysql -lmysqlclient " ++ LIBS="$LIBS $(mysql_config --libs) " + fi + + dnl check for odbc +-- +1.7.3.4 + diff --git a/yap-6.2.0-Remove-feature-macro.patch b/yap-6.2.0-Remove-feature-macro.patch new file mode 100644 index 0000000..75201ee --- /dev/null +++ b/yap-6.2.0-Remove-feature-macro.patch @@ -0,0 +1,27 @@ +From 9419d68dc09a4e3f7adfe7e654ef3952327cd9bf Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Wed, 7 Dec 2011 14:14:25 +0100 +Subject: [PATCH] Remove feature macro + +This macro clashes with struct ppc_debug_info member in +on PPC. The macro is not used anywhere in yap. +--- + packages/PLStream/pl-incl.h | 2 -- + 1 files changed, 0 insertions(+), 2 deletions(-) + +diff --git a/packages/PLStream/pl-incl.h b/packages/PLStream/pl-incl.h +index aa7b99c..8bf63de 100755 +--- a/packages/PLStream/pl-incl.h ++++ b/packages/PLStream/pl-incl.h +@@ -363,8 +363,6 @@ typedef struct PL_local_data { + + #define usedStack(D) 0 + +-#define features (LD->feature.mask) +- + extern PL_local_data_t lds; + + #define exception_term (LD->exception.term) +-- +1.7.7.4 + diff --git a/yap-6.2.0-gprof-macro.patch b/yap-6.2.0-gprof-macro.patch new file mode 100644 index 0000000..1d18164 --- /dev/null +++ b/yap-6.2.0-gprof-macro.patch @@ -0,0 +1,14 @@ +diff -up yap-6/C/gprof.c.macro yap-6/C/gprof.c +--- yap-6/C/gprof.c.macro 2011-06-23 14:45:25.000000000 +0200 ++++ yap-6/C/gprof.c 2011-06-23 14:45:43.000000000 +0200 +@@ -102,8 +102,8 @@ typedef greg_t context_reg; + + #else + +-#define CONTEXT_PC NULL +-#define CONTEXT_BP NULL ++#define CONTEXT_PC(scv) NULL ++#define CONTEXT_BP(scv) NULL + + #endif + diff --git a/yap-6.2.2-Off-by-one-error-when-initializing-yap_flags.patch b/yap-6.2.2-Off-by-one-error-when-initializing-yap_flags.patch new file mode 100644 index 0000000..a376743 --- /dev/null +++ b/yap-6.2.2-Off-by-one-error-when-initializing-yap_flags.patch @@ -0,0 +1,41 @@ +From fa8f0f7b2d107770ae4d37bc77c902eafc59c86c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Mon, 7 Jan 2013 17:31:08 +0100 +Subject: [PATCH] Off-by-one error when initializing yap_flags + +The yap_flags_field of all_heap_codes structure is of type +Int[LAST_FLAG], thus the loop should iterate from 0 to LAST_FLAG - 1. +--- + C/init.c | 2 +- + C/stdpreds.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/C/init.c b/C/init.c +index dda09cc..8f01864 100755 +--- a/C/init.c ++++ b/C/init.c +@@ -1348,7 +1348,7 @@ Yap_InitWorkspace(UInt Heap, UInt Stack, UInt Trail, UInt Atts, UInt max_table_s + Yap_InitTime (); + /* InitAbsmi must be done before InitCodes */ + /* This must be done before initialising predicates */ +- for (i = 0; i <= LAST_FLAG; i++) { ++ for (i = 0; i < LAST_FLAG; i++) { + yap_flags[i] = 0; + } + #ifdef MPW +diff --git a/C/stdpreds.c b/C/stdpreds.c +index a4c0e86..8a4183f 100755 +--- a/C/stdpreds.c ++++ b/C/stdpreds.c +@@ -3637,7 +3637,7 @@ p_access_yap_flags(void) + return(FALSE); + } + flag = IntOfTerm(tflag); +- if (flag < 0 || flag > NUMBER_OF_YAP_FLAGS) { ++ if (flag < 0 || flag >= NUMBER_OF_YAP_FLAGS) { + return(FALSE); + } + #ifdef TABLING +-- +1.7.11.7 + diff --git a/yap-6.2.2-Texinfo-5-does-not-allow-bullet-as-table-indicator.patch b/yap-6.2.2-Texinfo-5-does-not-allow-bullet-as-table-indicator.patch new file mode 100644 index 0000000..1c65631 --- /dev/null +++ b/yap-6.2.2-Texinfo-5-does-not-allow-bullet-as-table-indicator.patch @@ -0,0 +1,34 @@ +From 04fae092c7dd5e55846073887a9604e1008cbc82 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Thu, 28 Mar 2013 10:13:43 +0100 +Subject: [PATCH] Texinfo 5 does not allow @bullet as @table indicator + +From Texinfo 5 documentation: + +Write the '@table' command at the beginning of a line, after a blank +line, and follow it on the same line with an argument that is +a Texinfo "indicating" command [...] You may also use the '@asis' +command as an argument to '@table'. '@asis' is a command that does +nothing; + +Documentation for Indicating commands does not list @bullet. +--- + docs/yap.tex | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/docs/yap.tex b/docs/yap.tex +index 162a184..df40c71 100644 +--- a/docs/yap.tex ++++ b/docs/yap.tex +@@ -15820,7 +15820,7 @@ be lost. + We next discuss several issues on trying to make Prolog programs run + fast in YAP. We assume two different programming styles: + +-@table @bullet ++@table @asis + @item Execution of @emph{deterministic} programs often + boils down to a recursive loop of the form: + @example +-- +1.8.1.4 + diff --git a/yap.spec b/yap.spec new file mode 100644 index 0000000..4212c3f --- /dev/null +++ b/yap.spec @@ -0,0 +1,386 @@ +# BEAM is experimantal and some interpreter code unimplemented. See +# README.EAM.html for more details. +%global use_eam 0 + +Name: yap +Version: 6.2.2 +Release: 8%{?dist} +Summary: High-performance Prolog Compiler +Group: Development/Languages +# README Perl Artistic license 2 and the FSF's LGPL +# packages/ProbLog/ Artistic 2.0 +# COPYING LGPL +# LGPL/pillow/pillow.pl LGPLv2+ +# packages/clib/sha1/sha2.c BSD or GPL +# packages/http/examples/demo_threads.pl GPLv2+ +License: Artistic 2.0 and LGPLv2+ and (BSD or GPL+) and (GPLv2+) +URL: http://www.ncc.up.pt/~vsc/Yap/ +Source: %{url}%{name}-%{version}.tar.gz +Patch1: Yap-noni386.patch +Patch2: yap-6.2.0-Locate-mysql-by-mysql_config.patch +Patch3: yap-6.2.0-Install-directory-for-info-pages.patch +Patch4: yap-6.2.0-Install-http-CSS-files-into-PLTARGET.patch +Patch5: yap-6.2.0-Do-not-install-README-etc.patch +Patch6: yap-6.2.0-Install-info-pages-non-executable.patch +Patch7: yap-6.2.0-Do-not-install-info-dir-index.patch +# fix non-x86 build with recent gcc +Patch8: yap-6.2.0-gprof-macro.patch +# Fix compilation of PLStream package on PPC +Patch9: yap-6.2.0-Remove-feature-macro.patch +# Reported to upstream +Patch10: yap-6.2.2-Off-by-one-error-when-initializing-yap_flags.patch +# yap 6.2.2 does not work on PPC (bug #790625) +# Reported to upstream +Patch11: yap-6.2.2-Texinfo-5-does-not-allow-bullet-as-table-indicator.patch +ExcludeArch: ppc ppc64 +BuildRequires: autoconf +# Update config.sub to support aarch64, bug #926852 +BuildRequires: automake +BuildRequires: gmp-devel +BuildRequires: mysql-devel +# TODO: BuildRequires: openmpi-devel +BuildRequires: readline-devel +BuildRequires: texinfo +BuildRequires: unixODBC-devel +BuildRequires: zlib-devel +Requires(post): /sbin/install-info, /sbin/ldconfig +Requires(postun): /sbin/install-info, /sbin/ldconfig + +# Do not export provides and requires on private libraries +%filter_provides_in /usr/lib64/Yap/ +%filter_from_requires /^libplstream.so(/d +%filter_setup + +%description +A high-performance Prolog compiler developed at LIACC, Universidade do +Porto. The Prolog engine is based in the WAM (Warren Abstract +Machine), with several optimizations for better performance. YAP +follows the Edinburgh tradition, and is largely compatible with the +ISO-Prolog standard and with Quintus and SICStus Prolog. + + +%package devel +Summary: C-Interface development files for Yap +Group: Development/Languages +Requires: %{name} = %{version}-%{release} + +%description devel +C-Interface development files for Yap. + + +%package docs +Summary: Documentation for Yap +Group: Development/Languages +BuildArch: noarch +Requires: %{name} = %{version}-%{release} + +%description docs +Documentation for Yap. + + +%prep +%setup -q +%patch1 -p1 +%patch2 -p1 -b .mysql_config +%patch3 -p1 -b .install_info_directory +%patch4 -p1 -b .install_css_into_pltarget +%patch5 -p1 -b .do_not_install_readme +%patch6 -p1 -b .non_executable_info +%patch7 -p1 -b .do_not_install_info_index +%patch8 -p1 -b .macro +%patch9 -p1 -b .remove_feature_macro +%patch10 -p1 -b .initialization +%patch11 -p1 -b .texinfo5 + +# remove redundant RPATH +sed -i 's/-Wl,-R\(,\)\{0,1\}\\$(LIBDIR)//' configure.in +# transform RPATH into RUN_PATH. Private libraries dlopen()ed depend each on +# other +sed -i 's/-Wl,-R/-Wl,--enable-new-dtags,-R/g' configure.in +# Add soname to library +sed -i -e 's/\(-soname=\$DYNYAPLIB\)/\1.%{version}/' configure.in + +# Update config.sub to support aarch64, bug #926852 +cp -p %{_datadir}/automake-*/config.{sub,guess} . +cp -p %{_datadir}/automake-*/config.{sub,guess} packages/jpl +# Regerenate configure because of patching +autoconf + +# chr and clpqr are optional and they are a copy from SWI Prolog (LGPLv2+) +# TODO: Unbundle chr and clpqr libraries as subpackages + +# Add soname to library and symlink from unversioned to versioned one +sed -i \ + -e '/@YAPLIB_LD@/ s/\(-o @YAPLIB@\)\(.*\)/\1.%{version}\2\n\tln -s @YAPLIB@.%{version} @YAPLIB@/' \ + -e '/@INSTALL_DLLS@.* @YAPLIB@/ s/\(@YAPLIB@\)\(.*\)/\1.%{version}\2\n\t@LN_S@ @YAPLIB@.%{version} $(DESTDIR)$(LIBDIR)\/@YAPLIB@/' \ + Makefile.in + +# Fix file encoding +for F in README changes.css; do + tr -d '\r' < "$F" > "${F}.new" + touch -r "$F"{,.new} + mv "$F"{.new,} +done +for F in docs/yap.tex TO_DO; do + iconv -f iso-8859-1 -t utf-8 < "$F" > "${F}.new" + sed -i -e '/mode: texinfo/ s/\(coding: \)latin-1/\1utf-8/' "${F}.new" + touch -r "$F"{,.new} + mv "$F"{.new,} +done + +# Fix file permissions +chmod -x COPYING packages/http/examples/demo_inetd +# Permissions for debuginfo content +find -name '*.h' -exec chmod 0644 '{}' ';' +find -name '*.c' -exec chmod 0644 '{}' ';' + + +%build +# % define optflags $(echo $RPM_OPT_FLAGS | sed 's|-fstack-protector||') +%configure \ + --enable-coroutining \ + --enable-max-performance \ + --enable-depth-limit \ + --enable-dynamic-loading \ + --enable-myddas \ +%if %{use_eam} + --enable-eam \ +%endif + --enable-chr \ + --enable-clpqr +# TODO: --with-java + +make %{?_smp_mflags} +make %{?_smp_mflags} info + + +%install +make DESTDIR=$RPM_BUILD_ROOT install +make DESTDIR=$RPM_BUILD_ROOT install_info + +# fix permissions and flags +chmod 0644 $RPM_BUILD_ROOT%{_datadir}/Yap/pl/* +chmod 0644 $RPM_BUILD_ROOT%{_includedir}/Yap/* + +# Move installed examples to docs dir +%global documentation docs-documentation +for P in clpbn; do + mkdir -p "%{documentation}/examples/${P}" + mv "$RPM_BUILD_ROOT%{_datadir}/Yap/${P}/examples/"* \ + "%{documentation}/examples/${P}" + rmdir "$RPM_BUILD_ROOT%{_datadir}/Yap/${P}/examples" +done +for P in minisat problog; do + mkdir -p "%{documentation}/examples/${P}" + mv "$RPM_BUILD_ROOT%{_datadir}/Yap/${P}_examples/"* \ + "%{documentation}/examples/${P}" + rmdir "$RPM_BUILD_ROOT%{_datadir}/Yap/${P}_examples" +done +# Copy not-installed examples to docs dir +# CLPBN/*, swi-minisat2 installed already +# TODO: jpl documentation with java support +# TODO: mpi documentation with mpi support +for P in pyswip cplint http plunit; do + mkdir -p "%{documentation}/examples/${P}" + cp -a "packages/${P}/examples/"* "%{documentation}/examples/${P}" +done +for P in LGPL/pillow; do + mkdir -p "%{documentation}/examples/${P}" + cp -a "${P}/examples/"* "%{documentation}/examples/${P}" +done + +# Remove empty files +for F in $RPM_BUILD_ROOT%{_datadir}/Yap/myddas_top_level.yap \ + %{documentation}/examples/cplint/coin.uni; do + test -s "$F" || rm "$F" +done + + +%post +/sbin/install-info %{_infodir}/yap.info --section "Programming Languages" %{_infodir}/dir 2>/dev/null || : +/sbin/install-info %{_infodir}/pillow_doc.info --section "Programming Languages" %{_infodir}/dir 2>/dev/null || : +/sbin/ldconfig + + +%postun +if [ $1 -eq 0 ]; then + /sbin/install-info --delete %{_infodir}/yap.info %{_infodir}/dir 2>/dev/null || : + /sbin/install-info --delete %{_infodir}/pillow_doc.info %{_infodir}/dir 2>/dev/null || : +fi +/sbin/ldconfig + + +%files +%doc Artistic changes* COPYING GIT README TO_DO +%if %{use_eam} +%doc README.EAM.html +%endif +%{_bindir}/yap +%{_datadir}/Yap +%{_libdir}/Yap +%{_libdir}/libYap.so.* +%{_infodir}/* + + +%files devel +%{_libdir}/libYap.so +%{_includedir}/Yap + + +%files docs +%doc LGPL/pillow/doc/pillow_doc_html/* +%doc LGPL/pillow/doc/article.ps.gz +%doc %{documentation}/* + + +%changelog +* Sun Aug 04 2013 Fedora Release Engineering - 6.2.2-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Thu Mar 28 2013 Petr Pisar - 6.2.2-7 +- Update config.sub to support aarch64 (bug #926852) +- Adjust to Texinfo 5 + +* Fri Feb 15 2013 Fedora Release Engineering - 6.2.2-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Mon Jan 07 2013 Petr Pisar - 6.2.2-5 +- Fix off-by-one error when initializing yap_flags + +* Sun Jul 22 2012 Fedora Release Engineering - 6.2.2-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Thu Feb 23 2012 Petr Pisar - 6.2.2-3 +- yap 6.2.2 does not work on PPC (bug #790625) + +* Sat Jan 14 2012 Fedora Release Engineering - 6.2.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Fri Dec 09 2011 Petr Pisar - 6.2.2-1 +- 6.2.2 bump + +* Wed Dec 07 2011 Petr Pisar - 6.2.0-6 +- Fix building on PowerPC (bug #751144) + +* Wed Oct 26 2011 Marcela Mašláňová - 6.2.0-5.2 +- rebuild with new gmp without compat lib + +* Wed Oct 12 2011 Peter Schiffer - 6.2.0-5.1 +- rebuild with new gmp + +* Thu Jun 23 2011 Dan Horák - 6.2.0-5 +- fix non-x86 builds with recent gcc + +* Wed Mar 23 2011 Dan Horák - 6.2.0-4 +- rebuilt for mysql 5.5.10 (soname bump in libmysqlclient) + +* Wed Mar 23 2011 Petr Pisar - 6.2.0-3 +- Rebuild against mysql 5.5.10 + +* Tue Feb 08 2011 Fedora Release Engineering - 6.2.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Tue Jan 04 2011 Petr Pisar - 6.2.0-1 +- Reorder metadata in spec file +- 6.2.0 bump +- Remove uneeded Yap-creat.patch +- Remove uneeded Yap-5.1.1-config.sub.patch +- Locate mysql by mysql_config +- Fix info pages installation +- Logtalk is no logner distributed with yap +- Install http module CSS files to correct place +- Convert TO_DO into UTF-8 +- Make COPYING non-executable +- Remove empty myddas_top_level.yap file +- Fix soname injection +- Fix BuildRequires +- Package clpbn examples +- Fix Source URL +- Clean exported Requires +- Correct RPATH +- Enable chr and clpqr libraries installation (still bundled with source tar + ball) +- Package uninstalled examples + +* Wed Dec 08 2010 Petr Pisar - 5.1.3-3 +- Hack SWI-compatible libraries build system to be compilable (bug #660965) +- Correct spec file syntax (white spaces, percentages) +- Convert documentation into UTF-8/CR +- Do not put unversioned library into main package +- Make docs subpackege architecture independent + +* Mon Jul 27 2009 Fedora Release Engineering - 5.1.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Mon Jun 15 2009 Gerard Milmeister - 5.1.3-1 +- new release 5.1.3 + +* Sun Mar 01 2009 Ralf Corsépius - 5.1.1-13 +- Add Yap-5.1.1-config.sub.patch: + Upgrade outdated config.sub to fix rebuild breakdown on ppc64. + +* Fri Jul 11 2008 Tom "spot" Callaway - 5.1.1-11 +- fix license tag + +* Thu Apr 10 2008 Gerard Milmeister - 5.1.1-10 +- enable rpm_opt_flags +- patch for incorrect open call with O_CREAT + +* Mon Feb 18 2008 Fedora Release Engineering - 5.1.1-9 +- Autorebuild for GCC 4.3 + +* Sat Oct 20 2007 Gerard Milmeister - 5.1.1-8 +- fix library path for 64-bit platforms + +* Wed Aug 29 2007 Gerard Milmeister - 5.1.1-7 +- replaced ld -shared with gcc -shared + +* Wed Aug 29 2007 Fedora Release Engineering - 5.1.1-6 +- Rebuild for selinux ppc32 issue. + +* Thu Jul 5 2007 Gerard Milmeister - 5.1.1-5 +- also build libYap.so + +* Fri May 11 2007 Gerard Milmeister - 5.1.1-3 +- remove -fstack-protector from optflags in order to enable + loading of .so modules + +* Mon Aug 28 2006 Gerard Milmeister - 5.1.1-2 +- Rebuild for FE6 + +* Mon May 1 2006 Gerard Milmeister - 5.1.1-1 +- new version 5.1.1 +- split off devel and docs packages + +* Fri Feb 17 2006 Gerard Milmeister - 5.0.1-2 +- Rebuild for Fedora Extras 5 + +* Tue Oct 25 2005 Gerard Milmeister - 5.0.1-1 +- New Version 5.0.1 + +* Wed Sep 7 2005 Gerard Milmeister - 5.0.0-1 +- New Version 5.0.0 + +* Sat Jun 18 2005 Gerard Milmeister - 4.5.5-5 +- Use %%{_prefix}/lib for x86_64 + +* Sat Jun 18 2005 Gerard Milmeister - 4.5.5-4 +- Fix for non-i386 compilers + +* Sat Jun 18 2005 Gerard Milmeister - 4.5.5-3 +- Compiler fix for FC4 + +* Fri Apr 6 2005 Michael Schwendt +- rebuilt + +* Sat Feb 12 2005 Gerard Milmeister - 0:4.5.5-1 +- New Version 4.5.5 + +* Mon Nov 29 2004 Gerard Milmeister - 0:4.5.3-0.fdr.1 +- New Version 4.5.3 + +* Sat Mar 13 2004 Gerard Milmeister - 0:4.5.2-0.fdr.1 +- New Version 4.5.2 + +* Sat Nov 22 2003 Gerard Milmeister - 0:4.4.3-0.fdr.1 +- First Fedora release