forked from pool/caffeine
241 lines
7.9 KiB
RPMSpec
241 lines
7.9 KiB
RPMSpec
#
|
|
# spec file for package caffeine
|
|
#
|
|
# Copyright (c) 2025 SUSE LLC
|
|
#
|
|
# 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: caffeine
|
|
Version: 2.9.3
|
|
Release: 0
|
|
Summary: High performance, near optimal caching library based on Java 8
|
|
License: Apache-2.0
|
|
URL: https://github.com/ben-manes/%{name}
|
|
Source0: https://github.com/ben-manes/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
|
|
Source1: %{name}-gen.pom
|
|
Source2: https://repo1.maven.org/maven2/com/github/ben-manes/%{name}/%{name}/%{version}/%{name}-%{version}.pom
|
|
Source3: https://repo1.maven.org/maven2/com/github/ben-manes/%{name}/guava/%{version}/guava-%{version}.pom
|
|
Source4: https://repo1.maven.org/maven2/com/github/ben-manes/%{name}/jcache/%{version}/jcache-%{version}.pom
|
|
Patch0: no-formatter.patch
|
|
BuildRequires: maven-local
|
|
BuildRequires: mvn(com.google.code.findbugs:jsr305)
|
|
BuildRequires: mvn(com.google.errorprone:error_prone_annotations)
|
|
BuildRequires: mvn(com.google.guava:guava)
|
|
BuildRequires: mvn(com.squareup:javapoet)
|
|
BuildRequires: mvn(com.typesafe:config)
|
|
BuildRequires: mvn(javax.cache:cache-api)
|
|
BuildRequires: mvn(javax.inject:javax.inject)
|
|
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
|
|
BuildRequires: mvn(org.checkerframework:checker-qual)
|
|
BuildRequires: mvn(org.codehaus.mojo:exec-maven-plugin)
|
|
BuildRequires: mvn(org.osgi:osgi.cmpn)
|
|
BuildArch: noarch
|
|
|
|
%description
|
|
A Cache is similar to ConcurrentMap, but not quite the same. The most
|
|
fundamental difference is that a ConcurrentMap persists all elements that are
|
|
added to it until they are explicitly removed. A Cache on the other hand is
|
|
generally configured to evict entries automatically, in order to constrain its
|
|
memory footprint. In some cases a LoadingCache or AsyncLoadingCache can be
|
|
useful even if it doesn't evict entries, due to its automatic cache loading.
|
|
|
|
Caffeine provide flexible construction to create a cache with a combination
|
|
of the following features:
|
|
automatic loading of entries into the cache, optionally asynchronously
|
|
size-based eviction when a maximum is exceeded based on frequency and recency
|
|
time-based expiration of entries, measured since last access or last write
|
|
asynchronously refresh when the first stale request for an entry occurs
|
|
keys automatically wrapped in weak references
|
|
values automatically wrapped in weak or soft references
|
|
notification of evicted (or otherwise removed) entries
|
|
writes propagated to an external resource
|
|
accumulation of cache access statistics
|
|
|
|
%package guava
|
|
Summary: Caffeine Guava extension
|
|
|
|
%description guava
|
|
An adapter to expose a Caffeine cache through the Guava interfaces.
|
|
|
|
%package jcache
|
|
Summary: Caffeine JSR-107 JCache extension
|
|
|
|
%description jcache
|
|
An adapter to expose a Caffeine cache through the JCache interfaces.
|
|
|
|
%package javadoc
|
|
Summary: Javadoc for %{name}
|
|
|
|
%description javadoc
|
|
This package contains the API documentation for %{name}.
|
|
|
|
%prep
|
|
%setup -q
|
|
%patch -P 0 -p1
|
|
|
|
find -name "*.jar" -print -delete
|
|
|
|
# This is a dummy POM added just to ease building in the RPM platforms
|
|
cat > pom.xml << EOF
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<project
|
|
xmlns="http://maven.apache.org/POM/4.0.0"
|
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
|
|
<modelVersion>4.0.0</modelVersion>
|
|
<groupId>com.github.ben-manes.caffeine</groupId>
|
|
<artifactId>%{name}-parent</artifactId>
|
|
<version>%{version}</version>
|
|
<packaging>pom</packaging>
|
|
<name>Caffeine Parent</name>
|
|
<modules>
|
|
<module>%{name}</module>
|
|
<!-- module>simulator</module -->
|
|
<!-- module>examples/write-behind-rxjava</module -->
|
|
</modules>
|
|
</project>
|
|
EOF
|
|
|
|
cp -p %{SOURCE1} %{name}/gen.pom
|
|
%pom_add_dep org.checkerframework:checker-qual %{name}/gen.pom
|
|
cp -p %{SOURCE2} %{name}/pom.xml
|
|
cp -p %{SOURCE3} guava/pom.xml
|
|
cp -p %{SOURCE4} jcache/pom.xml
|
|
|
|
(
|
|
for p in guava \
|
|
jcache; do
|
|
%pom_xpath_inject "pom:project/pom:modules" "<module>${p}</module>"
|
|
%pom_xpath_inject "pom:project" "
|
|
<properties>
|
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
</properties>" ${p}
|
|
%pom_xpath_inject "pom:project" "
|
|
<build>
|
|
<pluginManagement>
|
|
<plugins>
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-compiler-plugin</artifactId>
|
|
<version>2.3.2</version>
|
|
<configuration>
|
|
<source>1.8</source>
|
|
<target>1.8</target>
|
|
<showDeprecation>true</showDeprecation>
|
|
</configuration>
|
|
</plugin>
|
|
</plugins>
|
|
</pluginManagement>
|
|
</build>" ${p}
|
|
|
|
%pom_xpath_set "pom:project/pom:name" "Caffeine ${p} extension" ${p}
|
|
%pom_xpath_inject "pom:project" "<packaging>bundle</packaging>" ${p}
|
|
%pom_add_plugin org.apache.felix:maven-bundle-plugin ${p} "
|
|
<extensions>true</extensions>
|
|
<configuration>
|
|
<instructions>
|
|
<Bundle-SymbolicName>\${project.groupId}.${p}</Bundle-SymbolicName>
|
|
<Bundle-Name>\${project.groupId}.${p}</Bundle-Name>
|
|
<Bundle-Version>\${project.version}</Bundle-Version>
|
|
</instructions>
|
|
</configuration>
|
|
<executions>
|
|
<execution>
|
|
<id>bundle-manifest</id>
|
|
<phase>process-classes</phase>
|
|
<goals>
|
|
<goal>manifest</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>"
|
|
echo hello
|
|
done
|
|
)
|
|
|
|
%pom_xpath_inject "pom:project" "<properties>
|
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
</properties>" %{name}
|
|
|
|
%pom_xpath_inject "pom:project" "
|
|
<build>
|
|
<pluginManagement>
|
|
<plugins>
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-compiler-plugin</artifactId>
|
|
<version>2.3.2</version>
|
|
<configuration>
|
|
<source>1.8</source>
|
|
<target>1.8</target>
|
|
<showDeprecation>true</showDeprecation>
|
|
</configuration>
|
|
</plugin>
|
|
</plugins>
|
|
</pluginManagement>
|
|
</build>" %{name}
|
|
|
|
%pom_xpath_inject "pom:project" "<packaging>bundle</packaging>" %{name}
|
|
%pom_add_plugin org.apache.felix:maven-bundle-plugin %{name} "
|
|
<extensions>true</extensions>
|
|
<configuration>
|
|
<excludeDependencies>true</excludeDependencies>
|
|
<instructions>
|
|
<Bundle-SymbolicName>com.github.ben-manes.caffeine</Bundle-SymbolicName>
|
|
<Bundle-Name>com.github.ben-manes.caffeine</Bundle-Name>
|
|
<Bundle-Version>\${project.version}</Bundle-Version>
|
|
</instructions>
|
|
</configuration>
|
|
<executions>
|
|
<execution>
|
|
<id>bundle-manifest</id>
|
|
<phase>process-classes</phase>
|
|
<goals>
|
|
<goal>manifest</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>"
|
|
|
|
%pom_change_dep org.osgi:org.osgi.service.component.annotations org.osgi:osgi.cmpn:8.0.0 jcache
|
|
|
|
%{mvn_package} :%{name}-parent __noinstall
|
|
|
|
%build
|
|
(
|
|
cd %{name}
|
|
for class in com.github.benmanes.caffeine.cache.LocalCacheFactoryGenerator \
|
|
com.github.benmanes.caffeine.cache.NodeFactoryGenerator; do
|
|
xmvn -B --offline -f gen.pom compile exec:java -Dexec.mainClass=$class -Dexec.args=src/main/java
|
|
done
|
|
)
|
|
|
|
# tests are skipped due to missing dependencies
|
|
%{mvn_build} -sf
|
|
|
|
%install
|
|
%mvn_install
|
|
|
|
%files -f .mfiles-%{name}
|
|
%doc README.md
|
|
%license LICENSE
|
|
|
|
%files guava -f .mfiles-guava
|
|
|
|
%files jcache -f .mfiles-jcache
|
|
|
|
%files javadoc -f .mfiles-javadoc
|
|
%license LICENSE
|
|
|
|
%changelog
|