[cpptasks] Build with maven 3, update for newer guidelines

mbooth mbooth at fedoraproject.org
Sun Aug 11 11:42:18 UTC 2013


commit 83d4f82d72284c3abf67d1cc82b910847aa78d0a
Author: Mat Booth <fedora at matbooth.co.uk>
Date:   Sun Aug 11 12:41:57 2013 +0100

    Build with maven 3, update for newer guidelines

 cpptasks.spec |  107 +++++++++++---------------------------------------------
 1 files changed, 21 insertions(+), 86 deletions(-)
---
diff --git a/cpptasks.spec b/cpptasks.spec
index 1e745f5..a313dd1 100644
--- a/cpptasks.spec
+++ b/cpptasks.spec
@@ -1,29 +1,19 @@
 Name:		cpptasks
 Version:	1.0b5
-Release:	10%{?dist}
+Release:	11%{?dist}
 Summary:	Compile and link task for ant
 
 Group:		Development/Libraries
 
 License:	ASL 2.0
 URL:		http://ant-contrib.sourceforge.net/
-Vendor:		Ant contrib project
 Source0:	http://downloads.sourceforge.net/ant-contrib/cpptasks-1.0b5.tar.gz
 Source1:	%{name}-README.fedora
 
 BuildRequires:	ant 
-BuildRequires:	ant-junit 
-BuildRequires:	jpackage-utils 
-BuildRequires:	junit
-#BuildRequires:	mave
-
-Requires:	ant 
-Requires:	java
-Requires:	jpackage-utils
+BuildRequires:	maven-local
 
 BuildArch:	noarch
-BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-	
 
 %description
 This ant task can compile various source languages and produce
@@ -34,101 +24,46 @@ MIDL and Windows Resource files.
 %package        javadoc
 Summary:	Javadoc for %{name}
 Group:		Documentation
-Requires:	%{name} >= %{version}-%{release}
-Requires:	jpackage-utils
 
 %description	javadoc
 Javadoc documentation for %{summary}.
 
-
-#The manual for b5 has been moved to xdoc (doxia) format.
-# This requires maven, which requires many dependencies which we don't have.
-#%package	manual
-#Summary:	Docs for %{name}
-#Group:		Development/Documentation
-
-#%description	manual
-#User manual for %{summary}.
-
 %prep
-%setup -q -n %{name}-%{version}
-
-#End of line conversion
-%{__sed} -i 's/\r//' NOTICE 
+%setup -q
 
-#Check for exisiting jar files
-JAR_files=""
-for j in $(find -name \*.jar); do
-if [ ! -L $j ] ; then
-	JAR_files="$JAR_files $j"
-	fi
-done
+find . -name "*.jar" -exec rm -f {} \;
+find . -name "*.class" -exec rm -f {} \;
 
-if [ ! -z "$JAR_files" ] ; then
-	echo "These JAR files should be deleted and symlinked to system JAR files: $JAR_files"
-	exit 1
-fi
+sed -i 's/\r//' NOTICE 
 
 cp -p %{SOURCE1} ./README.fedora
 
-%build
-export OPT_JAR_LIST="ant/ant-junit junit"
-export CLASSPATH=
-ant jars javadocs 
-
-#In lieu of maven built docs, which requires clirr
-#a URL is supplied in README.fedora
-#mvn-jpp site
-
-%install
-rm -rf $RPM_BUILD_ROOT
-
+%pom_remove_dep ant:ant
+%pom_add_dep org.apache.ant:ant
 
-# jars
-mkdir -p $RPM_BUILD_ROOT%{_javadir}/ant/
-install -Dpm 644 target/lib/%{name}.jar \
-	$RPM_BUILD_ROOT%{_javadir}/ant/%{name}-%{version}.jar
+%mvn_file :%{name} ant/%{name}
 
-pushd $RPM_BUILD_ROOT%{_javadir}/ant/
-ln -s %{name}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/ant/%{name}.jar
-popd
-
-# javadoc
-install -dm 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
-
-cp -pr target/javadocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
-ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name} # ghost symlink
+%build
+%mvn_build
 
-# manual - 
-#install -dm 755 $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
-#cp -pr docs/* $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
+%install
+%mvn_install
 
-#Place a file into ant's config dir
+# Place a file into ant's config dir
 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/ant.d/
-echo "%{name} ant/%{name}" > $RPM_BUILD_ROOT/%{_sysconfdir}/ant.d/%{name}
-
+echo "ant/%{name}" > $RPM_BUILD_ROOT/%{_sysconfdir}/ant.d/%{name}
 
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%files
-%defattr(-,root,root,-)
+%files -f .mfiles
 %doc LICENSE NOTICE README.fedora
-%{_javadir}/ant/*.jar
 %{_sysconfdir}/ant.d/%{name}
 
-%files javadoc
-%defattr(-,root,root,-)
-%doc %{_javadocdir}/%{name}-%{version}
-%doc %{_javadocdir}/%{name}
-
-#%files manual
-#%defattr(-,root,root,-)
-#%doc %{_docdir}/%{name}-%{version}
-
-# -----------------------------------------------------------------------------
+%files javadoc -f .mfiles-javadoc
+%doc LICENSE NOTICE
 
 %changelog
+* Sun Aug 11 2013 Mat Booth <fedora at matbooth.co.uk> - 1.0b5-11
+- Build with maven 3, update for newer guidelines
+
 * Sat Aug 03 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.0b5-10
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
 


More information about the scm-commits mailing list