Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37564416
en ru br
ALT Linux repos
S:2.17.2-alt1_3jpp11
5.0: 1.2.14-alt7_4jpp5
4.1: 1.2.14-alt5_3jpp1.7
4.0: 1.2.14-alt5_3jpp1.7
3.0: 1.2.8-alt2

Group :: Development/Java
RPM: log4j

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Packager: Igor Vlasenko <viy at altlinux.ru>
BuildRequires: /proc
BuildRequires: jpackage-compat
# 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.
#

# If you want repolib package to be built,

# issue the following: 'rpmbuild --with repolib'

%define _with_repolib 1

%define with_repolib %{?_with_repolib:1}%{!?_with_repolib:0}
%define without_repolib %{!?_with_repolib:1}%{?_with_repolib:0}

%define repodir %{_javadir}/repository.jboss.com/apache-log4j/1.2.14-brew
%define repodirlib %{repodir}/lib
%define repodirsrc %{repodir}/src

%define gcj_support 0
%define bootstrap %{?_with_bootstrap:1}%{!?_with_bootstrap:%{?_without_bootstrap:0}%{!?_without_bootstrap:%{?_bootstrap:%{_bootstrap}}%{!?_bootstrap:0}}}


Name:           log4j
Version:        1.2.14
Release:        alt7_4jpp5
Epoch:          0
Summary:        Java logging package
License:        ASL 2.0
Group:          Development/Java
URL:            http://logging.apache.org/log4j/
Source0:        http://www.apache.org/dist/logging/log4j/1.2.14/logging-log4j-1.2.14.tar.gz
# Converted from src/java/org/apache/log4j/lf5/viewer/images/lf5_small_icon.gif
Source1:        %{name}-logfactor5.png
Source2:        %{name}-logfactor5.sh
Source3:        %{name}-logfactor5.desktop
# Converted from docs/images/logo.jpg
Source4:        %{name}-chainsaw.png
Source5:        %{name}-chainsaw.sh
Source6:        %{name}-chainsaw.desktop
Source7:        %{name}.catalog
Source8: log4j-component-info.xml
Patch0:         %{name}-logfactor5-userdir.patch
Patch1:         %{name}-javadoc-xlink.patch
# FIXME: (dwalluck) I would think a dependency on mx4j here is better than Sun
# internal, but someone disagrees
Patch2:         %{name}-mx4j-tools.patch
Patch3:         %{name}-jmx-Agent.patch
BuildRequires: jpackage-utils >= 0:1.6
BuildRequires: ant
%if ! %{bootstrap}
BuildRequires: geronimo-jaf-1.0.2-api
BuildRequires: classpathx-mail
BuildRequires: geronimo-jms-1.1-api
BuildRequires: mx4j
%endif
BuildRequires: jndi
BuildRequires: java-javadoc
Requires: jpackage-utils >= 0:1.6
Requires: xml-commons-apis
Requires: jaxp_parser_impl
%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
BuildRequires: jmx

%description
Log4j is a tool to help the programmer output log statements to a
variety of output targets.

%if %{with_repolib}
%package repolib
Summary: Artifacts to be uploaded to a repository library
Group: Development/Java

%description repolib
Artifacts to be uploaded to a repository library.
This package is not meant to be installed but so its contents
can be extracted through rpm2cpio
%endif

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

%description    manual
Documentation for %{name}.

%package        javadoc
Summary:        Javadoc for %{name}
Group:          Development/Java
Requires(post): %{__rm}
Requires(postun): %{__rm}

%description    javadoc
Javadoc for %{name}.

%prep
%setup -q -n logging-%{name}-%{version}
%patch0 -b .sav
%patch1 -b .sav
#%%patch2 -b .sav2
#%%patch3 -b .sav
%{__perl} -pi -e 's/\r$//g' LICENSE NOTICE

# remove all the stuff we'll build ourselves

find . -name "*.jar" -o -name "*.class" | xargs %{__rm}
%__rm -r docs/api

# fix perl location

%__perl -p -i -e 's|/opt/perl5/bin/perl|%{__perl}|' \
contribs/KitchingSimon/udpserver.pl

%if %{with_repolib}
tag=`echo %{name}-%{version}-%{release} | sed 's|\.|_|g'`
sed -i "s/ at TAG at /$tag/g" %{SOURCE8}
%endif

%build
# javac.source=1.1 doesn't work with Sun's 1.4.2_09/1.5.0_05
# Provide -Djmx-present="true" option to build Patch02 to enable HtmlAdaptor
export CLASSPATH=
export OPT_JAR_LIST=:
ant -Dant.build.javac.source=1.4 -Dant.build.javac.target=1.4 \
       -Djavamail.jar=$(build-classpath javamail/mailapi) \
       -Dactivation.jar=$(build-classpath jaf) \
       -Djaxp.jaxp.jar=$(build-classpath jaxp_parser_impl) \
       -Djms.jar=$(build-classpath jms) \
       -Djmx.jar=$(build-classpath jmxri) \
       -Djmx-extra.jar=$(build-classpath jmxtools) \
       -Djndi.jar=$(build-classpath jndi) \
       -Djavac.source=1.2 \
       -Djdk.javadoc=%{_javadocdir}/java \
       jar javadoc


%install
%__rm -rf %{buildroot}

# jars

%__mkdir_p %{buildroot}%{_javadir}
%__cp -a dist/lib/%{name}-%{version}.jar %{buildroot}%{_javadir}
(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed  "s|-%{version}||g"`; done)

# javadoc

%__mkdir_p %{buildroot}%{_javadocdir}/%{name}-%{version}
%__cp -a docs/api/* %{buildroot}%{_javadocdir}/%{name}-%{version}
(cd %{buildroot}%{_javadocdir} && %__ln_s %{name}-%{version} %{name})
# FIXME: (dwalluck) This breaks -bi --short-circuit
%__rm -rf docs/api
ln -s %{_javadocdir}/log4j docs/api

# scripts

%__mkdir_p %{buildroot}%{_bindir}
%__install -p -m 755 %{SOURCE2} %{buildroot}%{_bindir}/logfactor5
%__install -p -m 755 %{SOURCE5} %{buildroot}%{_bindir}/chainsaw

# freedesktop.org menu entries and icons

%__mkdir_p %{buildroot}%{_datadir}/{applications,pixmaps}
%__cp -a %{SOURCE1} \
 %{buildroot}%{_datadir}/pixmaps/logfactor5.png
%__cp -a %{SOURCE3} \
 %{buildroot}%{_datadir}/applications/jpackage-logfactor5.desktop
%__cp -a %{SOURCE4} \
 %{buildroot}%{_datadir}/pixmaps/chainsaw.png
%__cp -a %{SOURCE6} \
 %{buildroot}%{_datadir}/applications/jpackage-chainsaw.desktop

# DTD and the SGML catalog (XML catalog handled in scriptlets)

%__mkdir_p %{buildroot}%{_datadir}/sgml/%{name}
%__cp -a src/java/org/apache/log4j/xml/log4j.dtd \
 %{buildroot}%{_datadir}/sgml/%{name}
%__cp -a %{SOURCE7} \
 %{buildroot}%{_datadir}/sgml/%{name}/catalog

%if %{gcj_support}
%{_bindir}/aot-compile-rpm
%endif

%if %{with_repolib}
install -d -m 755 $RPM_BUILD_ROOT%{repodir}
install -d -m 755 $RPM_BUILD_ROOT%{repodirlib}
install -m 755 %{SOURCE8} $RPM_BUILD_ROOT%{repodir}/component-info.xml
install -d -m 755 $RPM_BUILD_ROOT%{repodirsrc}
install -m 755 %{PATCH0} $RPM_BUILD_ROOT%{repodirsrc}
install -m 755 %{PATCH1} $RPM_BUILD_ROOT%{repodirsrc}
install -m 755 %{SOURCE0} $RPM_BUILD_ROOT%{repodirsrc}
cp -p $RPM_BUILD_ROOT%{_javadir}/log4j.jar $RPM_BUILD_ROOT%{repodirlib}
%endif

mkdir -p $RPM_BUILD_ROOT`dirname /etc/chainsaw.conf`
touch $RPM_BUILD_ROOT/etc/chainsaw.conf

%post
# Note that we're using versioned catalog, so this is always ok.
if [ -x %{_bindir}/install-catalog -a -d %{_sysconfdir}/sgml ]; then
 %{_bindir}/install-catalog --add \
   %{_sysconfdir}/sgml/%{name}-%{version}-%{release}.cat \
   %{_datadir}/sgml/%{name}/catalog > /dev/null || :
fi
if [ -x %{_bindir}/xmlcatalog -a -w %{_sysconfdir}/xml/catalog ]; then
 %{_bindir}/xmlcatalog --noout --add system log4j.dtd \
   file://%{_datadir}/sgml/%{name}/log4j.dtd %{_sysconfdir}/xml/catalog \
   > /dev/null || :
fi

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

%preun
if [ $1 -eq 0 ]; then
 if [ -x %{_bindir}/xmlcatalog -a -w %{_sysconfdir}/xml/catalog ]; then
   %{_bindir}/xmlcatalog --noout --del log4j.dtd \
     %{_sysconfdir}/xml/catalog > /dev/null || :
 fi
fi

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

%postun
# Note that we're using versioned catalog, so this is always ok.
if [ -x %{_bindir}/install-catalog -a -d %{_sysconfdir}/sgml ]; then
 %{_bindir}/install-catalog --remove \
   %{_sysconfdir}/sgml/%{name}-%{version}-%{release}.cat \
   %{_datadir}/sgml/%{name}/catalog > /dev/null || :
fi

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

%files
%doc LICENSE NOTICE
%attr(0755,root,root) %{_bindir}/*
%{_javadir}/*.jar
%{_datadir}/applications/*
%{_datadir}/pixmaps/*
%{_datadir}/sgml/%{name}
%if %{gcj_support}
%dir %{_libdir}/gcj/%{name}
%{_libdir}/gcj/%{name}/%{name}-%{version}.jar.*
%endif
%config(noreplace,missingok) /etc/chainsaw.conf

%files manual
# FIXME: (dwalluck) Manuals are usually installed at an absolute location inside %%{_docdir}
%doc --no-dereference docs/* contribs

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

%if %{with_repolib}
%files repolib
%{repodir}
%endif

%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