Change-Id: I9e64c52de6be47646e7dd0bcee8da703050962c6
Reviewed-on: http://photon-jenkins.eng.vmware.com/220
Tested-by: jenkins-photon <wangnan2015@hotmail.com>
Reviewed-by: Sharath George
Reviewed-by: Alexey Makhalov <amakhalov@vmware.com>
| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,55 @@ |
| 0 |
+# This package depends on exact version of kernel rpm |
|
| 1 |
+# since it provides kernel modules |
|
| 2 |
+%define LINUX_VERSION 4.2.0 |
|
| 3 |
+ |
|
| 4 |
+Summary: A New Scripting Dynamic Tracing Tool For Linux |
|
| 5 |
+Name: ktap |
|
| 6 |
+Version: 0.4 |
|
| 7 |
+Release: 1.gitfca420f%{?dist}
|
|
| 8 |
+License: GPLv2 |
|
| 9 |
+URL: https://github.com/ktap/ktap |
|
| 10 |
+Source: %{name}-master.zip
|
|
| 11 |
+%define sha1 ktap=8dca9a25e8917ad8cabdf176de487949c235ec80 |
|
| 12 |
+Group: Development/Tools |
|
| 13 |
+Vendor: VMware, Inc. |
|
| 14 |
+Distribution: Photon |
|
| 15 |
+BuildRequires: elfutils-devel |
|
| 16 |
+BuildRequires: linux-dev = %{LINUX_VERSION}
|
|
| 17 |
+BuildRequires: linux = %{LINUX_VERSION}
|
|
| 18 |
+BuildRequires: unzip |
|
| 19 |
+Requires: kmod |
|
| 20 |
+Requires: linux = %{LINUX_VERSION}
|
|
| 21 |
+ |
|
| 22 |
+%description |
|
| 23 |
+ktap is a new scripting dynamic tracing tool for Linux, it uses a scripting language and lets users trace the Linux kernel dynamically. ktap is designed to give operational insights with interoperability that allows users to tune, troubleshoot and extend the kernel and applications. It's similar to Linux Systemtap and Solaris Dtrace. |
|
| 24 |
+ |
|
| 25 |
+%prep |
|
| 26 |
+%setup -q -n ktap-master |
|
| 27 |
+ |
|
| 28 |
+%build |
|
| 29 |
+make ktap |
|
| 30 |
+# ugly hack: disable security hardening to build kernel module |
|
| 31 |
+# we need to remove sec hard specs file for that. |
|
| 32 |
+rm -f `dirname $(gcc --print-libgcc-file-name)`/../specs |
|
| 33 |
+make KVERSION=%{LINUX_VERSION} mod
|
|
| 34 |
+ |
|
| 35 |
+%install |
|
| 36 |
+mkdir -p %{buildroot}%{_bindir}
|
|
| 37 |
+make install DESTDIR=%{buildroot} KVERSION=%{LINUX_VERSION}
|
|
| 38 |
+ |
|
| 39 |
+%post |
|
| 40 |
+/sbin/depmod -a |
|
| 41 |
+ |
|
| 42 |
+%postun |
|
| 43 |
+/sbin/depmod -a |
|
| 44 |
+ |
|
| 45 |
+%files |
|
| 46 |
+%defattr(-, root, root, 0755) |
|
| 47 |
+%doc README.md |
|
| 48 |
+%{_bindir}/ktap
|
|
| 49 |
+/lib/modules/%{LINUX_VERSION}/extra/ktapvm.ko
|
|
| 50 |
+ |
|
| 51 |
+%changelog |
|
| 52 |
+* Fri Dec 04 2015 Xiaolin Li <xiaolinl@vmware.com> 0.4-1 |
|
| 53 |
+- Initial build. First version |
|
| 54 |
+ |
| ... | ... |
@@ -90,7 +90,7 @@ EOF |
| 90 | 90 |
rm -rf %{buildroot}/lib/modules/%{version}/source
|
| 91 | 91 |
rm -rf %{buildroot}/lib/modules/%{version}/build
|
| 92 | 92 |
|
| 93 |
-find . -name Makefile* -o -name Kconfig* -o -name *.pl | xargs sh -c 'cp --parents "$@" %{buildroot}/usr/src/%{name}-headers-%{version}-%{release}'
|
|
| 93 |
+find . -name Makefile* -o -name Kconfig* -o -name *.pl | xargs sh -c 'cp --parents "$@" %{buildroot}/usr/src/%{name}-headers-%{version}-%{release}' copy
|
|
| 94 | 94 |
find arch/x86/include include scripts -type f | xargs sh -c 'cp --parents "$@" %{buildroot}/usr/src/%{name}-headers-%{version}-%{release}'
|
| 95 | 95 |
find $(find arch/x86 -name include -o -name scripts -type d) -type f | xargs sh -c 'cp --parents "$@" %{buildroot}/usr/src/%{name}-headers-%{version}-%{release}'
|
| 96 | 96 |
find arch/x86/include Module.symvers include scripts -type f | xargs sh -c 'cp --parents "$@" %{buildroot}/usr/src/%{name}-headers-%{version}-%{release}'
|