17
0

5 Commits

3 changed files with 173 additions and 4 deletions

113
QR-Code-generator-build.xml Normal file
View File

@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="qrcodegen" default="package" basedir=".">
<!-- ====================================================================== -->
<!-- Build environment properties -->
<!-- ====================================================================== -->
<property name="project.artifactId" value="qrcodegen"/>
<property name="compiler.release" value="8"/>
<property name="compiler.source" value="1.${compiler.release}"/>
<property name="compiler.target" value="${compiler.source}"/>
<property name="build.finalName" value="${project.artifactId}"/>
<property name="build.dir" value="target"/>
<property name="build.outputDir" value="${build.dir}/classes"/>
<property name="build.srcDir" value="src/main/java"/>
<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"
release="${compiler.release}"
target="${compiler.target}"
verbose="false"
fork="false"
source="${compiler.source}">
<src>
<pathelement location="${build.srcDir}"/>
</src>
<exclude name="**/module-info.java"/>
</javac>
<!-- compile the module-info.java -->
<javac destdir="${build.outputDir}"
nowarn="false"
debug="true"
encoding="utf-8"
optimize="false"
deprecation="true"
release="9"
verbose="false"
fork="false">
<src>
<pathelement location="${build.srcDir}"/>
</src>
<include name="**/module-info.java"/>
</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="${compiler.source}"
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>

View File

@@ -1,3 +1,14 @@
-------------------------------------------------------------------
Fri Nov 7 07:52:18 UTC 2025 - Fridrich Strba <fstrba@suse.com>
- Building also the Java implementation
-------------------------------------------------------------------
Mon Jun 23 05:29:49 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
- Use pyproject macros to build and install.
- List files and directories underneath python_sitelib explicitly.
-------------------------------------------------------------------
Wed Oct 9 10:51:51 UTC 2024 - Marcus Rueckert <mrueckert@suse.de>

View File

@@ -1,7 +1,7 @@
#
# spec file for package QR-Code-generator
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,6 +19,7 @@
%define libcname libqrcodegen1
%define libcppname libqrcodegencpp1
%global pip_version 1.8.0
%global cmake_code_version 1.8.0.cmake3
%{?sle15_python_module_pythons}
@@ -31,9 +32,16 @@ License: MIT
URL: https://github.com/nayuki/QR-Code-generator
Source0: %{name}-%{version}.tar.zst
Source1: qrcodegen-cmake-%cmake_code_version.tar.zst
Source2: %{name}-build.xml
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: ant
BuildRequires: cmake
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: java-devel >= 9
BuildRequires: javapackages-local
BuildRequires: pkgconfig
BuildRequires: python-rpm-macros
BuildRequires: zstd
@@ -74,23 +82,51 @@ Summary: QR Code generator library
%description -n %{libcppname}
C++ QR Code generator library
%package java
Summary: QR Code generator library - Java
%description java
Java implementation of the QR Code generator library
%package javadoc
Summary: QR Code generator library - Javadoc
%description javadoc
The Javadoc for the Java implementaion of the QR Code generator library
%prep
%autosetup -p1 -a1
ln -s qrcodegen-cmake-%cmake_code_version/{CMakeLists.txt,cmake} .
cp qrcodegen-cmake-%cmake_code_version/{README.md,LICENSE} .
cp %{SOURCE2} java/build.xml
%build
%cmake
pushd ../python
%python_build
%pyproject_wheel
popd
pushd ../java
ant jar javadoc
popd
%install
%cmake_install
pushd python
%python_install
%pyproject_install
popd
pushd java
install -dm 0755 %{buildroot}%{_javadir}
install -pm 0644 target/qrcodegen.jar %{buildroot}%{_javadir}/qrcodegen.jar
install -dm 0755 %{buildroot}%{_mavenpomdir}
%mvn_install_pom pom.xml %{buildroot}%{_mavenpomdir}/qrcodegen.pom
%add_maven_depmap qrcodegen.pom qrcodegen.jar
install -dm 0755 %{buildroot}%{_javadocdir}
cp -r target/site/apidocs %{buildroot}%{_javadocdir}/qrcodegen
%fdupes -s %{buildroot}%{_javadocdir}
popd
%ldconfig_scriptlets -n %{libcname}
@@ -98,7 +134,9 @@ popd
%files %{python_files}
%license Readme.markdown
%{python_sitelib}/*
%{python_sitelib}/qrcodegen.py
%pycache_only %{python_sitelib}/__pycache__/qrcodegen.*.pyc
%{python_sitelib}/qrcodegen-%{pip_version}.dist-info
%files -n QR-Code-generator-devel
%license LICENSE Readme.markdown
@@ -120,4 +158,11 @@ popd
%license Readme.markdown
%{_libdir}/libqrcodegencpp.so.*
%files -n QR-Code-generator-java -f java/.mfiles
%license Readme.markdown
%files -n QR-Code-generator-javadoc
%{_javadocdir}/qrcodegen
%license Readme.markdown
%changelog