# Copyright (c) 2000-2008, JPackage Project # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the # distribution. # 3. Neither the name of the JPackage Project nor the names of its # contributors may be used to endorse or promote products derived # from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # %global with_gcj %{!?_without_gcj:1}%{?_without_gcj:0} Name: jarjar Version: 0.9 Release: 5%{?dist} Summary: Jar Jar Links License: GPLv2+ URL: http://tonicsystems.com/products/jarjar/ Group: Development/Tools Source0: http://downloads.sourceforge.net/jarjar/jarjar-src-0.9.zip Source1: jarjar-0.9.pom BuildRequires: ant >= 0:1.6 BuildRequires: ant-junit >= 0:1.6 BuildRequires: jpackage-utils >= 0:1.7.2 BuildRequires: junit BuildRequires: asm2 BuildRequires: gnu-regexp BuildRequires: maven2 Requires: asm2 Requires: gnu-regexp Requires: jpackage-utils >= 0:1.7.2 Requires(post): jpackage-utils >= 0:1.7.2 Requires(postun): jpackage-utils >= 0:1.7.2 %if %{with_gcj} BuildRequires: java-gcj-compat-devel >= 1.0.31 Requires(post): java-gcj-compat >= 1.0.31 Requires(postun): java-gcj-compat >= 1.0.31 %else BuildArch: noarch %endif BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root %description Jar Jar Links is a utility that makes it easy to repackage Java libraries and embed them into your own distribution. This is useful for two reasons: You can easily ship a single jar file with no external dependencies. You can avoid problems where your library depends on a specific version of a library, which may conflict with the dependencies of another library. %package maven2-plugin Summary: Maven2 plugin for %{name} Group: Development/Tools Requires: maven2 Requires: %{name} = %{version}-%{release} %description maven2-plugin %{summary}. %package javadoc Summary: Javadoc for %{name} Group: Documentation BuildArch: noarch %description javadoc %{summary}. %prep %setup -q -n %{name}-%{version} # remove all binary libs find . -name "*.jar" | xargs -t rm %build pushd lib ln -sf $(build-classpath gnu-regexp) ln -sf $(build-classpath asm2/asm2) asm.jar ln -sf $(build-classpath asm2/asm2-commons) asm-commons.jar ln -sf $(build-classpath asm2/asm2-util) asm-util.jar ln -sf $(build-classpath maven2/plugin-api) maven-plugin-api.jar popd export OPT_JAR_LIST="ant/ant-junit junit" export CLASSPATH=$(build-classpath ant) ant jar jar-util javadoc mojo test %install rm -rf $RPM_BUILD_ROOT # jars mkdir -p $RPM_BUILD_ROOT%{_javadir} install -m 644 dist/%{name}-%{version}.jar \ $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar install -m 644 dist/%{name}-util-%{version}.jar \ $RPM_BUILD_ROOT%{_javadir}/%{name}-util-%{version}.jar install -m 644 dist/%{name}-plugin-%{version}.jar \ $RPM_BUILD_ROOT%{_javadir}/%{name}-maven2-plugin-%{version}.jar (cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}.jar; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done) %if %{with_gcj} %{_bindir}/aot-compile-rpm %endif %add_to_maven_depmap tonic jarjar %{version} JPP %{name} %add_to_maven_depmap com.tonicsystems jarjar %{version} JPP %{name} %add_to_maven_depmap tonic jarjar-util %{version} JPP %{name}-util %add_to_maven_depmap com.tonicsystems jarjar-util %{version} JPP %{name}-util %add_to_maven_depmap tonic jarjar-plugin %{version} JPP %{name}-plugin %add_to_maven_depmap com.tonicsystems jarjar-plugin %{version} JPP %{name}-plugin # poms install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/maven2/poms install -pm 644 %{SOURCE1} \ $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.%{name}.pom # javadoc mkdir -p $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version} cp -pr dist/javadoc/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version} cd $RPM_BUILD_ROOT%{_javadocdir} && ln -sf %{name}-%{version} %{name} %clean rm -rf $RPM_BUILD_ROOT %post %update_maven_depmap %if %{with_gcj} if [ -x %{_bindir}/rebuild-gcj-db ] then %{_bindir}/rebuild-gcj-db fi %endif %postun %update_maven_depmap %if %{with_gcj} if [ -x %{_bindir}/rebuild-gcj-db ] then %{_bindir}/rebuild-gcj-db fi %endif %files %defattr(-,root,root,-) %doc COPYING %{_javadir}/%{name}-%{version}.jar %{_javadir}/%{name}-util-%{version}.jar %{_javadir}/%{name}.jar %{_javadir}/%{name}-util.jar %{_datadir}/maven2/poms/* %config(noreplace) %{_mavendepmapfragdir}/* %if %{with_gcj} %attr(-,root,root) %{_libdir}/gcj/%{name} %endif %files maven2-plugin %defattr(-,root,root,-) %{_javadir}/%{name}-maven2-plugin-%{version}.jar %{_javadir}/%{name}-maven2-plugin.jar %files javadoc %defattr(-,root,root,-) %{_javadocdir}/%{name}-%{version} %{_javadocdir}/%{name} %changelog * Fri Feb 5 2010 Mary Ellen Foster <mefoster at gmail.com> 0.9-5 - Make javadoc noarch * Tue Nov 17 2009 Mary Ellen Foster <mefoster at gmail.com> 0.9-4 - Re-add GCJ bits - Require jpackage-utils (for directories) - Link javadoc dir * Sun Nov 1 2009 Mary Ellen Foster <mefoster at gmail.com> 0.9-3 - Initial package, based on jpackage jarjar-0.9-2