17
0

5 Commits

7 changed files with 51 additions and 166 deletions

View File

@@ -1,16 +0,0 @@
<services>
<service name="tar_scm" mode="disabled">
<param name="scm">git</param>
<param name="url">https://github.com/stephenc/jcip-annotations.git</param>
<param name="revision">jcip-annotations-1.0-1</param>
<param name="match-tag">jcip-annotations-*</param>
<param name="versionformat">@PARENT_TAG@</param>
<param name="versionrewrite-pattern">jcip-annotations-(\d+).(\d+)-(\d+)</param>
<param name="versionrewrite-replacement">\1.\2.\3</param>
</service>
<service name="recompress" mode="disabled">
<param name="file">*.tar</param>
<param name="compression">xz</param>
</service>
<service name="set_version" mode="disabled"/>
</services>

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:076a4e9e75936d6400da791d6601c14bb31c3ee4d20ca66eb086bab89b7649cb
size 6996

14
jcip-annotations-1.0.pom Normal file
View File

@@ -0,0 +1,14 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
>
<modelVersion>4.0.0</modelVersion>
<groupId>net.jcip</groupId>
<artifactId>jcip-annotations</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
<name>"Java Concurrency in Practice" book annotations</name>
<url>http://jcip.net/</url>
</project>

View File

@@ -1,94 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="jcip-annotations" default="package" basedir=".">
<!-- ====================================================================== -->
<!-- Build environment properties -->
<!-- ====================================================================== -->
<property name="build.finalName" value="jcip-annotations"/>
<property name="build.dir" value="target"/>
<property name="build.outputDir" value="${build.dir}/classes"/>
<property name="build.srcDir" value="src/main/java"/>
<property name="build.resourceDir" value="src/main/resources"/>
<property name="reporting.outputDirectory" value="${build.dir}/site"/>
<!-- ====================================================================== -->
<!-- Cleaning up target -->
<!-- ====================================================================== -->
<target name="clean" description="Clean the output directory">
<delete dir="${build.dir}"/>
</target>
<!-- ====================================================================== -->
<!-- Compilation target -->
<!-- ====================================================================== -->
<target name="compile" description="Compile the code">
<mkdir dir="${build.outputDir}"/>
<javac destdir="${build.outputDir}"
nowarn="false"
debug="true"
optimize="false"
deprecation="true"
encoding="utf-8"
release="8"
target="1.8"
verbose="false"
fork="false"
source="1.8">
<src>
<pathelement location="${build.srcDir}"/>
</src>
</javac>
</target>
<!-- ====================================================================== -->
<!-- Javadoc target -->
<!-- ====================================================================== -->
<target name="javadoc" description="Generates the Javadoc of the application">
<javadoc sourcepath="${build.srcDir}"
packagenames="*"
destdir="${reporting.outputDirectory}/apidocs"
access="protected"
source="1.8"
encoding="utf-8"
verbose="false"
version="true"
use="true"
author="true"
splitindex="false"
nodeprecated="false"
nodeprecatedlist="false"
notree="false"
noindex="false"
nohelp="false"
nonavbar="false"
serialwarn="false"
charset="ISO-8859-1"
linksource="false"
breakiterator="false"/>
</target>
<!-- ====================================================================== -->
<!-- Package target -->
<!-- ====================================================================== -->
<target name="package" depends="compile" description="Package the application">
<jar jarfile="${build.dir}/${build.finalName}.jar"
compress="true"
index="false"
basedir="${build.outputDir}"
excludes="**/package.html"/>
</target>
<!-- ====================================================================== -->
<!-- A dummy target for the package named after the type it creates -->
<!-- ====================================================================== -->
<target name="jar" depends="package" description="Builds the jar for the application"/>
</project>

3
jcip-annotations-src.jar Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:221f5cbe0b00a4c5f3c8870639de3573223fb9aa2636c631f901302fd4339efc
size 4998

View File

@@ -1,26 +1,3 @@
-------------------------------------------------------------------
Thu Dec 19 02:46:22 UTC 2024 - Fridrich Strba <fstrba@suse.com>
- Use ant to build
-------------------------------------------------------------------
Wed Dec 18 16:09:47 UTC 2024 - Fridrich Strba <fstrba@suse.com>
- Switch to clean room implementation, as original implementation
uses CC-BY-2.5 licence. The clean room implementation is under
Apache-2.0
-------------------------------------------------------------------
Sun Dec 8 20:13:14 UTC 2024 - Fridrich Strba <fstrba@suse.com>
- The pom file is simple, so it does not need to be installed
using the %%mvn_install_pom macro
-------------------------------------------------------------------
Wed Dec 4 11:15:53 UTC 2024 - Fridrich Strba <fstrba@suse.com>
- Add alias to the other implementation out there
-------------------------------------------------------------------
Mon Sep 23 13:15:04 UTC 2024 - Fridrich Strba <fstrba@suse.com>

View File

@@ -17,56 +17,63 @@
Name: jcip-annotations
Version: 1.0.1
Version: 1.0
Release: 0
Summary: A clean room implementation of the JCIP Annotations
License: Apache-2.0
Summary: Java Concurrency in Practice
License: CC-BY-2.5
Group: Development/Libraries/Java
URL: https://github.com/stephenc/jcip-annotations
Source0: %{name}-%{version}.tar.xz
Source1: %{name}-build.xml
BuildRequires: ant
URL: http://www.jcip.net/
Source0: http://www.jcip.net/jcip-annotations-src.jar
Source1: https://repo1.maven.org/maven2/net/jcip/jcip-annotations/1.0/jcip-annotations-1.0.pom
BuildRequires: fdupes
BuildRequires: java-devel >= 1.8
BuildRequires: javapackages-local
BuildRequires: javapackages-local >= 6
BuildRequires: unzip
BuildArch: noarch
%description
A clean room implementation of the JCIP Annotations based entirely on the
specification provided by the javadocs.
Class, field, and method level annotations for describing thread-safety
policies.
%package javadoc
Summary: API documentation for %{name}
Summary: Javadoc for %{name}
Group: Development/Libraries/Java
%description javadoc
A clean room implementation of the JCIP Annotations based entirely on the
specification provided by the javadocs.
This package contains the API documentation.
Class, field, and method level annotations for describing thread-safety
policies.
%prep
%setup -q
cp %{SOURCE1} build.xml
# Remove unnecessary dependency on parent POM
%pom_remove_parent
# Remove unnecessary dependency on JUnit
%pom_remove_dep junit:junit
%setup -q -c
mkdir -p target/site/apidocs/
mkdir -p target/classes/
mkdir -p src/main/java/
mv net src/main/java
%build
ant jar javadoc
javac -source 1.8 -target 1.8 -d target/classes $(find src/main/java -name "*.java")
javadoc -source 1.8 -notimestamp -d target/site/apidocs -sourcepath src/main/java net.jcip.annotations
for f in $(find aQute/ -type f -not -name "*.class"); do
cp $f target/classes/$f
done
pushd target/classes
jar \
%if %{?pkg_vcmp:%pkg_vcmp java-devel >= 17}%{!?pkg_vcmp:0}
--date="$(date -u -d @${SOURCE_DATE_EPOCH:-$(date +%%s)} +%%Y-%%m-%%dT%%H:%%M:%%SZ)" \
%endif
--create --manifest=../../META-INF/MANIFEST.MF --file=../%{name}-%{version}.jar *
popd
%install
# jars
install -dm 0755 %{buildroot}%{_javadir}
install -pm 0644 target/%{name}.jar %{buildroot}%{_javadir}/%{name}.jar
install -pm 0644 target/%{name}-%{version}.jar \
%{buildroot}%{_javadir}/%{name}.jar
# pom
install -dm 0755 %{buildroot}%{_mavenpomdir}
install -pm 0644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
%add_maven_depmap JPP-%{name}.pom %{name}.jar -a "net.jcip:%{name}"
%{mvn_install_pom} %{SOURCE1} %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
%add_maven_depmap JPP-%{name}.pom %{name}.jar
# javadoc
install -dm 0755 %{buildroot}%{_javadocdir}/%{name}
@@ -74,11 +81,8 @@ cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}
%fdupes -s %{buildroot}%{_javadocdir}/%{name}
%files -f .mfiles
%license LICENSE.txt
%doc README.md
%files javadoc
%{_javadocdir}/%{name}
%license LICENSE.txt
%changelog