# # spec file for package slf4j # # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2000-2009, JPackage Project # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # Name: slf4j Version: 1.7.25 Release: 0 Summary: Simple Logging Facade for Java License: MIT Group: Development/Libraries/Java URL: http://www.slf4j.org/ Source0: http://www.slf4j.org/dist/%{name}-%{version}.tar.gz Source1: build.xml.tar.bz2 Patch1: build-remove-slf4j_api-binder.patch Patch2: slf4j-commons-lang3.patch Patch3: slf4j-Disallow-EventData-deserialization-by-default.patch BuildRequires: ant >= 1.6.5 BuildRequires: ant-junit >= 1.6.5 BuildRequires: apache-commons-lang3 BuildRequires: apache-commons-logging BuildRequires: cal10n BuildRequires: java-devel >= 1.5.0 BuildRequires: javapackages-local BuildRequires: javapackages-tools BuildRequires: javassist >= 3.4 BuildRequires: junit >= 3.8.2 BuildRequires: log4j-mini Requires: cal10n Requires: java # this is ugly hack, which creates package wich requires the same, # however slf4j is not splitted between -api and -impl, but pom files are modeled as it was Provides: osgi(slf4j.api) BuildArch: noarch %description The Simple Logging Facade for Java or (SLF4J) is intended to serve as a simple facade for various logging APIs allowing to the end-user to plug in the desired implementation at deployment time. SLF4J also allows for a gradual migration path away from Jakarta Commons Logging (JCL). Logging API implementations can either choose to implement the SLF4J interfaces directly, e.g. NLOG4J or SimpleLogger. Alternatively, it is possible (and rather easy) to write SLF4J adapters for the given API implementation, e.g. Log4jLoggerAdapter or JDK14LoggerAdapter.. %package javadoc Summary: Javadoc for %{name} Group: Documentation/HTML %description javadoc API documentation for %{name}. %package manual Summary: Documents for %{name} Group: Documentation/Other %description manual Manual for %{name}. %prep %setup -q tar xjf %{SOURCE1} %patch1 -p1 %patch2 -p1 %patch3 -p1 find . -name "*.jar" | xargs rm sed -i -e "s|ant<|org.apache.ant<|g" integration/pom.xml %{_bindir}/find -name "*.css" -o -name "*.js" -o -name "*.txt" | \ %{_bindir}/xargs -t perl -pi -e 's/\r$//g' # The general pattern is that the API package exports API classes and does # # not require impl classes. slf4j was breaking that causing "A cycle was # # detected when generating the classpath slf4j.api, slf4j.nop, slf4j.api." # # The API bundle requires impl package, so to avoid cyclic dependencies # # during build time, it is necessary to mark the imported package as an # # optional one. # # Reported upstream: http://bugzilla.slf4j.org/show_bug.cgi?id=283 sed -i "/Import-Package/s/.$/;resolution:=optional&/" slf4j-api/src/main/resources/META-INF/MANIFEST.MF %build export CLASSPATH=$(build-classpath log4j \ commons-logging \ commons-lang3 \ javassist-3.14.0 \ cal10n) export CLASSPATH=$CLASSPATH:$(pwd)/slf4j-api/target/slf4j-api-%{version}.jar export MAVEN_REPO_LOCAL=$(pwd)/.m2 ant -Dmaven2.jpp.mode=true \ -Dmaven.test.skip=true \ -Dmaven.repo.local=$MAVEN_REPO_LOCAL \ package javadoc \ %install # jars install -d -m 0755 %{buildroot}%{_javadir}/%{name} install -m 644 jcl-over-slf4j/target/jcl-over-slf4j-%{version}.jar \ %{buildroot}%{_javadir}/%{name}/jcl-over-slf4j.jar install -m 644 jul-to-slf4j/target/jul-to-slf4j-%{version}.jar \ %{buildroot}%{_javadir}/%{name}/jul-to-slf4j.jar install -m 644 log4j-over-slf4j/target/log4j-over-slf4j-%{version}.jar \ %{buildroot}%{_javadir}/%{name}/log4j-over-slf4j.jar install -m 644 slf4j-api/target/%{name}-api-%{version}.jar \ %{buildroot}%{_javadir}/%{name}/api.jar install -m 644 slf4j-ext/target/%{name}-ext-%{version}.jar \ %{buildroot}%{_javadir}/%{name}/ext.jar install -m 644 slf4j-jcl/target/%{name}-jcl-%{version}.jar \ %{buildroot}%{_javadir}/%{name}/jcl.jar install -m 644 slf4j-jdk14/target/%{name}-jdk14-%{version}.jar \ %{buildroot}%{_javadir}/%{name}/jdk14.jar install -m 644 slf4j-log4j12/target/%{name}-log4j12-%{version}.jar \ %{buildroot}%{_javadir}/%{name}/log4j12.jar install -m 644 slf4j-migrator/target/%{name}-migrator-%{version}.jar \ %{buildroot}%{_javadir}/%{name}/migrator.jar install -m 644 slf4j-nop/target/%{name}-nop-%{version}.jar \ %{buildroot}%{_javadir}/%{name}/nop.jar install -m 644 slf4j-simple/target/%{name}-simple-%{version}.jar \ %{buildroot}%{_javadir}/%{name}/simple.jar # pom install -d -m 755 %{buildroot}%{_mavenpomdir} for i in api ext jcl jdk14 log4j12 migrator nop simple; do install -pm 644 slf4j-$i/pom.xml %{buildroot}%{_mavenpomdir}/%{name}-$i.pom %add_maven_depmap %{name}-$i.pom %{name}/$i.jar done for i in jcl-over-slf4j jul-to-slf4j log4j-over-slf4j; do install -pm 644 $i/pom.xml %{buildroot}%{_mavenpomdir}/%{name}-$i.pom %add_maven_depmap %{name}-$i.pom %{name}/$i.jar done install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/%{name}.pom %add_maven_depmap %{name}.pom # manual install -d -m 0755 %{buildroot}%{_docdir}/%{name}-%{version} rm -f target/site/.htaccess cp -pr target/site %{buildroot}%{_docdir}/%{name}-%{version}/ install -m 644 LICENSE.txt %{buildroot}%{_docdir}/%{name}-%{version}/ # javadoc install -d -m 0755 %{buildroot}%{_javadocdir}/%{name} cp -pr target/site/* %{buildroot}%{_javadocdir}/%{name}/ rm -rf target/site %files %dir %{_docdir}/%{name}-%{version} %license %{_docdir}/%{name}-%{version}/LICENSE.txt %{_javadir}/%{name} %{_mavenpomdir}/* %if %{defined _maven_repository} %{_mavendepmapfragdir}/%{name} %else %{_datadir}/maven-metadata/%{name}.xml* %endif %files javadoc %{_javadocdir}/%{name} %files manual %{_docdir}/%{name}-%{version}/site %changelog