[oprofile] Add a number of improvements from the oprofile package review rhbz226222
William Eden Cohen
wcohen at fedoraproject.org
Wed Apr 4 20:34:42 UTC 2012
commit 35cb249cb5b640c9d0de00427649b2d020799165
Author: William Cohen <wcohen at redhat.com>
Date: Wed Apr 4 16:27:57 2012 -0400
Add a number of improvements from the oprofile package review rhbz226222
oprofile.spec | 56 +++++++++++++++++++++++++++++++-------------------------
1 files changed, 31 insertions(+), 25 deletions(-)
---
diff --git a/oprofile.spec b/oprofile.spec
index 8a0152c..d6d8629 100644
--- a/oprofile.spec
+++ b/oprofile.spec
@@ -1,11 +1,11 @@
Summary: System wide profiler
Name: oprofile
Version: 0.9.7
-Release: 2%{?dist}
-License: GPLv2
+Release: 3%{?dist}
+License: GPLv2+ and LGPLv2+
Group: Development/System
#
-Source0: http://sourceforge.net/projects/oprofile/files/oprofile/oprofile-%{version}/oprofile-%{version}.tar.gz
+Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
Requires: binutils
Requires: which
Requires(pre): shadow-utils
@@ -24,12 +24,11 @@ BuildRequires: elinks
BuildRequires: gtk2-devel
BuildRequires: automake
BuildRequires: libtool
-BuildRequires: binutils-devel
BuildRequires: binutils-static
BuildRequires: popt-devel
BuildRequires: java-devel
BuildRequires: jpackage-utils
-BuildRequires: java-1.6.0-openjdk-devel
+BuildRequires: java-1.7.0-openjdk-devel
BuildRoot: %{_tmppath}/%{name}-root
@@ -43,7 +42,7 @@ the RTC for profiling on other x86 processor types.
See the HTML documentation for further details.
%package devel
-Summary: Header files and libraries for developing apps which will use oprofile.
+Summary: Header files and libraries for developing apps which will use oprofile
Group: Development/Libraries
Requires: oprofile = %{version}-%{release}
Provides: oprofile-static = %{version}-%{release}
@@ -53,7 +52,7 @@ Provides: oprofile-static = %{version}-%{release}
Header files and libraries for developing apps which will use oprofile.
%package gui
-Summary: GUI for oprofile.
+Summary: GUI for oprofile
Group: Development/System
Requires: oprofile = %{version}-%{release}
@@ -67,9 +66,6 @@ Group: Development/System
Requires: oprofile = %{version}-%{release}
#Requires: java >= 1.6
#Requires: jpackage-utils
-Requires(post): /sbin/ldconfig
-Requires(postun): /sbin/ldconfig
-Requires: /etc/ld.so.conf.d
%description jit
This package includes a base JIT support library, as well as a Java
@@ -108,7 +104,7 @@ CXXFLAGS=-g; export CXXFLAGS
--enable-gui=qt4 \
--with-java=/usr/lib/jvm/java
-make CFLAGS="$RPM_OPT_FLAGS"
+make CFLAGS="%{optflags}"
#tweak the manual pages
find -path "*/doc/*.1" -exec \
@@ -116,26 +112,23 @@ find -path "*/doc/*.1" -exec \
's,/doc/oprofile/,/doc/oprofile-%{version}/,g' {} \;
%install
-rm -rf ${RPM_BUILD_ROOT}
+rm -rf %{buildroot}
-mkdir -p ${RPM_BUILD_ROOT}%{_bindir}
-mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man1
+mkdir -p %{buildroot}%{_bindir}
+mkdir -p %{buildroot}%{_mandir}/man1
-make DESTDIR=${RPM_BUILD_ROOT} install
+make DESTDIR=%{buildroot} INSTALL="install -p" install
# We want the manuals in the special doc dir, not the generic doc install dir.
# We build it in place and then move it away so it doesn't get installed
# twice. rpm can specify itself where the (versioned) docs go with the
-# %doc directive.
+# %%doc directive.
mkdir docs.installed
-mv $RPM_BUILD_ROOT%{_datadir}/doc/oprofile/* docs.installed/
+mv %{buildroot}%{_datadir}/doc/oprofile/* docs.installed/
mkdir -p %{buildroot}/etc/ld.so.conf.d
echo "%{_libdir}/oprofile" > %{buildroot}/etc/ld.so.conf.d/oprofile-%{_arch}.conf
-%clean
-rm -rf ${RPM_BUILD_ROOT}
-
%pre
getent group oprofile >/dev/null || groupadd -r -g 16 oprofile
getent passwd oprofile >/dev/null || \
@@ -144,8 +137,7 @@ useradd -g oprofile -d /var/lib/oprofile -M -r -u 16 -s /sbin/nologin \
exit 0
%postun
-test "$1" != 0 || userdel oprofile &>/dev/null || :
-test "$1" != 0 || groupdel oprofile &>/dev/null || :
+# do not try to remove existing oprofile user or group
%files
%defattr(-,root,root)
@@ -171,7 +163,7 @@ test "$1" != 0 || groupdel oprofile &>/dev/null || :
%{_mandir}/man1/oparchive.1.gz
%{_mandir}/man1/opimport.1.gz
-/usr/share/oprofile
+%{_datadir}/oprofile
%files devel
%defattr(-,root,root)
@@ -191,11 +183,25 @@ test "$1" != 0 || groupdel oprofile &>/dev/null || :
%defattr(-,root,root)
%{_libdir}/oprofile
-/etc/ld.so.conf.d/*
+%{_sysconfdir}/ld.so.conf.d/*
%changelog
+* Thu Apr 04 2012 Will Cohen <wcohen at redhat.com> - 0.9.7-3
+- Use correct macros for /etc and /user/share. rhbz #226222
+- Consistently use macros for buildroot.
+- Preserve timestamp for installed files.
+- Remove the clean section.
+- Fix the source location.
+- Remove unneeded BuildRequires: binutils-devel
+- Remove unneeded depends.
+- Correct Buildreq to java-1.7.0-openjdk-devel.
+- Fix macro-in-comment and macro-in-changelog
+- Remove '.' from Summary lines
+- Correct license GPLv2+ and LGPLv2+.
+- Do not remove oprofile user or group.
+
* Tue Jan 10 2012 Will Cohen <wcohen at redhat.com> - 0.9.7-2
-- Remove duplicate -r option in %pre useradd Resolves: rhbz #772841
+- Remove duplicate -r option in %%pre useradd Resolves: rhbz #772841
* Mon Nov 29 2011 Will Cohen <wcohen at redhat.com> - 0.9.7-1
- Rebase on oprofile-0.9.7.
More information about the scm-commits
mailing list