[undertaker] New upstream version.

Jerry James jjames at fedoraproject.org
Fri Oct 24 17:02:48 UTC 2014


commit 96cf69b8bd7075999eab6ba3aaac3eee15f0bb36
Author: Jerry James <jamesjer at betterlinux.com>
Date:   Fri Oct 24 11:02:36 2014 -0600

    New upstream version.
    
    Also:
    - Drop upstreamed -boost_mt patch
    - Build with -D_FILE_OFFSET_BITS=64
    - Fix license handling

 .gitignore                |    2 +-
 sources                   |    2 +-
 undertaker-boost_mt.patch |   24 -----
 undertaker-picosat.patch  |  216 +++++++++++++++++++++++++++++----------------
 undertaker.spec           |  119 +++++++++++++++----------
 5 files changed, 211 insertions(+), 152 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 067d0f5..feea2ae 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1 @@
-/undertaker-1.2.tar.gz
+/undertaker-1.6.tar.xz
diff --git a/sources b/sources
index 4c612f0..e4597a0 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-455613fb59573a12d5b30abcd87d474b  undertaker-1.2.tar.gz
+9d1c7022ad6624f2398f1e68b1e78612  undertaker-1.6.tar.xz
diff --git a/undertaker-picosat.patch b/undertaker-picosat.patch
index 58b3a0a..2fa31cd 100644
--- a/undertaker-picosat.patch
+++ b/undertaker-picosat.patch
@@ -1,91 +1,151 @@
---- ./undertaker/SatChecker.h.orig	2011-08-24 09:05:15.000000000 -0600
-+++ ./undertaker/SatChecker.h	2013-07-31 16:34:25.000000000 -0600
-@@ -48,7 +48,7 @@ namespace Picosat {
+--- ./Makefile.orig	2014-10-12 10:18:47.000000000 -0600
++++ ./Makefile	2014-10-23 20:00:00.000000000 -0600
+@@ -1,5 +1,5 @@
+ PROGS = scripts/kconfig/dumpconf scripts/kconfig/conf undertaker/undertaker undertaker/predator undertaker/rsf2cnf \
+-	undertaker/satyr python/rsf2model tailor/undertaker-traceutil ziz/zizler picosat/picomus
++	undertaker/satyr python/rsf2model tailor/undertaker-traceutil ziz/zizler
+ MANPAGES = doc/undertaker.1.gz doc/undertaker-linux-tree.1.gz doc/undertaker-kconfigdump.1.gz \
+ 	doc/undertaker-kconfigpp.1.gz
  
-     /* Include the Limmat library header as C */
+@@ -18,7 +18,7 @@ SETUP_PY_EXTRA_ARG = --root=$(DESTDIR)
+ SETUP_PY_INSTALL_EXTRA_ARG = $(SETUP_PY_EXTRA_ARG)
+ endif
+ 
+-all: picosat/libpicosat.a $(PROGS)
++all: $(PROGS)
+ 
+ version.h: generate-version.sh
+ 	./$<
+@@ -74,7 +74,7 @@ check:
+ 	$(MAKE) -C tailor $@
+ 	$(MAKE) -s -C fm $@
+ 
+-models: picosat/libpicosat.a
++models:
+ 	$(MAKE) -C undertaker/kconfig-dumps/
+ 
+ install: all $(MANPAGES)
+@@ -115,8 +115,6 @@ install: all $(MANPAGES)
+ 	@install -v undertaker/rsf2cnf $(DESTDIR)$(BINDIR)
+ 	@install -v undertaker/satyr $(DESTDIR)$(BINDIR)
+ 
+-	@install -v picosat/picomus $(DESTDIR)$(BINDIR)
+-
+ 	@install -v ziz/zizler $(DESTDIR)$(BINDIR)
+ 
+ 	@install -v scripts/Makefile.list $(DESTDIR)$(LIBDIR)
+--- ./undertaker/Makefile.orig	2014-10-12 10:18:47.000000000 -0600
++++ ./undertaker/Makefile	2014-10-23 20:00:00.000000000 -0600
+@@ -5,15 +5,15 @@ SUFFIXES += .d
+ NODEPS:=clean clean-check clean-parsers
+ 
+ CFLAGS = -Wall -Wextra -O2
+-CPPFLAGS = -I $(CURDIR)/../scripts/kconfig -I $(CURDIR)/../picosat
++CPPFLAGS = -I $(CURDIR)/../scripts/kconfig
+ CXXFLAGS = $(CFLAGS) -std=gnu++11
+ 
+ # use g++ for linking, will automaticly use "-lstdc++ -lm" libraries
+ CC = g++
+ 
+-LDFLAGS =
++LDFLAGS = -Wl,--as-needed
+ BOOST_LIBS = -lboost_system -lboost_regex -lboost_filesystem -lboost_thread
+-LDLIBS = $(BOOST_LIBS) -lpthread -lPuma
++LDLIBS = $(BOOST_LIBS) -lpthread -lPuma -lpicosat
+ 
+ # LDCOV = -coverage
+ ifdef LDCOV
+@@ -48,10 +48,10 @@ DEPFILES:=$(patsubst %.o,%.d,$(PARSEROBJ
+ 
+ all: $(PROGS) $(TESTPROGS)
+ 
+-undertaker: libparser.a ../picosat/libpicosat.a
+-rsf2cnf: libparser.a ../picosat/libpicosat.a
++undertaker: libparser.a
++rsf2cnf: libparser.a
+ predator: predator.o PredatorVisitor.o
+-satyr: libsatyr.a zconf.tab.o ../picosat/libpicosat.a
++satyr: libsatyr.a zconf.tab.o
+ 
+ ../picosat/libpicosat.a:
+ 	$(MAKE) -C .. picosat/libpicosat.a
+@@ -104,7 +104,7 @@ clean-parsers:
+ 	rm -rf location.hh stack.hh position.hh BoolExpParser.hh
+ 	rm -rf BoolExpParser.cpp BoolExpLexer.cpp
+ 
+-test-%: test-%.cpp libparser.a ../picosat/libpicosat.a
++test-%: test-%.cpp libparser.a
+ 	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -g -O0 -o $@ $^ -lcheck -lrt $(LDFLAGS) $(LDLIBS)
+ 
+ 
+--- ./undertaker/PicosatCNF.cpp.orig	2014-10-12 10:18:47.000000000 -0600
++++ ./undertaker/PicosatCNF.cpp	2014-10-21 20:00:00.000000000 -0600
+@@ -30,7 +30,7 @@
+ namespace Picosat {
+ // include picosat header as C
      extern "C" {
--#include <picosat/picosat.h>
-+#include <picosat.h>
+-        #include "picosat.h"
++        #include <picosat.h>
      }
- };
- 
-@@ -202,6 +202,8 @@ private:
-     const std::string _sat;
-     clock_t _runtime;
- 
-+    Picosat::PicoSAT *picosat_inst;
-+
-     int stringToSymbol(const std::string &key);
-     int newSymbol(void);
-     void addClause(int *clause);
---- ./undertaker/SatChecker.cpp.orig	2011-08-24 09:05:15.000000000 -0600
-+++ ./undertaker/SatChecker.cpp	2013-07-31 16:32:06.000000000 -0600
-@@ -70,13 +70,13 @@ int SatChecker::stringToSymbol(const std
  }
  
- int SatChecker::newSymbol(void) {
--    return Picosat::picosat_inc_max_var();
-+    return Picosat::picosat_inc_max_var(picosat_inst);
- }
+@@ -39,6 +39,7 @@ using namespace kconfig;
  
- void SatChecker::addClause(int *clause) {
-     for (int *x = clause; *x; x++)
--        Picosat::picosat_add(*x);
--    Picosat::picosat_add(0);
-+        Picosat::picosat_add(picosat_inst, *x);
-+    Picosat::picosat_add(picosat_inst, 0);
- }
+ static bool picosatIsInitalized = false;
+ static PicosatCNF *currentContext = nullptr;
++static Picosat::PicoSAT *picosat_inst;
+ 
+ PicosatCNF::PicosatCNF(Picosat::SATMode defaultPhase) : defaultPhase(defaultPhase) {}
+ 
+@@ -309,26 +310,26 @@ bool PicosatCNF::checkSatisfiable() {
+     if (this != currentContext){
+         // if not, reset the context....
+         if (picosatIsInitalized)
+-            Picosat::picosat_reset();
+-        Picosat::picosat_init();
++            Picosat::picosat_reset(picosat_inst);
++        picosat_inst = Picosat::picosat_init();
+         picosatIsInitalized = true;
+         // and load the current context
+         currentContext = this;
+-        Picosat::picosat_set_global_default_phase(defaultPhase);
++        Picosat::picosat_set_global_default_phase(picosat_inst, defaultPhase);
+     }
+     if (pushed_clauses_index < clauses.size()) {
+         // tell picosat how many different variables it will receive
+-        Picosat::picosat_adjust(varcount);
++        Picosat::picosat_adjust(picosat_inst, varcount);
  
- int SatChecker::notClause(int inner_clause) {
-@@ -299,7 +299,8 @@ void SatChecker::fillSatChecker(std::str
-         std::cout << std::string(expression.begin(), expression.begin()
-                                  + info.length) << endl;
-         */
--        Picosat::picosat_reset();
-+        Picosat::picosat_reset(picosat_inst);
-+	picosat_inst = NULL;
-         throw SatCheckerError("SatChecker: Couldn't parse: " + expression);
+         for (unsigned int i = pushed_clauses_index, e = clauses.size(); i < e; ++i)
+-            Picosat::picosat_add(clauses[i]);
++            Picosat::picosat_add(picosat_inst, clauses[i]);
+         pushed_clauses_index = clauses.size();
      }
+     for (const int &assumption : assumptions)
+-        Picosat::picosat_assume(assumption);
++        Picosat::picosat_assume(picosat_inst, assumption);
+ 
+     assumptions.clear();
+-    return Picosat::picosat_sat(-1) == PICOSAT_SATISFIABLE;
++    return Picosat::picosat_sat(picosat_inst, -1) == PICOSAT_SATISFIABLE;
  }
-@@ -308,7 +309,7 @@ void SatChecker::fillSatChecker(tree_par
-     iter_t expression = info.trees.begin()->children.begin();
-     int top_clause = transform_bool_rec(expression);
-     /* This adds the last clause */
--    Picosat::picosat_assume(top_clause);
-+    Picosat::picosat_assume(picosat_inst, top_clause);
+ 
+ void PicosatCNF::pushAssumptions(std::map<std::string, bool> &a) {
+@@ -340,7 +341,7 @@ void PicosatCNF::pushAssumptions(std::ma
  }
  
- SatChecker::SatChecker(const char *sat, int debug)
-@@ -325,26 +326,26 @@ bool SatChecker::operator()() throw (Sat
-     debug_parser_indent = 0;
+ bool PicosatCNF::deref(int s) const {
+-    return Picosat::picosat_deref(s) == 1;
++    return Picosat::picosat_deref(picosat_inst, s) == 1;
+ }
  
-     try {
--        Picosat::picosat_init();
-+        picosat_inst = Picosat::picosat_init();
-         // try to enable as many features as possible
--        Picosat::picosat_set_global_default_phase(1);
-+        Picosat::picosat_set_global_default_phase(picosat_inst, 1);
- 
-         fillSatChecker(_sat);
- 
--        int res = Picosat::picosat_sat(-1);
-+        int res = Picosat::picosat_sat(picosat_inst, -1);
- 
-         if (res == PICOSAT_SATISFIABLE) {
-             /* Let's get the assigment out of picosat, because we have to
-                reset the sat solver afterwards */
-             std::map<std::string, int>::const_iterator it;
-             for (it = symbolTable.begin(); it != symbolTable.end(); ++it) {
--                bool selected = Picosat::picosat_deref(it->second) == 1;
-+                bool selected = Picosat::picosat_deref(picosat_inst, it->second) == 1;
-                 assignmentTable.insert(std::make_pair(it->first, selected));
-             }
-         }
- 
--        Picosat::picosat_reset();
--
-+        Picosat::picosat_reset(picosat_inst);
-+        picosat_inst = NULL;
+ bool PicosatCNF::deref(const std::string &s) const {
+@@ -359,7 +360,7 @@ const std::string *PicosatCNF::getAssoci
+ }
+ 
+ const int *PicosatCNF::failedAssumptions() const {
+-    return Picosat::picosat_failed_assumptions();
++    return Picosat::picosat_failed_assumptions(picosat_inst);
+ }
  
-     if (res == PICOSAT_UNSATISFIABLE)
-         return false;
+ void PicosatCNF::addMetaValue(const std::string &key, const std::string &value) {
diff --git a/undertaker.spec b/undertaker.spec
index ace0e9c..7c41718 100644
--- a/undertaker.spec
+++ b/undertaker.spec
@@ -1,27 +1,29 @@
 Name:           undertaker
-Version:        1.2
-Release:        14%{?dist}
+Version:        1.6
+Release:        1%{?dist}
 Summary:        Find always-on and always-off conditional C code
 
 Group:          Development/Languages
 License:        GPLv2 and GPLv3+
 URL:            http://vamos.informatik.uni-erlangen.de/trac/undertaker
-Source0:        http://vamos.informatik.uni-erlangen.de/files/%{name}-%{version}.tar.gz
-# As of F20, Boost doesn't ship -mt DSO's anymore.
-Patch0:         %{name}-boost_mt.patch
+Source0:        http://vamos.informatik.uni-erlangen.de/files/%{name}-%{version}.tar.xz
 # Adapt to new picosat API
-Patch1:         %{name}-picosat.patch
+Patch0:         %{name}-picosat.patch
 
 BuildRequires:  boost-devel
 BuildRequires:  emacs
+BuildRequires:  flex
+BuildRequires:  libpuma-devel
 BuildRequires:  ncurses-devel
 BuildRequires:  picosat-devel
+BuildRequires:  pstreams-devel
 BuildRequires:  python2-devel
 BuildRequires:  xemacs
 BuildRequires:  xemacs-packages-extra
 
 # Needed for undertaker-calc-coverage
 Requires:       cpp
+Requires:       findutils
 Requires:       git
 Requires:       make
 Requires:       sparse
@@ -71,27 +73,27 @@ BuildArch:      noarch
 Source Elisp code for XEmacs support for %{name}.
 
 %prep
-%setup -q -n vamos-%{version}
+%setup -q
 %patch0
-%patch1
 
-# Fix a python path
-sed -i "s|^PYTHONPATH=.*|PYTHONPATH=\""%{python2_sitelib}"\"|" \
-    rsf2model/undertaker-kconfigdump.in
+# Fix python dependencies
+for fil in $(grep -FRls 'bin/env' .); do
+  sed -i.orig 's|env python|python|' $fil
+  touch -r ${fil}.orig $fil
+  rm -f ${fil}.orig
+done
 
-# Fix a python dependency
-sed 's|env python|python|' undertaker/undertaker-calc-coverage > foo
-chmod a+x foo
-touch -r undertaker/undertaker-calc-coverage foo
-mv -f foo undertaker/undertaker-calc-coverage
+# Fix the installation path for the makefiles
+sed -i "s|'\.\./lib'|'../%{libdir}/%{name}', &|" python/vamos/golem/kbuild.py
+sed -ri "s,Makefile\.(list|version).*\(LIBDIR\),&/undertaker," Makefile
 
 # Use the right flags when building and linking
-sed -e "s|-Wall -Wextra -O2|$RPM_OPT_FLAGS|" \
+sed -e "s|-Wall -Wextra -O2|$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64|" \
     -e "s|^LDFLAGS =.*|LDFLAGS = $RPM_OPT_FLAGS|" \
     -i undertaker/Makefile
 sed -e "s|^LDXX=.*|LDXX=g++ \$(CXXFLAGS)|" \
     -e "s|^DEBUG =.*|DEBUG=|" \
-    -e "s|-Wall -Wextra -O2|$RPM_OPT_FLAGS|" \
+    -e "s|-Wall -Wextra -O2|$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64|" \
     -i ziz/Makefile
 
 # Fix the Makefile so we don't rebuild everything when installing
@@ -100,53 +102,69 @@ sed -e "s|^all:.*|all: \$(PROGS) \$(TEMPLATED) \$(MANPAGES)|" \
     -e "s|check undertaker-lcov|check install undertaker-lcov|" \
     -i Makefile
 
-# Remove prebuilt objects
-make clean
-rm -f scripts/basic/docproc scripts/basic/fixdep scripts/basic/hash \
-   scripts/kconfig/dumpconf undertaker/test-ConditionalBlock \
-   undertaker/test-SatChecker undertaker/undertaker ziz/zizler
-
-# Fix end-of-line encodings
-for f in DeadAnalysis ElDocumentation Interactive ModelFiles Preconditions; do
-  sed -i.orig 's/\r//' doc/Undertaker$f
-  touch -r doc/Undertaker$f.orig doc/Undertaker$f
-  rm -f doc/Undertaker$f.orig
-done
+# Make sure we don't use the bundled version of picosat
+rm -fr picosat
 
 %build
-# FIXME: building with %%{?_smp_mflags} sometimes fails
-make PREFIX=%{_prefix} LIBDIR=%{_libdir} \
-  HOSTCFLAGS="${RPM_OPT_FLAGS}" HOSTCXXFLAGS="${RPM_OPT_FLAGS}" \
+make %{?_smp_mflags} PREFIX=%{_prefix} LIBDIR=%{_libdir} \
+  ETCDIR=%{_sysconfdir} HOSTCFLAGS="${RPM_OPT_FLAGS} -D_FILE_OFFSET_BITS=64" \
+  HOSTCXXFLAGS="${RPM_OPT_FLAGS} -D_FILE_OFFSET_BITS=64" \
   HOSTLDFLAGS="${RPM_LD_FLAGS} -Wl,--as-needed"
 
 %install
-make install DESTDIR=$RPM_BUILD_ROOT PREFIX=%{_prefix} LIBDIR=%{_libdir}
-
-# The rsf2model script is installed in two places.  We only need one.
-rm -f $RPM_BUILD_ROOT%{_bindir}/rsf2model
+make install DESTDIR=%{buildroot} PREFIX=%{_prefix} LIBDIR=%{_libdir} \
+  ETCDIR=%{_sysconfdir}
+
+# Fix permissions
+chmod 0644 %{buildroot}%{_libdir}/undertaker/Makefile*
+chmod 0755 %{buildroot}%{python_sitelib}/vamos/Model_test.py
+chmod 0755 %{buildroot}%{python_sitelib}/vamos/busyfix/basic_test.py
+chmod 0755 %{buildroot}%{python_sitelib}/vamos/rsf2model/BoolRewriter_test.py
+chmod 0755 %{buildroot}%{python_sitelib}/vamos/rsf2model/RsfReader_test.py
+chmod 0755 %{buildroot}%{python_sitelib}/vamos/vampyr/Coverage_test.py
+chmod 0755 %{buildroot}%{python_sitelib}/vamos/vampyr/Message_test.py
+chmod 0755 %{buildroot}%{python_sitelib}/vamos/vampyr/utils.py
+
+# Help the debuginfo generator
+mkdir -p ../libpuma-1.2/aspectc++/Puma/gen-release
+pushd ../libpuma-1.2/aspectc++/Puma/gen-release
+mkdir -p step1/aspects
+ln -s %{_includedir}/Puma step1/aspects/Puma
+mkdir -p step1/inc
+ln -s %{_includedir}/Puma step1/inc/Puma
+mkdir -p step2/aspects
+ln -s %{_includedir}/Puma step2/aspects/Puma
+popd
+ln -s BoolExpLP/BoolExpLexer.l undertaker/BoolExpLexer.l
+ln -s BoolExpLP/BoolExpLexer.cpp_shipped undertaker/BoolExpLexer.cpp_shipped
+ln -s BoolExpLP/BoolExpParser.y undertaker/BoolExpParser.y
+ln -s BoolExpLP/BoolExpParser.cpp_shipped undertaker/BoolExpParser.cpp_shipped
 
 # Copy the Emacs support to the appropriate XEmacs dir and byte compile
-mkdir -p $RPM_BUILD_ROOT%{_xemacs_sitelispdir}
-cp -a $RPM_BUILD_ROOT%{_emacs_sitelispdir}/%{name} \
-   $RPM_BUILD_ROOT%{_xemacs_sitelispdir}
-cd $RPM_BUILD_ROOT%{_xemacs_sitelispdir}/%{name}
+mkdir -p %{buildroot}%{_xemacs_sitelispdir}
+cp -a %{buildroot}%{_emacs_sitelispdir}/%{name} \
+   %{buildroot}%{_xemacs_sitelispdir}
+cd %{buildroot}%{_xemacs_sitelispdir}/%{name}
 %{_xemacs_bytecompile} *.el
 
 # Byte compile the Emacs support file
-cd $RPM_BUILD_ROOT%{_emacs_sitelispdir}/%{name}
+cd %{buildroot}%{_emacs_sitelispdir}/%{name}
 %{_emacs_bytecompile} *.el
 
 %files
-%doc AUTHORS LICENSE README
-%doc doc/UndertakerDeadAnalysis doc/UndertakerInteractive
-%doc doc/UndertakerModelFiles doc/UndertakerPreconditions
+%doc AUTHORS README
+%license LICENSE
 %{_bindir}/*
+%{_sbindir}/%{name}-traceutil
 %{_libdir}/undertaker
 %{_mandir}/man1/*
-%{python_sitelib}/undertaker*
+%dir %{_sysconfdir}/%{name}/
+%config(noreplace) %{_sysconfdir}/%{name}/blacklist*
+%config(noreplace) %{_sysconfdir}/%{name}/whitelist*
+%config(noreplace) %{_sysconfdir}/%{name}/undertaker.ignore
+%{python_sitelib}/vamos*
 
 %files emacs
-%doc doc/UndertakerElDocumentation
 %dir %{_emacs_sitelispdir}/%{name}
 %{_emacs_sitelispdir}/%{name}/*.elc
 
@@ -154,7 +172,6 @@ cd $RPM_BUILD_ROOT%{_emacs_sitelispdir}/%{name}
 %{_emacs_sitelispdir}/%{name}/*.el
 
 %files xemacs
-%doc doc/UndertakerElDocumentation
 %dir %{_xemacs_sitelispdir}/%{name}
 %{_xemacs_sitelispdir}/%{name}/*.elc
 
@@ -162,6 +179,12 @@ cd $RPM_BUILD_ROOT%{_emacs_sitelispdir}/%{name}
 %{_xemacs_sitelispdir}/%{name}/*.el
 
 %changelog
+* Thu Oct 23 2014 Jerry James <loganjerry at gmail.com> - 1.6-1
+- New upstream version
+- Drop upstreamed -boost_mt patch
+- Build with -D_FILE_OFFSET_BITS=64
+- Fix license handling
+
 * Mon Aug 18 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.2-14
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
 


More information about the scm-commits mailing list