[ini4j] Update package to build using maven instead of ant

Omair Majid omajid at fedoraproject.org
Mon Jan 17 19:57:36 UTC 2011


commit 2f6a3ef3c0b885e445bb36cc932540afecddc122
Author: Omair Majid <omajid at redhat.com>
Date:   Mon Jan 17 14:56:36 2011 -0500

    Update package to build using maven instead of ant

 .gitignore                     |    1 +
 LICENSE-2.0.txt                |  202 ----------------------------------------
 fix-maven-license-plugin.patch |   11 ++
 ini4j-0.4.1-build.xml          |   99 --------------------
 ini4j.depmap                   |   23 +++++
 ini4j.spec                     |  124 +++++++++++++++++--------
 javadoc-encoding.patch         |   22 +++++
 remove-test-dependencies.patch |   33 +++++++
 remove-translator.patch        |   26 +++++
 remove-wagon.patch             |   28 ++++++
 10 files changed, 228 insertions(+), 341 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 67ea92a..bb22408 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
 ini4j-0.4.1-src.zip
+/ini4j-0.4.1-src.zip
diff --git a/fix-maven-license-plugin.patch b/fix-maven-license-plugin.patch
new file mode 100644
index 0000000..2b6dfad
--- /dev/null
+++ b/fix-maven-license-plugin.patch
@@ -0,0 +1,11 @@
+--- a/pom.xml	2010-12-23 13:11:11.143336083 -0500
++++ b/pom.xml	2010-12-23 13:40:34.138396919 -0500
+@@ -344,7 +344,7 @@
+                 </configuration>
+             </plugin>
+             <plugin>
+-                <groupId>com.google.code.maven-license-plugin</groupId>
++                <groupId>com.mycila.maven-license-plugin</groupId>
+                 <artifactId>maven-license-plugin</artifactId>
+                 <version>1.4.0</version>
+                 <inherited>true</inherited>
diff --git a/ini4j.depmap b/ini4j.depmap
new file mode 100644
index 0000000..b089678
--- /dev/null
+++ b/ini4j.depmap
@@ -0,0 +1,23 @@
+<dependencies>
+  <dependency>
+    <maven>
+      <groupId>javax.activation</groupId>
+      <artifactId>activation</artifactId>
+      <version>1.0.2</version> 
+    </maven>
+  </dependency>
+
+  <dependency>
+    <maven>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-mail-sender-api</artifactId>
+      <version>1.0-alpha-2</version> 
+    </maven>
+    <jpp>
+      <groupId>JPP/plexus</groupId>
+      <artifactId>mail-sender-api</artifactId>
+      <version>1.0</version>
+    </jpp>
+  </dependency>
+
+</dependencies>
diff --git a/ini4j.spec b/ini4j.spec
index f730c41..3179bee 100644
--- a/ini4j.spec
+++ b/ini4j.spec
@@ -1,95 +1,139 @@
-# Prevent brp-java-repack-jars from being run.
-%global __jar_repack %{nil}
-
-%global servlet_jar %{_javadir}/servlet.jar
-%global jetty_jar %{_javadir}/jetty/jetty.jar
-
 Name:           ini4j
 Version:        0.4.1
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        Java API for handling files in Windows .ini format
-
 Group:          Development/Libraries
 License:        ASL 2.0
 URL:            http://www.ini4j.org/
 Source0:        http://downloads.sourceforge.net/%{name}/%{name}-%{version}-src.zip
-Source1:        http://www.apache.org/licenses/LICENSE-2.0.txt
-Source2:        %{name}-%{version}-build.xml
-
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+# bug 665544: problem in depmap supplied by plexus-mail-sender
+Source1:        %{name}.depmap
+Patch0:         remove-translator.patch
+Patch1:         remove-wagon.patch
+Patch2:         fix-maven-license-plugin.patch
+Patch3:         remove-test-dependencies.patch
+Patch4:         javadoc-encoding.patch
 BuildArch:      noarch
 
 # See http://ini4j.sourceforge.net/dependencies.html
 BuildRequires:  jpackage-utils
-BuildRequires:  ant
 BuildRequires:  java-devel >= 1:1.6.0
-BuildRequires:  tomcat5-servlet-2.4-api >= 5.5
-BuildRequires:  jetty >= 4.2.2
+
+BuildRequires:  maven-antrun-plugin
+BuildRequires:  maven-assembly-plugin
+BuildRequires:  maven-changes-plugin
+BuildRequires:  maven-compiler-plugin
+BuildRequires:  maven-install-plugin
+BuildRequires:  maven-jar-plugin
+BuildRequires:  maven-javadoc-plugin
+BuildRequires:  maven-release-plugin
+BuildRequires:  maven-site-plugin
+BuildRequires:  maven-license-plugin
+BuildRequires:  maven-source-plugin
+BuildRequires:  maven-surefire-plugin
+BuildRequires:  plexus-mail-sender
+BuildRequires:  xmlrpc3-client
+BuildRequires:  xmlrpc3-common
 
 Requires:       jpackage-utils
 Requires:       java >= 1:1.6.0
-Requires:       tomcat5-servlet-2.4-api >= 5.5
+
+Requires(post): jpackage-utils
+Requires(postun): jpackage-utils
+
 
 %description
-The [ini4j] is a simple Java API for handling configuration files in Windows 
+%{name} is a simple Java API for handling configuration files in Windows 
 .ini format. Additionally, the library includes Java Preferences API 
 implementation based on the .ini file.
 
+
 %package javadoc
-Summary:        Javadocs for %{name}
+Summary:        API documentation for %{name}
 Group:          Documentation
-Requires:       %{name} = %{version}-%{release}
 Requires:       jpackage-utils
 
 %description javadoc
 This package contains the API documentation for %{name}.
 
-%prep
 
+%prep
 %setup -q
+# remove existing binaries
+find . -type f \( -iname "*.jar" -o -iname "*.class" -o -iname "*.exe" \) | \
+  xargs -t rm -f
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1 
+%patch3 -p1
+%patch4 -p1
 
-cp -a %{SOURCE1} ./LICENSE-2.0.txt
-cp -a %{SOURCE2} ./build.xml
 
-find . -type f \( -iname "*.jar" -o -iname "*.class" \) | xargs -t %{__rm} -f
+%build
+export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
+mkdir -p $MAVEN_REPO_LOCAL
 
-# remove test sources
-%{__rm} -rf src/test
-# remove site sources
-%{__rm} -rf src/site
+# Tests require easymock2 class extension to compile. This package is not
+# available in fedora yet. So disable tests for now.
+# Will also need to add the correct depmap for jetty when tests are enabled.
 
-%build
+mvn-jpp -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
+        -Dmaven2.jpp.depmap.file=%{SOURCE1} \
+        -Dmaven.test.skip=true \
+        install javadoc:javadoc
 
-%ant -Dbuild.servlet.jar=%{servlet_jar} -Dbuild.jetty.jar=%{jetty_jar} build javadoc
 
 %install
-%{__rm} -rf %{buildroot}
+# jar
+mkdir -p $RPM_BUILD_ROOT%{_javadir}
+cp -p target/%{name}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar
+
+# javadoc
+mkdir -p $RPM_BUILD_ROOT%{_javadocdir}/%{name}
+cp -rp target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}
+
+# pom
+install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir}
+install -pm 644 pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP-%{name}.pom
+%add_to_maven_depmap org.ini4j ini4j %{version} JPP %{name}
+
 
-# JAR
-%{__mkdir_p} %{buildroot}%{_javadir}
-%{__cp} -p dist/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
-(cd %{buildroot}%{_javadir} && %{__ln_s} %{name}-%{version}.jar %{name}.jar)
+%post
+%update_maven_depmap
 
-# Javadoc
-%{__mkdir_p} %{buildroot}%{_javadocdir}/%{name}
-%{__cp} -rp build/doc/api/* %{buildroot}%{_javadocdir}/%{name}
 
-%clean
-%{__rm} -rf %{buildroot}
+%postun
+%update_maven_depmap
+
 
 %files
 %defattr(-,root,root,-)
+%{_mavenpomdir}/*
+%{_mavendepmapfragdir}/*
 %{_javadir}/*
-%doc LICENSE-2.0.txt src/main/java/org/ini4j/package.html
+%doc LICENSE.txt NOTICE.txt
+
 
 %files javadoc
 %defattr(-,root,root,-)
 %{_javadocdir}/%{name}
+%doc LICENSE.txt
 
 
 %changelog
+* Thu Jan 13 2011 Omair Majid <omajid at redhat.com> 0.4.1-3
+- Update based on package review.
+- Fixe typo in documentation
+- Remove dependency of javadoc subpackage on main package
+- Install versionless jar
+- Add missing requires
+
+* Thu Dec 23 2010 Omair Majid <omajid at redhat.com> 0.4.1-3
+- Switch to maven build
+
 * Tue Aug 11 2009 Victor Vasilyev <victor.vasilyev at sun.com> 0.4.1-2
 - Syntax is corrected
+
 * Sat Aug 08 2009 Victor Vasilyev <victor.vasilyev at sun.com> 0.4.1-1
 - Re-base for the version 0.4.1
 - Ant instead of Maven
diff --git a/javadoc-encoding.patch b/javadoc-encoding.patch
new file mode 100644
index 0000000..8b8cdd1
--- /dev/null
+++ b/javadoc-encoding.patch
@@ -0,0 +1,22 @@
+--- a/pom.xml	2010-12-23 15:27:41.969895820 -0500
++++ b/pom.xml	2010-12-23 16:55:39.455895239 -0500
+@@ -285,6 +285,9 @@
+             <plugin>
+                 <groupId>org.apache.maven.plugins</groupId>
+                 <artifactId>maven-javadoc-plugin</artifactId>
++                <configuration>
++                    <encoding>UTF-8</encoding>
++                </configuration>
+                 <executions>
+                     <execution>
+                         <id>attach-javadoc</id>
+@@ -417,6 +420,9 @@
+             <plugin>
+                 <groupId>org.apache.maven.plugins</groupId>
+                 <artifactId>maven-javadoc-plugin</artifactId>
++                <configuration>
++                    <encoding>UTF-8</encoding>
++                </configuration>
+             </plugin>
+             
+             <plugin>
diff --git a/remove-test-dependencies.patch b/remove-test-dependencies.patch
new file mode 100644
index 0000000..add026f
--- /dev/null
+++ b/remove-test-dependencies.patch
@@ -0,0 +1,33 @@
+--- a/pom.xml	2010-12-23 13:11:11.143336083 -0500
++++ b/pom.xml	2010-12-23 14:21:30.860359960 -0500
+@@ -58,30 +58,6 @@
+             <version>2.3</version>
+             <scope>provided</scope>
+         </dependency>
+-        <dependency>
+-            <groupId>junit</groupId>
+-            <artifactId>junit</artifactId>
+-            <version>4.5</version>
+-            <scope>test</scope>
+-        </dependency>
+-        <dependency>
+-            <groupId>jetty</groupId>
+-            <artifactId>jetty</artifactId>
+-            <version>4.2.2</version>
+-            <scope>test</scope>
+-        </dependency>
+-        <dependency>
+-            <groupId>org.easymock</groupId>
+-            <artifactId>easymock</artifactId>
+-            <version>2.3</version>
+-            <scope>test</scope>
+-        </dependency>
+-        <dependency>
+-            <groupId>org.easymock</groupId>
+-            <artifactId>easymockclassextension</artifactId>
+-            <version>2.3</version>
+-            <scope>test</scope>
+-        </dependency>
+     </dependencies>
+     <properties>
+         <upload.url>scp://shell.sourceforge.net/incoming/s/sz/szkiba/uploads</upload.url>
diff --git a/remove-translator.patch b/remove-translator.patch
new file mode 100644
index 0000000..453c4ec
--- /dev/null
+++ b/remove-translator.patch
@@ -0,0 +1,26 @@
+--- a/pom.xml	2010-12-23 13:11:11.143336083 -0500
++++ b/pom.xml	2010-12-23 13:12:36.712711766 -0500
+@@ -253,23 +253,6 @@
+             </plugin>
+ 
+             <plugin>
+-                <groupId>org.codehaus.mojo</groupId>
+-                <artifactId>retrotranslator-maven-plugin</artifactId>
+-                <executions>
+-                    <execution>
+-                        <phase>deploy</phase>
+-                        <goals>
+-                            <goal>translate-project</goal>
+-                        </goals>
+-                        <configuration>
+-                            <classifier>jdk14</classifier>
+-                            <attach>true</attach>
+-                        </configuration>
+-                    </execution>
+-                </executions>
+-            </plugin>
+-
+-            <plugin>
+                 <groupId>org.apache.maven.plugins</groupId>
+                 <artifactId>maven-source-plugin</artifactId>
+                 <executions>
diff --git a/remove-wagon.patch b/remove-wagon.patch
new file mode 100644
index 0000000..2866122
--- /dev/null
+++ b/remove-wagon.patch
@@ -0,0 +1,28 @@
+--- a/pom.xml	2010-12-23 13:11:11.143336083 -0500
++++ b/pom.xml	2010-12-23 13:29:22.504462645 -0500
+@@ -318,25 +318,6 @@
+                 </executions>
+             </plugin>
+             <plugin>
+-                <groupId>org.codehaus.mojo</groupId>
+-                <artifactId>wagon-maven-plugin</artifactId>
+-                <executions>
+-                    <execution>
+-                        <id>upload</id>
+-                        <goals>
+-                            <goal>upload</goal>
+-                        </goals>
+-                        <phase>deploy</phase>
+-                        <configuration>
+-                            <serverId>ini4j-upload</serverId>
+-                            <fromDir>${project.build.directory}</fromDir>
+-                            <includes>${project.build.finalName}-src*,${project.build.finalName}-bin*,${project.build.finalName}-all*</includes>
+-                            <url>${upload.url}</url>
+-                        </configuration>
+-                    </execution>
+-                </executions>
+-            </plugin>
+-            <plugin>
+                 <groupId>org.apache.maven.plugins</groupId>
+                 <artifactId>maven-site-plugin</artifactId>
+                 <configuration>


More information about the scm-commits mailing list