diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7e154e7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/client-2.2.0.zip diff --git a/dead.package b/dead.package deleted file mode 100644 index 5d8b605..0000000 --- a/dead.package +++ /dev/null @@ -1,3 +0,0 @@ -2017-04-30: Retired orphaned package, because it was orphaned for -more than six weeks. - diff --git a/slf4j-backward-compatible-fix.patch b/slf4j-backward-compatible-fix.patch new file mode 100644 index 0000000..318681c --- /dev/null +++ b/slf4j-backward-compatible-fix.patch @@ -0,0 +1,13 @@ +diff --git zanata-client-commands/src/main/java/org/zanata/client/commands/push/PushCommand.java zanata-client-commands/src/main/java/org/zanata/client/commands/push/PushCommand.java +index a625bc1..46e0ab1 100644 +--- zanata-client-commands/src/main/java/org/zanata/client/commands/push/PushCommand.java ++++ zanata-client-commands/src/main/java/org/zanata/client/commands/push/PushCommand.java +@@ -646,7 +646,7 @@ public class PushCommand extends PushPullCommand + } + else + { +- log.info("pushing target doc [name={} size={} client-locale={}] to server [locale={}] (skipped due to dry run)", srcDoc.getName(), targetDoc.getTextFlowTargets().size(), locale.getLocalLocale(), locale.getLocale()); ++ log.info("pushing target doc [name={} size={} client-locale={}] to server [locale={}] (skipped due to dry run)", new Object[] {srcDoc.getName(), targetDoc.getTextFlowTargets().size(), locale.getLocalLocale(), locale.getLocale()}); + } + } + diff --git a/sources b/sources new file mode 100644 index 0000000..7718596 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +a63d56d4a11fa48f7fbda5f0efbe0cf9 client-2.2.0.zip diff --git a/zanata-client.spec b/zanata-client.spec new file mode 100644 index 0000000..1efa0d4 --- /dev/null +++ b/zanata-client.spec @@ -0,0 +1,221 @@ +%if 0%{?fedora} > 18 + %global mvn_exec_plugin exec-maven-plugin +%else + %global mvn_exec_plugin maven-plugin-exec +%endif + +%global shortname client + +%global submodule_rest zanata-rest-%{shortname} +%global submodule_commands zanata-%{shortname}-commands +%global submodule_cli zanata-cli + +Name: zanata-%{shortname} +Version: 2.2.0 +Release: 4%{?dist} +Summary: Zanata client module + +Group: Development/Tools +License: LGPLv2+ +URL: https://github.com/zanata/%{name} +Source0: https://github.com/zanata/%{name}/archive/%{shortname}-%{version}.zip + +BuildArch: noarch + +BuildRequires: maven-local + +BuildRequires: maven-dependency-plugin +BuildRequires: maven-enforcer-plugin +BuildRequires: maven-surefire-plugin +BuildRequires: maven-surefire-provider-testng +BuildRequires: maven-surefire-provider-junit4 + +# dependencies in zanata-rest-client +BuildRequires: zanata-parent +BuildRequires: zanata-api +BuildRequires: junit +BuildRequires: resteasy +BuildRequires: apache-james-project + +# dependencies in zanata-common-commands +BuildRequires: zanata-common +BuildRequires: mockito +BuildRequires: apache-commons-configuration +BuildRequires: log4j +BuildRequires: args4j +BuildRequires: openprops +BuildRequires: apache-commons-collections +BuildRequires: guava +BuildRequires: hamcrest +BuildRequires: apache-commons-lang +BuildRequires: apache-commons-codec +BuildRequires: apache-commons-io +BuildRequires: opencsv +BuildRequires: ant + +# dependencies in zanata-cli +BuildRequires: %mvn_exec_plugin + +Requires: jpackage-utils +Requires: java +Requires: maven + +Requires: slf4j +Requires: zanata-api +Requires: resteasy +Requires: zanata-common +Requires: apache-commons-configuration +Requires: log4j +Requires: args4j +Requires: openprops +Requires: apache-commons-collections +Requires: guava +Requires: apache-commons-lang +Requires: apache-commons-codec +Requires: apache-commons-io +Requires: opencsv +Requires: ant + + +%description +Zanata client modules. +Holds most of Zanata's client code, including Zanata CLI. +It also contains REST stub for interacting with a Zanata server. + +%package javadoc +Summary: Javadocs for %{name} +Group: Documentation +Requires: jpackage-utils +Requires: %{name} = %{version}-%{release} + +%description javadoc +This package contains the API documentation for %{shortname}. +This includes submodules: +%{submodule_rest}, %{submodule_commands} and %{submodule_cli}. + +%prep +%setup -q -n %{name}-%{shortname}-%{version} +%pom_disable_module zanata-maven-plugin +%pom_remove_plugin :appassembler-maven-plugin %{submodule_cli} +%pom_remove_plugin :maven-assembly-plugin %{submodule_cli} + +%build +# -Dmaven.local.debug=true +find . -type f -name "*Test.java" | xargs rm +mvn-rpmbuild package javadoc:aggregate -DskipTests + +# local offline maven can not resolve each module, +# we have to disable our own module and generate classpath one by one +cd %{submodule_rest} +mvn-rpmbuild dependency:build-classpath -DincludeScope=compile -Dmdep.outputFile=target/%{submodule_rest}-classpath.txt + +cd .. +%pom_remove_dep org.zanata:%{submodule_rest} %{submodule_commands} +cd %{submodule_commands} +mvn-rpmbuild dependency:build-classpath -DincludeScope=compile -Dmdep.outputFile=target/%{submodule_commands}-classpath.txt + +cd .. +%pom_remove_dep org.zanata:%{submodule_commands} %{submodule_cli} +cd %{submodule_cli} +mvn-rpmbuild dependency:build-classpath -DincludeScope=compile -Dmdep.outputFile=target/%{submodule_cli}-classpath.txt + + +%install +mkdir -p %{buildroot}%{_javadir} + +cp -p %{submodule_rest}/target/%{submodule_rest}*-%{version}.jar %{buildroot}%{_javadir}/%{submodule_rest}.jar +cp -p %{submodule_commands}/target/%{submodule_commands}*-%{version}.jar %{buildroot}%{_javadir}/%{submodule_commands}.jar +cp -p %{submodule_cli}/target/%{submodule_cli}*-%{version}.jar %{buildroot}%{_javadir}/%{submodule_cli}.jar + +mkdir -p %{buildroot}%{_javadocdir}/%{name} +cp -rp target/site/apidocs %{buildroot}%{_javadocdir}/%{name}/%{submodule_rest} +cp -rp target/site/apidocs %{buildroot}%{_javadocdir}/%{name}/%{submodule_commands} +cp -rp target/site/apidocs %{buildroot}%{_javadocdir}/%{name}/%{submodule_cli} + +install -d -m 755 %{buildroot}%{_mavenpomdir} +install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom +install -pm 644 %{submodule_rest}/pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{submodule_rest}.pom +install -pm 644 %{submodule_commands}/pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{submodule_commands}.pom +install -pm 644 %{submodule_cli}/pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{submodule_cli}.pom + +%add_maven_depmap JPP-%{name}.pom +%add_maven_depmap JPP-%{submodule_rest}.pom %{submodule_rest}.jar +%add_maven_depmap JPP-%{submodule_commands}.pom %{submodule_commands}.jar +%add_maven_depmap JPP-%{submodule_cli}.pom %{submodule_cli}.jar + +rest_cp=$(cat %{submodule_rest}/target/%{submodule_rest}-classpath.txt) +commands_cp=$(cat %{submodule_commands}/target/%{submodule_commands}-classpath.txt) +cli_cp=$(cat %{submodule_cli}/target/%{submodule_cli}-classpath.txt) + +%global CLASSPATH $rest_cp:$commands_cp:$cli_cp + +mkdir -p %{buildroot}%{_bindir} + +install -d -m 755 %{buildroot}%{_bindir} +# create wrapper script +# adapted from jpackage_script(). +# We build CLASSPATH at build time and the script won't be able to access it at runtime +############# copied from jpackage_script() ########################### +cat > %{buildroot}%{_bindir}/zanata-cli << ZANATA_CLI +#!/bin/sh +# +# %{name} script +# JPackage Project + +# Source functions library +. %{_javadir}-utils/java-functions + +# Source system prefs +if [ -f %{_sysconfdir}/java/%{name}.conf ] ; then + . %{_sysconfdir}/java/%{name}.conf +fi + +# Source user prefs +if [ -f \$HOME/.%{name}rc ] ; then + . \$HOME/.%{name}rc +fi + +# Configuration +MAIN_CLASS=org.zanata.client.ZanataClient +BASE_JARS="%{submodule_rest} %{submodule_commands} %{submodule_cli} slf4j/log4j12 opencsv" +CLASSPATH=%{CLASSPATH} + +# Set parameters +set_jvm +# we have built CLASSPATH above +set_classpath \$BASE_JARS + +# Let's start +run "\$@" +ZANATA_CLI + +chmod 755 %{buildroot}%{_bindir}/zanata-cli +################################################################# + + +%files -f .mfiles +%attr(0755,root,root) %{_bindir}/zanata-cli +%doc README.txt + +%files javadoc +%{_javadocdir}/%{name}/%{submodule_rest} +%{_javadocdir}/%{name}/%{submodule_commands} +%{_javadocdir}/%{name}/%{submodule_cli} + +%changelog +* Thu Nov 14 2013 Patrick Huang 2.2.0-4 +- Fix classpath in fedora 18 +- Remove conditional build for other fedora version +- Add require maven + +* Fri Nov 01 2013 Ding-Yi Chen 2.2.0-3 +- Fixes Bug 1025112 - zanata-cli: Incorrect BASE_JARS + +* Thu May 16 2013 Patrick Huang 2.2.0-2 +- Change license to LGPLv2+ + +* Fri Mar 1 2013 Patrick Huang 2.2.0-1 +- Upstream version update + +* Mon Feb 11 2013 Patrick Huang 2.0.1-1 +- Initial RPM package