[libpuma] Fixes needed to build undertaker.
Jerry James
jjames at fedoraproject.org
Fri Oct 24 15:19:58 UTC 2014
commit dc50bf8bb7308c04d183f515d982bc1a29ccdcaa
Author: Jerry James <jamesjer at betterlinux.com>
Date: Fri Oct 24 09:19:36 2014 -0600
Fixes needed to build undertaker.
In particular, these changes were needed:
- The -devel subpackage needs to Require lexertl-devel.
- Package missing header files.
- Use triggers to update the config file instead of rebuilding the entire
library for every gcc update.
- Merge aspectc++ into the main package so ag++ is available for the
trigger.
That last change means that multilib is now impossible, but it was already
impossible. We would have needed a multilib ag++ binary to generate
puma.config for the multilib library.
libpuma.spec | 70 +++++++++++++++++++++++++++++++++++----------------------
1 files changed, 43 insertions(+), 27 deletions(-)
---
diff --git a/libpuma.spec b/libpuma.spec
index cdc67b8..71fd9ce 100644
--- a/libpuma.spec
+++ b/libpuma.spec
@@ -1,14 +1,23 @@
-%global gccver %(gcc --version | sed -n 's/.*(Red Hat \\(.*\\)).*/\\1/p')
-%global with_hard_gcc_version_requirement 1
+# NOTE: The configuration file puma.config depends on the exact version of gcc
+# that generated it. However, the library itself does not. To avoid the
+# necessity of recompiling libpuma for every gcc update, we instead generate
+# the configuration file on the fly as the installed gcc is updated. See the
+# trigger script below.
+#
+# Since the trigger script requires the presence of the ag++ binary, the binary
+# and the library thus depend on each other, so we collapse them into a single
+# package. This means multilib is currently impossible, but it was impossible
+# anyway, since we would have needed a multilib ag++ binary to generate the
+# multilib config.
Name: libpuma
Version: 1.2
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: Library for parsing and manipulating C/C++ source code
License: GPLv2+
URL: http://aspectc.org/
-Source0: ftp://akut.aspectc.org/releases/%{version}/ac-woven-%{version}.tar.gz
+Source0: http://aspectc.org/releases/%{version}/ac-woven-%{version}.tar.gz
# Man pages from Debian
Source1: ac++.1
Source2: ag++.1
@@ -26,15 +35,14 @@ BuildRequires: graphviz
BuildRequires: lexertl-devel
BuildRequires: libxml2-devel
-# The generated config depends on a specific version of gcc/g++
-%if 0%{?with_hard_gcc_version_requirement}
-Requires: gcc-c++ = %{gccver}%{?dist}
-%else
Requires: gcc-c++
-%endif
Requires: libstdc++-devel%{?_isa}
Requires: glibc-devel%{?_isa}
+# This can be removed once F-21 reaches EOL.
+Obsoletes: aspectc++ < 1.2-3%{?dist}
+Provides: aspectc++ = %{version}-%{release}
+
%description
PUMA is a library of C++ classes for parsing and manipulating C/C++
source code. It provides different levels of analyzing source code,
@@ -59,6 +67,7 @@ transaction.
%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
+Requires: lexertl-devel
%description devel
Header files and library links for developing applications that use
@@ -71,16 +80,6 @@ BuildArch: noarch
%description doc
User and developer documentation for %{name}.
-%package -n aspectc++
-Summary: Compiler for C/C++ with aspect-oriented extensions
-Requires: %{name}%{?_isa} = %{version}-%{release}
-
-%description -n aspectc++
-AspectC++ extends the AspectJ approach to object-oriented programming to
-the C and C++ languages. This package contains a compiler for
-extensions to the C and C++ languages that recognizees a set of aspect-
-oriented extensions.
-
%prep
%setup -q -c
%patch0
@@ -124,6 +123,9 @@ sed -i 's/unsigned int/unsigned long int/' \
# Do the initial build of the prewoven sources in a separate build dir
cp -a aspectc++ aspectc++.prewoven
+# Avoid a name collision in the docs
+cp -p aspectc++/README aspectc++/README.aspectc++
+
%build
# Phase 1: bootstrap by building the tools with the prewoven sources.
pushd aspectc++.prewoven
@@ -179,6 +181,9 @@ cp -p aspectc++/Ag++/bin/linux-release/* %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_mandir}/man1
cp -p %{SOURCE1} %{SOURCE2} %{buildroot}%{_mandir}/man1
+# Install missing headers
+cp -p aspectc++/Puma/include/Puma/*.inc %{buildroot}%{_includedir}/Puma
+
# Generate the default config
mkdir -p %{buildroot}%{_libdir}/%{name}
pushd %{buildroot}%{_libdir}/%{name}
@@ -191,7 +196,7 @@ chmod 0755 %{buildroot}%{_libdir}/libPuma.so.0.0.0 %{buildroot}%{_bindir}/*
%check
export LD_LIBRARY_PATH=%{buildroot}%{_libdir}
-export PUMA_CONFIG=%{buildroot}%{_libdir}/%{name}/puma.config
+export PUMA_CONFIG=$PWD/aspectc++.prewoven/puma.config
make -C aspectc++/Puma test
make -C aspectc++/AspectC++ test SHARED=1
make -C aspectc++/Ag++ test SHARED=1
@@ -200,11 +205,21 @@ make -C aspectc++/Ag++ test SHARED=1
%postun -p /sbin/ldconfig
+%triggerin -- gcc-c++
+pushd %{_libdir}/%{name}
+rm -f puma.config
+%{_bindir}/ag++ --gen_config
+chmod 0644 puma.config
+popd
+
%files
-%doc aspectc++/Puma/README
+%doc aspectc++/README.aspectc++ aspectc++/Puma/README
%license aspectc++/Puma/COPYING
+%{_bindir}/*
%{_libdir}/libPuma.so.*
-%{_libdir}/%{name}/
+%{_mandir}/man1/*
+%dir %{_libdir}/%{name}/
+%ghost %{_libdir}/%{name}/puma.config
%files devel
%{_includedir}/Puma/
@@ -219,12 +234,13 @@ make -C aspectc++/Ag++ test SHARED=1
%doc aspectc++/AspectC++/doc/NoE_ShortSurvey/ac++lang-survey.pdf
%doc aspectc++/AspectC++/doc/QuickRef/ac++quickref.pdf
-%files -n aspectc++
-%doc aspectc++/README
-%{_bindir}/*
-%{_mandir}/man1/*
-
%changelog
+* Tue Oct 21 2014 Jerry James <loganjerry at gmail.com> - 1.2-3
+- The -devel subpackage needs to Require lexertl-devel
+- Package missing header files
+- Use triggers to update the config file instead of rebuilding for every gcc
+- Merge aspectc++ into the main package so ag++ is available for the trigger
+
* Wed Oct 15 2014 Jerry James <loganjerry at gmail.com> - 1.2-2
- Do not fix the FSF's address in the license file (or anywhere else)
- Drop -doc subpackage dependencies
More information about the scm-commits
mailing list