logback/logback.spec
daidai_is_here fa8f8a7679 package init
2020-03-07 18:42:58 +08:00

144 lines
5.1 KiB
RPMSpec

Name: logback
Version: 1.1.7
Release: 6
Summary: A Java logging library
License: LGPLv2 or EPL
URL: http://logback.qos.ch/
Source0: https://github.com/qos-ch/logback/archive/v_%{version}.tar.gz
# servlet 3.1 support
Patch0001: %{name}-1.1.7-servlet.patch
# Remove deprecate methods,otherwise it will cause compilation to fail
Patch0002: %{name}-1.1.7-jetty.patch
Patch0003: %{name}-1.1.7-tomcat.patch
BuildRequires: java-devel >= 1:1.6.0 maven-local mvn(javax.mail:mail)
BuildRequires: mvn(javax.servlet:javax.servlet-api) mvn(junit:junit) mvn(log4j:log4j:1.2.17)
BuildRequires: mvn(org.apache.ant:ant-junit) mvn(org.apache.felix:maven-bundle-plugin)
BuildRequires: mvn(org.apache.felix:org.apache.felix.main)
BuildRequires: mvn(org.apache.geronimo.specs:geronimo-jms_1.1_spec)
BuildRequires: mvn(org.apache.maven.plugins:maven-antrun-plugin)
BuildRequires: mvn(org.apache.tomcat:tomcat-catalina) mvn(org.apache.tomcat:tomcat-coyote)
BuildRequires: mvn(org.codehaus.gmavenplus:gmavenplus-plugin) mvn(org.codehaus.groovy:groovy-all)
BuildRequires: mvn(org.codehaus.janino:janino) mvn(org.eclipse.jetty:jetty-server)
BuildRequires: mvn(org.eclipse.jetty:jetty-util) mvn(org.fusesource:fusesource-pom:pom:)
BuildRequires: mvn(org.fusesource.jansi:jansi) mvn(org.slf4j:slf4j-api) mvn(org.slf4j:slf4j-ext)
BuildRequires: mvn(antlr:antlr) mvn(commons-cli:commons-cli) mvn(org.ow2.asm:asm-all)
BuildRequires: mvn(org.slf4j:slf4j-nop)
BuildArch: noarch
%description
Logback is intended as a successor to the popular log4j project.
Logback's architecture is sufficiently generic so as to apply under
different circumstances. At present time, logback is divided into
three modules, logback-core, logback-classic and logback-access.
The logback-core module lays the groundwork for the other two modules. The
logback-classic module can be assimilated to a significantly improved
version of log4j. Moreover, logback-classic natively implements the SLF4J
API so that you can readily switch back and forth between logback and other
logging frameworks such as log4j or java.util.logging (JUL).
The logback-access module integrates with Servlet containers, such as
Tomcat and Jetty, to provide HTTP-access log functionality. Note that you
could easily build your own module on top of logback-core.
%package help
Summary: Javadoc for %{name}
Provides: %{name}-javadoc = %{version}-%{release}
Obsoletes: %{name}-javadoc < %{version}-%{release}
%description help
API documentation for the Logback library
%package access
Summary: Logback-access module for Servlet integration
%description access
The logback-access module is integrated with servlet containers
(such as Tomcat and Jetty) to provide HTTP-access logging capabilities.
Note that you can easily build your own modules on top of logback-core.
%package examples
Summary: Logback Examples Module
%description examples
logback-examples module.
%prep
%autosetup -p1 -n %{name}-v_%{version}
find . -name "*.class" -delete
find . -name "*.cmd" -delete
find . -name "*.jar" -delete
%pom_remove_plugin :maven-source-plugin
%pom_remove_plugin :findbugs-maven-plugin
%pom_remove_plugin -r :maven-dependency-plugin
%pom_remove_plugin -r :cobertura-maven-plugin
sed -i 's/\r//' LICENSE.txt README.txt
%pom_change_dep -r :servlet-api javax.servlet:javax.servlet-api:3.1.0
sed -i 's#javax.servlet.*;version="2.5"#javax.servlet.*;version="3.1"#' %{name}-access/pom.xml
rm -r %{name}-*/src/test/java/*
%pom_xpath_remove -r "pom:dependency[pom:type = 'test-jar']"
%pom_xpath_remove -r "pom:dependency[pom:scope = 'test']"
%pom_xpath_remove -r "pom:plugin[pom:artifactId = 'maven-jar-plugin']/pom:executions"
%pom_xpath_remove "pom:project/pom:profiles/pom:profile[pom:id = 'host-orion']" %{name}-access
%pom_xpath_remove "pom:project/pom:profiles" %{name}-classic
%pom_xpath_remove "pom:project/pom:profiles/pom:profile[pom:id = 'javadocjar']"
%pom_disable_module logback-site
%pom_xpath_remove "pom:build/pom:extensions"
%pom_remove_plugin :maven-compiler-plugin logback-classic
%pom_add_plugin org.codehaus.gmavenplus:gmavenplus-plugin:1.5 logback-classic "
<executions>
<execution>
<goals>
<goal>generateStubs</goal>
<goal>testGenerateStubs</goal>
<!--goal>compile</goal>
<goal>testCompile</goal-->
</goals>
</execution>
</executions>"
%mvn_package ":%{name}-access" access
%mvn_package ":%{name}-examples" examples
%build
%mvn_build -f -- -Dorg.slf4j:slf4j-api:jar=$(build-classpath slf4j/api) \
-Dorg.apache.felix:org.apache.felix.main:jar=$(build-classpath felix/org.apache.felix.main)
%install
%mvn_install
install -d -m 755 %{buildroot}%{_datadir}/%{name}/examples
cp -r %{name}-examples/pom.xml %{name}-examples/src %{buildroot}%{_datadir}/%{name}/examples
%files -f .mfiles
%doc README.txt
%license LICENSE.txt
%files access -f .mfiles-access
%license LICENSE.txt
%files examples -f .mfiles-examples
%license LICENSE.txt
%{_datadir}/%{name}
%files help -f .mfiles-javadoc
%changelog
* Wed Mar 4 2020 dingyiming <dingyiming3@huawei.com> - 1.1.7-6
- Package init