[jline] Remove bundled jars in %%prep phase. Tidy up spec file, fix some rpmlint warnings. Add pom and depma

mbooth mbooth at fedoraproject.org
Sat Dec 18 13:20:47 UTC 2010


commit 7d957f653db7264c2214009a26e80b5ed8aa52ee
Author: mbooth <fedora at matbooth.co.uk>
Date:   Sat Dec 18 12:21:35 2010 +0000

    Remove bundled jars in %%prep phase. Tidy up spec file, fix some rpmlint warnings. Add pom and depmaps.

 jline-build.xml |   86 -----------------------------------
 jline.spec      |  134 ++++++++++++++++++++++++-------------------------------
 2 files changed, 58 insertions(+), 162 deletions(-)
---
diff --git a/jline.spec b/jline.spec
index 4d49c3b..76a4899 100644
--- a/jline.spec
+++ b/jline.spec
@@ -28,115 +28,85 @@
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #
 
-%define _with_maven 1
-
-%define with_maven %{!?_without_maven:1}%{?_without_maven:0}
-%define without_maven %{?_without_maven:1}%{!?_without_maven:0}
-
-%define cvs_version     0.9.94
-%define repo_dir    .m2/repository
-
 Name:           jline
 Version:        0.9.94
-Release:        0.6%{?dist}
-Epoch:          0
+Release:        1%{?dist}
 Summary:        Java library for reading and editing user input in console applications
 License:        BSD
-URL:            http://jline.sf.net/
+URL:            http://jline.sourceforge.net/
 Group:          Development/Libraries
-Source0:        http://download.sourceforge.net/sourceforge/jline/jline-%{cvs_version}.zip
+Source0:        http://download.sourceforge.net/sourceforge/jline/jline-%{version}.zip
 Source1:        CatalogManager.properties
-Source2:        jline-build.xml
-Requires:       bash
+
+Requires:      bash
 # for /bin/stty
-Requires:       coreutils
-Requires:       jpackage-utils
-BuildRequires:  jpackage-utils >= 0:1.7
-%if %{with_maven}
-BuildRequires:  xml-commons-resolver
-BuildRequires:  maven2
-BuildRequires:  maven2-plugin-resources
-BuildRequires:  maven2-plugin-compiler
-BuildRequires:  maven-surefire-maven-plugin
-BuildRequires:  maven-surefire-provider-junit
-BuildRequires:  maven2-plugin-jar
-BuildRequires:  maven2-plugin-install
-BuildRequires:  maven2-plugin-assembly
-BuildRequires:  maven2-plugin-site
-BuildRequires:  maven2-plugin-javadoc
-BuildRequires:  ant-apache-resolver
-%else
-BuildRequires:  ant
-BuildRequires:  junit
-%endif
-BuildArch:      noarch
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Requires:      coreutils
+Requires:      jpackage-utils
+Requires(post):   jpackage-utils
+Requires(postun): jpackage-utils
+
+BuildRequires: jpackage-utils
+BuildRequires: maven-assembly-plugin
+BuildRequires: maven-compiler-plugin
+BuildRequires: maven-install-plugin
+BuildRequires: maven-jar-plugin
+BuildRequires: maven-javadoc-plugin
+BuildRequires: maven-resources-plugin
+BuildRequires: maven-site-plugin
+BuildRequires: maven-surefire-plugin
+BuildRequires: maven-surefire-provider-junit
+
+BuildArch:     noarch
+BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 %description
 JLine is a java library for reading and editing user input in console
 applications. It features tab-completion, command history, password
-masking, customizable keybindings, and pass-through handlers to use to
+masking, configurable key-bindings, and pass-through handlers to use to
 chain to other console applications.
 
 %package        demo
 Summary:        Demos for %{name}
-Group:          Development/Documentation
+Group:          Documentation
+Requires:       %{name} = %{version}-%{release}
 
 %description    demo
 Demonstrations and samples for %{name}.
 
-# FIXME: the maven ant:ant generated build.xml file does not contain
-#        a javadoc task
-%if %{with_maven}
 %package        javadoc
 Summary:        Javadoc for %{name}
-Group:          Development/Documentation
+Group:          Documentation
 Requires:       jpackage-utils
 
 %description    javadoc
 Javadoc for %{name}.
-%endif
 
 %prep
-# BEWARE: The jar file META-INF is not under the subdir
-%setup -q -c -n %{name}-%{cvs_version}
-cp -pr %{name}-%{cvs_version}/* .
-rm -fr %{name}-%{cvs_version}
+%setup -q
 
-# Use locally installed DTDs
-mkdir %{_builddir}/%{name}-%{cvs_version}/build
-cp -p %SOURCE1 %{_builddir}/%{name}-%{cvs_version}/build/
+# Make sure upstream hasn't sneaked in any jars we don't know about
+find -name '*.class' -exec rm -f '{}' \;
+find -name '*.jar' -exec rm -f '{}' \;
 
-cp -p %{SOURCE2} src/build.xml
+# Use locally installed DTDs
+mkdir build
+cp -p %{SOURCE1} build/
 
 %build
-mkdir -p native
-# Now done by Patch0 for documentation purposes
-#perl -p -i -e 's|^.*<attribute name="Class-Path".*||' build.xml
-
 # Use locally installed DTDs
-export CLASSPATH=%{_builddir}/%{name}-%{cvs_version}/build
+export CLASSPATH=%{_builddir}/%{name}-%{version}/build
 
 cd src/
 
-%if %{with_maven}
 export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
 mkdir -p $MAVEN_REPO_LOCAL
 
-mvn-jpp \
-        -e \
-                -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
-                -Dmaven.test.failure.ignore=true \
-        install javadoc:javadoc
-%else
-mkdir -p $(pwd)/.m2/repository
-build-jar-repository $(pwd)/.m2/repository junit
-export CLASSPATH=target/classes
-ant -Dbuild.sysclasspath="only" -Duser.home=$(pwd)
-%endif
+mvn-jpp -e -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
+  install javadoc:javadoc
 
 %install
 rm -rf $RPM_BUILD_ROOT
+
 # jars
 install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
 for jar in $(find -type f -name "*.jar" | grep -E target/.*.jar); do
@@ -145,8 +115,6 @@ done
 (cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}*; do \
 ln -sf ${jar} ${jar/-%{version}/}; done)
 
-# the maven ant:ant task did not generate a build.xml file with a javadoc task
-%if %{with_maven}
 # javadoc
 install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
 for target in $(find -type d -name target); do
@@ -154,25 +122,39 @@ for target in $(find -type d -name target); do
         cp -pr $target/site/apidocs/* $jar $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/`basename \`dirname $target\` | sed -e s:jline-::g`
 done
 ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name}
-%endif
+
+# pom
+install -pD -T -m 644 src/pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
+%add_to_maven_depmap %{name} %{name} %{version} JPP %{name}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 rm -rf $RPM_BUILD_DIR/META-INF
 
+%post
+%update_maven_depmap
+
+%postun
+%update_maven_depmap
+
 %files
-%defattr(0644,root,root,0755)
+%defattr(-,root,root,-)
 %{_javadir}/%{name}.jar
 %{_javadir}/%{name}-%{version}.jar
+%{_mavendepmapfragdir}/*
+%{_mavenpomdir}/*
 %doc LICENSE.txt
 
-%if %{with_maven}
 %files javadoc
-%defattr(0644,root,root,0755)
-%doc %{_javadocdir}/*
-%endif
+%defattr(-,root,root,-)
+%{_javadocdir}/*
 
 %changelog
+* Sat Dec 18 2010 Mat Booth <fedora at matbooth.co.uk> - 0.9.94-1
+- Remove bundled jars in %%prep phase.
+- Tidy up spec file, fix some rpmlint warnings.
+- Add pom and depmaps.
+
 * Mon Mar  8 2010 Peter Lemenkov <lemenkov at gmail.com> - 0:0.9.94-0.6
 - Added missing Requires: jpackage-utils (%%{_javadir} and %%{_javadocdir})
 


More information about the scm-commits mailing list