#
# Conditional build:
-%bcond_without java # JNI interface
+%bcond_without java # JNI interface [builds with java-sun 1.6, but not gcj 4.9]
+%bcond_without python # Python agent
%bcond_without systemtap # SystemTap integration
+%bcond_without static_libs # static libraries
#
Summary: LTTng Userspace Tracer
Summary(pl.UTF-8): LTTng Userspace Tracer - narzędzia LTTng do śledzenia przestrzeni użytkownika
Name: lttng-ust
-Version: 2.5.0
+Version: 2.10.3
Release: 1
License: LGPL v2.1 (library), MIT (headers), GPL v2 (programs)
Group: Libraries
-Source0: http://lttng.org/files/lttng-ust/%{name}-%{version}.tar.bz2
-# Source0-md5: 08c8ee02e71110842c20f8d4e132e65f
+Source0: https://lttng.org/files/lttng-ust/%{name}-%{version}.tar.bz2
+# Source0-md5: ffcfa8c1ba9a52f002d240e936e9afa2
Patch0: %{name}-link.patch
-URL: http://lttng.org/ust
-BuildRequires: autoconf >= 2.50
-BuildRequires: automake
-%{?with_java:BuildRequires: jdk}
-BuildRequires: rpmbuild(macros) >= 1.294
+Patch1: %{name}-java.patch
+Patch2: %{name}-python.patch
+URL: https://lttng.org/
+BuildRequires: autoconf >= 2.59
+BuildRequires: automake >= 1:1.9
+# for examples build
+BuildRequires: cmake >= 2.8.11
+BuildRequires: libstdc++-devel
BuildRequires: libtool >= 2:2
+%{?with_python:BuildRequires: python >= 1:2.7}
+BuildRequires: rpmbuild(macros) >= 1.294
%{?with_systemtap:BuildRequires: systemtap-sdt-devel}
BuildRequires: userspace-rcu-devel >= 0.7.2
+%if %{with java}
+BuildRequires: java-log4j
+BuildRequires: jdk
+BuildRequires: jpackage-utils
+%endif
Requires: userspace-rcu >= 0.7.2
+ExclusiveArch: %{ix86} %{x8664} x32 %{arm} aarch64 mips ppc ppc64 s390 s390x tile
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-# rcu_reader_bp is not a function, but some kind of symbol that check doesn't support
-%define skip_post_check_so liblttng-ust\.so.* liblttng-ust-cyg-profile\.so.* liblttng-ust-cyg-profile-fast\.so.* liblttng-ust-dl\.so.* liblttng-ust-tracepoint\.so.*
+# non-function rcu_reader_bp symbol
+%define skip_post_check_so_1 liblttng-ust\.so.* liblttng-ust-cyg-profile\.so.* liblttng-ust-cyg-profile-fast\.so.* liblttng-ust-dl\.so.* liblttng-ust-java\.so.* liblttng-ust-python-agent\.so.* liblttng-ust-tracepoint\.so.*
+# non-function lttng_ust_context_info_tls symbol
+%define skip_post_check_so_2 liblttng-ust-jul-jni\.so.* liblttng-ust-log4j-jni\.so.*
+
+%define skip_post_check_so %{skip_post_check_so_1} %{skip_post_check_so_2}
%description
The LTTng Userspace Tracer (UST) is a library accompanied by a set of
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: userspace-rcu-devel >= 0.7.2
+%{?with_systemtap:Requires: systemtap-sdt-devel}
%description devel
Header files for LTTNG-UST libraries.
%description -n java-lttng-ust -l pl.UTF-8
Interfejs JNI do biblioteki LTTng Userspace Tracer.
+%package -n python-lttng-ust
+Summary: Python agent for LTTng Userspace Tracer library
+Summary(pl.UTF-8): Agent Pythona do biblioteki LTTng Userspace Tracer
+Group: Libraries/Python
+Requires: %{name} = %{version}-%{release}
+
+%description -n python-lttng-ust
+Python agent for LTTng Userspace Tracer library.
+
+%description -n python-lttng-ust -l pl.UTF-8
+Agent Pythona do biblioteki LTTng Userspace Tracer.
+
%prep
%setup -q
%patch0 -p1
+%patch1 -p1
+%patch2 -p1
%build
%{__libtoolize}
%{__autoconf}
%{__autoheader}
%{__automake}
-export CLASSPATH=.
+export CLASSPATH=.:%{_javadir}/log4j.jar
%configure \
+ %{?with_java:JAVA_HOME="%{java_home}" JAVAC=javac} \
--disable-silent-rules \
- %{?with_java:--with-java-jdk=%{java_home} --with-jni-interface} \
- %{?with_systemtap:--with-sdt}
+ %{?with_java:--enable-jni-interface --enable-java-agent-all} \
+ %{?with_python:--enable-python-agent} \
+ %{?with_systemtap:--with-sdt} \
+ %{?with_static_libs:--enable-static}
-%{__make}
+%{__make} -j1
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT%{_examplesdir}
%{__mv} $RPM_BUILD_ROOT%{_docdir}/lttng-ust/examples $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
# packaged as %doc
-%{__rm} $RPM_BUILD_ROOT%{_docdir}/lttng-ust/{ChangeLog,README,java-util-logging.txt}
+%{__rm} $RPM_BUILD_ROOT%{_docdir}/lttng-ust/{ChangeLog,README.md,java-agent.txt}
%if %{with java}
-install -d $RPM_BUILD_ROOT%{_javadir}
-cp -p liblttng-ust-java/liblttng-ust-java.jar $RPM_BUILD_ROOT%{_javadir}
-%{__rm} $RPM_BUILD_ROOT%{_libdir}/liblttng-ust-{java,jul-jni}.{la,a}
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/liblttng-ust-{context-jni,java,jul-jni,log4j-jni}.la \
+ %{?with_static_libs:$RPM_BUILD_ROOT%{_libdir}/liblttng-ust-{context-jni,java,jul-jni,log4j-jni}.a}
+%endif
+%if %{with python}
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/liblttng-ust-python-agent.la \
+ %{?with_static_libs:$RPM_BUILD_ROOT%{_libdir}/liblttng-ust-python-agent.a}
+%py_postclean
%endif
%clean
%post -n java-lttng-ust -p /sbin/ldconfig
%postun -n java-lttng-ust -p /sbin/ldconfig
+%post -n python-lttng-ust -p /sbin/ldconfig
+%postun -n python-lttng-ust -p /sbin/ldconfig
+
%files
%defattr(644,root,root,755)
-%doc COPYING ChangeLog README
+%doc COPYING ChangeLog README.md
%attr(755,root,root) %{_libdir}/liblttng-ust.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/liblttng-ust.so.0
%attr(755,root,root) %{_libdir}/liblttng-ust-ctl.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/liblttng-ust-ctl.so.2
+%attr(755,root,root) %ghost %{_libdir}/liblttng-ust-ctl.so.4
%attr(755,root,root) %{_libdir}/liblttng-ust-cyg-profile.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/liblttng-ust-cyg-profile.so.0
%attr(755,root,root) %{_libdir}/liblttng-ust-cyg-profile-fast.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/liblttng-ust-cyg-profile-fast.so.0
%attr(755,root,root) %{_libdir}/liblttng-ust-dl.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/liblttng-ust-dl.so.0
+%attr(755,root,root) %{_libdir}/liblttng-ust-fd.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/liblttng-ust-fd.so.0
%attr(755,root,root) %{_libdir}/liblttng-ust-fork.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/liblttng-ust-fork.so.0
%attr(755,root,root) %{_libdir}/liblttng-ust-libc-wrapper.so.*.*.*
%attr(755,root,root) %{_libdir}/liblttng-ust-cyg-profile.so
%attr(755,root,root) %{_libdir}/liblttng-ust-cyg-profile-fast.so
%attr(755,root,root) %{_libdir}/liblttng-ust-dl.so
+%attr(755,root,root) %{_libdir}/liblttng-ust-fd.so
%attr(755,root,root) %{_libdir}/liblttng-ust-fork.so
%attr(755,root,root) %{_libdir}/liblttng-ust-libc-wrapper.so
%attr(755,root,root) %{_libdir}/liblttng-ust-pthread-wrapper.so
%{_libdir}/liblttng-ust-cyg-profile.la
%{_libdir}/liblttng-ust-cyg-profile-fast.la
%{_libdir}/liblttng-ust-dl.la
+%{_libdir}/liblttng-ust-fd.la
%{_libdir}/liblttng-ust-fork.la
%{_libdir}/liblttng-ust-libc-wrapper.la
%{_libdir}/liblttng-ust-pthread-wrapper.la
%{_includedir}/lttng
%{_pkgconfigdir}/lttng-ust.pc
%{_mandir}/man1/lttng-gen-tp.1*
+%{_mandir}/man3/do_tracepoint.3*
%{_mandir}/man3/lttng-ust.3*
%{_mandir}/man3/lttng-ust-cyg-profile.3*
%{_mandir}/man3/lttng-ust-dl.3*
+%{_mandir}/man3/tracef.3*
+%{_mandir}/man3/tracelog.3*
+%{_mandir}/man3/tracepoint.3*
+%{_mandir}/man3/tracepoint_enabled.3*
%{_examplesdir}/%{name}-%{version}
+%if %{with static_libs}
%files static
%defattr(644,root,root,755)
%{_libdir}/liblttng-ust.a
%{_libdir}/liblttng-ust-cyg-profile.a
%{_libdir}/liblttng-ust-cyg-profile-fast.a
%{_libdir}/liblttng-ust-dl.a
+%{_libdir}/liblttng-ust-fd.a
%{_libdir}/liblttng-ust-fork.a
%{_libdir}/liblttng-ust-libc-wrapper.a
%{_libdir}/liblttng-ust-pthread-wrapper.a
%{_libdir}/liblttng-ust-tracepoint.a
+%endif
%if %{with java}
%files -n java-lttng-ust
%defattr(644,root,root,755)
-%doc doc/java-util-logging.txt
+%doc doc/java-agent.txt
+%attr(755,root,root) %{_libdir}/liblttng-ust-context-jni.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/liblttng-ust-context-jni.so.0
+%attr(755,root,root) %{_libdir}/liblttng-ust-context-jni.so
%attr(755,root,root) %{_libdir}/liblttng-ust-java.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/liblttng-ust-java.so.0
%attr(755,root,root) %{_libdir}/liblttng-ust-java.so
%attr(755,root,root) %{_libdir}/liblttng-ust-jul-jni.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/liblttng-ust-jul-jni.so.0
%attr(755,root,root) %{_libdir}/liblttng-ust-jul-jni.so
+%attr(755,root,root) %{_libdir}/liblttng-ust-log4j-jni.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/liblttng-ust-log4j-jni.so.0
+%attr(755,root,root) %{_libdir}/liblttng-ust-log4j-jni.so
+%{_javadir}/liblttng-ust-agent.jar
%{_javadir}/liblttng-ust-java.jar
-%{_javadir}/liblttng-ust-jul.jar
+%{_javadir}/lttng-ust-agent-all-1.0.0.jar
+%{_javadir}/lttng-ust-agent-all.jar
+%{_javadir}/lttng-ust-agent-common-1.0.0.jar
+%{_javadir}/lttng-ust-agent-common.jar
+%{_javadir}/lttng-ust-agent-jul-1.0.0.jar
+%{_javadir}/lttng-ust-agent-jul.jar
+%{_javadir}/lttng-ust-agent-log4j-1.0.0.jar
+%{_javadir}/lttng-ust-agent-log4j.jar
+%endif
+
+%if %{with python}
+%files -n python-lttng-ust
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/liblttng-ust-python-agent.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/liblttng-ust-python-agent.so.0
+%attr(755,root,root) %{_libdir}/liblttng-ust-python-agent.so
+%{py_sitescriptdir}/lttngust
+%{py_sitescriptdir}/lttngust-%{version}-py*.egg-info
%endif