Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37845422
en ru br
ALT Linux repos
S:6.5.0-alt1_2jpp11
5.0: 5.2-alt2_3jpp1.7
4.1: 5.2-alt2_3jpp1.7
4.0: 5.2-alt2_3jpp1.7
3.0: 5.1-alt1

Other repositories

Group :: Development/Java
RPM: bcel

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

BuildRequires: /proc
BuildRequires: jpackage-1.4-compat
# Copyright (c) 2000-2007, 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.
#

%define gcj_support 0

# If you don't want to build with maven, and use straight ant instead,

# give rpmbuild option '--without maven'

%define with_maven %{!?_without_maven:1}%{?_without_maven:0}
%define without_maven %{?_without_maven:1}%{!?_without_maven:0}


Name:           bcel
Version:        5.2
Release:        alt2_3jpp1.7
Epoch:          0
Summary:        Byte Code Engineering Library
License:        Apache Software License
Source0:        http://www.apache.org/dist/jakarta/%{name}/source/%{name}-%{version}-src.tar.gz
Source1:        pom-maven2jpp-depcat.xsl
Source2:        pom-maven2jpp-newdepmap.xsl
Source3:        pom-maven2jpp-mapdeps.xsl
Source4:        %{name}-%{version}-jpp-depmap.xml
Source5:        commons-build.tar.gz
Source6:        %{name}-%{version}-build.xml
Source7:        %{name}-%{version}.pom

Patch0:         %{name}-%{version}-project_properties.patch
URL:            http://jakarta.apache.org/%{name}/
Group:          Development/Java
Requires: regexp
BuildRequires: ant
%if %{with_maven}
BuildRequires: maven-plugins >= 0:1.1
BuildRequires: saxon
BuildRequires: saxon-scripts
BuildRequires: maven-plugins-base
BuildRequires: maven-plugin-changelog
BuildRequires: maven-plugin-changes
BuildRequires: maven-plugin-developer-activity
BuildRequires: maven-plugin-jxr
BuildRequires: maven-plugin-license
BuildRequires: maven-plugin-pmd
BuildRequires: maven-plugin-test
BuildRequires: maven-plugin-xdoc
Requires(post): jpackage-utils >= 0:1.7.2
Requires(postun): jpackage-utils >= 0:1.7.2
%endif
BuildRequires: regexp
BuildRequires: jpackage-utils >= 0:1.7.2
%if ! %{gcj_support}
BuildArch:      noarch
%endif

%if %{gcj_support}
BuildRequires: gnu-crypto
BuildRequires: java-gcj-compat-devel
Requires(post): java-gcj-compat
Requires(postun): java-gcj-compat
%endif

%description
The Byte Code Engineering Library (formerly known as JavaClass) is
intended to give users a convenient possibility to analyze, create, and
manipulate (binary) Java class files (those ending with .class). Classes
are represented by objects which contain all the symbolic information of
the given class: methods, fields and byte code instructions, in
particular.  Such objects can be read from an existing file, be
transformed by a program (e.g. a class loader at run-time) and dumped to
a file again. An even more interesting application is the creation of
classes from scratch at run-time. The Byte Code Engineering Library
(BCEL) may be also useful if you want to learn about the Java Virtual
Machine (JVM) and the format of Java .class files.  BCEL is already
being used successfully in several projects such as compilers,
optimizers, obfuscators and analysis tools, the most popular probably
being the Xalan XSLT processor at Apache.

%package javadoc
Summary:        Javadoc for %{name}
Group:          Development/Documentation

%description javadoc
%{summary}.

%package manual
Summary:        Manual for %{name}
Group:          Development/Java

%description manual
%{summary}.

%prep

%setup -q
gzip -dc %{SOURCE5} | tar xf -
# remove all binary libs
#find . -name "*.jar" -exec rm -f {} \;
for j in $(find . -name "*.jar"); do
   %{__mv} $j ${j}.no
done
cp %{SOURCE6} build.xml
%patch0 -b .sav

%build
%if %{with_maven}
export DEPCAT="$(pwd)/%{name}-%{version}-depcat.new.xml"
echo '<?xml version="1.0" standalone="yes"?>' > $DEPCAT
echo '<depset>' >> $DEPCAT
for p in $(find . -name project.xml); do
   pushd $(dirname $p)
       /usr/bin/saxon project.xml %{SOURCE1} >> $DEPCAT
   popd
done
echo >> $DEPCAT
echo '</depset>' >> $DEPCAT
/usr/bin/saxon $DEPCAT %{SOURCE2} > %{name}-%{version}-depmap.new.xml

for p in $(find . -name project.xml); do
   pushd $(dirname $p)
       %{__cp} project.xml project.xml.orig
       /usr/bin/saxon -o project.xml project.xml.orig %{SOURCE3} \
           map="%{SOURCE4}"
   popd
done

export MAVEN_HOME_LOCAL="$(pwd)/.maven"

maven -e \
       -Dmaven.repo.remote=file:/usr/share/maven/repository \
       -Dmaven.home.local=${MAVEN_HOME_LOCAL} \
       jar:jar javadoc:generate xdoc:transform
%else
ant -Dregexp.jar="file://$(build-classpath regexp)" jar javadoc
%endif

%install
# jars
%{__mkdir_p} %{buildroot}%{_javadir}
%{__install} -m 0644 target/%{name}-%{version}.jar \
   %{buildroot}%{_javadir}/%{name}-%{version}.jar
(
   cd %{buildroot}%{_javadir}
   for jar in *-%{version}*; do
       %{__ln_s} ${jar} `echo $jar | %{__sed}  "s|-%{version}||g"`
   done
)
# depmap frags
%add_to_maven_depmap %{name} %{name} %{version} JPP %{name}
%add_to_maven_depmap org.apache.bcel %{name} %{version} JPP %{name}
# pom
%{__mkdir_p} %{buildroot}%{_datadir}/maven2/poms
%{__install} -m 0644 %{SOURCE7} \
   %{buildroot}%{_datadir}/maven2/poms/JPP-%{name}.pom
%{__mkdir_p} %{buildroot}%{_datadir}/maven2/default_poms
%{__install} -m 0644 %{SOURCE7} \
   %{buildroot}%{_datadir}/maven2/default_poms/JPP-%{name}.pom

# javadoc

%{__mkdir_p} %{buildroot}%{_javadocdir}/%{name}-%{version}
%if %{with_maven}
%{__cp} -pr target/docs/apidocs/* %{buildroot}%{_javadocdir}/%{name}-%{version}
%{__rm} -rf target/docs/apidocs
%else
%{__cp} -pr dist/docs/api/* %{buildroot}%{_javadocdir}/%{name}-%{version}
%{__rm} -rf docs/api
%endif
%{__ln_s} %{name}-%{version} %{buildroot}%{_javadocdir}/%{name} # ghost symlink

# manual

%{__mkdir_p} %{buildroot}%{_docdir}/%{name}-%{version}
%if %{with_maven}
%{__cp} -pr target/docs/* %{buildroot}%{_docdir}/%{name}-%{version}
%else
%{__cp} -pr docs/* %{buildroot}%{_docdir}/%{name}-%{version}
%endif
%{__cp} LICENSE.txt %{buildroot}%{_docdir}/%{name}-%{version}

%if %{gcj_support}
export CLASSPATH="$(build-classpath gnu-crypto)"
%{_bindir}/aot-compile-rpm
%endif

%clean
%{__rm} -rf %{buildroot}

%post javadoc
%{__rm} -f %{_javadocdir}/%{name}
%{__ln_s} %{name}-%{version} %{_javadocdir}/%{name}

%postun javadoc
if [ "$1" = "0" ]; then
   %{__rm} -f %{_javadocdir}/%{name}
fi

%post
%update_maven_depmap
%if %{gcj_support}
if [ -x %{_bindir}/rebuild-gcj-db ]; then
   %{_bindir}/rebuild-gcj-db
fi
%endif

%postun
%update_maven_depmap
%if %{gcj_support}
if [ -x %{_bindir}/rebuild-gcj-db ]; then
   %{_bindir}/rebuild-gcj-db
fi
%endif

%files
%doc %{_docdir}/%{name}-%{version}/LICENSE.txt
%{_javadir}/*
%if %{with_maven}
%{_datadir}/maven2/poms/*
%{_datadir}/maven2/default_poms/*
%endif
%{_mavendepmapfragdir}
%if %{gcj_support}
%{_libdir}/gcj/%{name}/%{name}-*.jar.*
%endif

%files javadoc
%{_javadocdir}/%{name}-%{version}
%ghost %doc %{_javadocdir}/%{name}

%files manual
%doc %{_docdir}/%{name}-%{version}

%changelog

Full changelog you can see here

 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin