[multithreadedtc/f20] fix rhbz#992389 update to current packaging guidelines

mbooth mbooth at fedoraproject.org
Thu Sep 5 09:16:35 UTC 2013


commit 86231ca88b0dd2a417842f3f03e57f9db6ae3a05
Author: Mat Booth <fedora at matbooth.co.uk>
Date:   Thu Sep 5 10:16:00 2013 +0100

    fix rhbz#992389
    update to current packaging guidelines
    
    patch supplied by gil cattaneo

 multithreadedtc.spec |   54 +++++++++++++++++--------------------------------
 1 files changed, 19 insertions(+), 35 deletions(-)
---
diff --git a/multithreadedtc.spec b/multithreadedtc.spec
index d3f67bb..9c7f3b5 100644
--- a/multithreadedtc.spec
+++ b/multithreadedtc.spec
@@ -1,17 +1,14 @@
 %global project_name MultithreadedTC
 Name:           multithreadedtc
 Version:        1.01
-Release:        14%{?dist}
+Release:        15%{?dist}
 Summary:        A framework for testing concurrent Java application
-
-Group:          Development/Libraries
 License:        BSD 
 URL:            http://www.cs.umd.edu/projects/PL/multithreadedtc
 #http://multithreadedtc.googlecode.com/files/MultithreadedTC-1.01-source.zip
 Source0:        %{project_name}-%{version}-source.zip
 Source1:        %{name}.pom
-Patch0:        %{name}-build.patch
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Patch0:         %{name}-build.patch
 
 BuildArch: noarch
 
@@ -22,21 +19,16 @@ BuildRequires: ant-junit
 BuildRequires: junit
 
 Requires:      java
-Requires:       jpackage-utils
+Requires:      jpackage-utils
 Requires:      junit
 
-Requires(post):       jpackage-utils
-Requires(postun):     jpackage-utils
-
 %description
 MultithreadedTC is a framework for testing concurrent applications. 
 It features a metronome that is used to provide fine control over
 the sequence of activities in multiple threads.
 
 %package javadoc
-Group:          Documentation
 Summary:        Javadoc for %{name}
-Requires:       jpackage-utils 
 
 %description javadoc
 API documentation for %{name}.
@@ -46,7 +38,8 @@ API documentation for %{name}.
 %setup -q -n %{project_name}-%{version}-source
 %patch0 -p0 -b .sav
 
-rm -f *.jar
+find . -name "*.class" -print -delete
+find . -name "*.jar" -print -delete
 
 sed -i 's/\r//' web/docs/package-list
 sed -i 's/\r//' web/docs/stylesheet.css
@@ -57,51 +50,42 @@ sed -i 's/\r//' README.txt
 ant
 
 %install
-rm -rf %{buildroot}
 
 # jars
 install -d -m 0755 %{buildroot}%{_javadir}
-install -m 644 %{project_name}-%{version}.jar   %{buildroot}%{_javadir}/%{project_name}-%{version}.jar
-
-(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; \
-    do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
-
-%add_to_maven_depmap edu.umd.cs.mtc multithreadedtc %{version} JPP %{project_name}
-%add_to_maven_depmap edu.umd.cs.mtc multithreadedtc-jdk14 %{version} JPP %{project_name}
+install -m 644 %{project_name}-%{version}.jar   %{buildroot}%{_javadir}/%{project_name}.jar
 
 # poms
 install -d -m 755 %{buildroot}%{_mavenpomdir}
 install -pm 644 %{SOURCE1} \
     %{buildroot}%{_mavenpomdir}/JPP-%{project_name}.pom
+%add_maven_depmap JPP-%{project_name}.pom %{project_name}.jar -a "edu.umd.cs.mtc:multithreadedtc-jdk14"
 
 # javadoc
-install -d -m 0755 %{buildroot}%{_javadocdir}/%{name}-%{version}
-cp -pr web/docs/* %{buildroot}%{_javadocdir}/%{name}-%{version}/
-ln -s %{name}-%{version} %{buildroot}%{_javadocdir}/%{name}
+install -d -m 0755 %{buildroot}%{_javadocdir}/%{name}
+cp -pr web/docs/* %{buildroot}%{_javadocdir}/%{name}/
 rm -rf web/docs
 
-%post
-%update_maven_depmap
-
-%postun
-%update_maven_depmap
-
-%clean
-rm -rf %{buildroot}
-
 %files
-%defattr(-,root,root,-)
 %doc LICENSE.txt README.txt
 %{_javadir}/*
 %{_mavenpomdir}/*
 %{_mavendepmapfragdir}/*
 
+# Workaround for rpm bug, remove in F23
+%pre javadoc
+[ $1 -gt 1 ] && [ -L %{_javadocdir}/%{name} ] && \
+rm -rf $(readlink -f %{_javadocdir}/%{name}) %{_javadocdir}/%{name} || :
+
 %files javadoc
-%defattr(-,root,root,-)
-%{_javadocdir}/%{name}-%{version}
+%doc LICENSE.txt
 %{_javadocdir}/%{name}
 
 %changelog
+* Mon Aug 12 2013 gil cattaneo <puntogil at libero.it> - 1.01-15
+- fix rhbz#992389
+- update to current packaging guidelines
+
 * Sat Aug 03 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.01-14
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
 


More information about the scm-commits mailing list