Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
List overview
Download
Arch-excludes
April 2019
----- 2025 -----
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
arch-excludes@lists.fedoraproject.org
2 participants
257 discussions
Start a n
N
ew thread
Architecture specific change in rpms/oidn.git
by githook-noreply@fedoraproject.org
03 Apr '19
03 Apr '19
The package rpms/oidn.git has added or updated architecture specific content in its spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/oidn.git/commit/?id=9fda1910efad3d1…
. Change: +ExclusiveArch: x86_64 Thanks. Full change: ============ commit 9fda1910efad3d175c3ff7f18b4f1a2c895b0f1c Author: Luya Tshimbalanga <luya(a)fedoraproject.org> Date: Tue Apr 2 08:34:46 2019 -0700 Use spaces on line 47 Make -doc subpackage noarch Make -doc subpackage requiring main package diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..479af45 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/oidn-0.8.2.src.tar.gz diff --git a/oidn.spec b/oidn.spec new file mode 100644 index 0000000..8a0a018 --- /dev/null +++ b/oidn.spec @@ -0,0 +1,94 @@ +Name: oidn +Version: 0.8.2 +Release: 4%{?dist} +Summary: Library of denoising filters for images rendered with ray tracing + +License: ASL 2.0 +URL:
https://openimagedenoise.github.io/
+Source0:
https://github.com/OpenImageDenoise/%{name}/releases/download/v%{version}/%…
+ +# Library only available of x86_64 arch +ExclusiveArch: x86_64 + +BuildRequires: cmake >= 3.13.0 +BuildRequires: gcc-c++ +BuildRequires: python3-devel +BuildRequires: tbb-devel + +%description +An open source library of high-performance, high-quality denoising +filters for images rendered with ray tracing. + +%package libs +Summary: Libraries for %{name} + +%description libs +The %{name}-libs package contains shared library for %{name}. + +%package devel +Summary: Development files for %{name} +Requires: %{name}-libs%{?_isa} = %{version}-%{release} + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + +%package docs +Summary: Documentation for %{name} +Requires: %{name}-libs%{?_isa} = %{version}-%{release} +BuildArch: noarch + +%description docs +The %{name}-docs package contains documentation for %{name}. + +%prep +%autosetup + + +%build +%cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE \ + . +%make_build + + +%install +%make_install + +# Remove duplicated documentation +rm -rf %{buildroot}%{_docdir}/OpenImageDenoise + + +%files +%license LICENSE.txt +%doc CHANGELOG.md +%{_bindir}/denoise + +%files libs +%{_libdir}/cmake/OpenImageDenoise +%{_libdir}/libOpenImageDenoise.so.* + +%files docs +%doc README.md readme.pdf + +%files devel +%{_includedir}/OpenImageDenoise +%{_libdir}/libOpenImageDenoise.so + +%changelog +* Tue Apr 02 2019 Luya Tshimbalanga <luya(a)fedoraproject.org> - 0.8.2-4 +- Use spaces on line 47 +- Make -doc subpackage noarch +- Make -doc subpackage requiring main package + +* Mon Apr 01 2019 Luya Tshimbalanga <luya(a)fedoraproject.org> - 0.8.2-3 +- Move versioned so-files to libs subpackage +- Move unversioned so-files to devel subpackage + +* Mon Apr 01 2019 Luya Tshimbalanga <luya(a)fedoraproject.org> - 0.8.2-2 +- Add subpackage for large doc files +- Move .so files to devel subpackage +- Fix library path +- Remove unneeded clearance + +* Sun Mar 31 2019 Luya Tshimbalanga <luya(a)fedoraproject.org> - 0.8.2-1 +- Initial packaging diff --git a/sources b/sources new file mode 100644 index 0000000..a60e158 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (oidn-0.8.2.src.tar.gz) = 1e43893edfb367ebbe8854fe8cb41292c89058496094007ed4bd65eb6742765e84b6c6ccb0a72a2f4bae650467b992ee465d18b206d1c05880576ce7c54fb3bf
1
0
0
0
Architecture specific change in rpms/oidn.git
by githook-noreply@fedoraproject.org
03 Apr '19
03 Apr '19
The package rpms/oidn.git has added or updated architecture specific content in its spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/oidn.git/commit/?id=9fda1910efad3d1…
. Change: +ExclusiveArch: x86_64 Thanks. Full change: ============ commit 9fda1910efad3d175c3ff7f18b4f1a2c895b0f1c Author: Luya Tshimbalanga <luya(a)fedoraproject.org> Date: Tue Apr 2 08:34:46 2019 -0700 Use spaces on line 47 Make -doc subpackage noarch Make -doc subpackage requiring main package diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..479af45 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/oidn-0.8.2.src.tar.gz diff --git a/oidn.spec b/oidn.spec new file mode 100644 index 0000000..8a0a018 --- /dev/null +++ b/oidn.spec @@ -0,0 +1,94 @@ +Name: oidn +Version: 0.8.2 +Release: 4%{?dist} +Summary: Library of denoising filters for images rendered with ray tracing + +License: ASL 2.0 +URL:
https://openimagedenoise.github.io/
+Source0:
https://github.com/OpenImageDenoise/%{name}/releases/download/v%{version}/%…
+ +# Library only available of x86_64 arch +ExclusiveArch: x86_64 + +BuildRequires: cmake >= 3.13.0 +BuildRequires: gcc-c++ +BuildRequires: python3-devel +BuildRequires: tbb-devel + +%description +An open source library of high-performance, high-quality denoising +filters for images rendered with ray tracing. + +%package libs +Summary: Libraries for %{name} + +%description libs +The %{name}-libs package contains shared library for %{name}. + +%package devel +Summary: Development files for %{name} +Requires: %{name}-libs%{?_isa} = %{version}-%{release} + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + +%package docs +Summary: Documentation for %{name} +Requires: %{name}-libs%{?_isa} = %{version}-%{release} +BuildArch: noarch + +%description docs +The %{name}-docs package contains documentation for %{name}. + +%prep +%autosetup + + +%build +%cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE \ + . +%make_build + + +%install +%make_install + +# Remove duplicated documentation +rm -rf %{buildroot}%{_docdir}/OpenImageDenoise + + +%files +%license LICENSE.txt +%doc CHANGELOG.md +%{_bindir}/denoise + +%files libs +%{_libdir}/cmake/OpenImageDenoise +%{_libdir}/libOpenImageDenoise.so.* + +%files docs +%doc README.md readme.pdf + +%files devel +%{_includedir}/OpenImageDenoise +%{_libdir}/libOpenImageDenoise.so + +%changelog +* Tue Apr 02 2019 Luya Tshimbalanga <luya(a)fedoraproject.org> - 0.8.2-4 +- Use spaces on line 47 +- Make -doc subpackage noarch +- Make -doc subpackage requiring main package + +* Mon Apr 01 2019 Luya Tshimbalanga <luya(a)fedoraproject.org> - 0.8.2-3 +- Move versioned so-files to libs subpackage +- Move unversioned so-files to devel subpackage + +* Mon Apr 01 2019 Luya Tshimbalanga <luya(a)fedoraproject.org> - 0.8.2-2 +- Add subpackage for large doc files +- Move .so files to devel subpackage +- Fix library path +- Remove unneeded clearance + +* Sun Mar 31 2019 Luya Tshimbalanga <luya(a)fedoraproject.org> - 0.8.2-1 +- Initial packaging diff --git a/sources b/sources new file mode 100644 index 0000000..a60e158 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (oidn-0.8.2.src.tar.gz) = 1e43893edfb367ebbe8854fe8cb41292c89058496094007ed4bd65eb6742765e84b6c6ccb0a72a2f4bae650467b992ee465d18b206d1c05880576ce7c54fb3bf
1
0
0
0
Architecture specific change in rpms/oidn.git
by githook-noreply@fedoraproject.org
03 Apr '19
03 Apr '19
The package rpms/oidn.git has added or updated architecture specific content in its spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/oidn.git/commit/?id=9fda1910efad3d1…
. Change: +ExclusiveArch: x86_64 Thanks. Full change: ============ commit 9fda1910efad3d175c3ff7f18b4f1a2c895b0f1c Author: Luya Tshimbalanga <luya(a)fedoraproject.org> Date: Tue Apr 2 08:34:46 2019 -0700 Use spaces on line 47 Make -doc subpackage noarch Make -doc subpackage requiring main package diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..479af45 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/oidn-0.8.2.src.tar.gz diff --git a/oidn.spec b/oidn.spec new file mode 100644 index 0000000..8a0a018 --- /dev/null +++ b/oidn.spec @@ -0,0 +1,94 @@ +Name: oidn +Version: 0.8.2 +Release: 4%{?dist} +Summary: Library of denoising filters for images rendered with ray tracing + +License: ASL 2.0 +URL:
https://openimagedenoise.github.io/
+Source0:
https://github.com/OpenImageDenoise/%{name}/releases/download/v%{version}/%…
+ +# Library only available of x86_64 arch +ExclusiveArch: x86_64 + +BuildRequires: cmake >= 3.13.0 +BuildRequires: gcc-c++ +BuildRequires: python3-devel +BuildRequires: tbb-devel + +%description +An open source library of high-performance, high-quality denoising +filters for images rendered with ray tracing. + +%package libs +Summary: Libraries for %{name} + +%description libs +The %{name}-libs package contains shared library for %{name}. + +%package devel +Summary: Development files for %{name} +Requires: %{name}-libs%{?_isa} = %{version}-%{release} + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + +%package docs +Summary: Documentation for %{name} +Requires: %{name}-libs%{?_isa} = %{version}-%{release} +BuildArch: noarch + +%description docs +The %{name}-docs package contains documentation for %{name}. + +%prep +%autosetup + + +%build +%cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE \ + . +%make_build + + +%install +%make_install + +# Remove duplicated documentation +rm -rf %{buildroot}%{_docdir}/OpenImageDenoise + + +%files +%license LICENSE.txt +%doc CHANGELOG.md +%{_bindir}/denoise + +%files libs +%{_libdir}/cmake/OpenImageDenoise +%{_libdir}/libOpenImageDenoise.so.* + +%files docs +%doc README.md readme.pdf + +%files devel +%{_includedir}/OpenImageDenoise +%{_libdir}/libOpenImageDenoise.so + +%changelog +* Tue Apr 02 2019 Luya Tshimbalanga <luya(a)fedoraproject.org> - 0.8.2-4 +- Use spaces on line 47 +- Make -doc subpackage noarch +- Make -doc subpackage requiring main package + +* Mon Apr 01 2019 Luya Tshimbalanga <luya(a)fedoraproject.org> - 0.8.2-3 +- Move versioned so-files to libs subpackage +- Move unversioned so-files to devel subpackage + +* Mon Apr 01 2019 Luya Tshimbalanga <luya(a)fedoraproject.org> - 0.8.2-2 +- Add subpackage for large doc files +- Move .so files to devel subpackage +- Fix library path +- Remove unneeded clearance + +* Sun Mar 31 2019 Luya Tshimbalanga <luya(a)fedoraproject.org> - 0.8.2-1 +- Initial packaging diff --git a/sources b/sources new file mode 100644 index 0000000..a60e158 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (oidn-0.8.2.src.tar.gz) = 1e43893edfb367ebbe8854fe8cb41292c89058496094007ed4bd65eb6742765e84b6c6ccb0a72a2f4bae650467b992ee465d18b206d1c05880576ce7c54fb3bf
1
0
0
0
Architecture specific change in rpms/java-latest-openjdk.git
by githook-noreply@fedoraproject.org
02 Apr '19
02 Apr '19
The package rpms/java-latest-openjdk.git has added or updated architecture specific content in its spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/java-latest-openjdk.git/commit/?id=…
. Change: +%ifarch x86_64 Thanks. Full change: ============ commit 2ffe923ca0819fcd33e35f40f480e1cb73a1e131 Author: pmikova <pmikova(a)redhat.com> Date: Tue Apr 2 19:40:23 2019 +0200 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..abae79e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/jdk-jdk12-jdk-12+33.tar.xz +/systemtap_3.2_tapsets_hg-icedtea8-9d464368e06d.tar.xz diff --git a/TestCryptoLevel.java b/TestCryptoLevel.java new file mode 100644 index 0000000..b32b7ae --- /dev/null +++ b/TestCryptoLevel.java @@ -0,0 +1,72 @@ +/* TestCryptoLevel -- Ensure unlimited crypto policy is in use. + Copyright (C) 2012 Red Hat, Inc. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as +published by the Free Software Foundation, either version 3 of the +License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see <
http://www.gnu.org/licenses/
>. +*/ + +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.lang.reflect.InvocationTargetException; + +import java.security.Permission; +import java.security.PermissionCollection; + +public class TestCryptoLevel +{ + public static void main(String[] args) + throws NoSuchFieldException, ClassNotFoundException, + IllegalAccessException, InvocationTargetException + { + Class<?> cls = null; + Method def = null, exempt = null; + + try + { + cls = Class.forName("javax.crypto.JceSecurity"); + } + catch (ClassNotFoundException ex) + { + System.err.println("Running a non-Sun JDK."); + System.exit(0); + } + try + { + def = cls.getDeclaredMethod("getDefaultPolicy"); + exempt = cls.getDeclaredMethod("getExemptPolicy"); + } + catch (NoSuchMethodException ex) + { + System.err.println("Running IcedTea with the original crypto patch."); + System.exit(0); + } + def.setAccessible(true); + exempt.setAccessible(true); + PermissionCollection defPerms = (PermissionCollection) def.invoke(null); + PermissionCollection exemptPerms = (PermissionCollection) exempt.invoke(null); + Class<?> apCls = Class.forName("javax.crypto.CryptoAllPermission"); + Field apField = apCls.getDeclaredField("INSTANCE"); + apField.setAccessible(true); + Permission allPerms = (Permission) apField.get(null); + if (defPerms.implies(allPerms) && (exemptPerms == null || exemptPerms.implies(allPerms))) + { + System.err.println("Running with the unlimited policy."); + System.exit(0); + } + else + { + System.err.println("WARNING: Running with a restricted crypto policy."); + System.exit(-1); + } + } +} diff --git a/TestECDSA.java b/TestECDSA.java new file mode 100644 index 0000000..6eb9cb2 --- /dev/null +++ b/TestECDSA.java @@ -0,0 +1,49 @@ +/* TestECDSA -- Ensure ECDSA signatures are working. + Copyright (C) 2016 Red Hat, Inc. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as +published by the Free Software Foundation, either version 3 of the +License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see <
http://www.gnu.org/licenses/
>. +*/ + +import java.math.BigInteger; +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.Signature; + +/** + * @test + */ +public class TestECDSA { + + public static void main(String[] args) throws Exception { + KeyPairGenerator keyGen = KeyPairGenerator.getInstance("EC"); + KeyPair key = keyGen.generateKeyPair(); + + byte[] data = "This is a string to sign".getBytes("UTF-8"); + + Signature dsa = Signature.getInstance("NONEwithECDSA"); + dsa.initSign(key.getPrivate()); + dsa.update(data); + byte[] sig = dsa.sign(); + System.out.println("Signature: " + new BigInteger(1, sig).toString(16)); + + Signature dsaCheck = Signature.getInstance("NONEwithECDSA"); + dsaCheck.initVerify(key.getPublic()); + dsaCheck.update(data); + boolean success = dsaCheck.verify(sig); + if (!success) { + throw new RuntimeException("Test failed. Signature verification error"); + } + System.out.println("Test passed."); + } +} diff --git a/java-latest-openjdk.spec b/java-latest-openjdk.spec new file mode 100644 index 0000000..4174aec --- /dev/null +++ b/java-latest-openjdk.spec @@ -0,0 +1,2101 @@ +# RPM conditionals so as to be able to dynamically produce +# slowdebug/release builds. See: +#
http://rpm.org/user_doc/conditional_builds.html
+# +# Examples: +# +# Produce release *and* slowdebug builds on x86_64 (default): +# $ rpmbuild -ba java-1.8.0-openjdk.spec +# +# Produce only release builds (no slowdebug builds) on x86_64: +# $ rpmbuild -ba java-1.8.0-openjdk.spec --without slowdebug +# +# Only produce a release build on x86_64: +# $ fedpkg mockbuild --without slowdebug +# +# Only produce a debug build on x86_64: +# $ fedpkg local --without release +# +# Enable slowdebug builds by default on relevant arches. +%bcond_without slowdebug +# Enable release builds by default on relevant arches. +%bcond_without release + +# The -g flag says to use strip -g instead of full strip on DSOs or EXEs. +# This fixes detailed NMT and other tools which need minimal debug info. +# See:
https://bugzilla.redhat.com/show_bug.cgi?id=1520879
+%global _find_debuginfo_opts -g + +# note: parametrized macros are order-sensitive (unlike not-parametrized) even with normal macros +# also necessary when passing it as parameter to other macros. If not macro, then it is considered a switch +# see the difference between global and define: +# See
https://github.com/rpm-software-management/rpm/issues/127
to comments at "pmatilai commented on Aug 18, 2017" +# (initiated in
https://bugzilla.redhat.com/show_bug.cgi?id=1482192
) +%global debug_suffix_unquoted -slowdebug +# quoted one for shell operations +%global debug_suffix "%{debug_suffix_unquoted}" +%global normal_suffix "" + +# if you want only debug build but providing java build only normal build but set normalbuild_parameter +%global debug_warning This package has full debug on. Install only in need and remove asap. +%global debug_on with full debug on +%global for_debug for packages with debug on + +%if %{with release} +%global include_normal_build 1 +%else +%global include_normal_build 0 +%endif + +%if %{include_normal_build} +%global build_loop1 %{normal_suffix} +%else +%global build_loop1 %{nil} +%endif + +# We have hardcoded list of files, which is appearing in alternatives, and in files +# in alternatives those are slaves and master, very often triplicated by man pages +# in files all masters and slaves are ghosted +# the ghosts are here to allow installation via query like `dnf install /usr/bin/java` +# you can list those files, with appropriate sections: cat *.spec | grep -e --install -e --slave -e post_ +# TODO - fix those hardcoded lists via single list +# those files ,must *NOT* be ghosted for *slowdebug* packages +# FIXME - if you are moving jshell or jlink or simialr, always modify all three sections +# you can check via headless and devels: +# rpm -ql --noghost java-11-openjdk-headless-11.0.1.13-8.fc29.x86_64.rpm | grep bin +# == rpm -ql java-11-openjdk-headless-slowdebug-11.0.1.13-8.fc29.x86_64.rpm | grep bin +# != rpm -ql java-11-openjdk-headless-11.0.1.13-8.fc29.x86_64.rpm | grep bin +# similarly for other %%{_jvmdir}/{jre,java} and %%{_javadocdir}/{java,java-zip} +%define is_release_build() %( if [ "%{?1}" == "%{debug_suffix_unquoted}" ]; then echo "0" ; else echo "1"; fi ) + +# while JDK is a techpreview(is_system_jdk=0), some provides are turned off. Once jdk stops to be an techpreview, move it to 1 +# as sytem JDK, we mean any JDK which can run whole system java stack without issues (like bytecode issues, module issues, dependencies...) +%global is_system_jdk 0 + +%global aarch64 aarch64 arm64 armv8 +# we need to distinguish between big and little endian PPC64 +%global ppc64le ppc64le +%global ppc64be ppc64 ppc64p7 +%global multilib_arches %{power64} sparc64 x86_64 +%global jit_arches %{ix86} x86_64 sparcv9 sparc64 %{aarch64} %{power64} %{arm} s390x +%global aot_arches x86_64 %{aarch64} + +# By default, we build a debug build during main build on JIT architectures +%if %{with slowdebug} +%ifarch %{jit_arches} +%ifnarch %{arm} +%global include_debug_build 1 +%else +%global include_debug_build 0 +%endif +%else +%global include_debug_build 0 +%endif +%else +%global include_debug_build 0 +%endif + +# On x86_64 and AArch64, we use the Shenandoah HotSpot +%ifarch x86_64 %{aarch64} +%global use_shenandoah_hotspot 1 +%else +%global use_shenandoah_hotspot 0 +%endif + +%if %{include_debug_build} +%global build_loop2 %{debug_suffix} +%else +%global build_loop2 %{nil} +%endif + +# if you disable both builds, then the build fails +%global build_loop %{build_loop1} %{build_loop2} +# note: that order: normal_suffix debug_suffix, in case of both enabled +# is expected in one single case at the end of the build +%global rev_build_loop %{build_loop2} %{build_loop1} + +%ifarch %{jit_arches} +%global bootstrap_build 1 +%else +%global bootstrap_build 1 +%endif + +%if %{bootstrap_build} +%global targets bootcycle-images docs +%else +%global targets images docs +%endif + + +# Filter out flags from the optflags macro that cause problems with the OpenJDK build +# We filter out -O flags so that the optimization of HotSpot is not lowered from O3 to O2 +# We filter out -Wall which will otherwise cause HotSpot to produce hundreds of thousands of warnings (100+mb logs) +# We replace it with -Wformat (required by -Werror=format-security) and -Wno-cpp to avoid FORTIFY_SOURCE warnings +# We filter out -fexceptions as the HotSpot build explicitly does -fno-exceptions and it's otherwise the default for C++ +%global ourflags %(echo %optflags | sed -e 's|-Wall|-Wformat -Wno-cpp|' | sed -r -e 's|-O[0-9]*||') +%global ourcppflags %(echo %ourflags | sed -e 's|-fexceptions||') +%global ourldflags %{__global_ldflags} + +# With disabled nss is NSS deactivated, so NSS_LIBDIR can contain the wrong path +# the initialization must be here. Later the pkg-config have buggy behavior +# looks like openjdk RPM specific bug +# Always set this so the nss.cfg file is not broken +%global NSS_LIBDIR %(pkg-config --variable=libdir nss) +%global NSS_LIBS %(pkg-config --libs nss) +%global NSS_CFLAGS %(pkg-config --cflags nss-softokn) +# see
https://bugzilla.redhat.com/show_bug.cgi?id=1332456
+%global NSSSOFTOKN_BUILDTIME_NUMBER %(pkg-config --modversion nss-softokn || : ) +%global NSS_BUILDTIME_NUMBER %(pkg-config --modversion nss || : ) +# this is workaround for processing of requires during srpm creation +%global NSSSOFTOKN_BUILDTIME_VERSION %(if [ "x%{NSSSOFTOKN_BUILDTIME_NUMBER}" == "x" ] ; then echo "" ;else echo ">= %{NSSSOFTOKN_BUILDTIME_NUMBER}" ;fi) +%global NSS_BUILDTIME_VERSION %(if [ "x%{NSS_BUILDTIME_NUMBER}" == "x" ] ; then echo "" ;else echo ">= %{NSS_BUILDTIME_NUMBER}" ;fi) + +# In some cases, the arch used by the JDK does +# not match _arch. +# Also, in some cases, the machine name used by SystemTap +# does not match that given by _build_cpu +%ifarch x86_64 +%global archinstall amd64 +%endif +%ifarch ppc +%global archinstall ppc +%endif +%ifarch %{ppc64be} +%global archinstall ppc64 +%endif +%ifarch %{ppc64le} +%global archinstall ppc64le +%endif +%ifarch %{ix86} +%global archinstall i686 +%endif +%ifarch ia64 +%global archinstall ia64 +%endif +%ifarch s390 +%global archinstall s390 +%endif +%ifarch s390x +%global archinstall s390x +%endif +%ifarch %{arm} +%global archinstall arm +%endif +%ifarch %{aarch64} +%global archinstall aarch64 +%endif +# 32 bit sparc, optimized for v9 +%ifarch sparcv9 +%global archinstall sparc +%endif +# 64 bit sparc +%ifarch sparc64 +%global archinstall sparcv9 +%endif +%ifnarch %{jit_arches} +%global archinstall %{_arch} +%endif + + + +%ifarch %{jit_arches} +%global with_systemtap 1 +%else +%global with_systemtap 0 +%endif + +# New Version-String scheme-style defines +%global majorver 12 +%global securityver 0 +# buildjdkver is usually same as %%{majorver}, +# but in time of bootstrap of next jdk, it is majorver-1, +# and this it is better to change it here, on single place +%global buildjdkver 11 +# Used via new version scheme. JDK 11 was +# GA'ed in March 2019 => 19.3 +%global vendor_version_string 19.3 +# We don't add any LTS designator for STS packages (this package). +# Neither for Fedora nor EPEL which would have %%{rhel} macro defined. + %global lts_designator "" + %global lts_designator_zip "" + +# Standard JPackage naming and versioning defines +%global origin openjdk +%global origin_nice OpenJDK +%global top_level_dir_name %{origin} +%global minorver 0 +%global buildver 33 +# priority must be 8 digits in total; up to openjdk 1.8, we were using 18..... so when we moved to 11, we had to add another digit +%if %is_system_jdk +%global priority %( printf '%02d%02d%02d%02d' %{majorver} %{minorver} %{securityver} %{buildver} ) +%else +# for techpreview, using 1, so slowdebugs can have 0 +%global priority %( printf '%08d' 1 ) +%endif +%global newjavaver %{majorver}.%{minorver}.%{securityver} + +%global javaver %{majorver} + +# parametrized macros are order-sensitive +%global compatiblename java-%{majorver}-%{origin} +%global fullversion %{compatiblename}-%{version}-%{release} +# images stub +%global jdkimage jdk +# output dir stub +%define buildoutputdir() %{expand:openjdk/build%{?1}} +# we can copy the javadoc to not arched dir, or make it not noarch +%define uniquejavadocdir() %{expand:%{fullversion}.%{_arch}%{?1}} +# main id and dir of this jdk +%define uniquesuffix() %{expand:%{fullversion}.%{_arch}%{?1}} + +# fix for
https://bugzilla.redhat.com/show_bug.cgi?id=1111349
+#
https://bugzilla.redhat.com/show_bug.cgi?id=1590796#c14
+#
https://bugzilla.redhat.com/show_bug.cgi?id=1655938
+%if %is_system_jdk +%global _privatelibs libsplashscreen[.]so.*|libawt_xawt[.]so.*|libjli[.]so.*|libattach[.]so.*|libawt[.]so.*|libextnet[.]so.*|libawt_headless[.]so.*|libdt_socket[.]so.*|libfontmanager[.]so.*|libinstrument[.]so.*|libj2gss[.]so.*|libj2pcsc[.]so.*|libj2pkcs11[.]so.*|libjaas[.]so.*|libjavajpeg[.]so.*|libjdwp[.]so.*|libjimage[.]so.*|libjsound[.]so.*|liblcms[.]so.*|libmanagement[.]so.*|libmanagement_agent[.]so.*|libmanagement_ext[.]so.*|libmlib_image[.]so.*|libnet[.]so.*|libnio[.]so.*|libprefs[.]so.*|librmi[.]so.*|libsaproc[.]so.*|libsctp[.]so.*|libsunec[.]so.*|libunpack[.]so.*|libzip[.]so.* +%global __provides_exclude ^(%{_privatelibs})$ +%global __requires_exclude ^(%{_privatelibs})$ +%global __provides_exclude_from ^.*/%{uniquesuffix -- %{debug_suffix_unquoted}}/.*$ +%else +%global __provides_exclude lib.*[.]so.* +%global __requires_exclude lib.*[.]so.* +%endif + + +%global etcjavasubdir %{_sysconfdir}/java/java-%{javaver}-%{origin} +%define etcjavadir() %{expand:%{etcjavasubdir}/%{uniquesuffix -- %{?1}}} +# Standard JPackage directories and symbolic links. +%define sdkdir() %{expand:%{uniquesuffix -- %{?1}}} +%define jrelnk() %{expand:jre-%{javaver}-%{origin}-%{version}-%{release}.%{_arch}%{?1}} + +%define sdkbindir() %{expand:%{_jvmdir}/%{sdkdir -- %{?1}}/bin} +%define jrebindir() %{expand:%{_jvmdir}/%{sdkdir -- %{?1}}/bin} + +%global rpm_state_dir %{_localstatedir}/lib/rpm-state/ + +%if %{with_systemtap} +# Where to install systemtap tapset (links) +# We would like these to be in a package specific sub-dir, +# but currently systemtap doesn't support that, so we have to +# use the root tapset dir for now. To distinguish between 64 +# and 32 bit architectures we place the tapsets under the arch +# specific dir (note that systemtap will only pickup the tapset +# for the primary arch for now). Systemtap uses the machine name +# aka build_cpu as architecture specific directory name. +%global tapsetroot /usr/share/systemtap +%global tapsetdirttapset %{tapsetroot}/tapset/ +%global tapsetdir %{tapsetdirttapset}/%{_build_cpu} +%endif + +# not-duplicated scriptlets for normal/debug packages +%global update_desktop_icons /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : + + +%define post_script() %{expand: +update-desktop-database %{_datadir}/applications &> /dev/null || : +/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : +exit 0 +} + + +%define post_headless() %{expand: +%ifarch %{jit_arches} +# MetaspaceShared::generate_vtable_methods not implemented for PPC JIT +%ifnarch %{ppc64le} +# see
https://bugzilla.redhat.com/show_bug.cgi?id=513605
+%{jrebindir -- %{?1}}/java -Xshare:dump >/dev/null 2>/dev/null +%endif +%endif + +PRIORITY=%{priority} +if [ "%{?1}" == %{debug_suffix} ]; then + let PRIORITY=PRIORITY-1 +fi + +ext=.gz +alternatives \\ + --install %{_bindir}/java java %{jrebindir -- %{?1}}/java $PRIORITY --family %{name}.%{_arch} \\ + --slave %{_jvmdir}/jre jre %{_jvmdir}/%{sdkdir -- %{?1}} \\ + --slave %{_bindir}/jjs jjs %{jrebindir -- %{?1}}/jjs \\ + --slave %{_bindir}/keytool keytool %{jrebindir -- %{?1}}/keytool \\ + --slave %{_bindir}/pack200 pack200 %{jrebindir -- %{?1}}/pack200 \\ + --slave %{_bindir}/rmid rmid %{jrebindir -- %{?1}}/rmid \\ + --slave %{_bindir}/rmiregistry rmiregistry %{jrebindir -- %{?1}}/rmiregistry \\ + --slave %{_bindir}/unpack200 unpack200 %{jrebindir -- %{?1}}/unpack200 \\ + --slave %{_mandir}/man1/java.1$ext java.1$ext \\ + %{_mandir}/man1/java-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/jjs.1$ext jjs.1$ext \\ + %{_mandir}/man1/jjs-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/keytool.1$ext keytool.1$ext \\ + %{_mandir}/man1/keytool-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/pack200.1$ext pack200.1$ext \\ + %{_mandir}/man1/pack200-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/rmid.1$ext rmid.1$ext \\ + %{_mandir}/man1/rmid-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/rmiregistry.1$ext rmiregistry.1$ext \\ + %{_mandir}/man1/rmiregistry-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/unpack200.1$ext unpack200.1$ext \\ + %{_mandir}/man1/unpack200-%{uniquesuffix -- %{?1}}.1$ext + +for X in %{origin} %{javaver} ; do + alternatives --install %{_jvmdir}/jre-"$X" jre_"$X" %{_jvmdir}/%{sdkdir -- %{?1}} $PRIORITY --family %{name}.%{_arch} +done + +update-alternatives --install %{_jvmdir}/jre-%{javaver}-%{origin} jre_%{javaver}_%{origin} %{_jvmdir}/%{jrelnk -- %{?1}} $PRIORITY --family %{name}.%{_arch} + + +update-desktop-database %{_datadir}/applications &> /dev/null || : +/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : + +# see pretrans where this file is declared +# also see that pretrans is only for non-debug +if [ ! "%{?1}" == %{debug_suffix} ]; then + if [ -f %{_libexecdir}/copy_jdk_configs_fixFiles.sh ] ; then + sh %{_libexecdir}/copy_jdk_configs_fixFiles.sh %{rpm_state_dir}/%{name}.%{_arch} %{_jvmdir}/%{sdkdir -- %{?1}} + fi +fi + +exit 0 +} + +%define postun_script() %{expand: +update-desktop-database %{_datadir}/applications &> /dev/null || : +if [ $1 -eq 0 ] ; then + /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null + %{update_desktop_icons} +fi +exit 0 +} + + +%define postun_headless() %{expand: + alternatives --remove java %{jrebindir -- %{?1}}/java + alternatives --remove jre_%{origin} %{_jvmdir}/%{sdkdir -- %{?1}} + alternatives --remove jre_%{javaver} %{_jvmdir}/%{sdkdir -- %{?1}} + alternatives --remove jre_%{javaver}_%{origin} %{_jvmdir}/%{jrelnk -- %{?1}} +} + +%define posttrans_script() %{expand: +%{update_desktop_icons} +} + +%define post_devel() %{expand: + +PRIORITY=%{priority} +if [ "%{?1}" == %{debug_suffix} ]; then + let PRIORITY=PRIORITY-1 +fi + +ext=.gz +alternatives \\ + --install %{_bindir}/javac javac %{sdkbindir -- %{?1}}/javac $PRIORITY --family %{name}.%{_arch} \\ + --slave %{_jvmdir}/java java_sdk %{_jvmdir}/%{sdkdir -- %{?1}} \\ +%ifarch %{aot_arches} + --slave %{_bindir}/jaotc jaotc %{sdkbindir -- %{?1}}/jaotc \\ +%endif + --slave %{_bindir}/jlink jlink %{sdkbindir -- %{?1}}/jlink \\ + --slave %{_bindir}/jmod jmod %{sdkbindir -- %{?1}}/jmod \\ +%ifarch %{jit_arches} +%ifnarch s390x + --slave %{_bindir}/jhsdb jhsdb %{sdkbindir -- %{?1}}/jhsdb \\ +%endif +%endif + --slave %{_bindir}/jar jar %{sdkbindir -- %{?1}}/jar \\ + --slave %{_bindir}/jarsigner jarsigner %{sdkbindir -- %{?1}}/jarsigner \\ + --slave %{_bindir}/javadoc javadoc %{sdkbindir -- %{?1}}/javadoc \\ + --slave %{_bindir}/javap javap %{sdkbindir -- %{?1}}/javap \\ + --slave %{_bindir}/jcmd jcmd %{sdkbindir -- %{?1}}/jcmd \\ + --slave %{_bindir}/jconsole jconsole %{sdkbindir -- %{?1}}/jconsole \\ + --slave %{_bindir}/jdb jdb %{sdkbindir -- %{?1}}/jdb \\ + --slave %{_bindir}/jdeps jdeps %{sdkbindir -- %{?1}}/jdeps \\ + --slave %{_bindir}/jdeprscan jdeprscan %{sdkbindir -- %{?1}}/jdeprscan \\ + --slave %{_bindir}/jimage jimage %{sdkbindir -- %{?1}}/jimage \\ + --slave %{_bindir}/jinfo jinfo %{sdkbindir -- %{?1}}/jinfo \\ + --slave %{_bindir}/jmap jmap %{sdkbindir -- %{?1}}/jmap \\ + --slave %{_bindir}/jps jps %{sdkbindir -- %{?1}}/jps \\ + --slave %{_bindir}/jrunscript jrunscript %{sdkbindir -- %{?1}}/jrunscript \\ + --slave %{_bindir}/jshell jshell %{sdkbindir -- %{?1}}/jshell \\ + --slave %{_bindir}/jstack jstack %{sdkbindir -- %{?1}}/jstack \\ + --slave %{_bindir}/jstat jstat %{sdkbindir -- %{?1}}/jstat \\ + --slave %{_bindir}/jstatd jstatd %{sdkbindir -- %{?1}}/jstatd \\ + --slave %{_bindir}/rmic rmic %{sdkbindir -- %{?1}}/rmic \\ + --slave %{_bindir}/serialver serialver %{sdkbindir -- %{?1}}/serialver \\ + --slave %{_mandir}/man1/jar.1$ext jar.1$ext \\ + %{_mandir}/man1/jar-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/jarsigner.1$ext jarsigner.1$ext \\ + %{_mandir}/man1/jarsigner-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/javac.1$ext javac.1$ext \\ + %{_mandir}/man1/javac-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/javadoc.1$ext javadoc.1$ext \\ + %{_mandir}/man1/javadoc-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/javap.1$ext javap.1$ext \\ + %{_mandir}/man1/javap-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/jcmd.1$ext jcmd.1$ext \\ + %{_mandir}/man1/jcmd-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/jconsole.1$ext jconsole.1$ext \\ + %{_mandir}/man1/jconsole-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/jdb.1$ext jdb.1$ext \\ + %{_mandir}/man1/jdb-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/jdeps.1$ext jdeps.1$ext \\ + %{_mandir}/man1/jdeps-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/jinfo.1$ext jinfo.1$ext \\ + %{_mandir}/man1/jinfo-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/jmap.1$ext jmap.1$ext \\ + %{_mandir}/man1/jmap-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/jps.1$ext jps.1$ext \\ + %{_mandir}/man1/jps-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/jrunscript.1$ext jrunscript.1$ext \\ + %{_mandir}/man1/jrunscript-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/jstack.1$ext jstack.1$ext \\ + %{_mandir}/man1/jstack-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/jstat.1$ext jstat.1$ext \\ + %{_mandir}/man1/jstat-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/jstatd.1$ext jstatd.1$ext \\ + %{_mandir}/man1/jstatd-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/rmic.1$ext rmic.1$ext \\ + %{_mandir}/man1/rmic-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/serialver.1$ext serialver.1$ext \\ + %{_mandir}/man1/serialver-%{uniquesuffix -- %{?1}}.1$ext \\ + +for X in %{origin} %{javaver} ; do + alternatives \\ + --install %{_jvmdir}/java-"$X" java_sdk_"$X" %{_jvmdir}/%{sdkdir -- %{?1}} $PRIORITY --family %{name}.%{_arch} +done + +update-alternatives --install %{_jvmdir}/java-%{javaver}-%{origin} java_sdk_%{javaver}_%{origin} %{_jvmdir}/%{sdkdir -- %{?1}} $PRIORITY --family %{name}.%{_arch} + +update-desktop-database %{_datadir}/applications &> /dev/null || : +/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : + +exit 0 +} + +%define postun_devel() %{expand: + alternatives --remove javac %{sdkbindir -- %{?1}}/javac + alternatives --remove java_sdk_%{origin} %{_jvmdir}/%{sdkdir -- %{?1}} + alternatives --remove java_sdk_%{javaver} %{_jvmdir}/%{sdkdir -- %{?1}} + alternatives --remove java_sdk_%{javaver}_%{origin} %{_jvmdir}/%{sdkdir -- %{?1}} + +update-desktop-database %{_datadir}/applications &> /dev/null || : + +if [ $1 -eq 0 ] ; then + /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null + %{update_desktop_icons} +fi +exit 0 +} + +%define posttrans_devel() %{expand: +%{update_desktop_icons} +} + +%define post_javadoc() %{expand: + +PRIORITY=%{priority} +if [ "%{?1}" == %{debug_suffix} ]; then + let PRIORITY=PRIORITY-1 +fi + +alternatives \\ + --install %{_javadocdir}/java javadocdir %{_javadocdir}/%{uniquejavadocdir -- %{?1}}/api \\ + $PRIORITY --family %{name} +exit 0 +} + +%define postun_javadoc() %{expand: + alternatives --remove javadocdir %{_javadocdir}/%{uniquejavadocdir -- %{?1}}/api +exit 0 +} + +%define post_javadoc_zip() %{expand: + +PRIORITY=%{priority} +if [ "%{?1}" == %{debug_suffix} ]; then + let PRIORITY=PRIORITY-1 +fi + +alternatives \\ + --install %{_javadocdir}/java-zip javadoczip %{_javadocdir}/%{uniquejavadocdir -- %{?1}}.zip \\ + $PRIORITY --family %{name} +exit 0 +} + +%define postun_javadoc_zip() %{expand: + alternatives --remove javadoczip %{_javadocdir}/%{uniquejavadocdir -- %{?1}}.zip +exit 0 +} + +%define files_jre() %{expand: +%{_datadir}/icons/hicolor/*x*/apps/java-%{javaver}-%{origin}.png +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libsplashscreen.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libawt_xawt.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjawt.so +} + + +%define files_jre_headless() %{expand: +%license %{_jvmdir}/%{sdkdir -- %{?1}}/legal +%dir %{_sysconfdir}/.java/.systemPrefs +%dir %{_sysconfdir}/.java +%dir %{_jvmdir}/%{sdkdir -- %{?1}} +%{_jvmdir}/%{sdkdir -- %{?1}}/release +%{_jvmdir}/%{jrelnk -- %{?1}} +%dir %{_jvmdir}/%{sdkdir -- %{?1}}/bin +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/java +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jjs +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/keytool +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/pack200 +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/rmid +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/rmiregistry +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/unpack200 +%dir %{_jvmdir}/%{sdkdir -- %{?1}}/lib +%ifarch %{jit_arches} +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/classlist +%endif +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/jexec +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/jspawnhelper +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/jrt-fs.jar +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/modules +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/psfont.properties.ja +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/psfontj2d.properties +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/tzdb.dat +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjli.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/jvm.cfg +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libattach.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libawt.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libextnet.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjsig.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libawt_headless.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libdt_socket.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libfontmanager.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libinstrument.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libj2gss.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libj2pcsc.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libj2pkcs11.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjaas.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjava.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjavajpeg.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjdwp.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjimage.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjsound.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/liblcms.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libmanagement.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libmanagement_agent.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libmanagement_ext.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libmlib_image.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libnet.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libnio.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libprefs.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/librmi.so +# Zero and S390x don't have SA +%ifarch %{jit_arches} +%ifnarch s390x +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libsaproc.so +%endif +%endif +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libsctp.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libsunec.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libunpack.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libverify.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libzip.so +%dir %{_jvmdir}/%{sdkdir -- %{?1}}/lib/jfr +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/jfr/default.jfc +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/jfr/profile.jfc +%{_mandir}/man1/java-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/jjs-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/keytool-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/pack200-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/rmid-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/rmiregistry-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/unpack200-%{uniquesuffix -- %{?1}}.1* +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/server/ +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/client/ +%ifarch %{jit_arches} +%ifnarch %{power64} +%attr(444, root, root) %ghost %{_jvmdir}/%{sdkdir -- %{?1}}/lib/server/classes.jsa +%attr(444, root, root) %ghost %{_jvmdir}/%{sdkdir -- %{?1}}/lib/client/classes.jsa +%endif +%endif +%dir %{etcjavasubdir} +%dir %{etcjavadir -- %{?1}} +%dir %{etcjavadir -- %{?1}}/lib +%dir %{etcjavadir -- %{?1}}/lib/security +%{etcjavadir -- %{?1}}/lib/security/cacerts +%dir %{etcjavadir -- %{?1}}/conf +%dir %{etcjavadir -- %{?1}}/conf/sdp +%dir %{etcjavadir -- %{?1}}/conf/management +%dir %{etcjavadir -- %{?1}}/conf/security +%dir %{etcjavadir -- %{?1}}/conf/security/policy +%dir %{etcjavadir -- %{?1}}/conf/security/policy/limited +%dir %{etcjavadir -- %{?1}}/conf/security/policy/unlimited +%config(noreplace) %{etcjavadir -- %{?1}}/lib/security/default.policy +%config(noreplace) %{etcjavadir -- %{?1}}/lib/security/blacklisted.certs +%config(noreplace) %{etcjavadir -- %{?1}}/lib/security/public_suffix_list.dat +%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/policy/limited/exempt_local.policy +%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/policy/limited/default_local.policy +%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/policy/limited/default_US_export.policy +%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/policy/unlimited/default_local.policy +%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/policy/unlimited/default_US_export.policy + %{etcjavadir -- %{?1}}/conf/security/policy/README.txt +%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/java.policy +%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/java.security +%config(noreplace) %{etcjavadir -- %{?1}}/conf/logging.properties +%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/nss.cfg +%config(noreplace) %{etcjavadir -- %{?1}}/conf/management/jmxremote.access +# these are config templates, thus not config-noreplace +%config %{etcjavadir -- %{?1}}/conf/management/jmxremote.password.template +%config %{etcjavadir -- %{?1}}/conf/sdp/sdp.conf.template +%config(noreplace) %{etcjavadir -- %{?1}}/conf/management/management.properties +%config(noreplace) %{etcjavadir -- %{?1}}/conf/net.properties +%config(noreplace) %{etcjavadir -- %{?1}}/conf/sound.properties +%{_jvmdir}/%{sdkdir -- %{?1}}/conf +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/security +%if %is_system_jdk +%if %{is_release_build -- %{?1}} +%ghost %{_bindir}/java +%ghost %{_jvmdir}/jre +#
https://bugzilla.redhat.com/show_bug.cgi?id=1312019
+%ghost %{_bindir}/jjs +%ghost %{_bindir}/keytool +%ghost %{_bindir}/pack200 +%ghost %{_bindir}/rmid +%ghost %{_bindir}/rmiregistry +%ghost %{_bindir}/unpack200 +%ghost %{_jvmdir}/jre-%{origin} +%ghost %{_jvmdir}/jre-%{javaver} +%ghost %{_jvmdir}/jre-%{javaver}-%{origin} +%endif +%endif +} + +%define files_devel() %{expand: +%dir %{_jvmdir}/%{sdkdir -- %{?1}}/bin +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jar +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jarsigner +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/javac +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/javadoc +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/javap +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jconsole +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jcmd +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jfr +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jdb +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jdeps +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jdeprscan +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jimage +# Zero and S390x don't have SA +%ifarch %{jit_arches} +%ifnarch s390x +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jhsdb +%endif +%endif +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jinfo +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jlink +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jmap +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jmod +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jps +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jrunscript +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jshell +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jstack +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jstat +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jstatd +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/rmic +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/serialver +%ifarch %{aot_arches} +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jaotc +%endif +%{_jvmdir}/%{sdkdir -- %{?1}}/include +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/ct.sym +%if %{with_systemtap} +%{_jvmdir}/%{sdkdir -- %{?1}}/tapset +%endif +%{_datadir}/applications/*jconsole%{?1}.desktop +%{_mandir}/man1/jar-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/jarsigner-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/javac-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/javadoc-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/javap-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/jconsole-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/jcmd-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/jdb-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/jdeps-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/jinfo-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/jmap-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/jps-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/jrunscript-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/jstack-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/jstat-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/jstatd-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/rmic-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/serialver-%{uniquesuffix -- %{?1}}.1* +%if %{with_systemtap} +%dir %{tapsetroot} +%dir %{tapsetdirttapset} +%dir %{tapsetdir} +%{tapsetdir}/*%{_arch}%{?1}.stp +%endif +%if %is_system_jdk +%if %{is_release_build -- %{?1}} +%ghost %{_bindir}/javac +%ghost %{_jvmdir}/java +%ghost %{_bindir}/jaotc +%ghost %{_bindir}/jlink +%ghost %{_bindir}/jmod +%ghost %{_bindir}/jhsdb +%ghost %{_bindir}/jar +%ghost %{_bindir}/jarsigner +%ghost %{_bindir}/javadoc +%ghost %{_bindir}/javap +%ghost %{_bindir}/jcmd +%ghost %{_bindir}/jconsole +%ghost %{_bindir}/jdb +%ghost %{_bindir}/jdeps +%ghost %{_bindir}/jdeprscan +%ghost %{_bindir}/jimage +%ghost %{_bindir}/jinfo +%ghost %{_bindir}/jmap +%ghost %{_bindir}/jps +%ghost %{_bindir}/jrunscript +%ghost %{_bindir}/jshell +%ghost %{_bindir}/jstack +%ghost %{_bindir}/jstat +%ghost %{_bindir}/jstatd +%ghost %{_bindir}/rmic +%ghost %{_bindir}/serialver +%ghost %{_jvmdir}/java-%{origin} +%ghost %{_jvmdir}/java-%{javaver} +%ghost %{_jvmdir}/java-%{javaver}-%{origin} +%endif +%endif +} + +%define files_jmods() %{expand: +%{_jvmdir}/%{sdkdir -- %{?1}}/jmods +} + +%define files_demo() %{expand: +%license %{_jvmdir}/%{sdkdir -- %{?1}}/legal +%{_jvmdir}/%{sdkdir -- %{?1}}/demo +%{_jvmdir}/%{sdkdir -- %{?1}}/sample +} + +%define files_src() %{expand: +%license %{_jvmdir}/%{sdkdir -- %{?1}}/legal +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/src.zip +} + +%define files_javadoc() %{expand: +%doc %{_javadocdir}/%{uniquejavadocdir -- %{?1}} +%license %{buildoutputdir -- %{?1}}/images/%{jdkimage}/legal +%if %is_system_jdk +%if %{is_release_build -- %{?1}} +%ghost %{_javadocdir}/java +%endif +%endif +} + +%define files_javadoc_zip() %{expand: +%doc %{_javadocdir}/%{uniquejavadocdir -- %{?1}}.zip +%license %{buildoutputdir -- %{?1}}/images/%{jdkimage}/legal +%if %is_system_jdk +%if %{is_release_build -- %{?1}} +%ghost %{_javadocdir}/java-zip +%endif +%endif +} + +# not-duplicated requires/provides/obsoletes for normal/debug packages +%define java_rpo() %{expand: +Requires: fontconfig%{?_isa} +Requires: xorg-x11-fonts-Type1 +# Requires rest of java +Requires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release} +OrderWithRequires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release} +# for java-X-openjdk package's desktop binding +Recommends: gtk3%{?_isa} + +Provides: java-%{javaver}-%{origin}%{?1} = %{epoch}:%{version}-%{release} + +# Standard JPackage base provides +Provides: jre-%{javaver}%{?1} = %{epoch}:%{version}-%{release} +Provides: jre-%{javaver}-%{origin}%{?1} = %{epoch}:%{version}-%{release} +Provides: java-%{javaver}%{?1} = %{epoch}:%{version}-%{release} +%if %is_system_jdk +Provides: java-%{origin}%{?1} = %{epoch}:%{version}-%{release} +Provides: jre-%{origin}%{?1} = %{epoch}:%{version}-%{release} +Provides: java%{?1} = %{epoch}:%{version}-%{release} +Provides: jre%{?1} = %{epoch}:%{version}-%{release} +%endif +} + +%define java_headless_rpo() %{expand: +# Require /etc/pki/java/cacerts +Requires: ca-certificates +# Require javapackages-filesystem for ownership of /usr/lib/jvm/ and macros +Requires: javapackages-filesystem +# Require zone-info data provided by tzdata-java sub-package +Requires: tzdata-java >= 2015d +# there is a need to depend on the exact version of NSS +Requires: nss%{?_isa} %{NSS_BUILDTIME_VERSION} +Requires: nss-softokn%{?_isa} %{NSSSOFTOKN_BUILDTIME_VERSION} +# tool to copy jdk's configs - should be Recommends only, but then only dnf/yum enforce it, +# not rpm transaction and so no configs are persisted when pure rpm -u is run. It may be +# considered as regression +Requires: copy-jdk-configs >= 3.3 +OrderWithRequires: copy-jdk-configs +# for printing support +Requires: cups-libs +# Post requires alternatives to install tool alternatives +Requires(post): %{_sbindir}/alternatives +# Postun requires alternatives to uninstall tool alternatives +Requires(postun): %{_sbindir}/alternatives +# for optional support of kernel stream control, card reader and printing bindings +Suggests: lksctp-tools%{?_isa}, pcsc-lite-libs%{?_isa} + +# Standard JPackage base provides +Provides: jre-%{javaver}-%{origin}-headless%{?1} = %{epoch}:%{version}-%{release} +Provides: jre-%{javaver}-headless%{?1} = %{epoch}:%{version}-%{release} +Provides: java-%{javaver}-%{origin}-headless%{?1} = %{epoch}:%{version}-%{release} +Provides: java-%{javaver}-headless%{?1} = %{epoch}:%{version}-%{release} +%if %is_system_jdk +Provides: java-%{origin}-headless%{?1} = %{epoch}:%{version}-%{release} +Provides: jre-%{origin}-headless%{?1} = %{epoch}:%{version}-%{release} +Provides: jre-headless%{?1} = %{epoch}:%{version}-%{release} +Provides: java-headless%{?1} = %{epoch}:%{version}-%{release} +%endif +} + +%define java_devel_rpo() %{expand: +# Requires base package +Requires: %{name}%{?1}%{?_isa} = %{epoch}:%{version}-%{release} +OrderWithRequires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release} +# Post requires alternatives to install tool alternatives +Requires(post): %{_sbindir}/alternatives +# Postun requires alternatives to uninstall tool alternatives +Requires(postun): %{_sbindir}/alternatives + +# Standard JPackage devel provides +Provides: java-sdk-%{javaver}-%{origin}%{?1} = %{epoch}:%{version}-%{release} +Provides: java-sdk-%{javaver}%{?1} = %{epoch}:%{version}-%{release} +Provides: java-%{javaver}-devel%{?1} = %{epoch}:%{version}-%{release} +Provides: java-%{javaver}-%{origin}-devel%{?1} = %{epoch}:%{version}-%{release} +%if %is_system_jdk +Provides: java-devel-%{origin}%{?1} = %{epoch}:%{version}-%{release} +Provides: java-sdk-%{origin}%{?1} = %{epoch}:%{version}-%{release} +Provides: java-devel%{?1} = %{epoch}:%{version}-%{release} +Provides: java-sdk%{?1} = %{epoch}:%{version}-%{release} +%endif +} + +%define java_jmods_rpo() %{expand: +# Requires devel package +# as jmods are bytecode, they should be OK without any _isa +Requires: %{name}-devel%{?1} = %{epoch}:%{version}-%{release} +OrderWithRequires: %{name}-headless%{?1} = %{epoch}:%{version}-%{release} + +Provides: java-%{javaver}-jmods%{?1} = %{epoch}:%{version}-%{release} +Provides: java-%{javaver}-%{origin}-jmods%{?1} = %{epoch}:%{version}-%{release} +%if %is_system_jdk +Provides: java-jmods%{?1} = %{epoch}:%{version}-%{release} +%endif +} + +%define java_demo_rpo() %{expand: +Requires: %{name}%{?1}%{?_isa} = %{epoch}:%{version}-%{release} +OrderWithRequires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release} + +Provides: java-%{javaver}-demo%{?1} = %{epoch}:%{version}-%{release} +Provides: java-%{javaver}-%{origin}-demo%{?1} = %{epoch}:%{version}-%{release} +%if %is_system_jdk +Provides: java-demo%{?1} = %{epoch}:%{version}-%{release} +%endif +} + +%define java_javadoc_rpo() %{expand: +OrderWithRequires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release} +# Post requires alternatives to install javadoc alternative +Requires(post): %{_sbindir}/alternatives +# Postun requires alternatives to uninstall javadoc alternative +Requires(postun): %{_sbindir}/alternatives + +# Standard JPackage javadoc provides +Provides: java-%{javaver}-javadoc%{?1} = %{epoch}:%{version}-%{release} +Provides: java-%{javaver}-%{origin}-javadoc%{?1} = %{epoch}:%{version}-%{release} +%if %is_system_jdk +Provides: java-javadoc%{?1} = %{epoch}:%{version}-%{release} +%endif +} + +%define java_src_rpo() %{expand: +Requires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release} + +# Standard JPackage sources provides +Provides: java-%{javaver}-src%{?1} = %{epoch}:%{version}-%{release} +Provides: java-%{javaver}-%{origin}-src%{?1} = %{epoch}:%{version}-%{release} +%if %is_system_jdk +Provides: java-src%{?1} = %{epoch}:%{version}-%{release} +%endif +} + +# Prevent brp-java-repack-jars from being run +%global __jar_repack 0 + +Name: java-latest-%{origin} +Version: %{newjavaver}.%{buildver} +# This package needs `.rolling` as part of Release so as to not conflict on install with +# java-X-openjdk. I.e. when latest rolling release is also an LTS release packaged as +# java-X-openjdk. See:
https://bugzilla.redhat.com/show_bug.cgi?id=1647298
+Release: 3.rolling%{?dist} +# java-1.5.0-ibm from
jpackage.org
set Epoch to 1 for unknown reasons +# and this change was brought into RHEL-4. java-1.5.0-ibm packages +# also included the epoch in their virtual provides. This created a +# situation where in-the-wild java-1.5.0-ibm packages provided "java = +# 1:1.5.0". In RPM terms, "1.6.0 < 1:1.5.0" since 1.6.0 is +# interpreted as 0:1.6.0. So the "java >= 1.6.0" requirement would be +# satisfied by the 1:1.5.0 packages. Thus we need to set the epoch in +# JDK package >= 1.6.0 to 1, and packages referring to JDK virtual +# provides >= 1.6.0 must specify the epoch, "java >= 1:1.6.0". + +Epoch: 1 +Summary: %{origin_nice} Runtime Environment %{majorver} + +# HotSpot code is licensed under GPLv2 +# JDK library code is licensed under GPLv2 with the Classpath exception +# The Apache license is used in code taken from Apache projects (primarily xalan & xerces) +# DOM levels 2 & 3 and the XML digital signature schemas are licensed under the W3C Software License +# The JSR166 concurrency code is in the public domain +# The BSD and MIT licenses are used for a number of third-party libraries (see ADDITIONAL_LICENSE_INFO) +# The OpenJDK source tree includes: +# - JPEG library (IJG), zlib & libpng (zlib), giflib (MIT), harfbuzz (ISC), +# - freetype (FTL), jline (BSD) and LCMS (MIT) +# - jquery (MIT), jdk.crypto.cryptoki PKCS 11 wrapper (RSA) +# - public_suffix_list.dat from
publicsuffix.org
(MPLv2.0) +# The test code includes copies of NSS under the Mozilla Public License v2.0 +# The PCSClite headers are under a BSD with advertising license +# The elliptic curve cryptography (ECC) source code is licensed under the LGPLv2.1 or any later version +License: ASL 1.1 and ASL 2.0 and BSD and BSD with advertising and GPL+ and GPLv2 and GPLv2 with exceptions and IJG and LGPLv2+ and MIT and MPLv2.0 and Public Domain and W3C and zlib and ISC and FTL and RSA +URL:
http://openjdk.java.net/
+ + +# to regenerate source0 (jdk) and source8 (jdk's taspets) run update_package.sh +# update_package.sh contains hard-coded repos, revisions, tags, and projects to regenerate the source archives +Source0: jdk-jdk%{majorver}-jdk-%{majorver}+%{buildver}.tar.xz +Source8: systemtap_3.2_tapsets_hg-icedtea8-9d464368e06d.tar.xz + +# Desktop files. Adapted from IcedTea +Source9: jconsole.desktop.in + +# nss configuration file +Source11: nss.cfg.in + +# Removed libraries that we link instead +Source12: remove-intree-libraries.sh + +# Ensure we aren't using the limited crypto policy +Source13: TestCryptoLevel.java + +# Ensure ECDSA is working +Source14: TestECDSA.java + +############################################ +# +# RPM/distribution specific patches +# +############################################ + +# NSS via SunPKCS11 Provider (disabled comment +# due to memory leak). +Patch1000: rh1648249-add_commented_out_nss_cfg_provider_to_java_security.patch + +# Ignore AWTError when assistive technologies are loaded +Patch1: rh1648242-accessible_toolkit_crash_do_not_break_jvm.patch +# Restrict access to java-atk-wrapper classes +Patch2: rh1648644-java_access_bridge_privileged_security.patch +Patch3: rh649512-remove_uses_of_far_in_jpeg_libjpeg_turbo_1_4_compat_for_jdk10_and_up.patch +# Follow system wide crypto policy RHBZ#1249083 +Patch4: pr3183-rh1340845-support_fedora_rhel_system_crypto_policy.patch +# System NSS via SunEC Provider +Patch5: pr1983-rh1565658-support_using_the_system_installation_of_nss_with_the_sunec_provider_jdk12.patch +# Depend on pcs-lite-libs instead of pcs-lite-devel as this is only in optional repo +Patch6: rh1684077-openjdk_should_depend_on_pcsc-lite-libs_instead_of_pcsc-lite-devel.patch + +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: alsa-lib-devel +BuildRequires: binutils +BuildRequires: cups-devel +BuildRequires: desktop-file-utils +# elfutils only are OK for build without AOT +BuildRequires: elfutils-devel +BuildRequires: fontconfig +BuildRequires: freetype-devel +BuildRequires: giflib-devel +BuildRequires: gcc-c++ +BuildRequires: gdb +BuildRequires: gtk3-devel +BuildRequires: lcms2-devel +BuildRequires: libjpeg-devel +BuildRequires: libpng-devel +BuildRequires: libxslt +BuildRequires: libX11-devel +BuildRequires: libXi-devel +BuildRequires: libXinerama-devel +BuildRequires: libXt-devel +BuildRequires: libXtst-devel +# Requirements for setting up the nss.cfg +BuildRequires: nss-devel +BuildRequires: pkgconfig +BuildRequires: xorg-x11-proto-devel +BuildRequires: zip +BuildRequires: javapackages-filesystem +BuildRequires: java-%{buildjdkver}-openjdk-devel +# Zero-assembler build requirement +%ifnarch %{jit_arches} +BuildRequires: libffi-devel +%endif +BuildRequires: tzdata-java >= 2015d +# Earlier versions have a bug in tree vectorization on PPC +BuildRequires: gcc >= 4.8.3-8 +# Build requirements for SunEC system NSS support +BuildRequires: nss-softokn-freebl-devel >= 3.16.1 + +%if %{with_systemtap} +BuildRequires: systemtap-sdt-devel +%endif + +# this is always built, also during debug-only build +# when it is built in debug-only this package is just placeholder +%{java_rpo %{nil}} + +%description +The %{origin_nice} runtime environment. + +%if %{include_debug_build} +%package slowdebug +Summary: %{origin_nice} Runtime Environment %{majorver} %{debug_on} + +%{java_rpo -- %{debug_suffix_unquoted}} +%description slowdebug +The %{origin_nice} runtime environment. +%{debug_warning} +%endif + +%if %{include_normal_build} +%package headless +Summary: %{origin_nice} Headless Runtime Environment %{majorver} + +%{java_headless_rpo %{nil}} + +%description headless +The %{origin_nice} runtime environment %{majorver} without audio and video support. +%endif + +%if %{include_debug_build} +%package headless-slowdebug +Summary: %{origin_nice} Runtime Environment %{debug_on} + +%{java_headless_rpo -- %{debug_suffix_unquoted}} + +%description headless-slowdebug +The %{origin_nice} runtime environment %{majorver} without audio and video support. +%{debug_warning} +%endif + +%if %{include_normal_build} +%package devel +Summary: %{origin_nice} Development Environment %{majorver} + +%{java_devel_rpo %{nil}} + +%description devel +The %{origin_nice} development tools %{majorver}. +%endif + +%if %{include_debug_build} +%package devel-slowdebug +Summary: %{origin_nice} Development Environment %{majorver} %{debug_on} + +%{java_devel_rpo -- %{debug_suffix_unquoted}} + +%description devel-slowdebug +The %{origin_nice} development tools %{majorver}. +%{debug_warning} +%endif + +%if %{include_normal_build} +%package jmods +Summary: JMods for %{origin_nice} %{majorver} + +%{java_jmods_rpo %{nil}} + +%description jmods +The JMods for %{origin_nice}. +%endif + +%if %{include_debug_build} +%package jmods-slowdebug +Summary: JMods for %{origin_nice} %{majorver} %{debug_on} + +%{java_jmods_rpo -- %{debug_suffix_unquoted}} + +%description jmods-slowdebug +The JMods for %{origin_nice} %{majorver}. +%{debug_warning} +%endif + +%if %{include_normal_build} +%package demo +Summary: %{origin_nice} Demos %{majorver} + +%{java_demo_rpo %{nil}} + +%description demo +The %{origin_nice} demos %{majorver}. +%endif + +%if %{include_debug_build} +%package demo-slowdebug +Summary: %{origin_nice} Demos %{majorver} %{debug_on} + +%{java_demo_rpo -- %{debug_suffix_unquoted}} + +%description demo-slowdebug +The %{origin_nice} demos %{majorver}. +%{debug_warning} +%endif + +%if %{include_normal_build} +%package src +Summary: %{origin_nice} Source Bundle %{majorver} + +%{java_src_rpo %{nil}} + +%description src +The java-%{origin}-src sub-package contains the complete %{origin_nice} %{majorver} +class library source code for use by IDE indexers and debuggers. +%endif + +%if %{include_debug_build} +%package src-slowdebug +Summary: %{origin_nice} Source Bundle %{majorver} %{for_debug} + +%{java_src_rpo -- %{debug_suffix_unquoted}} + +%description src-slowdebug +The java-%{origin}-src-slowdebug sub-package contains the complete %{origin_nice} %{majorver} + class library source code for use by IDE indexers and debuggers. Debugging %{for_debug}. +%endif + +%if %{include_normal_build} +%package javadoc +Summary: %{origin_nice} %{majorver} API documentation +Requires: javapackages-filesystem + +%{java_javadoc_rpo %{nil}} + +%description javadoc +The %{origin_nice} %{majorver} API documentation. +%endif + +%if %{include_normal_build} +%package javadoc-zip +Summary: %{origin_nice} %{majorver} API documentation compressed in single archive +Requires: javapackages-filesystem + +%{java_javadoc_rpo %{nil}} + +%description javadoc-zip +The %{origin_nice} %{majorver} API documentation compressed in single archive. +%endif + +%if %{include_debug_build} +%package javadoc-slowdebug +Summary: %{origin_nice} %{majorver} API documentation %{for_debug} +Requires: javapackages-filesystem + +%{java_javadoc_rpo -- %{debug_suffix_unquoted}} + +%description javadoc-slowdebug +The %{origin_nice} %{majorver} API documentation %{for_debug}. +%endif + +%if %{include_debug_build} +%package javadoc-zip-slowdebug +Summary: %{origin_nice} %{majorver} API documentation compressed in single archive %{for_debug} +Requires: javapackages-filesystem + +%{java_javadoc_rpo -- %{debug_suffix_unquoted}} + +%description javadoc-zip-slowdebug +The %{origin_nice} %{majorver} API documentation compressed in single archive %{for_debug}. +%endif + + +%prep +if [ %{include_normal_build} -eq 0 -o %{include_normal_build} -eq 1 ] ; then + echo "include_normal_build is %{include_normal_build}" +else + echo "include_normal_build is %{include_normal_build}, thats invalid. Use 1 for yes or 0 for no" + exit 11 +fi +if [ %{include_debug_build} -eq 0 -o %{include_debug_build} -eq 1 ] ; then + echo "include_debug_build is %{include_debug_build}" +else + echo "include_debug_build is %{include_debug_build}, thats invalid. Use 1 for yes or 0 for no" + exit 12 +fi +if [ %{include_debug_build} -eq 0 -a %{include_normal_build} -eq 0 ] ; then + echo "You have disabled both include_debug_build and include_normal_build. That is a no go." + exit 13 +fi +%setup -q -c -n %{uniquesuffix ""} -T -a 0 +#
https://bugzilla.redhat.com/show_bug.cgi?id=1189084
+prioritylength=`expr length %{priority}` +if [ $prioritylength -ne 8 ] ; then + echo "priority must be 8 digits in total, violated" + exit 14 +fi + +# OpenJDK patches + +# Remove libraries that are linked +sh %{SOURCE12} +pushd %{top_level_dir_name} +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +popd # openjdk + +%patch1000 + +# Extract systemtap tapsets +%if %{with_systemtap} +tar --strip-components=1 -x -I xz -f %{SOURCE8} +%if %{include_debug_build} +cp -r tapset tapset%{debug_suffix} +%endif + + +for suffix in %{build_loop} ; do + for file in "tapset"$suffix/*.in; do + OUTPUT_FILE=`echo $file | sed -e "s:\.stp\.in$:%{version}-%{release}.%{_arch}.stp:g"` + sed -e "s:@ABS_SERVER_LIBJVM_SO@:%{_jvmdir}/%{sdkdir -- $suffix}/lib/server/libjvm.so:g" $file > $file.1 +# TODO find out which architectures other than i686 have a client vm +%ifarch %{ix86} + sed -e "s:@ABS_CLIENT_LIBJVM_SO@:%{_jvmdir}/%{sdkdir -- $suffix}/lib/client/libjvm.so:g" $file.1 > $OUTPUT_FILE +%else + sed -e "/@ABS_CLIENT_LIBJVM_SO@/d" $file.1 > $OUTPUT_FILE +%endif + sed -i -e "s:@ABS_JAVA_HOME_DIR@:%{_jvmdir}/%{sdkdir -- $suffix}:g" $OUTPUT_FILE + sed -i -e "s:@INSTALL_ARCH_DIR@:%{archinstall}:g" $OUTPUT_FILE + sed -i -e "s:@prefix@:%{_jvmdir}/%{sdkdir -- $suffix}/:g" $OUTPUT_FILE + done +done +# systemtap tapsets ends +%endif + +# Prepare desktop files +for suffix in %{build_loop} ; do +for file in %{SOURCE9}; do + FILE=`basename $file | sed -e s:\.in$::g` + EXT="${FILE##*.}" + NAME="${FILE%.*}" + OUTPUT_FILE=$NAME$suffix.$EXT + sed -e "s:@JAVA_HOME@:%{sdkbindir -- $suffix}:g" $file > $OUTPUT_FILE + sed -i -e "s:@JRE_HOME@:%{jrebindir -- $suffix}:g" $OUTPUT_FILE + sed -i -e "s:@ARCH@:%{version}-%{release}.%{_arch}$suffix:g" $OUTPUT_FILE + sed -i -e "s:@JAVA_MAJOR_VERSION@:%{majorver}:g" $OUTPUT_FILE + sed -i -e "s:@JAVA_VENDOR@:%{origin}:g" $OUTPUT_FILE +done +done + +# Setup nss.cfg +sed -e "s:@NSS_LIBDIR@:%{NSS_LIBDIR}:g" %{SOURCE11} > nss.cfg + + +%build +# How many CPU's do we have? +export NUM_PROC=%(/usr/bin/getconf _NPROCESSORS_ONLN 2> /dev/null || :) +export NUM_PROC=${NUM_PROC:-1} +%if 0%{?_smp_ncpus_max} +# Honor %%_smp_ncpus_max +[ ${NUM_PROC} -gt %{?_smp_ncpus_max} ] && export NUM_PROC=%{?_smp_ncpus_max} +%endif + +%ifarch s390x sparc64 alpha %{power64} %{aarch64} +export ARCH_DATA_MODEL=64 +%endif +%ifarch alpha +export CFLAGS="$CFLAGS -mieee" +%endif + +# We use ourcppflags because the OpenJDK build seems to +# pass EXTRA_CFLAGS to the HotSpot C++ compiler... +# Explicitly set the C++ standard as the default has changed on GCC >= 6 +EXTRA_CFLAGS="%ourcppflags -std=gnu++98 -Wno-error -fno-delete-null-pointer-checks -fno-lifetime-dse" +EXTRA_CPP_FLAGS="%ourcppflags -std=gnu++98 -fno-delete-null-pointer-checks -fno-lifetime-dse" + +%ifarch %{power64} ppc +# fix rpmlint warnings +EXTRA_CFLAGS="$EXTRA_CFLAGS -fno-strict-aliasing" +%endif +export EXTRA_CFLAGS + +for suffix in %{build_loop} ; do +if [ "x$suffix" = "x" ] ; then + debugbuild=release +else + # change --something to something + debugbuild=`echo $suffix | sed "s/-//g"` +fi + +# Variable used in hs_err hook on build failures +top_dir_abs_path=$(pwd)/%{top_level_dir_name} + +mkdir -p %{buildoutputdir -- $suffix} +pushd %{buildoutputdir -- $suffix} + +bash ../configure \ +%ifnarch %{jit_arches} + --with-jvm-variants=zero \ +%endif +%ifarch %{ppc64le} + --with-jobs=1 \ +%endif + --with-version-build=%{buildver} \ + --with-version-pre="" \ + --with-version-opt=%{lts_designator} \ + --with-vendor-version-string="%{vendor_version_string}" \ + --with-boot-jdk=/usr/lib/jvm/java-%{buildjdkver}-openjdk \ + --with-debug-level=$debugbuild \ + --with-native-debug-symbols=internal \ + --enable-unlimited-crypto \ + --enable-system-nss \ + --with-zlib=system \ + --with-libjpeg=system \ + --with-giflib=system \ + --with-libpng=system \ + --with-lcms=system \ + --with-stdc++lib=dynamic \ + --with-extra-cxxflags="$EXTRA_CPP_FLAGS" \ + --with-extra-cflags="$EXTRA_CFLAGS" \ + --with-extra-ldflags="%{ourldflags}" \ + --with-num-cores="$NUM_PROC" \ + --disable-javac-server \ +%ifarch x86_64 + --with-jvm-features=zgc \ +%endif + --disable-warnings-as-errors + +# use --no-print-directory as workaround for build failure +#
https://bugs.openjdk.java.net/browse/JDK-8215213
+make --no-print-directory \ + JAVAC_FLAGS=-g \ + LOG=trace \ + WARNINGS_ARE_ERRORS="-Wno-error" \ + CFLAGS_WARNINGS_ARE_ERRORS="-Wno-error" \ + %{targets} || ( pwd; find $top_dir_abs_path -name "hs_err_pid*.log" | xargs cat && false ) + +make docs-zip + +# the build (erroneously) removes read permissions from some jars +# this is a regression in OpenJDK 7 (our compiler): +#
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1437
+find images/%{jdkimage} -iname '*.jar' -exec chmod ugo+r {} \; + +# Build screws up permissions on binaries +#
https://bugs.openjdk.java.net/browse/JDK-8173610
+find images/%{jdkimage} -iname '*.so' -exec chmod +x {} \; +find images/%{jdkimage}/bin/ -exec chmod +x {} \; + +popd >& /dev/null + +# Install nss.cfg right away as we will be using the JRE above +export JAVA_HOME=$(pwd)/%{buildoutputdir -- $suffix}/images/%{jdkimage} + +# Install nss.cfg right away as we will be using the JRE above +install -m 644 nss.cfg $JAVA_HOME/conf/security/ + +# Use system-wide tzdata +rm $JAVA_HOME/lib/tzdb.dat +ln -s %{_datadir}/javazi-1.8/tzdb.dat $JAVA_HOME/lib/tzdb.dat + +# build cycles +done + +%check + +# We test debug first as it will give better diagnostics on a crash +for suffix in %{rev_build_loop} ; do + +export JAVA_HOME=$(pwd)/%{buildoutputdir -- $suffix}/images/%{jdkimage} + +#check sheandoah is enabled +%if %{use_shenandoah_hotspot} +$JAVA_HOME//bin/java -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -version +%endif + +# Check unlimited policy has been used +$JAVA_HOME/bin/javac -d . %{SOURCE13} +$JAVA_HOME/bin/java --add-opens java.base/javax.crypto=ALL-UNNAMED TestCryptoLevel + +# Check ECC is working +$JAVA_HOME/bin/javac -d . %{SOURCE14} +$JAVA_HOME/bin/java $(echo $(basename %{SOURCE14})|sed "s|\.java||") + +# Check debug symbols are present and can identify code +find "$JAVA_HOME" -iname '*.so' -print0 | while read -d $'\0' lib +do + if [ -f "$lib" ] ; then + echo "Testing $lib for debug symbols" + # All these tests rely on RPM failing the build if the exit code of any set + # of piped commands is non-zero. + + # Test for .debug_* sections in the shared object. This is the main test + # Stripped objects will not contain these + eu-readelf -S "$lib" | grep "] .debug_" + test $(eu-readelf -S "$lib" | grep -E "\]\ .debug_(info|abbrev)" | wc --lines) == 2 + + # Test FILE symbols. These will most likely be removed by anything that + # manipulates symbol tables because it's generally useless. So a nice test + # that nothing has messed with symbols + old_IFS="$IFS" + IFS=$'\n' + for line in $(eu-readelf -s "$lib" | grep "00000000 0 FILE LOCAL DEFAULT") + do + # We expect to see .cpp files, except for architectures like aarch64 and + # s390 where we expect .o and .oS files + echo "$line" | grep -E "ABS ((.*/)?[-_a-zA-Z0-9]+\.(c|cc|cpp|cxx|o|oS))?$" + done + IFS="$old_IFS" + + # If this is the JVM, look for javaCalls.(cpp|o) in FILEs, for extra sanity checking + if [ "`basename $lib`" = "libjvm.so" ]; then + eu-readelf -s "$lib" | \ + grep -E "00000000 0 FILE LOCAL DEFAULT ABS javaCalls.(cpp|o)$" + fi + + # Test that there are no .gnu_debuglink sections pointing to another + # debuginfo file. There shouldn't be any debuginfo files, so the link makes + # no sense either + eu-readelf -S "$lib" | grep 'gnu' + if eu-readelf -S "$lib" | grep '] .gnu_debuglink' | grep PROGBITS; then + echo "bad .gnu_debuglink section." + eu-readelf -x .gnu_debuglink "$lib" + false + fi + fi +done + +# Make sure gdb can do a backtrace based on line numbers on libjvm.so +# javaCalls.cpp:58 should map to: +#
http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/file/ff3b27e6bcc2/src/share/…
+# Using line number 1 might cause build problems. See: +#
https://bugzilla.redhat.com/show_bug.cgi?id=1539664
+#
https://bugzilla.redhat.com/show_bug.cgi?id=1538767
+gdb -q "$JAVA_HOME/bin/java" <<EOF | tee gdb.out +handle SIGSEGV pass nostop noprint +handle SIGILL pass nostop noprint +set breakpoint pending on +break javaCalls.cpp:1 +commands 1 +backtrace +quit +end +run -version +EOF +grep 'JavaCallWrapper::JavaCallWrapper' gdb.out + +# Check src.zip has all sources. See RHBZ#1130490 +jar -tf $JAVA_HOME/lib/src.zip | grep 'sun.misc.Unsafe' + +# Check class files include useful debugging information +$JAVA_HOME/bin/javap -l java.lang.Object | grep "Compiled from" +$JAVA_HOME/bin/javap -l java.lang.Object | grep LineNumberTable +$JAVA_HOME/bin/javap -l java.lang.Object | grep LocalVariableTable + +# Check generated class files include useful debugging information +$JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep "Compiled from" +$JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep LineNumberTable +$JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep LocalVariableTable + +# build cycles check +done + +%install +STRIP_KEEP_SYMTAB=libjvm* + +for suffix in %{build_loop} ; do + +# Install the jdk +mkdir -p $RPM_BUILD_ROOT%{_jvmdir} +cp -a %{buildoutputdir -- $suffix}/images/%{jdkimage} \ + $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix} + +# Install jsa directories so we can owe them +mkdir -p $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}/lib/%{archinstall}/server/ +mkdir -p $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}/lib/%{archinstall}/client/ +mkdir -p $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}/lib/client/ || true ; # sometimes is here, sometimes not, ifout it or || true it out + +pushd %{buildoutputdir $suffix}/images/%{jdkimage} + +%if %{with_systemtap} + # Install systemtap support files + install -dm 755 $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}/tapset + # note, that uniquesuffix is in BUILD dir in this case + cp -a $RPM_BUILD_DIR/%{uniquesuffix ""}/tapset$suffix/*.stp $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}/tapset/ + pushd $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}/tapset/ + tapsetFiles=`ls *.stp` + popd + install -d -m 755 $RPM_BUILD_ROOT%{tapsetdir} + for name in $tapsetFiles ; do + targetName=`echo $name | sed "s/.stp/$suffix.stp/"` + ln -sf %{_jvmdir}/%{sdkdir -- $suffix}/tapset/$name $RPM_BUILD_ROOT%{tapsetdir}/$targetName + done +%endif + + # Remove empty cacerts database + rm -f $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}/lib/security/cacerts + # Install cacerts symlink needed by some apps which hard-code the path + pushd $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}/lib/security + ln -sf /etc/pki/java/cacerts . + popd + + # Install version-ed symlinks + pushd $RPM_BUILD_ROOT%{_jvmdir} + ln -sf %{sdkdir -- $suffix} %{jrelnk -- $suffix} + popd + + + # Install man pages + install -d -m 755 $RPM_BUILD_ROOT%{_mandir}/man1 + for manpage in man/man1/* + do + # Convert man pages to UTF8 encoding + iconv -f ISO_8859-1 -t UTF8 $manpage -o $manpage.tmp + mv -f $manpage.tmp $manpage + install -m 644 -p $manpage $RPM_BUILD_ROOT%{_mandir}/man1/$(basename \ + $manpage .1)-%{uniquesuffix -- $suffix}.1 + done + # Remove man pages from jdk image + rm -rf $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}/man + +popd + + +# Install Javadoc documentation +install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir} +cp -a %{buildoutputdir -- $suffix}/images/docs $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir -- $suffix} +cp -a %{buildoutputdir -- $suffix}/bundles/jdk-%{majorver}+%{buildver}%{lts_designator_zip}-docs.zip $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir -- $suffix}.zip + +# Install icons and menu entries +for s in 16 24 32 48 ; do + install -D -p -m 644 \ + %{top_level_dir_name}/src/java.desktop/unix/classes/sun/awt/X11/java-icon${s}.png \ + $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${s}x${s}/apps/java-%{javaver}-%{origin}.png +done + +# Install desktop files +install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/{applications,pixmaps} +for e in jconsole$suffix ; do + desktop-file-install --vendor=%{uniquesuffix -- $suffix} --mode=644 \ + --dir=$RPM_BUILD_ROOT%{_datadir}/applications $e.desktop +done + +# Install /etc/.java/.systemPrefs/ directory +# See
https://bugzilla.redhat.com/show_bug.cgi?id=741821
+mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/.java/.systemPrefs + +# copy samples next to demos; samples are mostly js files +cp -r %{top_level_dir_name}/src/sample $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/ + + +# moving config files to /etc +mkdir -p $RPM_BUILD_ROOT/%{etcjavadir -- $suffix} +mkdir -p $RPM_BUILD_ROOT/%{etcjavadir -- $suffix}/lib +mv $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/conf/ $RPM_BUILD_ROOT/%{etcjavadir -- $suffix} +mv $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/lib/security $RPM_BUILD_ROOT/%{etcjavadir -- $suffix}/lib +pushd $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix} + ln -s %{etcjavadir -- $suffix}/conf ./conf +popd +pushd $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/lib + ln -s %{etcjavadir -- $suffix}/lib/security ./security +popd +# end moving files to /etc + +# stabilize permissions +find $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/ -name "*.so" -exec chmod 755 {} \; ; +find $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/ -type d -exec chmod 755 {} \; ; +find $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/legal -type f -exec chmod 644 {} \; ; + +# end, dual install +done + +%if %{include_normal_build} +# intentionally only for non-debug +%pretrans headless -p <lua> +-- see
https://bugzilla.redhat.com/show_bug.cgi?id=1038092
for whole issue +-- see
https://bugzilla.redhat.com/show_bug.cgi?id=1290388
for pretrans over pre +-- if copy-jdk-configs is in transaction, it installs in pretrans to temp +-- if copy_jdk_configs is in temp, then it means that copy-jdk-configs is in transaction and so is +-- preferred over one in %%{_libexecdir}. If it is not in transaction, then depends +-- whether copy-jdk-configs is installed or not. If so, then configs are copied +-- (copy_jdk_configs from %%{_libexecdir} used) or not copied at all +local posix = require "posix" +local debug = false + +SOURCE1 = "%{rpm_state_dir}/copy_jdk_configs.lua" +SOURCE2 = "%{_libexecdir}/copy_jdk_configs.lua" + +local stat1 = posix.stat(SOURCE1, "type"); +local stat2 = posix.stat(SOURCE2, "type"); + + if (stat1 ~= nil) then + if (debug) then + print(SOURCE1 .." exists - copy-jdk-configs in transaction, using this one.") + end; + package.path = package.path .. ";" .. SOURCE1 +else + if (stat2 ~= nil) then + if (debug) then + print(SOURCE2 .." exists - copy-jdk-configs already installed and NOT in transaction. Using.") + end; + package.path = package.path .. ";" .. SOURCE2 + else + if (debug) then + print(SOURCE1 .." does NOT exists") + print(SOURCE2 .." does NOT exists") + print("No config files will be copied") + end + return + end +end +-- run content of included file with fake args +arg = {"--currentjvm", "%{uniquesuffix %{nil}}", "--jvmdir", "%{_jvmdir %{nil}}", "--origname", "%{name}", "--origjavaver", "%{javaver}", "--arch", "%{_arch}", "--temp", "%{rpm_state_dir}/%{name}.%{_arch}"} +require "copy_jdk_configs.lua" + +%post +%{post_script %{nil}} + +%post headless +%{post_headless %{nil}} + +%postun +%{postun_script %{nil}} + +%postun headless +%{postun_headless %{nil}} + +%posttrans +%{posttrans_script %{nil}} + +%post devel +%{post_devel %{nil}} + +%postun devel +%{postun_devel %{nil}} + +%posttrans devel +%{posttrans_devel %{nil}} + +%post javadoc +%{post_javadoc %{nil}} + +%postun javadoc +%{postun_javadoc %{nil}} + +%post javadoc-zip +%{post_javadoc_zip %{nil}} + +%postun javadoc-zip +%{postun_javadoc_zip %{nil}} +%endif + +%if %{include_debug_build} +%post slowdebug +%{post_script -- %{debug_suffix_unquoted}} + +%post headless-slowdebug +%{post_headless -- %{debug_suffix_unquoted}} + +%postun slowdebug +%{postun_script -- %{debug_suffix_unquoted}} + +%postun headless-slowdebug +%{postun_headless -- %{debug_suffix_unquoted}} + +%posttrans slowdebug +%{posttrans_script -- %{debug_suffix_unquoted}} + +%post devel-slowdebug +%{post_devel -- %{debug_suffix_unquoted}} + +%postun devel-slowdebug +%{postun_devel -- %{debug_suffix_unquoted}} + +%posttrans devel-slowdebug +%{posttrans_devel -- %{debug_suffix_unquoted}} + +%post javadoc-slowdebug +%{post_javadoc -- %{debug_suffix_unquoted}} + +%postun javadoc-slowdebug +%{postun_javadoc -- %{debug_suffix_unquoted}} + +%post javadoc-zip-slowdebug +%{post_javadoc_zip -- %{debug_suffix_unquoted}} + +%postun javadoc-zip-slowdebug +%{postun_javadoc_zip -- %{debug_suffix_unquoted}} +%endif + +%if %{include_normal_build} +%files +# main package builds always +%{files_jre %{nil}} +%else +%files +# placeholder +%endif + + +%if %{include_normal_build} +%files headless +# important note, see
https://bugzilla.redhat.com/show_bug.cgi?id=1038092
for whole issue +# all config/noreplace files (and more) have to be declared in pretrans. See pretrans +%{files_jre_headless %{nil}} + +%files devel +%{files_devel %{nil}} + +%files jmods +%{files_jmods %{nil}} + +%files demo +%{files_demo %{nil}} + +%files src +%{files_src %{nil}} + +%files javadoc +%{files_javadoc %{nil}} + +# this puts huge file to /usr/share +# unluckily it is really a documentation file +# and unluckily it really is architecture-dependent, as eg. aot and grail are now x86_64 only +# same for debug variant +%files javadoc-zip +%{files_javadoc_zip %{nil}} +%endif + +%if %{include_debug_build} +%files slowdebug +%{files_jre -- %{debug_suffix_unquoted}} + +%files headless-slowdebug +%{files_jre_headless -- %{debug_suffix_unquoted}} + +%files devel-slowdebug +%{files_devel -- %{debug_suffix_unquoted}} + +%files jmods-slowdebug +%{files_jmods -- %{debug_suffix_unquoted}} + +%files demo-slowdebug +%{files_demo -- %{debug_suffix_unquoted}} + +%files src-slowdebug +%{files_src -- %{debug_suffix_unquoted}} + +%files javadoc-slowdebug +%{files_javadoc -- %{debug_suffix_unquoted}} + +%files javadoc-zip-slowdebug +%{files_javadoc_zip -- %{debug_suffix_unquoted}} +%endif + + +%changelog +* Thu Mar 21 2019 Petra Mikova <pmikova(a)redhat.com - 1:12.0.0.33-3.rolling +- Replaced pcsc-lite-devel (which is in optional channel) with pcsc-lite-libs. +- added rh1684077-openjdk_should_depend_on_pcsc-lite-libs_instead_of_pcsc-lite-devel.patch to make jdk work with pcsc +- removed LTS string from LTS designator, because epel builds get identified as rhel and JDK 12 is not LTS +- removed duplicated dependency on lksctp-tools + +* Wed Mar 20 2019 Peter Robinson <pbrobinson(a)fedoraproject.org> 1:12.0.0.33-2.ea.1.rolling +- Drop chkconfig dep, 1.7 shipped in f24 + +* Thu Mar 07 2019 Petra Mikova <pmikova(a)redhat.com> - 1:12.0.0.33-1.ea.1.rolling +- bumped sources to jdk12+33 + +* Mon Feb 11 2019 Severin Gehwolf <sgehwolf(a)redhat.com> - 1:12.0.0.30-1.ea.1.rolling +- Only build 'bootcycle-images docs' target and 'images docs' targets, respectively. + +* Fri Feb 01 2019 Fedora Release Engineering <releng(a)fedoraproject.org> - 1:12.0.0.25-0.ea.1.rolling.1 +- Rebuilt for
https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
+ +* Fri Dec 21 2018 Jiri Vanek <jvanek(a)redhat.com> - 1:12.0.0.25-0.ea.1.rolling +- bumped sources to jdk12. Crypto list synced. +- adapted patches to usptream (removed are upstreamed) +- removed fixed upstreamed patch6, jdk8211105-aarch64-disable_cos_sin_and_log_intrinsics.patch: +- renamed patch5, pr1983-rh1565658-..._sunec_provider_jdk11.patch to pr1983-rh1565658-..._sunec_provider_jdk12.patch +- adapted patch5, pr1983-rh1565658 to jdk12 (libraries.m4 and /Lib-jdk.crypto.ec.gmk) +- removed patch8, jdk8210416-rh1632174-compile_fdlibm_with_o2_ffp_contract_off_on_gcc_clang_arches.patch +- removed patch9, jdk8210425-rh1632174-sharedRuntimeTrig_sharedRuntimeTrans_compiled_without_optimization.patch +- removed patch10, jdk8210647-rh1632174. Is rummored to be in upstream +- removed patch11, jdk8210761-rh1632174-libjsig_is_being_compiled_without_optimization.patch +- removed patch12, jdk8210703-rh1632174-vmStructs_cpp_no_longer_compiled_with_o0 +- removed patch584, jdk8209639-rh1640127-02-coalesce_attempted_spill_non_spillable.patch +- removed patch585, jdk8209639-rh1640127-02-coalesce_attempted_spill_non_spillable.patch +- set build jdk to jdk11; buildjdkver set to 11 +- todo, revisit _privatelibs and slaves, discuse patch10, more? +- now building with --no-print-directory to workaround JDK8215213 +- renamed original of docs zip to jdk-major+build +- check shenandaoh with -XX:+UnlockExperimentalVMOptions +- libjli moved from lib/libjli to lib +- added lib/jspawnhelper and bin/jfr and conf/sdp/sdp.conf.template +- added explanation to the --no-print-directory +- re-added lts_designator_zip macro +- added patch6 for rh1673833-remove_removal_of_wformat_during_test_compilation.patch + +* Wed Dec 5 2018 Jiri Vanek <jvanek(a)redhat.com> - 1:11.0.1.13-10.rolling +- for non debug supackages, ghosted all masters and slaves (rhbz1649776) +- for tech-preview packages, if-outed versionless provides. Aligned versions to be %%{epoch}:%%{version}-%%{release} instead of chaotic +- Removed all slowdebug provides (rhbz1655938); for tech-preview packages also removed all internal provides + +* Tue Dec 04 2018 Severin Gehwolf <sgehwolf(a)redhat.com> - 1:11.0.1.13-9 +- Added %%global _find_debuginfo_opts -g +- Resolves: RHBZ#1520879 (Detailed NMT issue) + +* Fri Nov 30 2018 Jiri Vanek <jvanek(a)redhat.com> - 1:11.0.1.13-8 +- added rolling suffix to release (before dist) to prevent conflict with java-11-openjdk which now have same major version + +* Mon Nov 12 2018 Jiri Vanek <jvanek(a)redhat.com> - 1:11.0.1.13-6 +- fixed tck failures of arraycopy and process exec with shenandoah on +- added patch585 rh1648995-shenandoah_array_copy_broken_by_not_always_copy_forward_for_disjoint_arrays.patch + +* Wed Nov 07 2018 Jiri Vanek <jvanek(a)redhat.com> - 1:11.0.1.13-5 +- headless' suggests of cups, replaced by Requires of cups-libs + +* Thu Nov 01 2018 Jiri Vanek <jvanek(a)redhat.com> - 1:11.0.1.13-3 +- added Patch584 jdk8209639-rh1640127-02-coalesce_attempted_spill_non_spillable.patch + +* Mon Oct 29 2018 Severin Gehwolf <sgehwolf(a)redhat.com> - 1:11.0.1.13-3 +- Use upstream's version of Aarch64 intrinsics disable patch: + - Removed: + RHBZ-1628612-JDK-8210461-workaround-disable-aarch64-intrinsic.patch + RHBZ-1630996-JDK-8210858-workaround-disable-aarch64-intrinsic-log.patch + - Superceded by: + jdk8211105-aarch64-disable_cos_sin_and_log_intrinsics.patch + +* Thu Oct 18 2018 Severin Gehwolf <sgehwolf(a)redhat.com> - 1:11.0.1.13-2 +- Use LTS designator in version output for RHEL. + +* Thu Oct 18 2018 Severin Gehwolf <sgehwolf(a)redhat.com> - 1:11.0.1.13-1 +- Update to October 2018 CPU release, 11.0.1+13. + +* Wed Oct 17 2018 Severin Gehwolf <sgehwolf(a)redhat.com> - 1:11.0.0.28-2 +- Use --with-vendor-version-string=18.9 so as to show original + GA date for the JDK. + +* Fri Sep 28 2018 Severin Gehwolf <sgehwolf(a)redhat.com> - 1:11.0.0.28-1 +- Identify as GA version and no longer as early access (EA). +- JDK 11 has been released for GA on 2018-09-25. + +* Fri Sep 28 2018 Severin Gehwolf <sgehwolf(a)redhat.com> - 1:11.0.ea.28-9 +- Rework changes from 1:11.0.ea.22-6. RHBZ#1632174 supercedes + RHBZ-1624122. +- Add patch, jdk8210416-rh1632174-compile_fdlibm_with_o2_ffp_contract_off_on_gcc_clang_arches.patch, so as to + optimize compilation of fdlibm library. +- Add patch, jdk8210425-rh1632174-sharedRuntimeTrig_sharedRuntimeTrans_compiled_without_optimization.patch, so + as to optimize compilation of sharedRuntime{Trig,Trans}.cpp +- Add patch, jdk8210647-rh1632174-libsaproc_is_being_compiled_without_optimization.patch, so as to + optimize compilation of libsaproc (extra c flags won't override + optimization). +- Add patch, jdk8210761-rh1632174-libjsig_is_being_compiled_without_optimization.patch, so as to + optimize compilation of libjsig. +- Add patch, jdk8210703-rh1632174-vmStructs_cpp_no_longer_compiled_with_o0, so as to + optimize compilation of vmStructs.cpp (part of libjvm.so). +- Reinstate filtering of opt flags coming from redhat-rpm-config. + +* Thu Sep 27 2018 Jiri Vanek <jvanek(a)redhat.com> - 1:11.0.ea.28-8 +- removed version less provides +- javadocdir moved to arched dir as it is no longer noarch + +* Thu Sep 20 2018 Severin Gehwolf <sgehwolf(a)redhat.com> - 1:11.0.ea.28-6 +- Add patch, RHBZ-1630996-JDK-8210858-workaround-disable-aarch64-intrinsic-log.patch, + so as to disable log math intrinsic on aarch64. Work-around for + JDK-8210858 + +* Thu Sep 13 2018 Severin Gehwolf <sgehwolf(a)redhat.com> - 1:11.0.ea.28-5 +- Add patch, RHBZ-1628612-JDK-8210461-workaround-disable-aarch64-intrinsic.patch, + so as to disable dsin/dcos math intrinsics on aarch64. Work-around for + JDK-8210461. + +* Wed Sep 12 2018 Severin Gehwolf <sgehwolf(a)redhat.com> - 1:11.0.ea.22-6 +- Add patch, JDK-8210416-RHBZ-1624122-fdlibm-opt-fix.patch, so as to + optimize compilation of fdlibm library. +- Add patch, JDK-8210425-RHBZ-1624122-sharedRuntimeTrig-opt-fix.patch, so + as to optimize compilation of sharedRuntime{Trig,Trans}.cpp +- Add patch, JDK-8210647-RHBZ-1624122-libsaproc-opt-fix.patch, so as to + optimize compilation of libsaproc (extra c flags won't override + optimization). +- Add patch, JDK-8210703-RHBZ-1624122-vmStructs-opt-fix.patch, so as to + optimize compilation of vmStructs.cpp (part of libjvm.so). +- No longer filter -O flags from C flags coming from + redhat-rpm-config. + +* Mon Sep 10 2018 Jiri Vanek <jvanek(a)redhat.com> - 1:11.0.ea.28-4 +- link to jhsdb followed its file to ifarch jit_arches ifnarch s390x + +* Fri Sep 7 2018 Severin Gehwolf <sgehwolf(a)redhat.com> - 1:11.0.ea.28-3 +- Enable ZGC on x86_64. + +* Tue Sep 4 2018 Jiri Vanek <jvanek(a)redhat.com> - 1:11.0.ea.28-2 +- jfr/*jfc files listed for all arches +- lib/classlist do not exists s390, ifarch-ed via jit_arches out + +* Fri Aug 31 2018 Severin Gehwolf <sgehwolf(a)redhat.com> - 1:11.0.ea.28-1 +- Update to latest upstream build jdk11+28, the first release + candidate. + +* Wed Aug 29 2018 Severin Gehwolf <sgehwolf(a)redhat.com> - 1:11.0.ea.22-8 +- Adjust system NSS patch, pr1983-rh1565658-support_using_the_system_installation_of_nss_with_the_sunec_provider_jdk11.patch, so + as to filter -Wl,--as-needed from linker flags. Fixes FTBFS issue. + +* Thu Aug 23 2018 Jiri Vanek <jvanek(a)redhat.com> - 1:11.0.ea.22-6 +- dissabled accessibility, fixed provides for main package's debug variant + +* Mon Jul 30 2018 Jiri Vanek <jvanek(a)redhat.com> - 1:11.0.ea.22-5 +- now buildrequires javapackages-filesystem as the issue with macros should be fixed + +* Wed Jul 18 2018 Jiri Vanek <jvanek(a)redhat.com> - 1:11.0.ea.22-2 +- changed to build by itself instead of by jdk10 + +* Tue Jul 17 2018 Jiri Vanek <jvanek(a)redhat.com> - 1:11.0.ea.22-1 +- added Recommends gtk3 for main package +- changed BuildRequires from gtk2-devel to gtk3-devel (it can be more likely dropped) +- added Suggests lksctp-tools, pcsc-lite-devel, cups for headless package +- see RHBZ1598152 +- added trick to catch hs_err files (sgehwolf) +- updated to shenandaoh-jdk-11+22 + +* Sat Jul 07 2018 Jiri Vanek <jvanek(a)redhat.com> - 1:11.0.ea.20-1 +- removed patch6 JDK-8205616-systemLcmsAndJpgFixFor-rev_f0aeede1b855.patch +- improved a bit generate_source_tarball.sh to serve also for systemtap +- thus deleted generate_tapsets.sh +- simplified and cleared update_package.sh +- moved to single source jdk - from shenandoah/jdk11 +- bumped to latest jdk11+20 +- adapted PR2126 to jdk11+20 +- adapted handling of systemtap sources to new style +- (no (misleading) version inside (full version is in name), thus different sed on tapsets and different directory) +- shortened summaries and descriptions to around 80 chars +- Hunspell spell checked +- license fixed to correct jdk11 (sgehwolf) +- more correct handling of internal libraries (sgehwolf) +- added lib/security/public_suffix_list.dat as +20 have added it (JDK-8201815) +- added test for shenandaoh GC presence where expected +- Removed workaround for broken aarch64 slowdebug build +- Removed all defattrs +- Removed no longer necessary cleanup of diz and debuginfo files + +* Fri Jun 22 2018 Jiri Vanek <jvanek(a)redhat.com> - 1:11.0.ea.19-1 +- updated sources to jdk-11+19 +- added patch6 systemLcmsAndJpgFixFor-f0aeede1b855.patch to fix regression of system libraries after f0aeede1b855 commit +- adapted pr1983-rh1565658-support_using_the_system_installation_of_nss_with_the_sunec_provider_jdk11.patch to accommodate changes after f0aeede1b855 commit + +* Thu Jun 14 2018 Severin Gehwolf <sgehwolf(a)redhat.com> - 1:11.0.ea.16-5 +- Revert rename: java-11-openjdk => java-openjdk. + +* Wed Jun 13 2018 Severin Gehwolf <sgehwolf(a)redhat.com> - 1:11.0.ea.16-4 +- Add aarch64 to aot_arches. + +* Wed Jun 13 2018 Severin Gehwolf <sgehwolf(a)redhat.com> - 1:11.0.ea.16-3 +- Rename to package java-11-openjdk. + +* Wed Jun 13 2018 Severin Gehwolf <sgehwolf(a)redhat.com> - 1:11.0.ea.16-2 +- Disable Aarch64 slowdebug build (see JDK-8204331). +- s390x doesn't have the SA even though it's a JIT arch. + +* Wed Jun 13 2018 Severin Gehwolf <sgehwolf(a)redhat.com> - 1:11.0.ea.16-1 +- Initial version of JDK 11 ea based on tag jdk-11+16. +- Removed patches no longer needed or upstream: + sorted-diff.patch (see JDK-8198844) + JDK-8201788-bootcycle-images-jobs.patch + JDK-8201509-s390-atomic_store.patch + JDK-8202262-libjsig.so-extra-link-flags.patch (never was an issue on 11) + JDK-8193802-npe-jar-getVersionMap.patch +- Updated and renamed patches: + java-openjdk-s390-size_t.patch => JDK-8203030-s390-size_t.patch +- Updated patches for JDK 11: + pr1983-rh1565658-support_using_the_system_installation_of_nss_with_the_sunec_provider_jdk11.patch + +* Tue Jun 12 2018 Severin Gehwolf <sgehwolf(a)redhat.com> - 1:10.0.1.10-9 +- Use proper private_libs expression for filtering requires/provides. + +* Fri Jun 08 2018 Severin Gehwolf <sgehwolf(a)redhat.com> - 1:10.0.1.10-8 +- Bump release and rebuild for fixed gdb. See RHBZ#1589118. + +* Mon Jun 04 2018 Jiri Vanek <jvanek(a)redhat.com> - 1:10.0.1.10-7 +- quoted sed expressions, changed possibly confusing # by @ +- added vendor(origin) into icons +- removed last trace of relative symlinks +- added BuildRequires of javapackages-tools to fix build failure after Requires change to javapackages-filesystem + +* Thu May 17 2018 Severin Gehwolf <sgehwolf(a)redhat.com> - 1:10.0.1.10-5 +- Move to javapackages-filesystem for directory ownership. + Resolves RHBZ#1500288 + +* Mon Apr 30 2018 Severin Gehwolf <sgehwolf(a)redhat.com> - 1:10.0.1.10-4 +- Add JDK-8193802-npe-jar-getVersionMap.patch so as to fix + RHBZ#1557375. + +* Mon Apr 23 2018 Severin Gehwolf <sgehwolf(a)redhat.com> - 1:10.0.1.10-3 +- Inject build flags properly. See RHBZ#1571359 +- Added patch JDK-8202262-libjsig.so-extra-link-flags.patch + since libjsig.so doesn't get linker flags injected properly. + +* Fri Apr 20 2018 Severin Gehwolf <sgehwolf(a)redhat.com> - 1:10.0.1.10-2 +- Removed unneeded patches: + PStack-808293.patch + multiple-pkcs11-library-init.patch + ppc_stack_overflow_fix.patch +- Added patches for s390 Zero builds: + JDK-8201495-s390-java-opts.patch + JDK-8201509-s390-atomic_store.patch +- Renamed patches for clarity: + aarch64BuildFailure.patch => JDK-8200556-aarch64-slowdebug-crash.patch + systemCryptoPolicyPR3183.patch => pr3183-rh1340845-support_fedora_rhel_system_crypto_policy.patch + bootcycle_jobs.patch => JDK-8201788-bootcycle-images-jobs.patch + system-nss-ec-rh1565658.patch => pr1983-rh1565658-support_using_the_system_installation_of_nss_with_the_sunec_provider_jdk11.patch + +* Fri Apr 20 2018 Jiri Vanek <jvanek(a)redhat.com> - 1:10.0.1.10-1 +- updated to security update 1 +- jexec unlinked from path +- used java-openjdk as boot jdk +- aligned provides/requires +- renamed zip javadoc + +* Tue Apr 10 2018 Severin Gehwolf <sgehwolf(a)redhat.com> - 1:10.0.0.46-12 +- Enable basic EC ciphers test in %check. + +* Tue Apr 10 2018 Severin Gehwolf <sgehwolf(a)redhat.com> - 1:10.0.0.46-11 +- Port Martin Balao's JDK 9 patch for system NSS support to JDK 10. +- Resolves RHBZ#1565658 + +* Mon Apr 09 2018 Jiri Vanek <jvanek(a)redhat.com> - 1:10.0.0.46-10 +- jexec linked to path + +* Fri Apr 06 2018 Jiri Vanek <jvanek(a)redhat.com> - 1:10.0.0.46-9 +- subpackage(s) replaced by sub-package(s) and other cosmetic changes + +* Tue Apr 03 2018 Jiri Vanek <jvanek(a)redhat.com> - 1:10.0.0.46-8 +- removed accessibility sub-packages +- kept applied patch and properties files +- debug sub-packages renamed to slowdebug + +* Fri Feb 23 2018 Jiri Vanek <jvanek(a)redhat.com> - 1:10.0.0.46-1 +- initial load diff --git a/jconsole.desktop.in b/jconsole.desktop.in new file mode 100644 index 0000000..a8917c1 --- /dev/null +++ b/jconsole.desktop.in @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=OpenJDK @JAVA_MAJOR_VERSION@ Monitoring & Management Console @ARCH@ +Comment=Monitor and manage OpenJDK @JAVA_MAJOR_VERSION@ applications for @ARCH@ +Exec=@JAVA_HOME@/jconsole +Icon=java-@JAVA_MAJOR_VERSION@-@JAVA_VENDOR@ +Terminal=false +Type=Application +StartupWMClass=sun-tools-jconsole-JConsole +Categories=Development;Profiling;Java; +Version=1.0 diff --git a/nss.cfg.in b/nss.cfg.in new file mode 100644 index 0000000..377a39c --- /dev/null +++ b/nss.cfg.in @@ -0,0 +1,5 @@ +name = NSS +nssLibraryDirectory = @NSS_LIBDIR@ +nssDbMode = noDb +attributes = compatibility +handleStartupErrors = ignoreMultipleInitialisation diff --git a/pr1983-rh1565658-support_using_the_system_installation_of_nss_with_the_sunec_provider_jdk12.patch b/pr1983-rh1565658-support_using_the_system_installation_of_nss_with_the_sunec_provider_jdk12.patch new file mode 100644 index 0000000..edd3480 --- /dev/null +++ b/pr1983-rh1565658-support_using_the_system_installation_of_nss_with_the_sunec_provider_jdk12.patch @@ -0,0 +1,649 @@ +diff --git a/make/autoconf/jdk-options.m4 b/make/autoconf/jdk-options.m4 +--- a/make/autoconf/jdk-options.m4 ++++ b/make/autoconf/jdk-options.m4 +@@ -267,9 +267,10 @@ + # + AC_DEFUN_ONCE([JDKOPT_DETECT_INTREE_EC], + [ ++ AC_REQUIRE([LIB_SETUP_MISC_LIBS]) + AC_MSG_CHECKING([if elliptic curve crypto implementation is present]) + +- if test -d "${TOPDIR}/src/jdk.crypto.ec/share/native/libsunec/impl"; then ++ if test "x${system_nss}" = "xyes" -o -d "${TOPDIR}/src/jdk.crypto.ec/share/native/libsunec/impl"; then + ENABLE_INTREE_EC=true + AC_MSG_RESULT([yes]) + else +diff --git a/make/autoconf/libraries.m4 b/make/autoconf/libraries.m4 +--- a/make/autoconf/libraries.m4 ++++ b/make/autoconf/libraries.m4 +@@ -178,6 +178,48 @@ + AC_SUBST(LIBDL) + LIBS="$save_LIBS" + ++ ############################################################################### ++ # ++ # Check for the NSS libraries ++ # ++ ++ AC_MSG_CHECKING([whether to build the Sun EC provider against the system NSS libraries]) ++ ++ # default is bundled ++ DEFAULT_SYSTEM_NSS=no ++ ++ AC_ARG_ENABLE([system-nss], [AS_HELP_STRING([--enable-system-nss], ++ [build the SunEC provider using the system NSS libraries @<:@disabled@:>@])], ++ [ ++ case "${enableval}" in ++ yes) ++ system_nss=yes ++ ;; ++ *) ++ system_nss=no ++ ;; ++ esac ++ ], ++ [ ++ system_nss=${DEFAULT_SYSTEM_NSS} ++ ]) ++ AC_MSG_RESULT([$system_nss]) ++ ++ if test "x${system_nss}" = "xyes"; then ++ PKG_CHECK_MODULES(NSS_SOFTTKN, nss-softokn >= 3.16.1, [NSS_SOFTOKN_FOUND=yes], [NSS_SOFTOKN_FOUND=no]) ++ PKG_CHECK_MODULES(NSS, nss >= 3.16.1, [NSS_FOUND=yes], [NSS_FOUND=no]) ++ if test "x${NSS_SOFTOKN_FOUND}" = "xyes" -a "x${NSS_FOUND}" = "xyes"; then ++ NSS_LIBS="$NSS_SOFTOKN_LIBS $NSS_LIBS -lfreebl"; ++ USE_EXTERNAL_NSS=true ++ else ++ AC_MSG_ERROR([--enable-system-nss specified, but NSS not found.]) ++ fi ++ else ++ USE_EXTERNAL_NSS=false ++ fi ++ AC_SUBST(USE_EXTERNAL_NSS) ++ ++ + # Control if libzip can use mmap. Available for purposes of overriding. + LIBZIP_CAN_USE_MMAP=true + AC_SUBST(LIBZIP_CAN_USE_MMAP) +diff --git a/make/autoconf/spec.gmk.in b/make/autoconf/spec.gmk.in +--- a/make/autoconf/spec.gmk.in ++++ b/make/autoconf/spec.gmk.in +@@ -795,6 +795,10 @@ + # Libraries + # + ++USE_EXTERNAL_NSS:=@USE_EXTERNAL_NSS@ ++NSS_LIBS:=@NSS_LIBS@ ++NSS_CFLAGS:=@NSS_CFLAGS@ ++ + USE_EXTERNAL_LCMS:=@USE_EXTERNAL_LCMS@ + LCMS_CFLAGS:=@LCMS_CFLAGS@ + LCMS_LIBS:=@LCMS_LIBS@ +diff --git a/make/lib/Lib-jdk.crypto.ec.gmk b/make/lib/Lib-jdk.crypto.ec.gmk +--- a/make/lib/Lib-jdk.crypto.ec.gmk ++++ b/make/lib/Lib-jdk.crypto.ec.gmk +@@ -28,19 +28,26 @@ + ################################################################################ + + ifeq ($(ENABLE_INTREE_EC), true) ++ ifeq ($(USE_EXTERNAL_NSS), true) ++ BUILD_LIBSUNEC_CFLAGS_JDKLIB := $(NSS_CFLAGS) -DSYSTEM_NSS -DNSS_ENABLE_ECC ++ BUILD_LIBSUNEC_CXXFLAGS_JDKLIB := $(NSS_CFLAGS) -DSYSTEM_NSS -DNSS_ENABLE_ECC ++ endif ++ + $(eval $(call SetupJdkLibrary, BUILD_LIBSUNEC, \ + NAME := sunec, \ + TOOLCHAIN := TOOLCHAIN_LINK_CXX, \ + OPTIMIZATION := LOW, \ +- CFLAGS := $(CFLAGS_JDKLIB) \ ++ CFLAGS := $(BUILD_LIBSUNEC_CFLAGS_JDKLIB) $(CFLAGS_JDKLIB) \ + -DMP_API_COMPATIBLE -DNSS_ECC_MORE_THAN_SUITE_B, \ +- CXXFLAGS := $(CXXFLAGS_JDKLIB), \ ++ CXXFLAGS := $(BUILD_LIBSUNEC_CXXFLAGS_JDKLIB) $(CXXFLAGS_JDKLIB), \ + DISABLED_WARNINGS_gcc := sign-compare implicit-fallthrough unused-value, \ + DISABLED_WARNINGS_clang := sign-compare, \ + DISABLED_WARNINGS_microsoft := 4101 4244 4146 4018, \ +- LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK), \ ++ LDFLAGS := $(subst -Xlinker --as-needed,, \ ++ $(subst -Wl$(COMMA)--as-needed,, $(LDFLAGS_JDKLIB))) $(LDFLAGS_CXX_JDK), \ + LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN), \ + LIBS := $(LIBCXX), \ ++ LIBS_linux := -lc $(NSS_LIBS), \ + )) + + TARGETS += $(BUILD_LIBSUNEC) +diff --git a/src/java.base/unix/native/include/jni_md.h b/src/java.base/unix/native/include/jni_md.h +--- a/src/java.base/unix/native/include/jni_md.h ++++ b/src/java.base/unix/native/include/jni_md.h +@@ -41,6 +41,11 @@ + #define JNIEXPORT + #define JNIIMPORT + #endif ++#if (defined(__GNUC__)) || __has_attribute(unused) ++ #define UNUSED(x) UNUSED_ ## x __attribute__((__unused__)) ++#else ++ #define UNUSED(x) UNUSED_ ## x ++#endif + + #define JNICALL + +diff --git a/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java b/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java +--- a/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java ++++ b/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java +@@ -61,6 +61,7 @@ + AccessController.doPrivileged(new PrivilegedAction<Void>() { + public Void run() { + System.loadLibrary("sunec"); // check for native library ++ initialize(); + return null; + } + }); +@@ -293,6 +294,11 @@ + "ECDH", "sun.security.ec.ECDHKeyAgreement", null, ATTRS)); + } + ++ /** ++ * Initialize the native code. ++ */ ++ private static native void initialize(); ++ + private void putXDHEntries() { + + HashMap<String, String> ATTRS = new HashMap<>(1); +diff --git a/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp b/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp +--- a/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp ++++ b/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp +@@ -25,7 +25,11 @@ + + #include <jni.h> + #include "jni_util.h" ++#ifdef SYSTEM_NSS ++#include "ecc_impl.h" ++#else + #include "impl/ecc_impl.h" ++#endif + #include "sun_security_ec_ECDHKeyAgreement.h" + #include "sun_security_ec_ECKeyPairGenerator.h" + #include "sun_security_ec_ECDSASignature.h" +@@ -33,6 +37,13 @@ + #define INVALID_PARAMETER_EXCEPTION \ + "java/security/InvalidParameterException" + #define KEY_EXCEPTION "java/security/KeyException" ++#define INTERNAL_ERROR "java/lang/InternalError" ++ ++#ifdef SYSTEM_NSS ++#define SYSTEM_UNUSED(x) UNUSED(x) ++#else ++#define SYSTEM_UNUSED(x) x ++#endif + + extern "C" { + +@@ -55,8 +66,13 @@ + /* + * Deep free of the ECParams struct + */ +-void FreeECParams(ECParams *ecparams, jboolean freeStruct) ++void FreeECParams(ECParams *ecparams, jboolean SYSTEM_UNUSED(freeStruct)) + { ++#ifdef SYSTEM_NSS ++ // Needs to be freed using the matching method to the one ++ // that allocated it. PR_TRUE means the memory is zeroed. ++ PORT_FreeArena(ecparams->arena, PR_TRUE); ++#else + // Use B_FALSE to free the SECItem->data element, but not the SECItem itself + // Use B_TRUE to free both + +@@ -70,6 +86,7 @@ + SECITEM_FreeItem(&ecparams->curveOID, B_FALSE); + if (freeStruct) + free(ecparams); ++#endif + } + + jbyteArray getEncodedBytes(JNIEnv *env, SECItem *hSECItem) +@@ -139,7 +156,7 @@ + */ + JNIEXPORT jobjectArray + JNICALL Java_sun_security_ec_ECKeyPairGenerator_generateECKeyPair +- (JNIEnv *env, jclass clazz, jint keySize, jbyteArray encodedParams, jbyteArray seed) ++ (JNIEnv *env, jclass UNUSED(clazz), jint UNUSED(keySize), jbyteArray encodedParams, jbyteArray seed) + { + ECPrivateKey *privKey = NULL; // contains both public and private values + ECParams *ecparams = NULL; +@@ -171,8 +188,17 @@ + env->GetByteArrayRegion(seed, 0, jSeedLength, pSeedBuffer); + + // Generate the new keypair (using the supplied seed) ++#ifdef SYSTEM_NSS ++ if (RNG_RandomUpdate((unsigned char *) pSeedBuffer, jSeedLength) ++ != SECSuccess) { ++ ThrowException(env, KEY_EXCEPTION); ++ goto cleanup; ++ } ++ if (EC_NewKey(ecparams, &privKey) != SECSuccess) { ++#else + if (EC_NewKey(ecparams, &privKey, (unsigned char *) pSeedBuffer, + jSeedLength, 0) != SECSuccess) { ++#endif + ThrowException(env, KEY_EXCEPTION); + goto cleanup; + } +@@ -219,10 +245,15 @@ + } + if (privKey) { + FreeECParams(&privKey->ecParams, false); ++#ifndef SYSTEM_NSS ++ // The entire ECPrivateKey is allocated in the arena ++ // when using system NSS, so only the in-tree version ++ // needs to clear these manually. + SECITEM_FreeItem(&privKey->version, B_FALSE); + SECITEM_FreeItem(&privKey->privateValue, B_FALSE); + SECITEM_FreeItem(&privKey->publicValue, B_FALSE); + free(privKey); ++#endif + } + + if (pSeedBuffer) { +@@ -240,7 +271,7 @@ + */ + JNIEXPORT jbyteArray + JNICALL Java_sun_security_ec_ECDSASignature_signDigest +- (JNIEnv *env, jclass clazz, jbyteArray digest, jbyteArray privateKey, jbyteArray encodedParams, jbyteArray seed, jint timing) ++ (JNIEnv *env, jclass UNUSED(clazz), jbyteArray digest, jbyteArray privateKey, jbyteArray encodedParams, jbyteArray seed, jint timing) + { + jbyte* pDigestBuffer = NULL; + jint jDigestLength = env->GetArrayLength(digest); +@@ -299,8 +330,18 @@ + env->GetByteArrayRegion(seed, 0, jSeedLength, pSeedBuffer); + + // Sign the digest (using the supplied seed) ++#ifdef SYSTEM_NSS ++ if (RNG_RandomUpdate((unsigned char *) pSeedBuffer, jSeedLength) ++ != SECSuccess) { ++ ThrowException(env, KEY_EXCEPTION); ++ goto cleanup; ++ } ++ if (ECDSA_SignDigest(&privKey, &signature_item, &digest_item) ++ != SECSuccess) { ++#else + if (ECDSA_SignDigest(&privKey, &signature_item, &digest_item, + (unsigned char *) pSeedBuffer, jSeedLength, 0, timing) != SECSuccess) { ++#endif + ThrowException(env, KEY_EXCEPTION); + goto cleanup; + } +@@ -349,7 +390,7 @@ + */ + JNIEXPORT jboolean + JNICALL Java_sun_security_ec_ECDSASignature_verifySignedDigest +- (JNIEnv *env, jclass clazz, jbyteArray signedDigest, jbyteArray digest, jbyteArray publicKey, jbyteArray encodedParams) ++ (JNIEnv *env, jclass UNUSED(clazz), jbyteArray signedDigest, jbyteArray digest, jbyteArray publicKey, jbyteArray encodedParams) + { + jboolean isValid = false; + +@@ -406,9 +447,10 @@ + + cleanup: + { +- if (params_item.data) ++ if (params_item.data) { + env->ReleaseByteArrayElements(encodedParams, + (jbyte *) params_item.data, JNI_ABORT); ++ } + + if (pubKey.publicValue.data) + env->ReleaseByteArrayElements(publicKey, +@@ -434,7 +476,7 @@ + */ + JNIEXPORT jbyteArray + JNICALL Java_sun_security_ec_ECDHKeyAgreement_deriveKey +- (JNIEnv *env, jclass clazz, jbyteArray privateKey, jbyteArray publicKey, jbyteArray encodedParams) ++ (JNIEnv *env, jclass UNUSED(clazz), jbyteArray privateKey, jbyteArray publicKey, jbyteArray encodedParams) + { + jbyteArray jSecret = NULL; + ECParams *ecparams = NULL; +@@ -510,9 +552,10 @@ + env->ReleaseByteArrayElements(publicKey, + (jbyte *) publicValue_item.data, JNI_ABORT); + +- if (params_item.data) ++ if (params_item.data) { + env->ReleaseByteArrayElements(encodedParams, + (jbyte *) params_item.data, JNI_ABORT); ++ } + + if (ecparams) + FreeECParams(ecparams, true); +@@ -521,4 +564,28 @@ + return jSecret; + } + ++JNIEXPORT void ++JNICALL Java_sun_security_ec_SunEC_initialize ++ (JNIEnv *env, jclass UNUSED(clazz)) ++{ ++#ifdef SYSTEM_NSS ++ if (SECOID_Init() != SECSuccess) { ++ ThrowException(env, INTERNAL_ERROR); ++ } ++ if (RNG_RNGInit() != SECSuccess) { ++ ThrowException(env, INTERNAL_ERROR); ++ } ++#endif ++} ++ ++JNIEXPORT void ++JNICALL JNI_OnUnload ++ (JavaVM *vm, void *reserved) ++{ ++#ifdef SYSTEM_NSS ++ RNG_RNGShutdown(); ++ SECOID_Shutdown(); ++#endif ++} ++ + } /* extern "C" */ +diff --git a/src/jdk.crypto.ec/share/native/libsunec/ecc_impl.h b/src/jdk.crypto.ec/share/native/libsunec/ecc_impl.h +new file mode 100644 +--- /dev/null ++++ b/src/jdk.crypto.ec/share/native/libsunec/ecc_impl.h +@@ -0,0 +1,298 @@ ++/* ++ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved. ++ * Use is subject to license terms. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public License ++ * along with this library; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit
www.oracle.com
if you need additional information or have any ++ * questions. ++ */ ++ ++/* ********************************************************************* ++ * ++ * The Original Code is the Netscape security libraries. ++ * ++ * The Initial Developer of the Original Code is ++ * Netscape Communications Corporation. ++ * Portions created by the Initial Developer are Copyright (C) 1994-2000 ++ * the Initial Developer. All Rights Reserved. ++ * ++ * Contributor(s): ++ * Dr Vipul Gupta <vipul.gupta(a)sun.com> and ++ * Douglas Stebila <douglas(a)stebila.ca>, Sun Microsystems Laboratories ++ * ++ * Last Modified Date from the Original Code: May 2017 ++ *********************************************************************** */ ++ ++#ifndef _ECC_IMPL_H ++#define _ECC_IMPL_H ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#include <sys/types.h> ++ ++#ifdef SYSTEM_NSS ++#include <secitem.h> ++#include <secerr.h> ++#include <keythi.h> ++#ifdef LEGACY_NSS ++#include <softoken.h> ++#else ++#include <blapi.h> ++#endif ++#else ++#include "ecl-exp.h" ++#endif ++ ++/* ++ * Multi-platform definitions ++ */ ++#ifdef __linux__ ++#define B_FALSE FALSE ++#define B_TRUE TRUE ++typedef unsigned char uint8_t; ++typedef unsigned long ulong_t; ++typedef enum { B_FALSE, B_TRUE } boolean_t; ++#endif /* __linux__ */ ++ ++#ifdef _ALLBSD_SOURCE ++#include <stdint.h> ++#define B_FALSE FALSE ++#define B_TRUE TRUE ++typedef unsigned long ulong_t; ++typedef enum boolean { B_FALSE, B_TRUE } boolean_t; ++#endif /* _ALLBSD_SOURCE */ ++ ++#ifdef AIX ++#define B_FALSE FALSE ++#define B_TRUE TRUE ++typedef unsigned char uint8_t; ++typedef unsigned long ulong_t; ++#endif /* AIX */ ++ ++#ifdef _WIN32 ++typedef unsigned char uint8_t; ++typedef unsigned long ulong_t; ++typedef enum boolean { B_FALSE, B_TRUE } boolean_t; ++#define strdup _strdup /* Replace POSIX name with ISO C++ name */ ++#endif /* _WIN32 */ ++ ++#ifndef _KERNEL ++#include <stdlib.h> ++#endif /* _KERNEL */ ++ ++#define EC_MAX_DIGEST_LEN 1024 /* max digest that can be signed */ ++#define EC_MAX_POINT_LEN 145 /* max len of DER encoded Q */ ++#define EC_MAX_VALUE_LEN 72 /* max len of ANSI X9.62 private value d */ ++#define EC_MAX_SIG_LEN 144 /* max signature len for supported curves */ ++#define EC_MIN_KEY_LEN 112 /* min key length in bits */ ++#define EC_MAX_KEY_LEN 571 /* max key length in bits */ ++#define EC_MAX_OID_LEN 10 /* max length of OID buffer */ ++ ++/* ++ * Various structures and definitions from NSS are here. ++ */ ++ ++#ifndef SYSTEM_NSS ++#ifdef _KERNEL ++#define PORT_ArenaAlloc(a, n, f) kmem_alloc((n), (f)) ++#define PORT_ArenaZAlloc(a, n, f) kmem_zalloc((n), (f)) ++#define PORT_ArenaGrow(a, b, c, d) NULL ++#define PORT_ZAlloc(n, f) kmem_zalloc((n), (f)) ++#define PORT_Alloc(n, f) kmem_alloc((n), (f)) ++#else ++#define PORT_ArenaAlloc(a, n, f) malloc((n)) ++#define PORT_ArenaZAlloc(a, n, f) calloc(1, (n)) ++#define PORT_ArenaGrow(a, b, c, d) NULL ++#define PORT_ZAlloc(n, f) calloc(1, (n)) ++#define PORT_Alloc(n, f) malloc((n)) ++#endif ++ ++#define PORT_NewArena(b) (char *)12345 ++#define PORT_ArenaMark(a) NULL ++#define PORT_ArenaUnmark(a, b) ++#define PORT_ArenaRelease(a, m) ++#define PORT_FreeArena(a, b) ++#define PORT_Strlen(s) strlen((s)) ++#define PORT_SetError(e) ++ ++#define PRBool boolean_t ++#define PR_TRUE B_TRUE ++#define PR_FALSE B_FALSE ++ ++#ifdef _KERNEL ++#define PORT_Assert ASSERT ++#define PORT_Memcpy(t, f, l) bcopy((f), (t), (l)) ++#else ++#define PORT_Assert assert ++#define PORT_Memcpy(t, f, l) memcpy((t), (f), (l)) ++#endif ++ ++#endif ++ ++#define CHECK_OK(func) if (func == NULL) goto cleanup ++#define CHECK_SEC_OK(func) if (SECSuccess != (rv = func)) goto cleanup ++ ++#ifndef SYSTEM_NSS ++typedef enum { ++ siBuffer = 0, ++ siClearDataBuffer = 1, ++ siCipherDataBuffer = 2, ++ siDERCertBuffer = 3, ++ siEncodedCertBuffer = 4, ++ siDERNameBuffer = 5, ++ siEncodedNameBuffer = 6, ++ siAsciiNameString = 7, ++ siAsciiString = 8, ++ siDEROID = 9, ++ siUnsignedInteger = 10, ++ siUTCTime = 11, ++ siGeneralizedTime = 12 ++} SECItemType; ++ ++typedef struct SECItemStr SECItem; ++ ++struct SECItemStr { ++ SECItemType type; ++ unsigned char *data; ++ unsigned int len; ++}; ++ ++typedef SECItem SECKEYECParams; ++ ++typedef enum { ec_params_explicit, ++ ec_params_named ++} ECParamsType; ++ ++typedef enum { ec_field_GFp = 1, ++ ec_field_GF2m ++} ECFieldType; ++ ++struct ECFieldIDStr { ++ int size; /* field size in bits */ ++ ECFieldType type; ++ union { ++ SECItem prime; /* prime p for (GFp) */ ++ SECItem poly; /* irreducible binary polynomial for (GF2m) */ ++ } u; ++ int k1; /* first coefficient of pentanomial or ++ * the only coefficient of trinomial ++ */ ++ int k2; /* two remaining coefficients of pentanomial */ ++ int k3; ++}; ++typedef struct ECFieldIDStr ECFieldID; ++ ++struct ECCurveStr { ++ SECItem a; /* contains octet stream encoding of ++ * field element (X9.62 section 4.3.3) ++ */ ++ SECItem b; ++ SECItem seed; ++}; ++typedef struct ECCurveStr ECCurve; ++ ++typedef void PRArenaPool; ++ ++struct ECParamsStr { ++ PRArenaPool * arena; ++ ECParamsType type; ++ ECFieldID fieldID; ++ ECCurve curve; ++ SECItem base; ++ SECItem order; ++ int cofactor; ++ SECItem DEREncoding; ++ ECCurveName name; ++ SECItem curveOID; ++}; ++typedef struct ECParamsStr ECParams; ++ ++struct ECPublicKeyStr { ++ ECParams ecParams; ++ SECItem publicValue; /* elliptic curve point encoded as ++ * octet stream. ++ */ ++}; ++typedef struct ECPublicKeyStr ECPublicKey; ++ ++struct ECPrivateKeyStr { ++ ECParams ecParams; ++ SECItem publicValue; /* encoded ec point */ ++ SECItem privateValue; /* private big integer */ ++ SECItem version; /* As per SEC 1, Appendix C, Section C.4 */ ++}; ++typedef struct ECPrivateKeyStr ECPrivateKey; ++ ++typedef enum _SECStatus { ++ SECBufferTooSmall = -3, ++ SECWouldBlock = -2, ++ SECFailure = -1, ++ SECSuccess = 0 ++} SECStatus; ++#endif ++ ++#ifdef _KERNEL ++#define RNG_GenerateGlobalRandomBytes(p,l) ecc_knzero_random_generator((p), (l)) ++#else ++/* ++ This function is no longer required because the random bytes are now ++ supplied by the caller. Force a failure. ++*/ ++#ifndef SYSTEM_NSS ++#define RNG_GenerateGlobalRandomBytes(p,l) SECFailure ++#endif ++#endif ++#define CHECK_MPI_OK(func) if (MP_OKAY > (err = func)) goto cleanup ++#define MP_TO_SEC_ERROR(err) ++ ++#define SECITEM_TO_MPINT(it, mp) \ ++ CHECK_MPI_OK(mp_read_unsigned_octets((mp), (it).data, (it).len)) ++ ++extern int ecc_knzero_random_generator(uint8_t *, size_t); ++extern ulong_t soft_nzero_random_generator(uint8_t *, ulong_t); ++ ++#ifdef SYSTEM_NSS ++#define EC_DecodeParams(a,b,c) EC_DecodeParams(a,b) ++#define ECDSA_VerifyDigest(a,b,c,d) ECDSA_VerifyDigest(a,b,c) ++#define ECDH_Derive(a,b,c,d,e,f) ECDH_Derive(a,b,c,d,e) ++#else ++extern SECStatus EC_DecodeParams(const SECItem *, ECParams **, int); ++ ++extern SECItem * SECITEM_AllocItem(PRArenaPool *, SECItem *, unsigned int, int); ++extern SECStatus SECITEM_CopyItem(PRArenaPool *, SECItem *, const SECItem *, ++ int); ++extern void SECITEM_FreeItem(SECItem *, boolean_t); ++ ++/* This function has been modified to accept an array of random bytes */ ++extern SECStatus EC_NewKey(ECParams *ecParams, ECPrivateKey **privKey, ++ const unsigned char* random, int randomlen, int); ++/* This function has been modified to accept an array of random bytes */ ++extern SECStatus ECDSA_SignDigest(ECPrivateKey *, SECItem *, const SECItem *, ++ const unsigned char* random, int randomlen, int, int timing); ++extern SECStatus ECDSA_VerifyDigest(ECPublicKey *, const SECItem *, ++ const SECItem *, int); ++extern SECStatus ECDH_Derive(SECItem *, ECParams *, SECItem *, boolean_t, ++ SECItem *, int); ++#endif ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif /* _ECC_IMPL_H */ diff --git a/pr3183-rh1340845-support_fedora_rhel_system_crypto_policy.patch b/pr3183-rh1340845-support_fedora_rhel_system_crypto_policy.patch new file mode 100644 index 0000000..4efbe9a --- /dev/null +++ b/pr3183-rh1340845-support_fedora_rhel_system_crypto_policy.patch @@ -0,0 +1,88 @@ + +# HG changeset patch +# User andrew +# Date 1478057514 0 +# Node ID 1c4d5cb2096ae55106111da200b0bcad304f650c +# Parent 3d53f19b48384e5252f4ec8891f7a3a82d77af2a +PR3183: Support Fedora/RHEL system crypto policy +diff -r 3d53f19b4838 -r 1c4d5cb2096a src/java.base/share/classes/java/security/Security.java +--- a/src/java.base/share/classes/java/security/Security.java Wed Oct 26 03:51:39 2016 +0100 ++++ b/src/java.base/share/classes/java/security/Security.java Wed Nov 02 03:31:54 2016 +0000 +@@ -43,6 +43,9 @@ + * implementation-specific location, which is typically the properties file + * {@code conf/security/java.security} in the Java installation directory. + * ++ * <p>Additional default values of security properties are read from a ++ * system-specific location, if available.</p> ++ * + * @author Benjamin Renaud + * @since 1.1 + */ +@@ -52,6 +55,10 @@ + private static final Debug sdebug = + Debug.getInstance("properties"); + ++ /* System property file*/ ++ private static final String SYSTEM_PROPERTIES = ++ "/etc/crypto-policies/back-ends/java.config"; ++ + /* The java.security properties */ + private static Properties props; + +@@ -93,6 +100,7 @@ + if (sdebug != null) { + sdebug.println("reading security properties file: " + + propFile); ++ sdebug.println(props.toString()); + } + } catch (IOException e) { + if (sdebug != null) { +@@ -114,6 +122,31 @@ + } + + if ("true".equalsIgnoreCase(props.getProperty ++ ("security.useSystemPropertiesFile"))) { ++ ++ // now load the system file, if it exists, so its values ++ // will win if they conflict with the earlier values ++ try (BufferedInputStream bis = ++ new BufferedInputStream(new FileInputStream(SYSTEM_PROPERTIES))) { ++ props.load(bis); ++ loadedProps = true; ++ ++ if (sdebug != null) { ++ sdebug.println("reading system security properties file " + ++ SYSTEM_PROPERTIES); ++ sdebug.println(props.toString()); ++ } ++ } catch (IOException e) { ++ if (sdebug != null) { ++ sdebug.println ++ ("unable to load security properties from " + ++ SYSTEM_PROPERTIES); ++ e.printStackTrace(); ++ } ++ } ++ } ++ ++ if ("true".equalsIgnoreCase(props.getProperty + ("security.overridePropertiesFile"))) { + + String extraPropFile = System.getProperty +diff -r 3d53f19b4838 -r 1c4d5cb2096a src/java.base/share/conf/security/java.security +--- a/src/java.base/share/conf/security/java.security Wed Oct 26 03:51:39 2016 +0100 ++++ b/src/java.base/share/conf/security/java.security Wed Nov 02 03:31:54 2016 +0000 +@@ -276,6 +276,13 @@ + security.overridePropertiesFile=true + + # ++# Determines whether this properties file will be appended to ++# using the system properties file stored at ++# /etc/crypto-policies/back-ends/java.config ++# ++security.useSystemPropertiesFile=true ++ ++# + # Determines the default key and trust manager factory algorithms for + # the javax.net.ssl package. + # diff --git a/remove-intree-libraries.sh b/remove-intree-libraries.sh new file mode 100644 index 0000000..635da8a --- /dev/null +++ b/remove-intree-libraries.sh @@ -0,0 +1,129 @@ +#!/bin/sh + +ZIP_SRC=src/java.base/share/native/libzip/zlib/ +JPEG_SRC=src/java.desktop/share/native/libjavajpeg/ +GIF_SRC=src/java.desktop/share/native/libsplashscreen/giflib/ +PNG_SRC=src/java.desktop/share/native/libsplashscreen/libpng/ +LCMS_SRC=src/java.desktop/share/native/liblcms/ + +cd openjdk + +echo "Removing built-in libs (they will be linked)" + +echo "Removing zlib" +if [ ! -d ${ZIP_SRC} ]; then + echo "${ZIP_SRC} does not exist. Refusing to proceed." + exit 1 +fi +rm -rvf ${ZIP_SRC} + +echo "Removing libjpeg" +if [ ! -f ${JPEG_SRC}/jdhuff.c ]; then # some file that sound definitely exist + echo "${JPEG_SRC} does not contain jpeg sources. Refusing to proceed." + exit 1 +fi + +rm -vf ${JPEG_SRC}/jcomapi.c +rm -vf ${JPEG_SRC}/jdapimin.c +rm -vf ${JPEG_SRC}/jdapistd.c +rm -vf ${JPEG_SRC}/jdcoefct.c +rm -vf ${JPEG_SRC}/jdcolor.c +rm -vf ${JPEG_SRC}/jdct.h +rm -vf ${JPEG_SRC}/jddctmgr.c +rm -vf ${JPEG_SRC}/jdhuff.c +rm -vf ${JPEG_SRC}/jdhuff.h +rm -vf ${JPEG_SRC}/jdinput.c +rm -vf ${JPEG_SRC}/jdmainct.c +rm -vf ${JPEG_SRC}/jdmarker.c +rm -vf ${JPEG_SRC}/jdmaster.c +rm -vf ${JPEG_SRC}/jdmerge.c +rm -vf ${JPEG_SRC}/jdphuff.c +rm -vf ${JPEG_SRC}/jdpostct.c +rm -vf ${JPEG_SRC}/jdsample.c +rm -vf ${JPEG_SRC}/jerror.c +rm -vf ${JPEG_SRC}/jerror.h +rm -vf ${JPEG_SRC}/jidctflt.c +rm -vf ${JPEG_SRC}/jidctfst.c +rm -vf ${JPEG_SRC}/jidctint.c +rm -vf ${JPEG_SRC}/jidctred.c +rm -vf ${JPEG_SRC}/jinclude.h +rm -vf ${JPEG_SRC}/jmemmgr.c +rm -vf ${JPEG_SRC}/jmemsys.h +rm -vf ${JPEG_SRC}/jmemnobs.c +rm -vf ${JPEG_SRC}/jmorecfg.h +rm -vf ${JPEG_SRC}/jpegint.h +rm -vf ${JPEG_SRC}/jpeglib.h +rm -vf ${JPEG_SRC}/jquant1.c +rm -vf ${JPEG_SRC}/jquant2.c +rm -vf ${JPEG_SRC}/jutils.c +rm -vf ${JPEG_SRC}/jcapimin.c +rm -vf ${JPEG_SRC}/jcapistd.c +rm -vf ${JPEG_SRC}/jccoefct.c +rm -vf ${JPEG_SRC}/jccolor.c +rm -vf ${JPEG_SRC}/jcdctmgr.c +rm -vf ${JPEG_SRC}/jchuff.c +rm -vf ${JPEG_SRC}/jchuff.h +rm -vf ${JPEG_SRC}/jcinit.c +rm -vf ${JPEG_SRC}/jconfig.h +rm -vf ${JPEG_SRC}/jcmainct.c +rm -vf ${JPEG_SRC}/jcmarker.c +rm -vf ${JPEG_SRC}/jcmaster.c +rm -vf ${JPEG_SRC}/jcparam.c +rm -vf ${JPEG_SRC}/jcphuff.c +rm -vf ${JPEG_SRC}/jcprepct.c +rm -vf ${JPEG_SRC}/jcsample.c +rm -vf ${JPEG_SRC}/jctrans.c +rm -vf ${JPEG_SRC}/jdtrans.c +rm -vf ${JPEG_SRC}/jfdctflt.c +rm -vf ${JPEG_SRC}/jfdctfst.c +rm -vf ${JPEG_SRC}/jfdctint.c +rm -vf ${JPEG_SRC}/jversion.h +rm -vf ${JPEG_SRC}/README + +echo "Removing giflib" +if [ ! -d ${GIF_SRC} ]; then + echo "${GIF_SRC} does not exist. Refusing to proceed." + exit 1 +fi +rm -rvf ${GIF_SRC} + +echo "Removing libpng" +if [ ! -d ${PNG_SRC} ]; then + echo "${PNG_SRC} does not exist. Refusing to proceed." + exit 1 +fi +rm -rvf ${PNG_SRC} + +echo "Removing lcms" +if [ ! -d ${LCMS_SRC} ]; then + echo "${LCMS_SRC} does not exist. Refusing to proceed." + exit 1 +fi +rm -vf ${LCMS_SRC}/cmscam02.c +rm -vf ${LCMS_SRC}/cmscgats.c +rm -vf ${LCMS_SRC}/cmscnvrt.c +rm -vf ${LCMS_SRC}/cmserr.c +rm -vf ${LCMS_SRC}/cmsgamma.c +rm -vf ${LCMS_SRC}/cmsgmt.c +rm -vf ${LCMS_SRC}/cmshalf.c +rm -vf ${LCMS_SRC}/cmsintrp.c +rm -vf ${LCMS_SRC}/cmsio0.c +rm -vf ${LCMS_SRC}/cmsio1.c +rm -vf ${LCMS_SRC}/cmslut.c +rm -vf ${LCMS_SRC}/cmsmd5.c +rm -vf ${LCMS_SRC}/cmsmtrx.c +rm -vf ${LCMS_SRC}/cmsnamed.c +rm -vf ${LCMS_SRC}/cmsopt.c +rm -vf ${LCMS_SRC}/cmspack.c +rm -vf ${LCMS_SRC}/cmspcs.c +rm -vf ${LCMS_SRC}/cmsplugin.c +rm -vf ${LCMS_SRC}/cmsps2.c +rm -vf ${LCMS_SRC}/cmssamp.c +rm -vf ${LCMS_SRC}/cmssm.c +rm -vf ${LCMS_SRC}/cmstypes.c +rm -vf ${LCMS_SRC}/cmsvirt.c +rm -vf ${LCMS_SRC}/cmswtpnt.c +rm -vf ${LCMS_SRC}/cmsxform.c +rm -vf ${LCMS_SRC}/lcms2.h +rm -vf ${LCMS_SRC}/lcms2_internal.h +rm -vf ${LCMS_SRC}/lcms2_plugin.h diff --git a/rh1648242-accessible_toolkit_crash_do_not_break_jvm.patch b/rh1648242-accessible_toolkit_crash_do_not_break_jvm.patch new file mode 100644 index 0000000..a877506 --- /dev/null +++ b/rh1648242-accessible_toolkit_crash_do_not_break_jvm.patch @@ -0,0 +1,18 @@ +diff -uNr openjdk/src/java.desktop/share/classes/java/awt/Toolkit.java jdk8/jdk/src/java.desktop/share/classes/java/awt/Toolkit.java +--- openjdk/src/java.desktop/share/classes/java/awt/Toolkit.java ++++ openjdk/src/java.desktop/share/classes/java/awt/Toolkit.java +@@ -883,9 +883,13 @@ + return null; + } + }); + if (!GraphicsEnvironment.isHeadless()) { +- loadAssistiveTechnologies(); ++ try { ++ loadAssistiveTechnologies(); ++ } catch (AWTError error) { ++ // ignore silently ++ } + } + } + return toolkit; + } diff --git a/rh1648249-add_commented_out_nss_cfg_provider_to_java_security.patch b/rh1648249-add_commented_out_nss_cfg_provider_to_java_security.patch new file mode 100644 index 0000000..1b92ddc --- /dev/null +++ b/rh1648249-add_commented_out_nss_cfg_provider_to_java_security.patch @@ -0,0 +1,11 @@ +diff -r 5b86f66575b7 src/share/lib/security/java.security-linux +--- openjdk/src/java.base/share/conf/security/java.security Tue May 16 13:29:05 2017 -0700 ++++ openjdk/src/java.base/share/conf/security/java.security Tue Jun 06 14:05:12 2017 +0200 +@@ -83,6 +83,7 @@ + #ifndef solaris + security.provider.tbd=SunPKCS11 + #endif ++#security.provider.tbd=SunPKCS11 ${java.home}/lib/security/nss.cfg + + # + # A list of preferred providers for specific algorithms. These providers will diff --git a/rh1648644-java_access_bridge_privileged_security.patch b/rh1648644-java_access_bridge_privileged_security.patch new file mode 100644 index 0000000..53026ad --- /dev/null +++ b/rh1648644-java_access_bridge_privileged_security.patch @@ -0,0 +1,20 @@ +--- openjdk/src/java.base/share/conf/security/java.security ++++ openjdk/src/java.base/share/conf/security/java.security +@@ -304,6 +304,8 @@ + # + package.access=sun.misc.,\ + sun.reflect.,\ ++ org.GNOME.Accessibility.,\ ++ org.GNOME.Bonobo.,\ + + # + # List of comma-separated packages that start with or equal this string +@@ -316,6 +318,8 @@ + # + package.definition=sun.misc.,\ + sun.reflect.,\ ++ org.GNOME.Accessibility.,\ ++ org.GNOME.Bonobo.,\ + + # + # Determines whether this properties file can be appended to diff --git a/rh1684077-openjdk_should_depend_on_pcsc-lite-libs_instead_of_pcsc-lite-devel.patch b/rh1684077-openjdk_should_depend_on_pcsc-lite-libs_instead_of_pcsc-lite-devel.patch new file mode 100644 index 0000000..5e2b254 --- /dev/null +++ b/rh1684077-openjdk_should_depend_on_pcsc-lite-libs_instead_of_pcsc-lite-devel.patch @@ -0,0 +1,13 @@ +--- openjdk/src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java 2013-03-01 10:48:12.038189968 +0100 ++++ openjdk/src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java 2013-03-01 10:48:11.913188505 +0100 +@@ -48,8 +48,8 @@ + + private final static String PROP_NAME = "sun.security.smartcardio.library"; + +- private final static String LIB1 = "/usr/$LIBISA/libpcsclite.so"; +- private final static String LIB2 = "/usr/local/$LIBISA/libpcsclite.so"; ++ private final static String LIB1 = "/usr/$LIBISA/libpcsclite.so.1"; ++ private final static String LIB2 = "/usr/local/$LIBISA/libpcsclite.so.1"; + private final static String PCSC_FRAMEWORK = "/System/Library/Frameworks/PCSC.framework/Versions/Current/PCSC"; + + PlatformPCSC() { diff --git a/rh649512-remove_uses_of_far_in_jpeg_libjpeg_turbo_1_4_compat_for_jdk10_and_up.patch b/rh649512-remove_uses_of_far_in_jpeg_libjpeg_turbo_1_4_compat_for_jdk10_and_up.patch new file mode 100644 index 0000000..1b706a1 --- /dev/null +++ b/rh649512-remove_uses_of_far_in_jpeg_libjpeg_turbo_1_4_compat_for_jdk10_and_up.patch @@ -0,0 +1,19 @@ +Remove uses of FAR in jpeg code + +Upstream libjpeg-trubo removed the (empty) FAR macro: +http://sourceforge.net/p/libjpeg-turbo/code/1312/ + +Adjust our code to not use the undefined FAR macro anymore. + +diff --git a/jdk/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c b/jdk/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c +--- openjdk/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c ++++ openjdk/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c +@@ -1385,7 +1385,7 @@ + /* and fill it in */ + dst_ptr = icc_data; + for (seq_no = first; seq_no < last; seq_no++) { +- JOCTET FAR *src_ptr = icc_markers[seq_no]->data + ICC_OVERHEAD_LEN; ++ JOCTET *src_ptr = icc_markers[seq_no]->data + ICC_OVERHEAD_LEN; + unsigned int length = + icc_markers[seq_no]->data_length - ICC_OVERHEAD_LEN; + diff --git a/sources b/sources new file mode 100644 index 0000000..dc02974 --- /dev/null +++ b/sources @@ -0,0 +1,2 @@ +SHA512 (jdk-jdk12-jdk-12+33.tar.xz) = e2dea9585fe07ae87fb313d090e9850a547e2ba84a7447d42acd0a04874599ef240f7b6ccaa69955cab5d12f646711cb4467e1b24e090af476e9ff708cc168fe +SHA512 (systemtap_3.2_tapsets_hg-icedtea8-9d464368e06d.tar.xz) = cf578221b77d8c7e019f69909bc86c419c5fb5e10bceba9592ff6e7f96887b0a7f07c9cefe90800975247a078785ca190fdec5c2d0f841bb447cee784b570f7d
1
0
0
0
Architecture specific change in rpms/oidn.git
by githook-noreply@fedoraproject.org
02 Apr '19
02 Apr '19
The package rpms/oidn.git has added or updated architecture specific content in its spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/oidn.git/commit/?id=9fda1910efad3d1…
. Change: +ExclusiveArch: x86_64 Thanks. Full change: ============ commit 9fda1910efad3d175c3ff7f18b4f1a2c895b0f1c Author: Luya Tshimbalanga <luya(a)fedoraproject.org> Date: Tue Apr 2 08:34:46 2019 -0700 Use spaces on line 47 Make -doc subpackage noarch Make -doc subpackage requiring main package diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..479af45 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/oidn-0.8.2.src.tar.gz diff --git a/oidn.spec b/oidn.spec new file mode 100644 index 0000000..8a0a018 --- /dev/null +++ b/oidn.spec @@ -0,0 +1,94 @@ +Name: oidn +Version: 0.8.2 +Release: 4%{?dist} +Summary: Library of denoising filters for images rendered with ray tracing + +License: ASL 2.0 +URL:
https://openimagedenoise.github.io/
+Source0:
https://github.com/OpenImageDenoise/%{name}/releases/download/v%{version}/%…
+ +# Library only available of x86_64 arch +ExclusiveArch: x86_64 + +BuildRequires: cmake >= 3.13.0 +BuildRequires: gcc-c++ +BuildRequires: python3-devel +BuildRequires: tbb-devel + +%description +An open source library of high-performance, high-quality denoising +filters for images rendered with ray tracing. + +%package libs +Summary: Libraries for %{name} + +%description libs +The %{name}-libs package contains shared library for %{name}. + +%package devel +Summary: Development files for %{name} +Requires: %{name}-libs%{?_isa} = %{version}-%{release} + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + +%package docs +Summary: Documentation for %{name} +Requires: %{name}-libs%{?_isa} = %{version}-%{release} +BuildArch: noarch + +%description docs +The %{name}-docs package contains documentation for %{name}. + +%prep +%autosetup + + +%build +%cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE \ + . +%make_build + + +%install +%make_install + +# Remove duplicated documentation +rm -rf %{buildroot}%{_docdir}/OpenImageDenoise + + +%files +%license LICENSE.txt +%doc CHANGELOG.md +%{_bindir}/denoise + +%files libs +%{_libdir}/cmake/OpenImageDenoise +%{_libdir}/libOpenImageDenoise.so.* + +%files docs +%doc README.md readme.pdf + +%files devel +%{_includedir}/OpenImageDenoise +%{_libdir}/libOpenImageDenoise.so + +%changelog +* Tue Apr 02 2019 Luya Tshimbalanga <luya(a)fedoraproject.org> - 0.8.2-4 +- Use spaces on line 47 +- Make -doc subpackage noarch +- Make -doc subpackage requiring main package + +* Mon Apr 01 2019 Luya Tshimbalanga <luya(a)fedoraproject.org> - 0.8.2-3 +- Move versioned so-files to libs subpackage +- Move unversioned so-files to devel subpackage + +* Mon Apr 01 2019 Luya Tshimbalanga <luya(a)fedoraproject.org> - 0.8.2-2 +- Add subpackage for large doc files +- Move .so files to devel subpackage +- Fix library path +- Remove unneeded clearance + +* Sun Mar 31 2019 Luya Tshimbalanga <luya(a)fedoraproject.org> - 0.8.2-1 +- Initial packaging diff --git a/sources b/sources new file mode 100644 index 0000000..a60e158 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (oidn-0.8.2.src.tar.gz) = 1e43893edfb367ebbe8854fe8cb41292c89058496094007ed4bd65eb6742765e84b6c6ccb0a72a2f4bae650467b992ee465d18b206d1c05880576ce7c54fb3bf
1
0
0
0
Architecture specific change in rpms/rust-packaging.git
by githook-noreply@fedoraproject.org
02 Apr '19
02 Apr '19
The package rpms/rust-packaging.git has added or updated architecture specific content in its spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/rust-packaging.git/commit/?id=965e2…
https://src.fedoraproject.org/cgit/rpms/rust-packaging.git/commit/?id=4e590…
. Change: +ExclusiveArch: %{rust_arches} +ExclusiveArch: %{rust_arches} noarch Thanks. Full change: ============ commit 9d3869c3408529507f7902b2b2903f0de9edf4a3 Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Mon Mar 11 00:09:20 2019 +0100 Install $PWD/Cargo.toml into $REG_DIR/Cargo.toml For things which are just including files, deps one doesn't get installed into the registry. Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/0019-Do-not-pull-optional-dependencies.patch b/0019-Do-not-pull-optional-dependencies.patch index 5b8a70e..814c920 100644 --- a/0019-Do-not-pull-optional-dependencies.patch +++ b/0019-Do-not-pull-optional-dependencies.patch @@ -1,4 +1,4 @@ -From 643bf0d32982b67854a39586244b25f54518de02 Mon Sep 17 00:00:00 2001 +From 604938a8bab778c58333643c3e069533327699e2 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Sat, 9 Mar 2019 22:04:49 +0100 Subject: [PATCH 19/19] Do not pull optional dependencies @@ -10,7 +10,7 @@ Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/data/macros.cargo b/data/macros.cargo -index 96dc354..f950e79 100644 +index 96dc354..999d787 100644 --- a/data/macros.cargo +++ b/data/macros.cargo @@ -2,8 +2,10 @@ @@ -50,7 +50,7 @@ index 96dc354..f950e79 100644 - %{__cp} -a Cargo.toml.orig $REG_DIR/Cargo.toml \ -%endif \ + %{__mv} Cargo.toml{.deps,} \ -+ %{__mv} $REG_DIR/Cargo.toml{.deps,} \ ++ %{__cp} -a Cargo.toml $REG_DIR/Cargo.toml \ + %{__rm} -f $REG_DIR/Cargo.toml.orig \ echo '{"files":{},"package":""}' > $REG_DIR/.cargo-checksum.json \ fi \ diff --git a/rust-packaging.spec b/rust-packaging.spec index 0ea39e1..7412fdf 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -5,7 +5,7 @@ Name: rust-packaging Version: 6 -Release: 27%{?dist} +Release: 28%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT @@ -91,6 +91,9 @@ py.test-%{python3_version} -vv test.py %{python3_sitelib}/rust2rpm/ %changelog +* Sun Mar 10 2019 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-28 +- Install $PWD/Cargo.toml into $REG_DIR/Cargo.toml + * Sun Mar 10 2019 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-27 - Restore Cargo.toml.deps into $PWD/Cargo.toml commit 56c2dbcef5aaf80855873b67964e94c48d137df3 Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Sun Mar 10 23:34:05 2019 +0100 Restore Cargo.toml.deps into $PWD/Cargo.toml Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/0019-Do-not-pull-optional-dependencies.patch b/0019-Do-not-pull-optional-dependencies.patch index 80d715a..5b8a70e 100644 --- a/0019-Do-not-pull-optional-dependencies.patch +++ b/0019-Do-not-pull-optional-dependencies.patch @@ -1,16 +1,16 @@ -From 72d9afecc6da319e1d59170f07a7b78afbbb1a68 Mon Sep 17 00:00:00 2001 +From 643bf0d32982b67854a39586244b25f54518de02 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Sat, 9 Mar 2019 22:04:49 +0100 Subject: [PATCH 19/19] Do not pull optional dependencies Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> --- - data/macros.cargo | 13 +++++++++++-- + data/macros.cargo | 20 +++++++++++--------- rust2rpm/templates/main.spec | 5 ----- - 2 files changed, 11 insertions(+), 7 deletions(-) + 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/data/macros.cargo b/data/macros.cargo -index 96dc354..b1a2e0b 100644 +index 96dc354..f950e79 100644 --- a/data/macros.cargo +++ b/data/macros.cargo @@ -2,8 +2,10 @@ @@ -26,7 +26,18 @@ index 96dc354..b1a2e0b 100644 %__cargo_inspector %{_bindir}/cargo-inspector %cargo_registry %{_datadir}/cargo/registry -@@ -74,10 +76,17 @@ if %__cargo_is_lib; then \ +@@ -36,10 +38,6 @@ registry = "
https://crates.io
"\ + replace-with = "local-registry"\ + EOF\ + %{__rm} -f Cargo.lock \ +-%if ! %{with check} \ +-#
https://github.com/rust-lang/cargo/issues/3732
\ +-%{__awk} -i inplace -v INPLACE_SUFFIX=.orig '/^\\\[dev-dependencies/{f=1;next} /^\\\[/{f=0}; !f' Cargo.toml \ +-%endif \ + ) + + %__cargo_parse_opts(naf:) %{shrink:\ +@@ -74,10 +72,14 @@ if %__cargo_is_lib; then \ CRATE_VERSION=$(%__cargo_inspector --version Cargo.toml) \ REG_DIR=%{buildroot}%{cargo_registry}/$CRATE_NAME-$CRATE_VERSION \ %{__mkdir} -p $REG_DIR \ @@ -35,12 +46,12 @@ index 96dc354..b1a2e0b 100644 +#
https://github.com/rust-lang/cargo/pull/6729
\ + %{__awk} -i inplace -v INPLACE_SUFFIX=.deps '/^\\\[((.+\\\.)?((dev|build)-)?dependencies|features)/{f=1;next} /^\\\[/{f=0}; !f' Cargo.toml \ %{__cargo} package -l | xargs -d '\\\n' %{__cp} --parents -a -t $REG_DIR \ - %if ! %{with check} \ - %{__cp} -a Cargo.toml.orig $REG_DIR/Cargo.toml \ -+%else \ -+ %{__cp} -a Cargo.toml.deps $REG_DIR/Cargo.toml \ - %endif \ -+ %{__rm} -f $REG_DIR/Cargo.toml.{orig,deps} \ +-%if ! %{with check} \ +- %{__cp} -a Cargo.toml.orig $REG_DIR/Cargo.toml \ +-%endif \ ++ %{__mv} Cargo.toml{.deps,} \ ++ %{__mv} $REG_DIR/Cargo.toml{.deps,} \ ++ %{__rm} -f $REG_DIR/Cargo.toml.orig \ echo '{"files":{},"package":""}' > $REG_DIR/.cargo-checksum.json \ fi \ if %__cargo_is_bin; then \ diff --git a/rust-packaging.spec b/rust-packaging.spec index f315a93..0ea39e1 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -5,7 +5,7 @@ Name: rust-packaging Version: 6 -Release: 26%{?dist} +Release: 27%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT @@ -91,6 +91,9 @@ py.test-%{python3_version} -vv test.py %{python3_sitelib}/rust2rpm/ %changelog +* Sun Mar 10 2019 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-27 +- Restore Cargo.toml.deps into $PWD/Cargo.toml + * Sun Mar 10 2019 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-26 - Strip out target dependencies too commit 2736dc0ce240753e28a3a2d5092925317eb8b5fe Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Sun Mar 10 20:12:00 2019 +0100 Strip out target dependencies too Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/0019-Do-not-pull-optional-dependencies.patch b/0019-Do-not-pull-optional-dependencies.patch index 0d746e6..80d715a 100644 --- a/0019-Do-not-pull-optional-dependencies.patch +++ b/0019-Do-not-pull-optional-dependencies.patch @@ -1,4 +1,4 @@ -From 5fbb0558d401c26f04e274b6b1fc5b0ed9d6e4cd Mon Sep 17 00:00:00 2001 +From 72d9afecc6da319e1d59170f07a7b78afbbb1a68 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Sat, 9 Mar 2019 22:04:49 +0100 Subject: [PATCH 19/19] Do not pull optional dependencies @@ -10,7 +10,7 @@ Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/data/macros.cargo b/data/macros.cargo -index 96dc354..a816578 100644 +index 96dc354..b1a2e0b 100644 --- a/data/macros.cargo +++ b/data/macros.cargo @@ -2,8 +2,10 @@ @@ -33,7 +33,7 @@ index 96dc354..a816578 100644 +# Drop all dependency/features information \ +# so that cargo doesn't fail resolving dependencies: \ +#
https://github.com/rust-lang/cargo/pull/6729
\ -+ %{__awk} -i inplace -v INPLACE_SUFFIX=.deps '/^\\\[((dev-)?dependencies|features)/{f=1;next} /^\\\[/{f=0}; !f' Cargo.toml \ ++ %{__awk} -i inplace -v INPLACE_SUFFIX=.deps '/^\\\[((.+\\\.)?((dev|build)-)?dependencies|features)/{f=1;next} /^\\\[/{f=0}; !f' Cargo.toml \ %{__cargo} package -l | xargs -d '\\\n' %{__cp} --parents -a -t $REG_DIR \ %if ! %{with check} \ %{__cp} -a Cargo.toml.orig $REG_DIR/Cargo.toml \ diff --git a/rust-packaging.spec b/rust-packaging.spec index 2418d1d..f315a93 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -5,7 +5,7 @@ Name: rust-packaging Version: 6 -Release: 25%{?dist} +Release: 26%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT @@ -91,6 +91,9 @@ py.test-%{python3_version} -vv test.py %{python3_sitelib}/rust2rpm/ %changelog +* Sun Mar 10 2019 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-26 +- Strip out target dependencies too + * Sun Mar 10 2019 Igor Gnatenko <ignatnekobrain(a)fedoraproject.org> - 6-25 - Do not error on removing files which do not exist commit e9a1f98b3d12d3661a330dc1ff11a1593f8a594e Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Sun Mar 10 10:42:12 2019 +0100 Do not error on removing files which do not exist Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/0019-Do-not-pull-optional-dependencies.patch b/0019-Do-not-pull-optional-dependencies.patch index 363fdc4..0d746e6 100644 --- a/0019-Do-not-pull-optional-dependencies.patch +++ b/0019-Do-not-pull-optional-dependencies.patch @@ -1,4 +1,4 @@ -From ccc7ed42c168675efc4b9719dad12800b92450d5 Mon Sep 17 00:00:00 2001 +From 5fbb0558d401c26f04e274b6b1fc5b0ed9d6e4cd Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Sat, 9 Mar 2019 22:04:49 +0100 Subject: [PATCH 19/19] Do not pull optional dependencies @@ -10,7 +10,7 @@ Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/data/macros.cargo b/data/macros.cargo -index 96dc354..4e8f0c9 100644 +index 96dc354..a816578 100644 --- a/data/macros.cargo +++ b/data/macros.cargo @@ -2,8 +2,10 @@ @@ -40,7 +40,7 @@ index 96dc354..4e8f0c9 100644 +%else \ + %{__cp} -a Cargo.toml.deps $REG_DIR/Cargo.toml \ %endif \ -+ %{__rm} $REG_DIR/Cargo.toml.{orig,deps} \ ++ %{__rm} -f $REG_DIR/Cargo.toml.{orig,deps} \ echo '{"files":{},"package":""}' > $REG_DIR/.cargo-checksum.json \ fi \ if %__cargo_is_bin; then \ diff --git a/rust-packaging.spec b/rust-packaging.spec index 80e49bc..2418d1d 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -5,7 +5,7 @@ Name: rust-packaging Version: 6 -Release: 24%{?dist} +Release: 25%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT @@ -91,6 +91,9 @@ py.test-%{python3_version} -vv test.py %{python3_sitelib}/rust2rpm/ %changelog +* Sun Mar 10 2019 Igor Gnatenko <ignatnekobrain(a)fedoraproject.org> - 6-25 +- Do not error on removing files which do not exist + * Sun Mar 10 2019 Igor Gnatenko <ignatnekobrain(a)fedoraproject.org> - 6-24 - Escape `\n` properly in macro file commit 60f3d8f016932795e43c88d70d9bb7d733da9a92 Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Sun Mar 10 10:16:51 2019 +0100 Escape `\n` properly in macro file Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/0001-name-spec-patch_file-by-real-crate-name.patch b/0001-name-spec-patch_file-by-real-crate-name.patch index 54c5624..d8df04a 100644 --- a/0001-name-spec-patch_file-by-real-crate-name.patch +++ b/0001-name-spec-patch_file-by-real-crate-name.patch @@ -1,7 +1,7 @@ From 0dc9fc182edf0791ca697f587e48dd39948d63c1 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Mon, 10 Sep 2018 23:37:40 +0200 -Subject: [PATCH 01/18] name spec/patch_file by real crate name +Subject: [PATCH 01/19] name spec/patch_file by real crate name When renaming using patch file, we really want to change file names too. diff --git a/0002-generate-doc-statements.patch b/0002-generate-doc-statements.patch index 5264c8d..7d5550b 100644 --- a/0002-generate-doc-statements.patch +++ b/0002-generate-doc-statements.patch @@ -1,7 +1,7 @@ From 561280a0ea35f226ef243526be2bbb656db44af6 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Mon, 10 Sep 2018 23:40:18 +0200 -Subject: [PATCH 02/18] generate %doc statements +Subject: [PATCH 02/19] generate %doc statements Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> --- diff --git a/0003-do-better-for-renamed-crates.patch b/0003-do-better-for-renamed-crates.patch index 2f72093..97d5815 100644 --- a/0003-do-better-for-renamed-crates.patch +++ b/0003-do-better-for-renamed-crates.patch @@ -1,7 +1,7 @@ From 2050880140d4953b9ebdc7211e30df3ccf5dd61d Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Tue, 11 Sep 2018 00:06:50 +0200 -Subject: [PATCH 03/18] do better for renamed crates +Subject: [PATCH 03/19] do better for renamed crates Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> --- diff --git a/0004-remove-pre-3.6-leftovers.patch b/0004-remove-pre-3.6-leftovers.patch index 34dcf6a..017fb26 100644 --- a/0004-remove-pre-3.6-leftovers.patch +++ b/0004-remove-pre-3.6-leftovers.patch @@ -1,7 +1,7 @@ From e6e9cbbb71199c2773b47fa21f1c917a167c1743 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Tue, 11 Sep 2018 10:43:53 +0200 -Subject: [PATCH 04/18] remove pre-3.6 leftovers +Subject: [PATCH 04/19] remove pre-3.6 leftovers Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> --- diff --git a/0005-Remove-half-downloaded-crate-on-C.patch b/0005-Remove-half-downloaded-crate-on-C.patch index 6546060..033815b 100644 --- a/0005-Remove-half-downloaded-crate-on-C.patch +++ b/0005-Remove-half-downloaded-crate-on-C.patch @@ -1,7 +1,7 @@ From 2f12c83d14afe71e9efed2d1be62e1e610e602e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl> Date: Fri, 17 Aug 2018 10:03:48 +0200 -Subject: [PATCH 05/18] Remove half-downloaded crate on ^C +Subject: [PATCH 05/19] Remove half-downloaded crate on ^C Subsequent invocations would fail with an error about a corrupted file. We don't have support for resuming a failed download, so let's remove the diff --git a/0006-Throw-an-error-if-s-is-used-without-a-crate.patch b/0006-Throw-an-error-if-s-is-used-without-a-crate.patch index 8efbc88..861d233 100644 --- a/0006-Throw-an-error-if-s-is-used-without-a-crate.patch +++ b/0006-Throw-an-error-if-s-is-used-without-a-crate.patch @@ -1,7 +1,7 @@ From 5a1cde5b8dcaea74ebb2050879036bf46df63adc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl> Date: Fri, 17 Aug 2018 10:18:59 +0200 -Subject: [PATCH 06/18] Throw an error if -s is used without a crate +Subject: [PATCH 06/19] Throw an error if -s is used without a crate In the future we might want to be smarter and find the crate, but let's at least not ignore the option completely. diff --git a/0007-split-features-into-subpackages.patch b/0007-split-features-into-subpackages.patch index 9aba559..acf5911 100644 --- a/0007-split-features-into-subpackages.patch +++ b/0007-split-features-into-subpackages.patch @@ -1,7 +1,7 @@ From 2cac5e5ad5ff5472923ce333bef59679612bbaa2 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Fri, 26 Oct 2018 11:20:13 +0200 -Subject: [PATCH 07/18] split features into subpackages +Subject: [PATCH 07/19] split features into subpackages References:
https://discussion.fedoraproject.org/t/rfc-new-crates-packaging-design-feat…
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/0008-add-support-for-dependencies-with-same-name.patch b/0008-add-support-for-dependencies-with-same-name.patch index 30b6c33..5412d76 100644 --- a/0008-add-support-for-dependencies-with-same-name.patch +++ b/0008-add-support-for-dependencies-with-same-name.patch @@ -1,7 +1,7 @@ From a1d3a84645aa7bbe5ca07b60bead1ddf90a21cc1 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Tue, 30 Oct 2018 20:37:38 +0100 -Subject: [PATCH 08/18] add support for dependencies with same name +Subject: [PATCH 08/19] add support for dependencies with same name Reported-by: Josh Stone <jistone(a)redhat.com> References:
https://internals.rust-lang.org/t/optional-dependencies-with-same-name/8728
diff --git a/0009-add-support-for-feeding-user-configuration.patch b/0009-add-support-for-feeding-user-configuration.patch index e2abc6e..8985513 100644 --- a/0009-add-support-for-feeding-user-configuration.patch +++ b/0009-add-support-for-feeding-user-configuration.patch @@ -1,7 +1,7 @@ From 197150ee2e862edcd46f7ab02c9e4d17e49ca75d Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Wed, 31 Oct 2018 18:03:21 +0100 -Subject: [PATCH 09/18] add support for feeding user configuration +Subject: [PATCH 09/19] add support for feeding user configuration Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> --- diff --git a/0010-trivial-use-f-strings-everywhere.patch b/0010-trivial-use-f-strings-everywhere.patch index dd9436d..c98be77 100644 --- a/0010-trivial-use-f-strings-everywhere.patch +++ b/0010-trivial-use-f-strings-everywhere.patch @@ -1,7 +1,7 @@ From 83ea3796cd28ec7689b39e7dc7a70bd11af1abf1 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Wed, 31 Oct 2018 17:00:58 +0100 -Subject: [PATCH 10/18] trivial: use f-strings everywhere +Subject: [PATCH 10/19] trivial: use f-strings everywhere Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> --- diff --git a/0011-Add-option-to-not-generate-a-default-changelog-entry.patch b/0011-Add-option-to-not-generate-a-default-changelog-entry.patch index c03faa6..8457b4a 100644 --- a/0011-Add-option-to-not-generate-a-default-changelog-entry.patch +++ b/0011-Add-option-to-not-generate-a-default-changelog-entry.patch @@ -1,7 +1,7 @@ From 294c6f571c0f4f7ed5a4fcb34142b0d332c55f29 Mon Sep 17 00:00:00 2001 From: Neal Gompa <ngompa13(a)gmail.com> Date: Sun, 11 Nov 2018 11:06:27 -0500 -Subject: [PATCH 11/18] Add option to not generate a default changelog entry +Subject: [PATCH 11/19] Add option to not generate a default changelog entry For Rust packages created through the OBS source service, the changelog is managed by an external <pkg>.changes file that is diff --git a/0012-Set-CARGO_HOME-to-the-local-.config.patch b/0012-Set-CARGO_HOME-to-the-local-.config.patch index a8e5ea1..e9e37de 100644 --- a/0012-Set-CARGO_HOME-to-the-local-.config.patch +++ b/0012-Set-CARGO_HOME-to-the-local-.config.patch @@ -1,7 +1,7 @@ From b4e25038296cd57eba639a059e8baaf139a5d287 Mon Sep 17 00:00:00 2001 From: Josh Stone <jistone(a)redhat.com> Date: Fri, 7 Dec 2018 13:58:41 -0800 -Subject: [PATCH 12/18] Set CARGO_HOME to the local .config +Subject: [PATCH 12/19] Set CARGO_HOME to the local .config --- data/macros.cargo | 6 +++++- diff --git a/0013-Set-the-install-root-in-.cargo-config.patch b/0013-Set-the-install-root-in-.cargo-config.patch index e2ef86e..0b97943 100644 --- a/0013-Set-the-install-root-in-.cargo-config.patch +++ b/0013-Set-the-install-root-in-.cargo-config.patch @@ -1,7 +1,7 @@ From a04e95bc4f807139bd3c4b75f46fd9a60ec1db8f Mon Sep 17 00:00:00 2001 From: Josh Stone <jistone(a)redhat.com> Date: Fri, 7 Dec 2018 13:59:03 -0800 -Subject: [PATCH 13/18] Set the install root in .cargo/config +Subject: [PATCH 13/19] Set the install root in .cargo/config --- data/macros.cargo | 4 +++- diff --git a/0014-licensing-fix-zlib-license-translation.patch b/0014-licensing-fix-zlib-license-translation.patch index fc8a165..a04f0db 100644 --- a/0014-licensing-fix-zlib-license-translation.patch +++ b/0014-licensing-fix-zlib-license-translation.patch @@ -1,7 +1,7 @@ From 7c00b0f29085166b1a89aec766945b10dc7aca23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl> Date: Sat, 1 Dec 2018 15:40:08 +0100 -Subject: [PATCH 14/18] licensing: fix zlib license translation +Subject: [PATCH 14/19] licensing: fix zlib license translation The file was mangled, and something about "teeworlds" was inserted into the line for zlib. The spdx database doesn't list "teeworlds diff --git a/0015-licensing-rename-EPL-to-EPL-1.0-and-add-EPL-2.0.patch b/0015-licensing-rename-EPL-to-EPL-1.0-and-add-EPL-2.0.patch index 76be3f8..ffe83aa 100644 --- a/0015-licensing-rename-EPL-to-EPL-1.0-and-add-EPL-2.0.patch +++ b/0015-licensing-rename-EPL-to-EPL-1.0-and-add-EPL-2.0.patch @@ -1,7 +1,7 @@ From b0d2756917b380a5d66d2407dbeb8891c51875e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl> Date: Sat, 1 Dec 2018 15:46:08 +0100 -Subject: [PATCH 15/18] licensing: rename EPL to EPL-1.0 and add EPL-2.0 +Subject: [PATCH 15/19] licensing: rename EPL to EPL-1.0 and add EPL-2.0 According to
https://fedoraproject.org/wiki/Licensing:Main#Software_License_List
EPL-1.0 and EPL-2.0 are the short tags that should be used now. diff --git a/0016-Add-support-for-prerelease-versions.patch b/0016-Add-support-for-prerelease-versions.patch index 187a47d..cbffd10 100644 --- a/0016-Add-support-for-prerelease-versions.patch +++ b/0016-Add-support-for-prerelease-versions.patch @@ -1,7 +1,7 @@ From 00c0c5cec90d5d6abbfd4acb2f5d65439b4bfd27 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Sat, 26 Jan 2019 08:33:37 +0100 -Subject: [PATCH 16/18] Add support for prerelease versions +Subject: [PATCH 16/19] Add support for prerelease versions Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> --- diff --git a/0017-data-Cargo-doesn-t-escape-paths-with-space.patch b/0017-data-Cargo-doesn-t-escape-paths-with-space.patch index 90dadeb..0d031b0 100644 --- a/0017-data-Cargo-doesn-t-escape-paths-with-space.patch +++ b/0017-data-Cargo-doesn-t-escape-paths-with-space.patch @@ -1,7 +1,7 @@ From 84a73bfa24ce11602a1f19554dc495125be4d0aa Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Sun, 17 Feb 2019 17:19:25 +0100 -Subject: [PATCH 17/18] data: Cargo doesn't escape paths with space +Subject: [PATCH 17/19] data: Cargo doesn't escape paths with space When building matrixmultiply v0.2.2: diff --git a/0018-Do-not-pull-optional-dependencies.patch b/0018-Do-not-pull-optional-dependencies.patch deleted file mode 100644 index 68f2a8c..0000000 --- a/0018-Do-not-pull-optional-dependencies.patch +++ /dev/null @@ -1,66 +0,0 @@ -From b0f34c2b6a7b8ca5b924e5c230f1271826114cb0 Mon Sep 17 00:00:00 2001 -From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> -Date: Sat, 9 Mar 2019 22:04:49 +0100 -Subject: [PATCH 18/18] Do not pull optional dependencies - -Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> ---- - data/macros.cargo | 13 +++++++++++-- - rust2rpm/templates/main.spec | 5 ----- - 2 files changed, 11 insertions(+), 7 deletions(-) - -diff --git a/data/macros.cargo b/data/macros.cargo -index 9a375d0..0e382c8 100644 ---- a/data/macros.cargo -+++ b/data/macros.cargo -@@ -2,8 +2,10 @@ - #
https://github.com/rust-lang/cargo/issues/6397
- # But we can set CARGO_HOME locally, which is a good idea anyway to make sure - # it never writes to ~/.cargo during rpmbuild. --%__cargo %{_bindir}/env CARGO_HOME=.cargo %{_bindir}/cargo --%__cargo_common_opts %{?_smp_mflags} -+# We also need RUSTC_BOOTSTRAP since we use -Z avoid-dev-deps -+# until it gets stabilized:
https://github.com/rust-lang/cargo/issues/5133
-+%__cargo %{_bindir}/env CARGO_HOME=.cargo RUSTC_BOOTSTRAP=1 %{_bindir}/cargo -+%__cargo_common_opts %{?_smp_mflags} -Z avoid-dev-deps - %__cargo_inspector %{_bindir}/cargo-inspector - - %cargo_registry %{_datadir}/cargo/registry -@@ -74,10 +76,17 @@ if %__cargo_is_lib; then \ - CRATE_VERSION=$(%__cargo_inspector --version Cargo.toml) \ - REG_DIR=%{buildroot}%{cargo_registry}/$CRATE_NAME-$CRATE_VERSION \ - %{__mkdir} -p $REG_DIR \ -+# Drop all dependency/features information \ -+# so that cargo doesn't fail resolving dependencies: \ -+#
https://github.com/rust-lang/cargo/pull/6729
\ -+ %{__awk} -i inplace -v INPLACE_SUFFIX=.deps '/^\\\[((dev-)?dependencies|features)/{f=1;next} /^\\\[/{f=0}; !f' Cargo.toml \ - %{__cargo} package -l | xargs -d '\n' %{__cp} --parents -a -t $REG_DIR \ - %if ! %{with check} \ - %{__cp} -a Cargo.toml.orig $REG_DIR/Cargo.toml \ -+%else \ -+ %{__cp} -a Cargo.toml.deps $REG_DIR/Cargo.toml \ - %endif \ -+ %{__rm} $REG_DIR/Cargo.toml.{orig,deps} \ - echo '{"files":{},"package":""}' > $REG_DIR/.cargo-checksum.json \ - fi \ - if %__cargo_is_bin; then \ -diff --git a/rust2rpm/templates/main.spec b/rust2rpm/templates/main.spec -index 1ebef7b..f0c5445 100644 ---- a/rust2rpm/templates/main.spec -+++ b/rust2rpm/templates/main.spec -@@ -44,12 +44,7 @@ Patch0: {{ patch_file }} - ExclusiveArch: %{rust_arches} - - BuildRequires: rust-packaging --{# We will put all non-optional and optional dependencies until --
https://github.com/rust-lang/cargo/issues/5133
-- is solved - {% set buildrequires = normalize_deps(md.requires("default", resolve=True))|sort %} --#} --{% set buildrequires = normalize_deps(md.all_dependencies)|sort %} - {% for req in buildrequires %} - BuildRequires: {{ req }} - {% endfor %} --- -2.21.0 - diff --git a/0018-data-Escape-n-properly.patch b/0018-data-Escape-n-properly.patch new file mode 100644 index 0000000..c9bffdf --- /dev/null +++ b/0018-data-Escape-n-properly.patch @@ -0,0 +1,26 @@ +From 7f0a499ff3fca046869ab754151ae068903c4ab9 Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +Date: Sun, 10 Mar 2019 10:14:28 +0100 +Subject: [PATCH 18/19] data: Escape `\n` properly + +Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +--- + data/macros.cargo | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/data/macros.cargo b/data/macros.cargo +index 9a375d0..96dc354 100644 +--- a/data/macros.cargo ++++ b/data/macros.cargo +@@ -74,7 +74,7 @@ if %__cargo_is_lib; then \ + CRATE_VERSION=$(%__cargo_inspector --version Cargo.toml) \ + REG_DIR=%{buildroot}%{cargo_registry}/$CRATE_NAME-$CRATE_VERSION \ + %{__mkdir} -p $REG_DIR \ +- %{__cargo} package -l | xargs -d '\n' %{__cp} --parents -a -t $REG_DIR \ ++ %{__cargo} package -l | xargs -d '\\\n' %{__cp} --parents -a -t $REG_DIR \ + %if ! %{with check} \ + %{__cp} -a Cargo.toml.orig $REG_DIR/Cargo.toml \ + %endif \ +-- +2.21.0 + diff --git a/0019-Do-not-pull-optional-dependencies.patch b/0019-Do-not-pull-optional-dependencies.patch new file mode 100644 index 0000000..363fdc4 --- /dev/null +++ b/0019-Do-not-pull-optional-dependencies.patch @@ -0,0 +1,66 @@ +From ccc7ed42c168675efc4b9719dad12800b92450d5 Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +Date: Sat, 9 Mar 2019 22:04:49 +0100 +Subject: [PATCH 19/19] Do not pull optional dependencies + +Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +--- + data/macros.cargo | 13 +++++++++++-- + rust2rpm/templates/main.spec | 5 ----- + 2 files changed, 11 insertions(+), 7 deletions(-) + +diff --git a/data/macros.cargo b/data/macros.cargo +index 96dc354..4e8f0c9 100644 +--- a/data/macros.cargo ++++ b/data/macros.cargo +@@ -2,8 +2,10 @@ + #
https://github.com/rust-lang/cargo/issues/6397
+ # But we can set CARGO_HOME locally, which is a good idea anyway to make sure + # it never writes to ~/.cargo during rpmbuild. +-%__cargo %{_bindir}/env CARGO_HOME=.cargo %{_bindir}/cargo +-%__cargo_common_opts %{?_smp_mflags} ++# We also need RUSTC_BOOTSTRAP since we use -Z avoid-dev-deps ++# until it gets stabilized:
https://github.com/rust-lang/cargo/issues/5133
++%__cargo %{_bindir}/env CARGO_HOME=.cargo RUSTC_BOOTSTRAP=1 %{_bindir}/cargo ++%__cargo_common_opts %{?_smp_mflags} -Z avoid-dev-deps + %__cargo_inspector %{_bindir}/cargo-inspector + + %cargo_registry %{_datadir}/cargo/registry +@@ -74,10 +76,17 @@ if %__cargo_is_lib; then \ + CRATE_VERSION=$(%__cargo_inspector --version Cargo.toml) \ + REG_DIR=%{buildroot}%{cargo_registry}/$CRATE_NAME-$CRATE_VERSION \ + %{__mkdir} -p $REG_DIR \ ++# Drop all dependency/features information \ ++# so that cargo doesn't fail resolving dependencies: \ ++#
https://github.com/rust-lang/cargo/pull/6729
\ ++ %{__awk} -i inplace -v INPLACE_SUFFIX=.deps '/^\\\[((dev-)?dependencies|features)/{f=1;next} /^\\\[/{f=0}; !f' Cargo.toml \ + %{__cargo} package -l | xargs -d '\\\n' %{__cp} --parents -a -t $REG_DIR \ + %if ! %{with check} \ + %{__cp} -a Cargo.toml.orig $REG_DIR/Cargo.toml \ ++%else \ ++ %{__cp} -a Cargo.toml.deps $REG_DIR/Cargo.toml \ + %endif \ ++ %{__rm} $REG_DIR/Cargo.toml.{orig,deps} \ + echo '{"files":{},"package":""}' > $REG_DIR/.cargo-checksum.json \ + fi \ + if %__cargo_is_bin; then \ +diff --git a/rust2rpm/templates/main.spec b/rust2rpm/templates/main.spec +index 1ebef7b..f0c5445 100644 +--- a/rust2rpm/templates/main.spec ++++ b/rust2rpm/templates/main.spec +@@ -44,12 +44,7 @@ Patch0: {{ patch_file }} + ExclusiveArch: %{rust_arches} + + BuildRequires: rust-packaging +-{# We will put all non-optional and optional dependencies until +-
https://github.com/rust-lang/cargo/issues/5133
+- is solved + {% set buildrequires = normalize_deps(md.requires("default", resolve=True))|sort %} +-#} +-{% set buildrequires = normalize_deps(md.all_dependencies)|sort %} + {% for req in buildrequires %} + BuildRequires: {{ req }} + {% endfor %} +-- +2.21.0 + diff --git a/rust-packaging.spec b/rust-packaging.spec index 3f2294c..80e49bc 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -5,7 +5,7 @@ Name: rust-packaging Version: 6 -Release: 23%{?dist} +Release: 24%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT @@ -28,8 +28,9 @@ Patch0014: 0014-licensing-fix-zlib-license-translation.patch Patch0015: 0015-licensing-rename-EPL-to-EPL-1.0-and-add-EPL-2.0.patch Patch0016: 0016-Add-support-for-prerelease-versions.patch Patch0017: 0017-data-Cargo-doesn-t-escape-paths-with-space.patch -#
https://pagure.io/fedora-rust/rust2rpm/pull-request/68
<Paste> -Patch0018: 0018-Do-not-pull-optional-dependencies.patch +Patch0018: 0018-data-Escape-n-properly.patch +#
https://pagure.io/fedora-rust/rust2rpm/pull-request/68
+Patch0019: 0019-Do-not-pull-optional-dependencies.patch ExclusiveArch: %{rust_arches} @@ -90,6 +91,9 @@ py.test-%{python3_version} -vv test.py %{python3_sitelib}/rust2rpm/ %changelog +* Sun Mar 10 2019 Igor Gnatenko <ignatnekobrain(a)fedoraproject.org> - 6-24 +- Escape `\n` properly in macro file + * Sun Mar 10 2019 Igor Gnatenko <ignatnekobrain(a)fedoraproject.org> - 6-23 - Do not pull optional deps into BRs and trivial fixes commit 5955f7d37d64720aa2f2f4147085f23fcce36d95 Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Sun Mar 10 09:49:25 2019 +0100 Do not pull optional deps into BRs and trivial fixes Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/0001-name-spec-patch_file-by-real-crate-name.patch b/0001-name-spec-patch_file-by-real-crate-name.patch index 4d55717..54c5624 100644 --- a/0001-name-spec-patch_file-by-real-crate-name.patch +++ b/0001-name-spec-patch_file-by-real-crate-name.patch @@ -1,7 +1,7 @@ From 0dc9fc182edf0791ca697f587e48dd39948d63c1 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Mon, 10 Sep 2018 23:37:40 +0200 -Subject: [PATCH 01/14] name spec/patch_file by real crate name +Subject: [PATCH 01/18] name spec/patch_file by real crate name When renaming using patch file, we really want to change file names too. @@ -33,5 +33,5 @@ index dc78828..1575ce6 100644 if args.stdout: print("# {}".format(spec_file)) -- -2.20.1 +2.21.0 diff --git a/0002-generate-doc-statements.patch b/0002-generate-doc-statements.patch index 42ca40d..5264c8d 100644 --- a/0002-generate-doc-statements.patch +++ b/0002-generate-doc-statements.patch @@ -1,7 +1,7 @@ From 561280a0ea35f226ef243526be2bbb656db44af6 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Mon, 10 Sep 2018 23:40:18 +0200 -Subject: [PATCH 02/14] generate %doc statements +Subject: [PATCH 02/18] generate %doc statements Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> --- @@ -54,5 +54,5 @@ index 1aeb969..2e9f841 100644 {% endif %} -- -2.20.1 +2.21.0 diff --git a/0003-do-better-for-renamed-crates.patch b/0003-do-better-for-renamed-crates.patch index 3f1bc98..2f72093 100644 --- a/0003-do-better-for-renamed-crates.patch +++ b/0003-do-better-for-renamed-crates.patch @@ -1,7 +1,7 @@ From 2050880140d4953b9ebdc7211e30df3ccf5dd61d Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Tue, 11 Sep 2018 00:06:50 +0200 -Subject: [PATCH 03/14] do better for renamed crates +Subject: [PATCH 03/18] do better for renamed crates Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> --- @@ -86,5 +86,5 @@ index 2e9f841..7dbcc3f 100644 %build -- -2.20.1 +2.21.0 diff --git a/0004-remove-pre-3.6-leftovers.patch b/0004-remove-pre-3.6-leftovers.patch index 7133f4e..34dcf6a 100644 --- a/0004-remove-pre-3.6-leftovers.patch +++ b/0004-remove-pre-3.6-leftovers.patch @@ -1,7 +1,7 @@ From e6e9cbbb71199c2773b47fa21f1c917a167c1743 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Tue, 11 Sep 2018 10:43:53 +0200 -Subject: [PATCH 04/14] remove pre-3.6 leftovers +Subject: [PATCH 04/18] remove pre-3.6 leftovers Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> --- @@ -23,5 +23,5 @@ index f52d968..5adeb65 100644 + "--manifest-path={}".format(path)]) return cls.from_json(json.loads(metadata)) -- -2.20.1 +2.21.0 diff --git a/0005-Remove-half-downloaded-crate-on-C.patch b/0005-Remove-half-downloaded-crate-on-C.patch index 8ae52e4..6546060 100644 --- a/0005-Remove-half-downloaded-crate-on-C.patch +++ b/0005-Remove-half-downloaded-crate-on-C.patch @@ -1,7 +1,7 @@ From 2f12c83d14afe71e9efed2d1be62e1e610e602e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl> Date: Fri, 17 Aug 2018 10:03:48 +0200 -Subject: [PATCH 05/14] Remove half-downloaded crate on ^C +Subject: [PATCH 05/18] Remove half-downloaded crate on ^C Subsequent invocations would fail with an error about a corrupted file. We don't have support for resuming a failed download, so let's remove the @@ -40,5 +40,5 @@ index e993e7b..8e6f6eb 100644 total=total, unit="B", unit_scale=True): f.write(chunk) -- -2.20.1 +2.21.0 diff --git a/0006-Throw-an-error-if-s-is-used-without-a-crate.patch b/0006-Throw-an-error-if-s-is-used-without-a-crate.patch index 8684175..8efbc88 100644 --- a/0006-Throw-an-error-if-s-is-used-without-a-crate.patch +++ b/0006-Throw-an-error-if-s-is-used-without-a-crate.patch @@ -1,7 +1,7 @@ From 5a1cde5b8dcaea74ebb2050879036bf46df63adc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl> Date: Fri, 17 Aug 2018 10:18:59 +0200 -Subject: [PATCH 06/14] Throw an error if -s is used without a crate +Subject: [PATCH 06/18] Throw an error if -s is used without a crate In the future we might want to be smarter and find the crate, but let's at least not ignore the option completely. @@ -24,5 +24,5 @@ index 8e6f6eb..f23ebbc 100644 diff = make_patch(toml, enabled=patch, tmpfile=True) metadata = Metadata.from_file(toml) -- -2.20.1 +2.21.0 diff --git a/0007-split-features-into-subpackages.patch b/0007-split-features-into-subpackages.patch index 19fd5e5..9aba559 100644 --- a/0007-split-features-into-subpackages.patch +++ b/0007-split-features-into-subpackages.patch @@ -1,7 +1,7 @@ From 2cac5e5ad5ff5472923ce333bef59679612bbaa2 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Fri, 26 Oct 2018 11:20:13 +0200 -Subject: [PATCH 07/14] split features into subpackages +Subject: [PATCH 07/18] split features into subpackages References:
https://discussion.fedoraproject.org/t/rfc-new-crates-packaging-design-feat…
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> @@ -1060,5 +1060,5 @@ index b856fdd..30263b4 100644 - assert [str(x) for x in md.provides] == provides - assert [str(x) for x in md.requires] == requires -- -2.20.1 +2.21.0 diff --git a/0008-add-support-for-dependencies-with-same-name.patch b/0008-add-support-for-dependencies-with-same-name.patch index f6f2743..30b6c33 100644 --- a/0008-add-support-for-dependencies-with-same-name.patch +++ b/0008-add-support-for-dependencies-with-same-name.patch @@ -1,7 +1,7 @@ From a1d3a84645aa7bbe5ca07b60bead1ddf90a21cc1 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Tue, 30 Oct 2018 20:37:38 +0100 -Subject: [PATCH 08/14] add support for dependencies with same name +Subject: [PATCH 08/18] add support for dependencies with same name Reported-by: Josh Stone <jistone(a)redhat.com> References:
https://internals.rust-lang.org/t/optional-dependencies-with-same-name/8728
@@ -70,5 +70,5 @@ index 4929cdd..328b67a 100644 if "default" not in deps_by_feature: -- -2.20.1 +2.21.0 diff --git a/0009-add-support-for-feeding-user-configuration.patch b/0009-add-support-for-feeding-user-configuration.patch index 5078943..e2abc6e 100644 --- a/0009-add-support-for-feeding-user-configuration.patch +++ b/0009-add-support-for-feeding-user-configuration.patch @@ -1,7 +1,7 @@ From 197150ee2e862edcd46f7ab02c9e4d17e49ca75d Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Wed, 31 Oct 2018 18:03:21 +0100 -Subject: [PATCH 09/14] add support for feeding user configuration +Subject: [PATCH 09/18] add support for feeding user configuration Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> --- @@ -144,5 +144,5 @@ index 0d9a80b..d901e6d 100644 %description {{ pkg }} %{_description} -- -2.20.1 +2.21.0 diff --git a/0010-trivial-use-f-strings-everywhere.patch b/0010-trivial-use-f-strings-everywhere.patch index 72c5828..dd9436d 100644 --- a/0010-trivial-use-f-strings-everywhere.patch +++ b/0010-trivial-use-f-strings-everywhere.patch @@ -1,7 +1,7 @@ From 83ea3796cd28ec7689b39e7dc7a70bd11af1abf1 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Wed, 31 Oct 2018 17:00:58 +0100 -Subject: [PATCH 10/14] trivial: use f-strings everywhere +Subject: [PATCH 10/18] trivial: use f-strings everywhere Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> --- @@ -90,5 +90,5 @@ index c691274..b60e6c4 100644 else: with open(spec_file, "w") as fobj: -- -2.20.1 +2.21.0 diff --git a/0011-Add-option-to-not-generate-a-default-changelog-entry.patch b/0011-Add-option-to-not-generate-a-default-changelog-entry.patch index 4345add..c03faa6 100644 --- a/0011-Add-option-to-not-generate-a-default-changelog-entry.patch +++ b/0011-Add-option-to-not-generate-a-default-changelog-entry.patch @@ -1,7 +1,7 @@ From 294c6f571c0f4f7ed5a4fcb34142b0d332c55f29 Mon Sep 17 00:00:00 2001 From: Neal Gompa <ngompa13(a)gmail.com> Date: Sun, 11 Nov 2018 11:06:27 -0500 -Subject: [PATCH 11/14] Add option to not generate a default changelog entry +Subject: [PATCH 11/18] Add option to not generate a default changelog entry For Rust packages created through the OBS source service, the changelog is managed by an external <pkg>.changes file that is @@ -59,5 +59,5 @@ index d901e6d..84bd97d 100644 + {% include target ~ "-changelog.spec.inc" %} +{% endif %} -- -2.20.1 +2.21.0 diff --git a/0012-Set-CARGO_HOME-to-the-local-.config.patch b/0012-Set-CARGO_HOME-to-the-local-.config.patch index ddf86d1..a8e5ea1 100644 --- a/0012-Set-CARGO_HOME-to-the-local-.config.patch +++ b/0012-Set-CARGO_HOME-to-the-local-.config.patch @@ -1,7 +1,7 @@ From b4e25038296cd57eba639a059e8baaf139a5d287 Mon Sep 17 00:00:00 2001 From: Josh Stone <jistone(a)redhat.com> Date: Fri, 7 Dec 2018 13:58:41 -0800 -Subject: [PATCH 12/14] Set CARGO_HOME to the local .config +Subject: [PATCH 12/18] Set CARGO_HOME to the local .config --- data/macros.cargo | 6 +++++- @@ -22,5 +22,5 @@ index 7fb025b..e760721 100644 %__cargo_inspector %{_bindir}/cargo-inspector -- -2.20.1 +2.21.0 diff --git a/0013-Set-the-install-root-in-.cargo-config.patch b/0013-Set-the-install-root-in-.cargo-config.patch index baa5e3a..e2ef86e 100644 --- a/0013-Set-the-install-root-in-.cargo-config.patch +++ b/0013-Set-the-install-root-in-.cargo-config.patch @@ -1,7 +1,7 @@ From a04e95bc4f807139bd3c4b75f46fd9a60ec1db8f Mon Sep 17 00:00:00 2001 From: Josh Stone <jistone(a)redhat.com> Date: Fri, 7 Dec 2018 13:59:03 -0800 -Subject: [PATCH 13/14] Set the install root in .cargo/config +Subject: [PATCH 13/18] Set the install root in .cargo/config --- data/macros.cargo | 4 +++- @@ -30,5 +30,5 @@ index e760721..9a9ce6a 100644 %* \ }\ -- -2.20.1 +2.21.0 diff --git a/0014-Add-support-for-prerelease-versions.patch b/0014-Add-support-for-prerelease-versions.patch deleted file mode 100644 index e7ec8ef..0000000 --- a/0014-Add-support-for-prerelease-versions.patch +++ /dev/null @@ -1,160 +0,0 @@ -From cfe4e77674ccb6e25e54a3749f4ef91b377e808f Mon Sep 17 00:00:00 2001 -From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> -Date: Sat, 26 Jan 2019 08:33:37 +0100 -Subject: [PATCH 14/14] Add support for prerelease versions - -Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> ---- - data/macros.rust-srpm | 38 ++++++++++++++++++++++++++++++++++++ - rust2rpm/metadata.py | 18 +++++++++++------ - rust2rpm/templates/main.spec | 10 +++------- - test.py | 8 ++++++++ - 4 files changed, 61 insertions(+), 13 deletions(-) - -diff --git a/data/macros.rust-srpm b/data/macros.rust-srpm -index f2bae9d..872b87f 100644 ---- a/data/macros.rust-srpm -+++ b/data/macros.rust-srpm -@@ -1 +1,39 @@ - %rust_arches x86_64 i686 armv7hl aarch64 ppc64 ppc64le s390x -+%version_no_tilde() %{lua: -+ local sep = rpm.expand('%1') -+ local ver = rpm.expand('%2') -+\ -+ if sep == '%1' then -+ sep = '-' -+ end -+\ -+ if ver == '%2' then -+ ver = rpm.expand('%version') -+ end -+ ver = ver:gsub('~', sep) -+\ -+ print(ver) -+} -+%__crates_url
https://crates.io/api/v1/crates/
-+%crates_source() %{lua: -+ local crate = rpm.expand('%1') -+ local version = rpm.expand('%2') -+ local url = rpm.expand('%__crates_url') -+\ -+ if crate == '%1' then -+ crate = rpm.expand('%real_crate') -+ end -+ if crate == '%real_crate' then -+ crate = rpm.expand('%crate') -+ end -+ if crate == '%crate' then -+ crate = rpm.expand('%name') -+ end -+\ -+ if version == '%2' then -+ version = rpm.expand('%version') -+ end -+ version = version:gsub('~', '-') -+\ -+ print(url .. crate .. '/' .. version .. '/download#/' .. crate .. '-' .. version .. '.crate') -+} -diff --git a/rust2rpm/metadata.py b/rust2rpm/metadata.py -index 328b67a..f0718d5 100644 ---- a/rust2rpm/metadata.py -+++ b/rust2rpm/metadata.py -@@ -45,11 +45,13 @@ class Dependency: - # Any means any - continue - ver = req.spec -- if ver.prerelease: -- raise NotImplementedError(f"Pre-release requirement is not supported: {ver}") - if req.kind in (req.KIND_NEQ, req.KIND_EMPTY): - raise NotImplementedError(f"'!=' and empty kinds are not supported: {req}") -- coerced = semver.Version.coerce(str(ver)) -+ coerced = str(semver.Version.coerce(str(ver))) -+ if ver.prerelease: -+ coerced = coerced.replace("-", "~") -+ # This will advance us to closest stable version (2.0.0-beta.6 2.0.0) -+ ver = ver.next_patch() - if req.kind == req.KIND_EQUAL: - req.kind = req.KIND_SHORTEQ - if req.kind in (req.KIND_CARET, req.KIND_COMPATIBLE): -@@ -107,7 +109,11 @@ class Dependency: - class Metadata: - def __init__(self, name, version): - self.name = name -- self.version = version -+ self._version = version -+ version_normalized = Dependency._normalize_req(f"={self._version}") -+ if len(version_normalized) != 1: -+ raise Exception(f"Incorrect version: {self._version}") -+ self.version = version_normalized[0][1] - self.license = None - self.license_file = None - self.readme = None -@@ -187,7 +193,7 @@ class Metadata: - def provides(self, feature=None): - if feature not in self.dependencies: - raise KeyError(f"Feature {feature!r} doesn't exist") -- return Dependency(self.name, f"={self.version}", features={feature}) -+ return Dependency(self.name, f"={self._version}", features={feature}) - - @classmethod - def _resolve(cls, deps_by_feature, feature): -@@ -207,7 +213,7 @@ class Metadata: - return self._resolve(self.dependencies, feature)[1] - else: - features, deps = self.dependencies[feature] -- fdeps = set(Dependency(self.name, f"={self.version}", features={feature}) -+ fdeps = set(Dependency(self.name, f"={self._version}", features={feature}) - for feature in features) - return fdeps | deps - -diff --git a/rust2rpm/templates/main.spec b/rust2rpm/templates/main.spec -index 84bd97d..1ebef7b 100644 ---- a/rust2rpm/templates/main.spec -+++ b/rust2rpm/templates/main.spec -@@ -31,11 +31,7 @@ License: {{ license|default("# FIXME") }} - {{ license_comments }} - {% endif %} - URL:
https://crates.io/crates/{{
crate }} --{% if md.name != crate %} --Source0:
https://crates.io/api/v1/crates/%{real_crate}/%{version}/download#/%{crate}…
--{% else %} --Source0:
https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{ve…
--{% endif %} -+Source: %{crates_source} - {% if patch_file is not none %} - {% if target == "opensuse" %} - # PATCH-FIX-OPENSUSE {{ patch_file }} -- Initial patched metadata -@@ -161,9 +157,9 @@ which use {% if feature is not none %}"{{ feature }}" feature of {% endif %}"%{c - - %prep - {% if md.name != crate %} --%autosetup -n %{real_crate}-%{version} -p1 -+%autosetup -n %{real_crate}-%{version_no_tilde} -p1 - {% else %} --%autosetup -n %{crate}-%{version} -p1 -+%autosetup -n %{crate}-%{version_no_tilde} -p1 - {% endif %} - %cargo_prep - -diff --git a/test.py b/test.py -index 30263b4..035df79 100644 ---- a/test.py -+++ b/test.py -@@ -37,6 +37,14 @@ import rust2rpm - "crate(test) = 1.2.3"), - (">= 1.2, < 1.5", - "(crate(test) >= 1.2.0 with crate(test) < 1.5.0)"), -+ ("^2.0.0-alpha.6", -+ "(crate(test) >= 2.0.0~alpha.6 with crate(test) < 3.0.0)"), -+ ("^0.1.0-alpha.6", -+ "(crate(test) >= 0.1.0~alpha.6 with crate(test) < 0.2.0)"), -+ ("^0.0.1-alpha.6", -+ "(crate(test) >= 0.0.1~alpha.6 with crate(test) < 0.0.2)"), -+ ("^0.0.0-alpha.6", -+ "(crate(test) >= 0.0.0~alpha.6 with crate(test) < 0.0.1)"), - ]) - def test_dependency(req, rpmdep): - dep = rust2rpm.Dependency("test", req) --- -2.20.1 - diff --git a/0014-licensing-fix-zlib-license-translation.patch b/0014-licensing-fix-zlib-license-translation.patch new file mode 100644 index 0000000..fc8a165 --- /dev/null +++ b/0014-licensing-fix-zlib-license-translation.patch @@ -0,0 +1,35 @@ +From 7c00b0f29085166b1a89aec766945b10dc7aca23 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl> +Date: Sat, 1 Dec 2018 15:40:08 +0100 +Subject: [PATCH 14/18] licensing: fix zlib license translation + +The file was mangled, and something about "teeworlds" was inserted +into the line for zlib. The spdx database doesn't list "teeworlds +license", so let's just remove that part. +Both [1] and [2] agree that "zlib" and "zlib license" are the same thing. + +[1]
https://spdx.org/licenses/Zlib
+[2]
https://fedoraproject.org/wiki/Licensing:Main#Good_Licenses
+ +Fixes #61. +--- + rust2rpm/spdx_to_fedora.csv | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/rust2rpm/spdx_to_fedora.csv b/rust2rpm/spdx_to_fedora.csv +index 829571a..1ca5a7e 100644 +--- a/rust2rpm/spdx_to_fedora.csv ++++ b/rust2rpm/spdx_to_fedora.csv +@@ -306,8 +306,7 @@ Zed License,Zed,Zed,,, + Zend License v2.0,Zend-2.0,Zend,,, + Zimbra Public License v1.3,Zimbra-1.3,,,Fedora bad list, + Zimbra Public License v1.4,Zimbra-1.4,,,not on Fedora list, +-zlib License,Zlib,"zlib +-Teeworlds",,,Teeworlds License ++zlib License,Zlib,zlib,,, + zlib/libpng License with Acknowledgement,zlib-acknowledgement,zlib with acknowledgement,,, + Zope Public License 1.1,ZPL-1.1,,,This specific version not on Fedora list, + Zope Public License 2.0,ZPL-2.0,ZPLv2.0,,, +-- +2.21.0 + diff --git a/0015-licensing-rename-EPL-to-EPL-1.0-and-add-EPL-2.0.patch b/0015-licensing-rename-EPL-to-EPL-1.0-and-add-EPL-2.0.patch new file mode 100644 index 0000000..76be3f8 --- /dev/null +++ b/0015-licensing-rename-EPL-to-EPL-1.0-and-add-EPL-2.0.patch @@ -0,0 +1,31 @@ +From b0d2756917b380a5d66d2407dbeb8891c51875e8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl> +Date: Sat, 1 Dec 2018 15:46:08 +0100 +Subject: [PATCH 15/18] licensing: rename EPL to EPL-1.0 and add EPL-2.0 + +According to
https://fedoraproject.org/wiki/Licensing:Main#Software_License_List
+EPL-1.0 and EPL-2.0 are the short tags that should be used now. +(C.f.
https://spdx.org/licenses/EPL-2.0.html
.) + +Fixes #64. +--- + rust2rpm/spdx_to_fedora.csv | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/rust2rpm/spdx_to_fedora.csv b/rust2rpm/spdx_to_fedora.csv +index 1ca5a7e..c42e66e 100644 +--- a/rust2rpm/spdx_to_fedora.csv ++++ b/rust2rpm/spdx_to_fedora.csv +@@ -112,7 +112,8 @@ DOC License,DOC,DOC,,, + Dotseqn License,Dotseqn,Dotseqn,,, + DSDP License,DSDP,DSDP,,, + dvipdfm License,dvipdfm,dvipdfm,,, +-Eclipse Public License 1.0,EPL-1.0,EPL,,, ++Eclipse Public License 1.0,EPL-1.0,EPL-1.0,,, ++Eclipse Public License 2.0,EPL-2.0,EPL-2.0,,, + Educational Community License v1.0,ECL-1.0,ECL 1.0,,, + Educational Community License v2.0,ECL-2.0,ECL 2.0,,, +
eGenix.com
Public License 1.1.0,eGenix,eGenix,,, +-- +2.21.0 + diff --git a/0016-Add-support-for-prerelease-versions.patch b/0016-Add-support-for-prerelease-versions.patch new file mode 100644 index 0000000..187a47d --- /dev/null +++ b/0016-Add-support-for-prerelease-versions.patch @@ -0,0 +1,160 @@ +From 00c0c5cec90d5d6abbfd4acb2f5d65439b4bfd27 Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +Date: Sat, 26 Jan 2019 08:33:37 +0100 +Subject: [PATCH 16/18] Add support for prerelease versions + +Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +--- + data/macros.rust-srpm | 38 ++++++++++++++++++++++++++++++++++++ + rust2rpm/metadata.py | 18 +++++++++++------ + rust2rpm/templates/main.spec | 10 +++------- + test.py | 8 ++++++++ + 4 files changed, 61 insertions(+), 13 deletions(-) + +diff --git a/data/macros.rust-srpm b/data/macros.rust-srpm +index f2bae9d..872b87f 100644 +--- a/data/macros.rust-srpm ++++ b/data/macros.rust-srpm +@@ -1 +1,39 @@ + %rust_arches x86_64 i686 armv7hl aarch64 ppc64 ppc64le s390x ++%version_no_tilde() %{lua: ++ local sep = rpm.expand('%1') ++ local ver = rpm.expand('%2') ++\ ++ if sep == '%1' then ++ sep = '-' ++ end ++\ ++ if ver == '%2' then ++ ver = rpm.expand('%version') ++ end ++ ver = ver:gsub('~', sep) ++\ ++ print(ver) ++} ++%__crates_url
https://crates.io/api/v1/crates/
++%crates_source() %{lua: ++ local crate = rpm.expand('%1') ++ local version = rpm.expand('%2') ++ local url = rpm.expand('%__crates_url') ++\ ++ if crate == '%1' then ++ crate = rpm.expand('%real_crate') ++ end ++ if crate == '%real_crate' then ++ crate = rpm.expand('%crate') ++ end ++ if crate == '%crate' then ++ crate = rpm.expand('%name') ++ end ++\ ++ if version == '%2' then ++ version = rpm.expand('%version') ++ end ++ version = version:gsub('~', '-') ++\ ++ print(url .. crate .. '/' .. version .. '/download#/' .. crate .. '-' .. version .. '.crate') ++} +diff --git a/rust2rpm/metadata.py b/rust2rpm/metadata.py +index 328b67a..f0718d5 100644 +--- a/rust2rpm/metadata.py ++++ b/rust2rpm/metadata.py +@@ -45,11 +45,13 @@ class Dependency: + # Any means any + continue + ver = req.spec +- if ver.prerelease: +- raise NotImplementedError(f"Pre-release requirement is not supported: {ver}") + if req.kind in (req.KIND_NEQ, req.KIND_EMPTY): + raise NotImplementedError(f"'!=' and empty kinds are not supported: {req}") +- coerced = semver.Version.coerce(str(ver)) ++ coerced = str(semver.Version.coerce(str(ver))) ++ if ver.prerelease: ++ coerced = coerced.replace("-", "~") ++ # This will advance us to closest stable version (2.0.0-beta.6 2.0.0) ++ ver = ver.next_patch() + if req.kind == req.KIND_EQUAL: + req.kind = req.KIND_SHORTEQ + if req.kind in (req.KIND_CARET, req.KIND_COMPATIBLE): +@@ -107,7 +109,11 @@ class Dependency: + class Metadata: + def __init__(self, name, version): + self.name = name +- self.version = version ++ self._version = version ++ version_normalized = Dependency._normalize_req(f"={self._version}") ++ if len(version_normalized) != 1: ++ raise Exception(f"Incorrect version: {self._version}") ++ self.version = version_normalized[0][1] + self.license = None + self.license_file = None + self.readme = None +@@ -187,7 +193,7 @@ class Metadata: + def provides(self, feature=None): + if feature not in self.dependencies: + raise KeyError(f"Feature {feature!r} doesn't exist") +- return Dependency(self.name, f"={self.version}", features={feature}) ++ return Dependency(self.name, f"={self._version}", features={feature}) + + @classmethod + def _resolve(cls, deps_by_feature, feature): +@@ -207,7 +213,7 @@ class Metadata: + return self._resolve(self.dependencies, feature)[1] + else: + features, deps = self.dependencies[feature] +- fdeps = set(Dependency(self.name, f"={self.version}", features={feature}) ++ fdeps = set(Dependency(self.name, f"={self._version}", features={feature}) + for feature in features) + return fdeps | deps + +diff --git a/rust2rpm/templates/main.spec b/rust2rpm/templates/main.spec +index 84bd97d..1ebef7b 100644 +--- a/rust2rpm/templates/main.spec ++++ b/rust2rpm/templates/main.spec +@@ -31,11 +31,7 @@ License: {{ license|default("# FIXME") }} + {{ license_comments }} + {% endif %} + URL:
https://crates.io/crates/{{
crate }} +-{% if md.name != crate %} +-Source0:
https://crates.io/api/v1/crates/%{real_crate}/%{version}/download#/%{crate}…
+-{% else %} +-Source0:
https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{ve…
+-{% endif %} ++Source: %{crates_source} + {% if patch_file is not none %} + {% if target == "opensuse" %} + # PATCH-FIX-OPENSUSE {{ patch_file }} -- Initial patched metadata +@@ -161,9 +157,9 @@ which use {% if feature is not none %}"{{ feature }}" feature of {% endif %}"%{c + + %prep + {% if md.name != crate %} +-%autosetup -n %{real_crate}-%{version} -p1 ++%autosetup -n %{real_crate}-%{version_no_tilde} -p1 + {% else %} +-%autosetup -n %{crate}-%{version} -p1 ++%autosetup -n %{crate}-%{version_no_tilde} -p1 + {% endif %} + %cargo_prep + +diff --git a/test.py b/test.py +index 30263b4..035df79 100644 +--- a/test.py ++++ b/test.py +@@ -37,6 +37,14 @@ import rust2rpm + "crate(test) = 1.2.3"), + (">= 1.2, < 1.5", + "(crate(test) >= 1.2.0 with crate(test) < 1.5.0)"), ++ ("^2.0.0-alpha.6", ++ "(crate(test) >= 2.0.0~alpha.6 with crate(test) < 3.0.0)"), ++ ("^0.1.0-alpha.6", ++ "(crate(test) >= 0.1.0~alpha.6 with crate(test) < 0.2.0)"), ++ ("^0.0.1-alpha.6", ++ "(crate(test) >= 0.0.1~alpha.6 with crate(test) < 0.0.2)"), ++ ("^0.0.0-alpha.6", ++ "(crate(test) >= 0.0.0~alpha.6 with crate(test) < 0.0.1)"), + ]) + def test_dependency(req, rpmdep): + dep = rust2rpm.Dependency("test", req) +-- +2.21.0 + diff --git a/0017-data-Cargo-doesn-t-escape-paths-with-space.patch b/0017-data-Cargo-doesn-t-escape-paths-with-space.patch new file mode 100644 index 0000000..90dadeb --- /dev/null +++ b/0017-data-Cargo-doesn-t-escape-paths-with-space.patch @@ -0,0 +1,31 @@ +From 84a73bfa24ce11602a1f19554dc495125be4d0aa Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +Date: Sun, 17 Feb 2019 17:19:25 +0100 +Subject: [PATCH 17/18] data: Cargo doesn't escape paths with space + +When building matrixmultiply v0.2.2: + +BUILDSTDERR: /usr/bin/cp: cannot stat 'spare': No such file or directory +BUILDSTDERR: /usr/bin/cp: failed to get attributes of 'kernels': No such file or directory + +Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +--- + data/macros.cargo | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/data/macros.cargo b/data/macros.cargo +index 9a9ce6a..9a375d0 100644 +--- a/data/macros.cargo ++++ b/data/macros.cargo +@@ -74,7 +74,7 @@ if %__cargo_is_lib; then \ + CRATE_VERSION=$(%__cargo_inspector --version Cargo.toml) \ + REG_DIR=%{buildroot}%{cargo_registry}/$CRATE_NAME-$CRATE_VERSION \ + %{__mkdir} -p $REG_DIR \ +- %{__cargo} package -l | xargs %{__cp} --parents -a -t $REG_DIR \ ++ %{__cargo} package -l | xargs -d '\n' %{__cp} --parents -a -t $REG_DIR \ + %if ! %{with check} \ + %{__cp} -a Cargo.toml.orig $REG_DIR/Cargo.toml \ + %endif \ +-- +2.21.0 + diff --git a/0018-Do-not-pull-optional-dependencies.patch b/0018-Do-not-pull-optional-dependencies.patch new file mode 100644 index 0000000..68f2a8c --- /dev/null +++ b/0018-Do-not-pull-optional-dependencies.patch @@ -0,0 +1,66 @@ +From b0f34c2b6a7b8ca5b924e5c230f1271826114cb0 Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +Date: Sat, 9 Mar 2019 22:04:49 +0100 +Subject: [PATCH 18/18] Do not pull optional dependencies + +Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +--- + data/macros.cargo | 13 +++++++++++-- + rust2rpm/templates/main.spec | 5 ----- + 2 files changed, 11 insertions(+), 7 deletions(-) + +diff --git a/data/macros.cargo b/data/macros.cargo +index 9a375d0..0e382c8 100644 +--- a/data/macros.cargo ++++ b/data/macros.cargo +@@ -2,8 +2,10 @@ + #
https://github.com/rust-lang/cargo/issues/6397
+ # But we can set CARGO_HOME locally, which is a good idea anyway to make sure + # it never writes to ~/.cargo during rpmbuild. +-%__cargo %{_bindir}/env CARGO_HOME=.cargo %{_bindir}/cargo +-%__cargo_common_opts %{?_smp_mflags} ++# We also need RUSTC_BOOTSTRAP since we use -Z avoid-dev-deps ++# until it gets stabilized:
https://github.com/rust-lang/cargo/issues/5133
++%__cargo %{_bindir}/env CARGO_HOME=.cargo RUSTC_BOOTSTRAP=1 %{_bindir}/cargo ++%__cargo_common_opts %{?_smp_mflags} -Z avoid-dev-deps + %__cargo_inspector %{_bindir}/cargo-inspector + + %cargo_registry %{_datadir}/cargo/registry +@@ -74,10 +76,17 @@ if %__cargo_is_lib; then \ + CRATE_VERSION=$(%__cargo_inspector --version Cargo.toml) \ + REG_DIR=%{buildroot}%{cargo_registry}/$CRATE_NAME-$CRATE_VERSION \ + %{__mkdir} -p $REG_DIR \ ++# Drop all dependency/features information \ ++# so that cargo doesn't fail resolving dependencies: \ ++#
https://github.com/rust-lang/cargo/pull/6729
\ ++ %{__awk} -i inplace -v INPLACE_SUFFIX=.deps '/^\\\[((dev-)?dependencies|features)/{f=1;next} /^\\\[/{f=0}; !f' Cargo.toml \ + %{__cargo} package -l | xargs -d '\n' %{__cp} --parents -a -t $REG_DIR \ + %if ! %{with check} \ + %{__cp} -a Cargo.toml.orig $REG_DIR/Cargo.toml \ ++%else \ ++ %{__cp} -a Cargo.toml.deps $REG_DIR/Cargo.toml \ + %endif \ ++ %{__rm} $REG_DIR/Cargo.toml.{orig,deps} \ + echo '{"files":{},"package":""}' > $REG_DIR/.cargo-checksum.json \ + fi \ + if %__cargo_is_bin; then \ +diff --git a/rust2rpm/templates/main.spec b/rust2rpm/templates/main.spec +index 1ebef7b..f0c5445 100644 +--- a/rust2rpm/templates/main.spec ++++ b/rust2rpm/templates/main.spec +@@ -44,12 +44,7 @@ Patch0: {{ patch_file }} + ExclusiveArch: %{rust_arches} + + BuildRequires: rust-packaging +-{# We will put all non-optional and optional dependencies until +-
https://github.com/rust-lang/cargo/issues/5133
+- is solved + {% set buildrequires = normalize_deps(md.requires("default", resolve=True))|sort %} +-#} +-{% set buildrequires = normalize_deps(md.all_dependencies)|sort %} + {% for req in buildrequires %} + BuildRequires: {{ req }} + {% endfor %} +-- +2.21.0 + diff --git a/rust-packaging.spec b/rust-packaging.spec index 374a238..3f2294c 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -5,7 +5,7 @@ Name: rust-packaging Version: 6 -Release: 22%{?dist} +Release: 23%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT @@ -24,7 +24,12 @@ Patch0010: 0010-trivial-use-f-strings-everywhere.patch Patch0011: 0011-Add-option-to-not-generate-a-default-changelog-entry.patch Patch0012: 0012-Set-CARGO_HOME-to-the-local-.config.patch Patch0013: 0013-Set-the-install-root-in-.cargo-config.patch -Patch0014: 0014-Add-support-for-prerelease-versions.patch +Patch0014: 0014-licensing-fix-zlib-license-translation.patch +Patch0015: 0015-licensing-rename-EPL-to-EPL-1.0-and-add-EPL-2.0.patch +Patch0016: 0016-Add-support-for-prerelease-versions.patch +Patch0017: 0017-data-Cargo-doesn-t-escape-paths-with-space.patch +#
https://pagure.io/fedora-rust/rust2rpm/pull-request/68
<Paste> +Patch0018: 0018-Do-not-pull-optional-dependencies.patch ExclusiveArch: %{rust_arches} @@ -85,6 +90,9 @@ py.test-%{python3_version} -vv test.py %{python3_sitelib}/rust2rpm/ %changelog +* Sun Mar 10 2019 Igor Gnatenko <ignatnekobrain(a)fedoraproject.org> - 6-23 +- Do not pull optional deps into BRs and trivial fixes + * Sat Feb 02 2019 Fedora Release Engineering <releng(a)fedoraproject.org> - 6-22 - Rebuilt for
https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
commit 17a86d1495e6c6374add1f4f72dee83b14930d2e Author: Fedora Release Engineering <releng(a)fedoraproject.org> Date: Sat Feb 2 14:06:10 2019 +0000 - Rebuilt for
https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng(a)fedoraproject.org> diff --git a/rust-packaging.spec b/rust-packaging.spec index 29dc5ec..374a238 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -5,7 +5,7 @@ Name: rust-packaging Version: 6 -Release: 21%{?dist} +Release: 22%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT @@ -85,6 +85,9 @@ py.test-%{python3_version} -vv test.py %{python3_sitelib}/rust2rpm/ %changelog +* Sat Feb 02 2019 Fedora Release Engineering <releng(a)fedoraproject.org> - 6-22 +- Rebuilt for
https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
+ * Sat Jan 26 2019 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-21 - Use %%version_no_tilde commit 6d95cfa0b0f183cb32e9a8818e582b16780a2296 Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Sat Jan 26 12:07:13 2019 +0100 Use %version_no_tilde Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/0014-Add-support-for-prerelease-versions.patch b/0014-Add-support-for-prerelease-versions.patch index d4c48ef..e7ec8ef 100644 --- a/0014-Add-support-for-prerelease-versions.patch +++ b/0014-Add-support-for-prerelease-versions.patch @@ -1,24 +1,39 @@ -From 769506caf08edb5ea2342d9add22e4db1b347375 Mon Sep 17 00:00:00 2001 +From cfe4e77674ccb6e25e54a3749f4ef91b377e808f Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Sat, 26 Jan 2019 08:33:37 +0100 Subject: [PATCH 14/14] Add support for prerelease versions Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> --- - data/macros.rust-srpm | 23 +++++++++++++++++++++++ - rust2rpm/metadata.py | 18 ++++++++++++------ - rust2rpm/templates/main.spec | 6 +----- + data/macros.rust-srpm | 38 ++++++++++++++++++++++++++++++++++++ + rust2rpm/metadata.py | 18 +++++++++++------ + rust2rpm/templates/main.spec | 10 +++------- test.py | 8 ++++++++ - 4 files changed, 44 insertions(+), 11 deletions(-) + 4 files changed, 61 insertions(+), 13 deletions(-) diff --git a/data/macros.rust-srpm b/data/macros.rust-srpm -index f2bae9d..bd21cb5 100644 +index f2bae9d..872b87f 100644 --- a/data/macros.rust-srpm +++ b/data/macros.rust-srpm -@@ -1 +1,24 @@ +@@ -1 +1,39 @@ %rust_arches x86_64 i686 armv7hl aarch64 ppc64 ppc64le s390x ++%version_no_tilde() %{lua: ++ local sep = rpm.expand('%1') ++ local ver = rpm.expand('%2') ++\ ++ if sep == '%1' then ++ sep = '-' ++ end ++\ ++ if ver == '%2' then ++ ver = rpm.expand('%version') ++ end ++ ver = ver:gsub('~', sep) ++\ ++ print(ver) ++} +%__crates_url
https://crates.io/api/v1/crates/
-+%crates_source %{lua: ++%crates_source() %{lua: + local crate = rpm.expand('%1') + local version = rpm.expand('%2') + local url = rpm.expand('%__crates_url') @@ -93,7 +108,7 @@ index 328b67a..f0718d5 100644 return fdeps | deps diff --git a/rust2rpm/templates/main.spec b/rust2rpm/templates/main.spec -index 84bd97d..f67e023 100644 +index 84bd97d..1ebef7b 100644 --- a/rust2rpm/templates/main.spec +++ b/rust2rpm/templates/main.spec @@ -31,11 +31,7 @@ License: {{ license|default("# FIXME") }} @@ -109,6 +124,18 @@ index 84bd97d..f67e023 100644 {% if patch_file is not none %} {% if target == "opensuse" %} # PATCH-FIX-OPENSUSE {{ patch_file }} -- Initial patched metadata +@@ -161,9 +157,9 @@ which use {% if feature is not none %}"{{ feature }}" feature of {% endif %}"%{c + + %prep + {% if md.name != crate %} +-%autosetup -n %{real_crate}-%{version} -p1 ++%autosetup -n %{real_crate}-%{version_no_tilde} -p1 + {% else %} +-%autosetup -n %{crate}-%{version} -p1 ++%autosetup -n %{crate}-%{version_no_tilde} -p1 + {% endif %} + %cargo_prep + diff --git a/test.py b/test.py index 30263b4..035df79 100644 --- a/test.py diff --git a/rust-packaging.spec b/rust-packaging.spec index 2162d19..29dc5ec 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -5,7 +5,7 @@ Name: rust-packaging Version: 6 -Release: 20%{?dist} +Release: 21%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT @@ -85,6 +85,9 @@ py.test-%{python3_version} -vv test.py %{python3_sitelib}/rust2rpm/ %changelog +* Sat Jan 26 2019 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-21 +- Use %%version_no_tilde + * Sat Jan 26 2019 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-20 - Trivial fixes for pre-release versions commit 2c9257ea1223fa871a2bdbd80a29eefde7b5fe5b Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Sat Jan 26 10:36:39 2019 +0100 Trivial fixes for pre-release versions Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/0014-Add-support-for-prerelease-versions.patch b/0014-Add-support-for-prerelease-versions.patch index cf16439..d4c48ef 100644 --- a/0014-Add-support-for-prerelease-versions.patch +++ b/0014-Add-support-for-prerelease-versions.patch @@ -1,14 +1,45 @@ -From 29a3c1b84e0971fc0c2edf483ae3b04139c19b32 Mon Sep 17 00:00:00 2001 +From 769506caf08edb5ea2342d9add22e4db1b347375 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Sat, 26 Jan 2019 08:33:37 +0100 Subject: [PATCH 14/14] Add support for prerelease versions Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> --- - rust2rpm/metadata.py | 18 ++++++++++++------ - test.py | 8 ++++++++ - 2 files changed, 20 insertions(+), 6 deletions(-) + data/macros.rust-srpm | 23 +++++++++++++++++++++++ + rust2rpm/metadata.py | 18 ++++++++++++------ + rust2rpm/templates/main.spec | 6 +----- + test.py | 8 ++++++++ + 4 files changed, 44 insertions(+), 11 deletions(-) +diff --git a/data/macros.rust-srpm b/data/macros.rust-srpm +index f2bae9d..bd21cb5 100644 +--- a/data/macros.rust-srpm ++++ b/data/macros.rust-srpm +@@ -1 +1,24 @@ + %rust_arches x86_64 i686 armv7hl aarch64 ppc64 ppc64le s390x ++%__crates_url
https://crates.io/api/v1/crates/
++%crates_source %{lua: ++ local crate = rpm.expand('%1') ++ local version = rpm.expand('%2') ++ local url = rpm.expand('%__crates_url') ++\ ++ if crate == '%1' then ++ crate = rpm.expand('%real_crate') ++ end ++ if crate == '%real_crate' then ++ crate = rpm.expand('%crate') ++ end ++ if crate == '%crate' then ++ crate = rpm.expand('%name') ++ end ++\ ++ if version == '%2' then ++ version = rpm.expand('%version') ++ end ++ version = version:gsub('~', '-') ++\ ++ print(url .. crate .. '/' .. version .. '/download#/' .. crate .. '-' .. version .. '.crate') ++} diff --git a/rust2rpm/metadata.py b/rust2rpm/metadata.py index 328b67a..f0718d5 100644 --- a/rust2rpm/metadata.py @@ -61,6 +92,23 @@ index 328b67a..f0718d5 100644 for feature in features) return fdeps | deps +diff --git a/rust2rpm/templates/main.spec b/rust2rpm/templates/main.spec +index 84bd97d..f67e023 100644 +--- a/rust2rpm/templates/main.spec ++++ b/rust2rpm/templates/main.spec +@@ -31,11 +31,7 @@ License: {{ license|default("# FIXME") }} + {{ license_comments }} + {% endif %} + URL:
https://crates.io/crates/{{
crate }} +-{% if md.name != crate %} +-Source0:
https://crates.io/api/v1/crates/%{real_crate}/%{version}/download#/%{crate}…
+-{% else %} +-Source0:
https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{ve…
+-{% endif %} ++Source: %{crates_source} + {% if patch_file is not none %} + {% if target == "opensuse" %} + # PATCH-FIX-OPENSUSE {{ patch_file }} -- Initial patched metadata diff --git a/test.py b/test.py index 30263b4..035df79 100644 --- a/test.py diff --git a/rust-packaging.spec b/rust-packaging.spec index 0d97e56..2162d19 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -5,7 +5,7 @@ Name: rust-packaging Version: 6 -Release: 19%{?dist} +Release: 20%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT @@ -85,6 +85,9 @@ py.test-%{python3_version} -vv test.py %{python3_sitelib}/rust2rpm/ %changelog +* Sat Jan 26 2019 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-20 +- Trivial fixes for pre-release versions + * Sat Jan 26 2019 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-19 - Add support for pre-release versions commit b078c549828898a71063bac9e3104b5a915b92ec Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Sat Jan 26 09:31:56 2019 +0100 Add support for pre-release versions Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/0001-name-spec-patch_file-by-real-crate-name.patch b/0001-name-spec-patch_file-by-real-crate-name.patch index 1f65e7f..4d55717 100644 --- a/0001-name-spec-patch_file-by-real-crate-name.patch +++ b/0001-name-spec-patch_file-by-real-crate-name.patch @@ -1,7 +1,7 @@ From 0dc9fc182edf0791ca697f587e48dd39948d63c1 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Mon, 10 Sep 2018 23:37:40 +0200 -Subject: [PATCH 01/13] name spec/patch_file by real crate name +Subject: [PATCH 01/14] name spec/patch_file by real crate name When renaming using patch file, we really want to change file names too. @@ -33,5 +33,5 @@ index dc78828..1575ce6 100644 if args.stdout: print("# {}".format(spec_file)) -- -2.20.0.rc2 +2.20.1 diff --git a/0002-generate-doc-statements.patch b/0002-generate-doc-statements.patch index 581990d..42ca40d 100644 --- a/0002-generate-doc-statements.patch +++ b/0002-generate-doc-statements.patch @@ -1,7 +1,7 @@ From 561280a0ea35f226ef243526be2bbb656db44af6 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Mon, 10 Sep 2018 23:40:18 +0200 -Subject: [PATCH 02/13] generate %doc statements +Subject: [PATCH 02/14] generate %doc statements Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> --- @@ -54,5 +54,5 @@ index 1aeb969..2e9f841 100644 {% endif %} -- -2.20.0.rc2 +2.20.1 diff --git a/0003-do-better-for-renamed-crates.patch b/0003-do-better-for-renamed-crates.patch index 1640604..3f1bc98 100644 --- a/0003-do-better-for-renamed-crates.patch +++ b/0003-do-better-for-renamed-crates.patch @@ -1,7 +1,7 @@ From 2050880140d4953b9ebdc7211e30df3ccf5dd61d Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Tue, 11 Sep 2018 00:06:50 +0200 -Subject: [PATCH 03/13] do better for renamed crates +Subject: [PATCH 03/14] do better for renamed crates Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> --- @@ -86,5 +86,5 @@ index 2e9f841..7dbcc3f 100644 %build -- -2.20.0.rc2 +2.20.1 diff --git a/0004-remove-pre-3.6-leftovers.patch b/0004-remove-pre-3.6-leftovers.patch index 0ba106c..7133f4e 100644 --- a/0004-remove-pre-3.6-leftovers.patch +++ b/0004-remove-pre-3.6-leftovers.patch @@ -1,7 +1,7 @@ From e6e9cbbb71199c2773b47fa21f1c917a167c1743 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Tue, 11 Sep 2018 10:43:53 +0200 -Subject: [PATCH 04/13] remove pre-3.6 leftovers +Subject: [PATCH 04/14] remove pre-3.6 leftovers Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> --- @@ -23,5 +23,5 @@ index f52d968..5adeb65 100644 + "--manifest-path={}".format(path)]) return cls.from_json(json.loads(metadata)) -- -2.20.0.rc2 +2.20.1 diff --git a/0005-Remove-half-downloaded-crate-on-C.patch b/0005-Remove-half-downloaded-crate-on-C.patch index 6f67bb9..8ae52e4 100644 --- a/0005-Remove-half-downloaded-crate-on-C.patch +++ b/0005-Remove-half-downloaded-crate-on-C.patch @@ -1,7 +1,7 @@ From 2f12c83d14afe71e9efed2d1be62e1e610e602e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl> Date: Fri, 17 Aug 2018 10:03:48 +0200 -Subject: [PATCH 05/13] Remove half-downloaded crate on ^C +Subject: [PATCH 05/14] Remove half-downloaded crate on ^C Subsequent invocations would fail with an error about a corrupted file. We don't have support for resuming a failed download, so let's remove the @@ -40,5 +40,5 @@ index e993e7b..8e6f6eb 100644 total=total, unit="B", unit_scale=True): f.write(chunk) -- -2.20.0.rc2 +2.20.1 diff --git a/0006-Throw-an-error-if-s-is-used-without-a-crate.patch b/0006-Throw-an-error-if-s-is-used-without-a-crate.patch index cc09ce2..8684175 100644 --- a/0006-Throw-an-error-if-s-is-used-without-a-crate.patch +++ b/0006-Throw-an-error-if-s-is-used-without-a-crate.patch @@ -1,7 +1,7 @@ From 5a1cde5b8dcaea74ebb2050879036bf46df63adc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl> Date: Fri, 17 Aug 2018 10:18:59 +0200 -Subject: [PATCH 06/13] Throw an error if -s is used without a crate +Subject: [PATCH 06/14] Throw an error if -s is used without a crate In the future we might want to be smarter and find the crate, but let's at least not ignore the option completely. @@ -24,5 +24,5 @@ index 8e6f6eb..f23ebbc 100644 diff = make_patch(toml, enabled=patch, tmpfile=True) metadata = Metadata.from_file(toml) -- -2.20.0.rc2 +2.20.1 diff --git a/0007-split-features-into-subpackages.patch b/0007-split-features-into-subpackages.patch index 52d253e..19fd5e5 100644 --- a/0007-split-features-into-subpackages.patch +++ b/0007-split-features-into-subpackages.patch @@ -1,7 +1,7 @@ From 2cac5e5ad5ff5472923ce333bef59679612bbaa2 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Fri, 26 Oct 2018 11:20:13 +0200 -Subject: [PATCH 07/13] split features into subpackages +Subject: [PATCH 07/14] split features into subpackages References:
https://discussion.fedoraproject.org/t/rfc-new-crates-packaging-design-feat…
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> @@ -1060,5 +1060,5 @@ index b856fdd..30263b4 100644 - assert [str(x) for x in md.provides] == provides - assert [str(x) for x in md.requires] == requires -- -2.20.0.rc2 +2.20.1 diff --git a/0008-add-support-for-dependencies-with-same-name.patch b/0008-add-support-for-dependencies-with-same-name.patch index 378edfc..f6f2743 100644 --- a/0008-add-support-for-dependencies-with-same-name.patch +++ b/0008-add-support-for-dependencies-with-same-name.patch @@ -1,7 +1,7 @@ From a1d3a84645aa7bbe5ca07b60bead1ddf90a21cc1 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Tue, 30 Oct 2018 20:37:38 +0100 -Subject: [PATCH 08/13] add support for dependencies with same name +Subject: [PATCH 08/14] add support for dependencies with same name Reported-by: Josh Stone <jistone(a)redhat.com> References:
https://internals.rust-lang.org/t/optional-dependencies-with-same-name/8728
@@ -70,5 +70,5 @@ index 4929cdd..328b67a 100644 if "default" not in deps_by_feature: -- -2.20.0.rc2 +2.20.1 diff --git a/0009-add-support-for-feeding-user-configuration.patch b/0009-add-support-for-feeding-user-configuration.patch index b130ebe..5078943 100644 --- a/0009-add-support-for-feeding-user-configuration.patch +++ b/0009-add-support-for-feeding-user-configuration.patch @@ -1,7 +1,7 @@ From 197150ee2e862edcd46f7ab02c9e4d17e49ca75d Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Wed, 31 Oct 2018 18:03:21 +0100 -Subject: [PATCH 09/13] add support for feeding user configuration +Subject: [PATCH 09/14] add support for feeding user configuration Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> --- @@ -144,5 +144,5 @@ index 0d9a80b..d901e6d 100644 %description {{ pkg }} %{_description} -- -2.20.0.rc2 +2.20.1 diff --git a/0010-trivial-use-f-strings-everywhere.patch b/0010-trivial-use-f-strings-everywhere.patch index f6ff2f4..72c5828 100644 --- a/0010-trivial-use-f-strings-everywhere.patch +++ b/0010-trivial-use-f-strings-everywhere.patch @@ -1,7 +1,7 @@ From 83ea3796cd28ec7689b39e7dc7a70bd11af1abf1 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Wed, 31 Oct 2018 17:00:58 +0100 -Subject: [PATCH 10/13] trivial: use f-strings everywhere +Subject: [PATCH 10/14] trivial: use f-strings everywhere Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> --- @@ -90,5 +90,5 @@ index c691274..b60e6c4 100644 else: with open(spec_file, "w") as fobj: -- -2.20.0.rc2 +2.20.1 diff --git a/0011-Add-option-to-not-generate-a-default-changelog-entry.patch b/0011-Add-option-to-not-generate-a-default-changelog-entry.patch index ccad736..4345add 100644 --- a/0011-Add-option-to-not-generate-a-default-changelog-entry.patch +++ b/0011-Add-option-to-not-generate-a-default-changelog-entry.patch @@ -1,7 +1,7 @@ From 294c6f571c0f4f7ed5a4fcb34142b0d332c55f29 Mon Sep 17 00:00:00 2001 From: Neal Gompa <ngompa13(a)gmail.com> Date: Sun, 11 Nov 2018 11:06:27 -0500 -Subject: [PATCH 11/13] Add option to not generate a default changelog entry +Subject: [PATCH 11/14] Add option to not generate a default changelog entry For Rust packages created through the OBS source service, the changelog is managed by an external <pkg>.changes file that is @@ -59,5 +59,5 @@ index d901e6d..84bd97d 100644 + {% include target ~ "-changelog.spec.inc" %} +{% endif %} -- -2.20.0.rc2 +2.20.1 diff --git a/0012-Set-CARGO_HOME-to-the-local-.config.patch b/0012-Set-CARGO_HOME-to-the-local-.config.patch index 9f81757..ddf86d1 100644 --- a/0012-Set-CARGO_HOME-to-the-local-.config.patch +++ b/0012-Set-CARGO_HOME-to-the-local-.config.patch @@ -1,7 +1,7 @@ From b4e25038296cd57eba639a059e8baaf139a5d287 Mon Sep 17 00:00:00 2001 From: Josh Stone <jistone(a)redhat.com> Date: Fri, 7 Dec 2018 13:58:41 -0800 -Subject: [PATCH 12/13] Set CARGO_HOME to the local .config +Subject: [PATCH 12/14] Set CARGO_HOME to the local .config --- data/macros.cargo | 6 +++++- @@ -22,5 +22,5 @@ index 7fb025b..e760721 100644 %__cargo_inspector %{_bindir}/cargo-inspector -- -2.20.0.rc2 +2.20.1 diff --git a/0013-Set-the-install-root-in-.cargo-config.patch b/0013-Set-the-install-root-in-.cargo-config.patch index cb106e8..baa5e3a 100644 --- a/0013-Set-the-install-root-in-.cargo-config.patch +++ b/0013-Set-the-install-root-in-.cargo-config.patch @@ -1,7 +1,7 @@ From a04e95bc4f807139bd3c4b75f46fd9a60ec1db8f Mon Sep 17 00:00:00 2001 From: Josh Stone <jistone(a)redhat.com> Date: Fri, 7 Dec 2018 13:59:03 -0800 -Subject: [PATCH 13/13] Set the install root in .cargo/config +Subject: [PATCH 13/14] Set the install root in .cargo/config --- data/macros.cargo | 4 +++- @@ -30,5 +30,5 @@ index e760721..9a9ce6a 100644 %* \ }\ -- -2.20.0.rc2 +2.20.1 diff --git a/0014-Add-support-for-prerelease-versions.patch b/0014-Add-support-for-prerelease-versions.patch new file mode 100644 index 0000000..cf16439 --- /dev/null +++ b/0014-Add-support-for-prerelease-versions.patch @@ -0,0 +1,85 @@ +From 29a3c1b84e0971fc0c2edf483ae3b04139c19b32 Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +Date: Sat, 26 Jan 2019 08:33:37 +0100 +Subject: [PATCH 14/14] Add support for prerelease versions + +Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +--- + rust2rpm/metadata.py | 18 ++++++++++++------ + test.py | 8 ++++++++ + 2 files changed, 20 insertions(+), 6 deletions(-) + +diff --git a/rust2rpm/metadata.py b/rust2rpm/metadata.py +index 328b67a..f0718d5 100644 +--- a/rust2rpm/metadata.py ++++ b/rust2rpm/metadata.py +@@ -45,11 +45,13 @@ class Dependency: + # Any means any + continue + ver = req.spec +- if ver.prerelease: +- raise NotImplementedError(f"Pre-release requirement is not supported: {ver}") + if req.kind in (req.KIND_NEQ, req.KIND_EMPTY): + raise NotImplementedError(f"'!=' and empty kinds are not supported: {req}") +- coerced = semver.Version.coerce(str(ver)) ++ coerced = str(semver.Version.coerce(str(ver))) ++ if ver.prerelease: ++ coerced = coerced.replace("-", "~") ++ # This will advance us to closest stable version (2.0.0-beta.6 2.0.0) ++ ver = ver.next_patch() + if req.kind == req.KIND_EQUAL: + req.kind = req.KIND_SHORTEQ + if req.kind in (req.KIND_CARET, req.KIND_COMPATIBLE): +@@ -107,7 +109,11 @@ class Dependency: + class Metadata: + def __init__(self, name, version): + self.name = name +- self.version = version ++ self._version = version ++ version_normalized = Dependency._normalize_req(f"={self._version}") ++ if len(version_normalized) != 1: ++ raise Exception(f"Incorrect version: {self._version}") ++ self.version = version_normalized[0][1] + self.license = None + self.license_file = None + self.readme = None +@@ -187,7 +193,7 @@ class Metadata: + def provides(self, feature=None): + if feature not in self.dependencies: + raise KeyError(f"Feature {feature!r} doesn't exist") +- return Dependency(self.name, f"={self.version}", features={feature}) ++ return Dependency(self.name, f"={self._version}", features={feature}) + + @classmethod + def _resolve(cls, deps_by_feature, feature): +@@ -207,7 +213,7 @@ class Metadata: + return self._resolve(self.dependencies, feature)[1] + else: + features, deps = self.dependencies[feature] +- fdeps = set(Dependency(self.name, f"={self.version}", features={feature}) ++ fdeps = set(Dependency(self.name, f"={self._version}", features={feature}) + for feature in features) + return fdeps | deps + +diff --git a/test.py b/test.py +index 30263b4..035df79 100644 +--- a/test.py ++++ b/test.py +@@ -37,6 +37,14 @@ import rust2rpm + "crate(test) = 1.2.3"), + (">= 1.2, < 1.5", + "(crate(test) >= 1.2.0 with crate(test) < 1.5.0)"), ++ ("^2.0.0-alpha.6", ++ "(crate(test) >= 2.0.0~alpha.6 with crate(test) < 3.0.0)"), ++ ("^0.1.0-alpha.6", ++ "(crate(test) >= 0.1.0~alpha.6 with crate(test) < 0.2.0)"), ++ ("^0.0.1-alpha.6", ++ "(crate(test) >= 0.0.1~alpha.6 with crate(test) < 0.0.2)"), ++ ("^0.0.0-alpha.6", ++ "(crate(test) >= 0.0.0~alpha.6 with crate(test) < 0.0.1)"), + ]) + def test_dependency(req, rpmdep): + dep = rust2rpm.Dependency("test", req) +-- +2.20.1 + diff --git a/rust-packaging.spec b/rust-packaging.spec index 5b5682d..0d97e56 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -5,7 +5,7 @@ Name: rust-packaging Version: 6 -Release: 18%{?dist} +Release: 19%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT @@ -24,6 +24,7 @@ Patch0010: 0010-trivial-use-f-strings-everywhere.patch Patch0011: 0011-Add-option-to-not-generate-a-default-changelog-entry.patch Patch0012: 0012-Set-CARGO_HOME-to-the-local-.config.patch Patch0013: 0013-Set-the-install-root-in-.cargo-config.patch +Patch0014: 0014-Add-support-for-prerelease-versions.patch ExclusiveArch: %{rust_arches} @@ -84,6 +85,9 @@ py.test-%{python3_version} -vv test.py %{python3_sitelib}/rust2rpm/ %changelog +* Sat Jan 26 2019 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-19 +- Add support for pre-release versions + * Fri Dec 07 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-18 - Set CARGO_HOME commit 6745bc623a3106cefedced2c8073010a7ac732aa Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Fri Dec 7 23:17:39 2018 +0100 Set CARGO_HOME Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/0001-name-spec-patch_file-by-real-crate-name.patch b/0001-name-spec-patch_file-by-real-crate-name.patch index 3049ab2..1f65e7f 100644 --- a/0001-name-spec-patch_file-by-real-crate-name.patch +++ b/0001-name-spec-patch_file-by-real-crate-name.patch @@ -1,7 +1,7 @@ From 0dc9fc182edf0791ca697f587e48dd39948d63c1 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Mon, 10 Sep 2018 23:37:40 +0200 -Subject: [PATCH 01/10] name spec/patch_file by real crate name +Subject: [PATCH 01/13] name spec/patch_file by real crate name When renaming using patch file, we really want to change file names too. @@ -33,5 +33,5 @@ index dc78828..1575ce6 100644 if args.stdout: print("# {}".format(spec_file)) -- -2.19.1 +2.20.0.rc2 diff --git a/0002-generate-doc-statements.patch b/0002-generate-doc-statements.patch index fb8f36b..581990d 100644 --- a/0002-generate-doc-statements.patch +++ b/0002-generate-doc-statements.patch @@ -1,7 +1,7 @@ From 561280a0ea35f226ef243526be2bbb656db44af6 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Mon, 10 Sep 2018 23:40:18 +0200 -Subject: [PATCH 02/10] generate %doc statements +Subject: [PATCH 02/13] generate %doc statements Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> --- @@ -54,5 +54,5 @@ index 1aeb969..2e9f841 100644 {% endif %} -- -2.19.1 +2.20.0.rc2 diff --git a/0003-do-better-for-renamed-crates.patch b/0003-do-better-for-renamed-crates.patch index e70a367..1640604 100644 --- a/0003-do-better-for-renamed-crates.patch +++ b/0003-do-better-for-renamed-crates.patch @@ -1,7 +1,7 @@ From 2050880140d4953b9ebdc7211e30df3ccf5dd61d Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Tue, 11 Sep 2018 00:06:50 +0200 -Subject: [PATCH 03/10] do better for renamed crates +Subject: [PATCH 03/13] do better for renamed crates Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> --- @@ -86,5 +86,5 @@ index 2e9f841..7dbcc3f 100644 %build -- -2.19.1 +2.20.0.rc2 diff --git a/0004-remove-pre-3.6-leftovers.patch b/0004-remove-pre-3.6-leftovers.patch index 0f2a391..0ba106c 100644 --- a/0004-remove-pre-3.6-leftovers.patch +++ b/0004-remove-pre-3.6-leftovers.patch @@ -1,7 +1,7 @@ From e6e9cbbb71199c2773b47fa21f1c917a167c1743 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Tue, 11 Sep 2018 10:43:53 +0200 -Subject: [PATCH 04/10] remove pre-3.6 leftovers +Subject: [PATCH 04/13] remove pre-3.6 leftovers Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> --- @@ -23,5 +23,5 @@ index f52d968..5adeb65 100644 + "--manifest-path={}".format(path)]) return cls.from_json(json.loads(metadata)) -- -2.19.1 +2.20.0.rc2 diff --git a/0005-Remove-half-downloaded-crate-on-C.patch b/0005-Remove-half-downloaded-crate-on-C.patch index 6daebcc..6f67bb9 100644 --- a/0005-Remove-half-downloaded-crate-on-C.patch +++ b/0005-Remove-half-downloaded-crate-on-C.patch @@ -1,7 +1,7 @@ From 2f12c83d14afe71e9efed2d1be62e1e610e602e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl> Date: Fri, 17 Aug 2018 10:03:48 +0200 -Subject: [PATCH 05/10] Remove half-downloaded crate on ^C +Subject: [PATCH 05/13] Remove half-downloaded crate on ^C Subsequent invocations would fail with an error about a corrupted file. We don't have support for resuming a failed download, so let's remove the @@ -40,5 +40,5 @@ index e993e7b..8e6f6eb 100644 total=total, unit="B", unit_scale=True): f.write(chunk) -- -2.19.1 +2.20.0.rc2 diff --git a/0006-Throw-an-error-if-s-is-used-without-a-crate.patch b/0006-Throw-an-error-if-s-is-used-without-a-crate.patch index 1f2a4e0..cc09ce2 100644 --- a/0006-Throw-an-error-if-s-is-used-without-a-crate.patch +++ b/0006-Throw-an-error-if-s-is-used-without-a-crate.patch @@ -1,7 +1,7 @@ From 5a1cde5b8dcaea74ebb2050879036bf46df63adc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl> Date: Fri, 17 Aug 2018 10:18:59 +0200 -Subject: [PATCH 06/10] Throw an error if -s is used without a crate +Subject: [PATCH 06/13] Throw an error if -s is used without a crate In the future we might want to be smarter and find the crate, but let's at least not ignore the option completely. @@ -24,5 +24,5 @@ index 8e6f6eb..f23ebbc 100644 diff = make_patch(toml, enabled=patch, tmpfile=True) metadata = Metadata.from_file(toml) -- -2.19.1 +2.20.0.rc2 diff --git a/0007-split-features-into-subpackages.patch b/0007-split-features-into-subpackages.patch index ac08472..52d253e 100644 --- a/0007-split-features-into-subpackages.patch +++ b/0007-split-features-into-subpackages.patch @@ -1,7 +1,7 @@ From 2cac5e5ad5ff5472923ce333bef59679612bbaa2 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Fri, 26 Oct 2018 11:20:13 +0200 -Subject: [PATCH 07/10] split features into subpackages +Subject: [PATCH 07/13] split features into subpackages References:
https://discussion.fedoraproject.org/t/rfc-new-crates-packaging-design-feat…
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> @@ -1060,5 +1060,5 @@ index b856fdd..30263b4 100644 - assert [str(x) for x in md.provides] == provides - assert [str(x) for x in md.requires] == requires -- -2.19.1 +2.20.0.rc2 diff --git a/0008-add-support-for-dependencies-with-same-name.patch b/0008-add-support-for-dependencies-with-same-name.patch index d63d0c4..378edfc 100644 --- a/0008-add-support-for-dependencies-with-same-name.patch +++ b/0008-add-support-for-dependencies-with-same-name.patch @@ -1,7 +1,7 @@ From a1d3a84645aa7bbe5ca07b60bead1ddf90a21cc1 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Tue, 30 Oct 2018 20:37:38 +0100 -Subject: [PATCH 08/10] add support for dependencies with same name +Subject: [PATCH 08/13] add support for dependencies with same name Reported-by: Josh Stone <jistone(a)redhat.com> References:
https://internals.rust-lang.org/t/optional-dependencies-with-same-name/8728
@@ -70,5 +70,5 @@ index 4929cdd..328b67a 100644 if "default" not in deps_by_feature: -- -2.19.1 +2.20.0.rc2 diff --git a/0009-add-support-for-feeding-user-configuration.patch b/0009-add-support-for-feeding-user-configuration.patch index 233c11c..b130ebe 100644 --- a/0009-add-support-for-feeding-user-configuration.patch +++ b/0009-add-support-for-feeding-user-configuration.patch @@ -1,7 +1,7 @@ From 197150ee2e862edcd46f7ab02c9e4d17e49ca75d Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Wed, 31 Oct 2018 18:03:21 +0100 -Subject: [PATCH 09/10] add support for feeding user configuration +Subject: [PATCH 09/13] add support for feeding user configuration Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> --- @@ -144,5 +144,5 @@ index 0d9a80b..d901e6d 100644 %description {{ pkg }} %{_description} -- -2.19.1 +2.20.0.rc2 diff --git a/0010-trivial-use-f-strings-everywhere.patch b/0010-trivial-use-f-strings-everywhere.patch index 32bae14..f6ff2f4 100644 --- a/0010-trivial-use-f-strings-everywhere.patch +++ b/0010-trivial-use-f-strings-everywhere.patch @@ -1,7 +1,7 @@ From 83ea3796cd28ec7689b39e7dc7a70bd11af1abf1 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Wed, 31 Oct 2018 17:00:58 +0100 -Subject: [PATCH 10/10] trivial: use f-strings everywhere +Subject: [PATCH 10/13] trivial: use f-strings everywhere Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> --- @@ -90,5 +90,5 @@ index c691274..b60e6c4 100644 else: with open(spec_file, "w") as fobj: -- -2.19.1 +2.20.0.rc2 diff --git a/0011-Add-option-to-not-generate-a-default-changelog-entry.patch b/0011-Add-option-to-not-generate-a-default-changelog-entry.patch new file mode 100644 index 0000000..ccad736 --- /dev/null +++ b/0011-Add-option-to-not-generate-a-default-changelog-entry.patch @@ -0,0 +1,63 @@ +From 294c6f571c0f4f7ed5a4fcb34142b0d332c55f29 Mon Sep 17 00:00:00 2001 +From: Neal Gompa <ngompa13(a)gmail.com> +Date: Sun, 11 Nov 2018 11:06:27 -0500 +Subject: [PATCH 11/13] Add option to not generate a default changelog entry + +For Rust packages created through the OBS source service, the +changelog is managed by an external <pkg>.changes file that is +transformed into an RPM changelog and appended to the spec file +automatically by the Open Build Service. + +Having a default entry means that the changelog handling will not +always work correctly and package builds may fail due to changelog +entries not being in reverse chronological order. + +This also is a future enabler for other workflows for external +changelog management in automated package builds. + +Signed-off-by: Neal Gompa <ngompa13(a)gmail.com> +--- + rust2rpm/__main__.py | 7 +++++++ + rust2rpm/templates/main.spec | 4 +++- + 2 files changed, 10 insertions(+), 1 deletion(-) + +diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py +index b60e6c4..747328e 100644 +--- a/rust2rpm/__main__.py ++++ b/rust2rpm/__main__.py +@@ -209,6 +209,8 @@ def main(): + formatter_class=argparse.RawTextHelpFormatter) + parser.add_argument("--show-license-map", action="store_true", + help="Print license mappings and exit") ++ parser.add_argument("--no-auto-changelog-entry", action="store_true", ++ help="Do not generate a changelog entry") + parser.add_argument("-", "--stdout", action="store_true", + help="Print spec and patches into stdout") + parser.add_argument("-t", "--target", action="store", +@@ -261,6 +263,11 @@ def main(): + raise ValueError("No bins and no libs") + kwargs["include_devel"] = is_lib + ++ if args.no_auto_changelog_entry: ++ kwargs["auto_changelog_entry"] = False ++ else: ++ kwargs["auto_changelog_entry"] = True ++ + if args.target in ("fedora", "mageia", "opensuse"): + kwargs["include_build_requires"] = True + kwargs["include_provides"] = False +diff --git a/rust2rpm/templates/main.spec b/rust2rpm/templates/main.spec +index d901e6d..84bd97d 100644 +--- a/rust2rpm/templates/main.spec ++++ b/rust2rpm/templates/main.spec +@@ -179,4 +179,6 @@ which use {% if feature is not none %}"{{ feature }}" feature of {% endif %}"%{c + %endif + + %changelog +-{% include target ~ "-changelog.spec.inc" %} ++{% if auto_changelog_entry %} ++ {% include target ~ "-changelog.spec.inc" %} ++{% endif %} +-- +2.20.0.rc2 + diff --git a/0012-Set-CARGO_HOME-to-the-local-.config.patch b/0012-Set-CARGO_HOME-to-the-local-.config.patch new file mode 100644 index 0000000..9f81757 --- /dev/null +++ b/0012-Set-CARGO_HOME-to-the-local-.config.patch @@ -0,0 +1,26 @@ +From b4e25038296cd57eba639a059e8baaf139a5d287 Mon Sep 17 00:00:00 2001 +From: Josh Stone <jistone(a)redhat.com> +Date: Fri, 7 Dec 2018 13:58:41 -0800 +Subject: [PATCH 12/13] Set CARGO_HOME to the local .config + +--- + data/macros.cargo | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/data/macros.cargo b/data/macros.cargo +index 7fb025b..e760721 100644 +--- a/data/macros.cargo ++++ b/data/macros.cargo +@@ -1,4 +1,8 @@ +-%__cargo %{_bindir}/cargo ++# Since cargo 1.31, install only uses $CARGO_HOME/config, ignoring $PWD. ++#
https://github.com/rust-lang/cargo/issues/6397
++# But we can set CARGO_HOME locally, which is a good idea anyway to make sure ++# it never writes to ~/.cargo during rpmbuild. ++%__cargo %{_bindir}/env CARGO_HOME=.cargo %{_bindir}/cargo + %__cargo_common_opts %{?_smp_mflags} + %__cargo_inspector %{_bindir}/cargo-inspector + +-- +2.20.0.rc2 + diff --git a/0013-Set-the-install-root-in-.cargo-config.patch b/0013-Set-the-install-root-in-.cargo-config.patch new file mode 100644 index 0000000..cb106e8 --- /dev/null +++ b/0013-Set-the-install-root-in-.cargo-config.patch @@ -0,0 +1,34 @@ +From a04e95bc4f807139bd3c4b75f46fd9a60ec1db8f Mon Sep 17 00:00:00 2001 +From: Josh Stone <jistone(a)redhat.com> +Date: Fri, 7 Dec 2018 13:59:03 -0800 +Subject: [PATCH 13/13] Set the install root in .cargo/config + +--- + data/macros.cargo | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/data/macros.cargo b/data/macros.cargo +index e760721..9a9ce6a 100644 +--- a/data/macros.cargo ++++ b/data/macros.cargo +@@ -20,6 +20,9 @@ rustc = "%{__rustc}"\ + rustdoc = "%{__rustdoc}"\ + rustflags = %{__global_rustflags_toml}\ + \ ++[install]\ ++root = "%{buildroot}%{_prefix}"\ ++\ + [term]\ + verbose = true\ + \ +@@ -81,7 +84,6 @@ if %__cargo_is_bin; then \ + %{shrink:%{__cargo} install \ + %{__cargo_common_opts} \ + --path . \ +- --root %{buildroot}%{_prefix} \ + %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \ + %* \ + }\ +-- +2.20.0.rc2 + diff --git a/rust-packaging.spec b/rust-packaging.spec index 98fa000..5b5682d 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -5,7 +5,7 @@ Name: rust-packaging Version: 6 -Release: 17%{?dist} +Release: 18%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT @@ -17,11 +17,13 @@ Patch0003: 0003-do-better-for-renamed-crates.patch Patch0004: 0004-remove-pre-3.6-leftovers.patch Patch0005: 0005-Remove-half-downloaded-crate-on-C.patch Patch0006: 0006-Throw-an-error-if-s-is-used-without-a-crate.patch -# Still in PR Patch0007: 0007-split-features-into-subpackages.patch Patch0008: 0008-add-support-for-dependencies-with-same-name.patch Patch0009: 0009-add-support-for-feeding-user-configuration.patch Patch0010: 0010-trivial-use-f-strings-everywhere.patch +Patch0011: 0011-Add-option-to-not-generate-a-default-changelog-entry.patch +Patch0012: 0012-Set-CARGO_HOME-to-the-local-.config.patch +Patch0013: 0013-Set-the-install-root-in-.cargo-config.patch ExclusiveArch: %{rust_arches} @@ -82,6 +84,9 @@ py.test-%{python3_version} -vv test.py %{python3_sitelib}/rust2rpm/ %changelog +* Fri Dec 07 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-18 +- Set CARGO_HOME + * Sat Nov 03 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-17 - Update patchset commit 04e7ad287a632a68ccd10cfd35a636852108ad28 Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Sat Nov 3 21:45:54 2018 +0100 Update patchset Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/0007-split-features-into-subpackages.patch b/0007-split-features-into-subpackages.patch index 519b6ac..ac08472 100644 --- a/0007-split-features-into-subpackages.patch +++ b/0007-split-features-into-subpackages.patch @@ -1,4 +1,4 @@ -From 5471c1916a5e947ba1b21343b70abd6d4aaf97de Mon Sep 17 00:00:00 2001 +From 2cac5e5ad5ff5472923ce333bef59679612bbaa2 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Fri, 26 Oct 2018 11:20:13 +0200 Subject: [PATCH 07/10] split features into subpackages @@ -7,12 +7,13 @@ References:
https://discussion.fedoraproject.org/t/rfc-new-crates-packaging-desi
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> --- data/cargo.attr | 4 +- - data/macros.cargo | 10 ++ + data/macros.cargo | 10 + rust2rpm/__main__.py | 11 +- rust2rpm/inspector.py | 22 ++- - rust2rpm/metadata.py | 315 +++++++++++++++++------------------ - rust2rpm/templates/main.spec | 142 ++++++++-------- - 6 files changed, 260 insertions(+), 244 deletions(-) + rust2rpm/metadata.py | 317 ++++++++++++++++---------------- + rust2rpm/templates/main.spec | 142 +++++++------- + test.py | 347 ++++------------------------------- + 7 files changed, 298 insertions(+), 555 deletions(-) diff --git a/data/cargo.attr b/data/cargo.attr index 392a72b..4910b5c 100644 @@ -143,10 +144,10 @@ index 2d488b2..9e79e88 100644 if __name__ == "__main__": main() diff --git a/rust2rpm/metadata.py b/rust2rpm/metadata.py -index 5adeb65..119dea5 100644 +index 5adeb65..4929cdd 100644 --- a/rust2rpm/metadata.py +++ b/rust2rpm/metadata.py -@@ -1,208 +1,205 @@ +@@ -1,208 +1,207 @@ __all__ = ["Dependency", "Metadata"] -import itertools @@ -260,8 +261,8 @@ index 5adeb65..119dea5 100644 - spec = semver.Spec(s.replace(" ", "")) - parsed = [] + def _normalize_req(req): -+ if "*" in req: -+ return NotImplemented ++ if "*" in req and req != "*": ++ raise NotImplementedError(f"'*' is not supported: {req}") + spec = semver.Spec(req.replace(" ", "")) + reqs = [] for req in spec.specs: @@ -271,8 +272,10 @@ index 5adeb65..119dea5 100644 + # Any means any continue + ver = req.spec -+ if ver.prerelease or req.kind in (req.KIND_NEQ, req.KIND_EMPTY): -+ return NotImplemented ++ if ver.prerelease: ++ raise NotImplementedError(f"Pre-release requirement is not supported: {ver}") ++ if req.kind in (req.KIND_NEQ, req.KIND_EMPTY): ++ raise NotImplementedError(f"'!=' and empty kinds are not supported: {req}") coerced = semver.Version.coerce(str(ver)) - if req.kind in (req.KIND_CARET, req.KIND_TILDE): - if ver.prerelease: @@ -697,6 +700,365 @@ index 7dbcc3f..0d9a80b 100644 -{% endif %} %changelog {% include target ~ "-changelog.spec.inc" %} +diff --git a/test.py b/test.py +index b856fdd..30263b4 100644 +--- a/test.py ++++ b/test.py +@@ -1,318 +1,43 @@ +-import os +-import shutil +-import subprocess +-import sys +-import tempfile +-import textwrap +- + import pytest + + import rust2rpm + +-DUMMY_LIB = """ +-pub fn say_hello() { +- println!("Hello, World!"); +-} +-""" +-DEPGEN = os.path.join(os.path.dirname(__file__), "cargodeps.py") +- +- +-(a)pytest.mark.parametrize("req, features, rpmdep", [ +- ("=1.0.0", [], +- "crate(test) = 1.0.0"), +- ("=1.0.0", ["feature"], +- "(crate(test) = 1.0.0 with crate(test/feature))"), +- (">=1.0.0,<2.0.0", [], ++(a)pytest.mark.parametrize("req, rpmdep", [ ++ ("^1.2.3", ++ "(crate(test) >= 1.2.3 with crate(test) < 2.0.0)"), ++ ("^1.2", ++ "(crate(test) >= 1.2.0 with crate(test) < 2.0.0)"), ++ ("^1", + "(crate(test) >= 1.0.0 with crate(test) < 2.0.0)"), +- (">=1.0.0,<2.0.0", ["feature"], +- "((crate(test) >= 1.0.0 with crate(test) < 2.0.0) with crate(test/feature))"), ++ ("^0.2.3", ++ "(crate(test) >= 0.2.3 with crate(test) < 0.3.0)"), ++ ("^0.2", ++ "(crate(test) >= 0.2.0 with crate(test) < 0.3.0)"), ++ ("^0.0.3", ++ "(crate(test) >= 0.0.3 with crate(test) < 0.0.4)"), ++ ("^0.0", ++ "(crate(test) >= 0.0.0 with crate(test) < 0.1.0)"), ++ ("^0", ++ "(crate(test) >= 0.0.0 with crate(test) < 1.0.0)"), ++ ("~1.2.3", ++ "(crate(test) >= 1.2.3 with crate(test) < 1.3.0)"), ++ ("~1.2", ++ "(crate(test) >= 1.2.0 with crate(test) < 1.3.0)"), ++ ("~1", ++ "(crate(test) >= 1.0.0 with crate(test) < 2.0.0)"), ++ ("*", ++ "crate(test)"), ++ (">= 1.2.0", ++ "crate(test) >= 1.2.0"), ++ ("> 1", ++ "crate(test) > 1.0.0"), ++ ("< 2", ++ "crate(test) < 2.0.0"), ++ ("= 1.2.3", ++ "crate(test) = 1.2.3"), ++ (">= 1.2, < 1.5", ++ "(crate(test) >= 1.2.0 with crate(test) < 1.5.0)"), + ]) +-def test_dependency(req, features, rpmdep): +- dep = rust2rpm.Dependency("test", req, features) ++def test_dependency(req, rpmdep): ++ dep = rust2rpm.Dependency("test", req) + assert str(dep) == rpmdep +- +-(a)pytest.fixture +-def cargo_toml(request): +- def make_cargo_toml(contents): +- toml = os.path.join(tmpdir, "Cargo.toml") +- with open(toml, "w") as fobj: +- fobj.write(textwrap.dedent(contents)) +- return toml +- +- tmpdir = tempfile.mkdtemp(prefix="cargo-deps-") +- srcdir = os.path.join(tmpdir, "src") +- os.mkdir(srcdir) +- with open(os.path.join(srcdir, "lib.rs"), "w") as fobj: +- fobj.write(DUMMY_LIB) +- +- def finalize(): +- shutil.rmtree(tmpdir) +- request.addfinalizer(finalize) +- +- return make_cargo_toml +- +-(a)pytest.mark.parametrize("toml, provides, requires", [ +- +- # Basic provides +- (""" +- [package] +- name = "hello" +- version = "0.0.0" +- """, +- ["crate(hello) = 0.0.0"], +- []), +- +- # Basic provides for feature +- (""" +- [package] +- name = "hello" +- version = "1.2.3" +- +- [features] +- color = [] +- """, +- ["crate(hello) = 1.2.3", +- "crate(hello/color) = 1.2.3"], +- []), +- +- # Provides for optional dependencies +- (""" +- [package] +- name = "hello" +- version = "1.2.3" +- +- [dependencies] +- non_optional = "1" +- serde = { version = "1", optional = true } +- rand = { version = "0.4", optional = true } +- +- [features] +- std = [] +- v1 = ["rand"] +- """, +- ["crate(hello) = 1.2.3", +- "crate(hello/rand) = 1.2.3", +- "crate(hello/serde) = 1.2.3", +- "crate(hello/std) = 1.2.3", +- "crate(hello/v1) = 1.2.3"], +- ["(crate(non_optional) >= 1.0.0 with crate(non_optional) < 2.0.0)", +- "(crate(rand) >= 0.4.0 with crate(rand) < 0.5.0)", +- "(crate(serde) >= 1.0.0 with crate(serde) < 2.0.0)"]), +- +- # Caret requirements +- (""" +- [package] +- name = "hello" +- version = "0.0.0" +- +- [dependencies] +- libc = "^0" +- """, +- ["crate(hello) = 0.0.0"], +- ["(crate(libc) >= 0.0.0 with crate(libc) < 1.0.0)"]), +- (""" +- [package] +- name = "hello" +- version = "0.0.0" +- +- [dependencies] +- libc = "^0.0" +- """, +- ["crate(hello) = 0.0.0"], +- ["(crate(libc) >= 0.0.0 with crate(libc) < 0.1.0)"]), +- (""" +- [package] +- name = "hello" +- version = "0.0.0" +- +- [dependencies] +- libc = "^0.0.3" +- """, +- ["crate(hello) = 0.0.0"], +- ["(crate(libc) >= 0.0.3 with crate(libc) < 0.0.4)"]), +- (""" +- [package] +- name = "hello" +- version = "0.0.0" +- +- [dependencies] +- libc = "^0.2.3" +- """, +- ["crate(hello) = 0.0.0"], +- ["(crate(libc) >= 0.2.3 with crate(libc) < 0.3.0)"]), +- (""" +- [package] +- name = "hello" +- version = "0.0.0" +- +- [dependencies] +- libc = "^1" +- """, +- ["crate(hello) = 0.0.0"], +- ["(crate(libc) >= 1.0.0 with crate(libc) < 2.0.0)"]), +- (""" +- [package] +- name = "hello" +- version = "0.0.0" +- +- [dependencies] +- libc = "^1.2" +- """, +- ["crate(hello) = 0.0.0"], +- ["(crate(libc) >= 1.2.0 with crate(libc) < 2.0.0)"]), +- (""" +- [package] +- name = "hello" +- version = "0.0.0" +- +- [dependencies] +- libc = "^1.2.3" +- """, +- ["crate(hello) = 0.0.0"], +- ["(crate(libc) >= 1.2.3 with crate(libc) < 2.0.0)"]), +- +- # Tilde requirements +- (""" +- [package] +- name = "hello" +- version = "0.0.0" +- +- [dependencies] +- libc = "~1" +- """, +- ["crate(hello) = 0.0.0"], +- ["(crate(libc) >= 1.0.0 with crate(libc) < 2.0.0)"]), +- (""" +- [package] +- name = "hello" +- version = "0.0.0" +- +- [dependencies] +- libc = "~1.2" +- """, +- ["crate(hello) = 0.0.0"], +- ["(crate(libc) >= 1.2.0 with crate(libc) < 1.3.0)"]), +- (""" +- [package] +- name = "hello" +- version = "0.0.0" +- +- [dependencies] +- libc = "~1.2.3" +- """, +- ["crate(hello) = 0.0.0"], +- ["(crate(libc) >= 1.2.3 with crate(libc) < 1.3.0)"]), +- +- # Wildcard requirements +- (""" +- [package] +- name = "hello" +- version = "0.0.0" +- +- [dependencies] +- libc = "*" +- """, +- ["crate(hello) = 0.0.0"], +- ["crate(libc)"]), +- (""" +- [package] +- name = "hello" +- version = "0.0.0" +- +- [dependencies] +- libc = "1.*" +- """, +- ["crate(hello) = 0.0.0"], +- ["(crate(libc) >= 1.0.0 with crate(libc) < 2.0.0)"]), +- (""" +- [package] +- name = "hello" +- version = "0.0.0" +- +- [dependencies] +- libc = "1.2.*" +- """, +- ["crate(hello) = 0.0.0"], +- ["(crate(libc) >= 1.2.0 with crate(libc) < 1.3.0)"]), +- (""" +- [package] +- name = "hello" +- version = "0.0.0" +- +- [dependencies] +- libc = "1.*.*" +- """, +- ["crate(hello) = 0.0.0"], +- ["(crate(libc) >= 1.0.0 with crate(libc) < 2.0.0)"]), +- +- # Inequality requirements +- (""" +- [package] +- name = "hello" +- version = "0.0.0" +- +- [dependencies] +- libc = ">= 1.2.0" +- """, +- ["crate(hello) = 0.0.0"], +- ["crate(libc) >= 1.2.0"]), +- (""" +- [package] +- name = "hello" +- version = "0.0.0" +- +- [dependencies] +- libc = "> 1" +- """, +- ["crate(hello) = 0.0.0"], +- ["crate(libc) > 1.0.0"]), +- (""" +- [package] +- name = "hello" +- version = "0.0.0" +- +- [dependencies] +- libc = "< 2" +- """, +- ["crate(hello) = 0.0.0"], +- ["crate(libc) < 2.0.0"]), +- (""" +- [package] +- name = "hello" +- version = "0.0.0" +- +- [dependencies] +- libc = "= 1.2.3" +- """, +- ["crate(hello) = 0.0.0"], +- ["crate(libc) = 1.2.3"]), +- +- # Multiple requirements +- (""" +- [package] +- name = "hello" +- version = "0.0.0" +- +- [dependencies] +- libc = ">= 1.2, < 1.5" +- """, +- ["crate(hello) = 0.0.0"], +- ["(crate(libc) >= 1.2.0 with crate(libc) < 1.5.0)"]), +- +- # Pre-release requirements +- (""" +- [package] +- name = "hello" +- version = "0.0.0-alpha" +- +- [dependencies] +- foo-bar = "1.2.3-beta" +- """, +- ["crate(hello) = 0.0.0~alpha"], +- ["(crate(foo-bar) >= 1.2.3~beta with crate(foo-bar) < 1.2.3)"]), +- +-]) +-def test_depgen(toml, provides, requires, cargo_toml): +- md = rust2rpm.Metadata.from_file(cargo_toml(toml)) +- assert [str(x) for x in md.provides] == provides +- assert [str(x) for x in md.requires] == requires -- 2.19.1 diff --git a/0008-add-support-for-dependencies-with-same-name.patch b/0008-add-support-for-dependencies-with-same-name.patch index 1932281..d63d0c4 100644 --- a/0008-add-support-for-dependencies-with-same-name.patch +++ b/0008-add-support-for-dependencies-with-same-name.patch @@ -1,4 +1,4 @@ -From 8905032db2b0198c6426011807f3b75fc91c38b5 Mon Sep 17 00:00:00 2001 +From a1d3a84645aa7bbe5ca07b60bead1ddf90a21cc1 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Tue, 30 Oct 2018 20:37:38 +0100 Subject: [PATCH 08/10] add support for dependencies with same name @@ -11,7 +11,7 @@ Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/rust2rpm/metadata.py b/rust2rpm/metadata.py -index 119dea5..febf1e5 100644 +index 4929cdd..328b67a 100644 --- a/rust2rpm/metadata.py +++ b/rust2rpm/metadata.py @@ -1,5 +1,6 @@ @@ -21,7 +21,7 @@ index 119dea5..febf1e5 100644 import copy import json import subprocess -@@ -124,9 +125,11 @@ class Metadata: +@@ -126,9 +127,11 @@ class Metadata: self.description = md.get("description") # dependencies + build-dependencies runtime @@ -36,7 +36,7 @@ index 119dea5..febf1e5 100644 deps_by_feature = {} for feature, f_deps in md["features"].items(): -@@ -137,18 +140,23 @@ class Metadata: +@@ -139,18 +142,23 @@ class Metadata: features.add(dep) else: pkg, _, f = dep.partition("/") diff --git a/0009-add-support-for-feeding-user-configuration.patch b/0009-add-support-for-feeding-user-configuration.patch index d811dac..233c11c 100644 --- a/0009-add-support-for-feeding-user-configuration.patch +++ b/0009-add-support-for-feeding-user-configuration.patch @@ -1,4 +1,4 @@ -From 9ef415cbd5e204849793a16fa1b8a9ed40c0be73 Mon Sep 17 00:00:00 2001 +From 197150ee2e862edcd46f7ab02c9e4d17e49ca75d Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Wed, 31 Oct 2018 18:03:21 +0100 Subject: [PATCH 09/10] add support for feeding user configuration diff --git a/0010-trivial-use-f-strings-everywhere.patch b/0010-trivial-use-f-strings-everywhere.patch index dd42d58..32bae14 100644 --- a/0010-trivial-use-f-strings-everywhere.patch +++ b/0010-trivial-use-f-strings-everywhere.patch @@ -1,4 +1,4 @@ -From be0464ab8a235b4c3b49e711140c2de2f0dcf6d8 Mon Sep 17 00:00:00 2001 +From 83ea3796cd28ec7689b39e7dc7a70bd11af1abf1 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Wed, 31 Oct 2018 17:00:58 +0100 Subject: [PATCH 10/10] trivial: use f-strings everywhere diff --git a/rust-packaging.spec b/rust-packaging.spec index f80f490..98fa000 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -1,12 +1,11 @@ -# Tests need fixing after patches -%bcond_with check +%bcond_without check %{?python_enable_dependency_generator} #
https://pagure.io/koji/issue/659
%global debug_package %{nil} Name: rust-packaging Version: 6 -Release: 16%{?dist} +Release: 17%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT @@ -83,6 +82,9 @@ py.test-%{python3_version} -vv test.py %{python3_sitelib}/rust2rpm/ %changelog +* Sat Nov 03 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-17 +- Update patchset + * Sat Nov 03 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-16 - Make package archful commit 965e2b87b5dc2618aacb99bd2875fc673f6746eb Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Sat Nov 3 10:15:56 2018 +0100 Make package archful Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/rust-packaging.spec b/rust-packaging.spec index 524b739..f80f490 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -1,10 +1,12 @@ # Tests need fixing after patches %bcond_with check %{?python_enable_dependency_generator} +#
https://pagure.io/koji/issue/659
+%global debug_package %{nil} Name: rust-packaging Version: 6 -Release: 15%{?dist} +Release: 16%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT @@ -22,8 +24,7 @@ Patch0008: 0008-add-support-for-dependencies-with-same-name.patch Patch0009: 0009-add-support-for-feeding-user-configuration.patch Patch0010: 0010-trivial-use-f-strings-everywhere.patch -BuildArch: noarch -ExclusiveArch: %{rust_arches} noarch +ExclusiveArch: %{rust_arches} # gawk is needed for stripping dev-deps in macro, 4.1.0 is needed for inplace feature Requires: gawk >= 4.1.0 @@ -82,6 +83,9 @@ py.test-%{python3_version} -vv test.py %{python3_sitelib}/rust2rpm/ %changelog +* Sat Nov 03 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-16 +- Make package archful + * Fri Nov 02 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-15 - Support .rust2rpm.conf commit 5ab9ed56cb2342f2e30413ce4cf1d3c499b5bfd2 Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Fri Nov 2 17:05:14 2018 +0100 update patches Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/0007-split-features-into-subpackages.patch b/0007-split-features-into-subpackages.patch index 0d4c7e2..519b6ac 100644 --- a/0007-split-features-into-subpackages.patch +++ b/0007-split-features-into-subpackages.patch @@ -1,4 +1,4 @@ -From 6f95899a21799054165858cacbe588a2a8bc6020 Mon Sep 17 00:00:00 2001 +From 5471c1916a5e947ba1b21343b70abd6d4aaf97de Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Fri, 26 Oct 2018 11:20:13 +0200 Subject: [PATCH 07/10] split features into subpackages diff --git a/0008-add-support-for-dependencies-with-same-name.patch b/0008-add-support-for-dependencies-with-same-name.patch index 490338c..1932281 100644 --- a/0008-add-support-for-dependencies-with-same-name.patch +++ b/0008-add-support-for-dependencies-with-same-name.patch @@ -1,4 +1,4 @@ -From a5fd01ecd0fd600a096c060ddfe77a21f54b045f Mon Sep 17 00:00:00 2001 +From 8905032db2b0198c6426011807f3b75fc91c38b5 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Tue, 30 Oct 2018 20:37:38 +0100 Subject: [PATCH 08/10] add support for dependencies with same name diff --git a/0009-add-support-for-feeding-user-configuration.patch b/0009-add-support-for-feeding-user-configuration.patch index 1a33fae..d811dac 100644 --- a/0009-add-support-for-feeding-user-configuration.patch +++ b/0009-add-support-for-feeding-user-configuration.patch @@ -1,4 +1,4 @@ -From 52b6ff8d55d59ace29950621ed41175ac31fa90c Mon Sep 17 00:00:00 2001 +From 9ef415cbd5e204849793a16fa1b8a9ed40c0be73 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Wed, 31 Oct 2018 18:03:21 +0100 Subject: [PATCH 09/10] add support for feeding user configuration @@ -57,7 +57,7 @@ index 8866027..0000000 - -Convert Rust crates to RPM. diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py -index d19cb47..18fac5c 100644 +index d19cb47..c691274 100644 --- a/rust2rpm/__main__.py +++ b/rust2rpm/__main__.py @@ -199,6 +199,11 @@ def make_diff_metadata(crate, version, patch=False, store=False): @@ -84,7 +84,7 @@ index d19cb47..18fac5c 100644 kwargs["license"] = license kwargs["license_comments"] = comments -+ conf = configparser.ConfigParser() ++ conf = configparser.ConfigParser(interpolation=configparser.ExtendedInterpolation()) + conf.read(".rust2rpm.conf") + if args.target not in conf: + conf.add_section(args.target) diff --git a/0010-trivial-use-f-strings-everywhere.patch b/0010-trivial-use-f-strings-everywhere.patch index 3d8ca14..dd42d58 100644 --- a/0010-trivial-use-f-strings-everywhere.patch +++ b/0010-trivial-use-f-strings-everywhere.patch @@ -1,4 +1,4 @@ -From 00ed1ce05d9dd4c8042f27ca959350ce34fb1be5 Mon Sep 17 00:00:00 2001 +From be0464ab8a235b4c3b49e711140c2de2f0dcf6d8 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Wed, 31 Oct 2018 17:00:58 +0100 Subject: [PATCH 10/10] trivial: use f-strings everywhere @@ -9,7 +9,7 @@ Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py -index 18fac5c..b4eb624 100644 +index c691274..b60e6c4 100644 --- a/rust2rpm/__main__.py +++ b/rust2rpm/__main__.py @@ -79,7 +79,7 @@ def detect_packager(): commit ae59ba471de8c4fbf9b5b99030f71b5758ce1a2e Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Fri Nov 2 17:00:14 2018 +0100 Support .rust2rpm.conf Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/0001-name-spec-patch_file-by-real-crate-name.patch b/0001-name-spec-patch_file-by-real-crate-name.patch index 27fbbfa..3049ab2 100644 --- a/0001-name-spec-patch_file-by-real-crate-name.patch +++ b/0001-name-spec-patch_file-by-real-crate-name.patch @@ -1,7 +1,7 @@ From 0dc9fc182edf0791ca697f587e48dd39948d63c1 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Mon, 10 Sep 2018 23:37:40 +0200 -Subject: [PATCH 1/8] name spec/patch_file by real crate name +Subject: [PATCH 01/10] name spec/patch_file by real crate name When renaming using patch file, we really want to change file names too. diff --git a/0002-generate-doc-statements.patch b/0002-generate-doc-statements.patch index fb5ec59..fb8f36b 100644 --- a/0002-generate-doc-statements.patch +++ b/0002-generate-doc-statements.patch @@ -1,7 +1,7 @@ From 561280a0ea35f226ef243526be2bbb656db44af6 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Mon, 10 Sep 2018 23:40:18 +0200 -Subject: [PATCH 2/8] generate %doc statements +Subject: [PATCH 02/10] generate %doc statements Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> --- diff --git a/0003-do-better-for-renamed-crates.patch b/0003-do-better-for-renamed-crates.patch index 0c9c3fd..e70a367 100644 --- a/0003-do-better-for-renamed-crates.patch +++ b/0003-do-better-for-renamed-crates.patch @@ -1,7 +1,7 @@ From 2050880140d4953b9ebdc7211e30df3ccf5dd61d Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Tue, 11 Sep 2018 00:06:50 +0200 -Subject: [PATCH 3/8] do better for renamed crates +Subject: [PATCH 03/10] do better for renamed crates Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> --- diff --git a/0004-remove-pre-3.6-leftovers.patch b/0004-remove-pre-3.6-leftovers.patch index 79d041d..0f2a391 100644 --- a/0004-remove-pre-3.6-leftovers.patch +++ b/0004-remove-pre-3.6-leftovers.patch @@ -1,7 +1,7 @@ From e6e9cbbb71199c2773b47fa21f1c917a167c1743 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Tue, 11 Sep 2018 10:43:53 +0200 -Subject: [PATCH 4/8] remove pre-3.6 leftovers +Subject: [PATCH 04/10] remove pre-3.6 leftovers Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> --- diff --git a/0005-Remove-half-downloaded-crate-on-C.patch b/0005-Remove-half-downloaded-crate-on-C.patch index ef0eb21..6daebcc 100644 --- a/0005-Remove-half-downloaded-crate-on-C.patch +++ b/0005-Remove-half-downloaded-crate-on-C.patch @@ -1,7 +1,7 @@ From 2f12c83d14afe71e9efed2d1be62e1e610e602e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl> Date: Fri, 17 Aug 2018 10:03:48 +0200 -Subject: [PATCH 5/8] Remove half-downloaded crate on ^C +Subject: [PATCH 05/10] Remove half-downloaded crate on ^C Subsequent invocations would fail with an error about a corrupted file. We don't have support for resuming a failed download, so let's remove the diff --git a/0006-Throw-an-error-if-s-is-used-without-a-crate.patch b/0006-Throw-an-error-if-s-is-used-without-a-crate.patch index 44bc5b1..1f2a4e0 100644 --- a/0006-Throw-an-error-if-s-is-used-without-a-crate.patch +++ b/0006-Throw-an-error-if-s-is-used-without-a-crate.patch @@ -1,7 +1,7 @@ From 5a1cde5b8dcaea74ebb2050879036bf46df63adc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl> Date: Fri, 17 Aug 2018 10:18:59 +0200 -Subject: [PATCH 6/8] Throw an error if -s is used without a crate +Subject: [PATCH 06/10] Throw an error if -s is used without a crate In the future we might want to be smarter and find the crate, but let's at least not ignore the option completely. diff --git a/0007-split-features-into-subpackages.patch b/0007-split-features-into-subpackages.patch index fe96334..0d4c7e2 100644 --- a/0007-split-features-into-subpackages.patch +++ b/0007-split-features-into-subpackages.patch @@ -1,7 +1,7 @@ -From d7caa1148d5fcac70030e3fb1eb698927e69960f Mon Sep 17 00:00:00 2001 +From 6f95899a21799054165858cacbe588a2a8bc6020 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Fri, 26 Oct 2018 11:20:13 +0200 -Subject: [PATCH 7/8] split features into subpackages +Subject: [PATCH 07/10] split features into subpackages References:
https://discussion.fedoraproject.org/t/rfc-new-crates-packaging-design-feat…
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/0008-add-support-for-dependencies-with-same-name.patch b/0008-add-support-for-dependencies-with-same-name.patch index dbbad89..490338c 100644 --- a/0008-add-support-for-dependencies-with-same-name.patch +++ b/0008-add-support-for-dependencies-with-same-name.patch @@ -1,7 +1,7 @@ -From 129d556d19d2e41135f5e98ed028d7d00e66b524 Mon Sep 17 00:00:00 2001 +From a5fd01ecd0fd600a096c060ddfe77a21f54b045f Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Tue, 30 Oct 2018 20:37:38 +0100 -Subject: [PATCH 8/8] add support for dependencies with same name +Subject: [PATCH 08/10] add support for dependencies with same name Reported-by: Josh Stone <jistone(a)redhat.com> References:
https://internals.rust-lang.org/t/optional-dependencies-with-same-name/8728
diff --git a/0009-add-support-for-feeding-user-configuration.patch b/0009-add-support-for-feeding-user-configuration.patch new file mode 100644 index 0000000..1a33fae --- /dev/null +++ b/0009-add-support-for-feeding-user-configuration.patch @@ -0,0 +1,148 @@ +From 52b6ff8d55d59ace29950621ed41175ac31fa90c Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +Date: Wed, 31 Oct 2018 18:03:21 +0100 +Subject: [PATCH 09/10] add support for feeding user configuration + +Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +--- + README.md | 26 ++++++++++++++++++++++++++ + README.rst | 5 ----- + rust2rpm/__main__.py | 13 +++++++++++++ + rust2rpm/templates/main.spec | 17 ++++++++++++++++- + 4 files changed, 55 insertions(+), 6 deletions(-) + create mode 100644 README.md + delete mode 100644 README.rst + +diff --git a/README.md b/README.md +new file mode 100644 +index 0000000..22b4b30 +--- /dev/null ++++ b/README.md +@@ -0,0 +1,26 @@ ++# rust2rpm ++ ++Convert Rust crates to RPM. ++ ++## `.rust2rpm.conf` ++ ++You can place configuration file which is used as source for additional ++information for spec generation. ++ ++Some simple example would be better than many words ;) ++ ++```ini ++[DEFAULT] ++buildrequires = ++ pkgconfig(foo) >= 1.2.3 ++lib.requires = ++ pkgconfig(foo) >= 1.2.3 ++ ++[fedora] ++bin.requires = ++ findutils ++buildrequires = ++lib.requires = ++lib+default.requires = ++ pkgconfig(bar) >= 2.0.0 ++``` +diff --git a/README.rst b/README.rst +deleted file mode 100644 +index 8866027..0000000 +--- a/README.rst ++++ /dev/null +@@ -1,5 +0,0 @@ +-======== +-rust2rpm +-======== +- +-Convert Rust crates to RPM. +diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py +index d19cb47..18fac5c 100644 +--- a/rust2rpm/__main__.py ++++ b/rust2rpm/__main__.py +@@ -199,6 +199,11 @@ def make_diff_metadata(crate, version, patch=False, store=False): + shutil.copy2(cratef, os.path.join(os.getcwd(), f"{metadata.name}-{version}.crate")) + return crate, diff, metadata + ++def to_list(s): ++ if not s: ++ return [] ++ return list(filter(None, (l.strip() for l in s.splitlines()))) ++ + def main(): + parser = argparse.ArgumentParser("rust2rpm", + formatter_class=argparse.RawTextHelpFormatter) +@@ -232,6 +237,7 @@ def main(): + store=args.store_crate) + + JINJA_ENV.globals["normalize_deps"] = normalize_deps ++ JINJA_ENV.globals["to_list"] = to_list + template = JINJA_ENV.get_template("main.spec") + + if args.patch and len(diff) > 0: +@@ -287,6 +293,13 @@ def main(): + kwargs["license"] = license + kwargs["license_comments"] = comments + ++ conf = configparser.ConfigParser() ++ conf.read(".rust2rpm.conf") ++ if args.target not in conf: ++ conf.add_section(args.target) ++ ++ kwargs["distconf"] = conf[args.target] ++ + spec_file = f"rust-{metadata.name}.spec" + spec_contents = template.render(md=metadata, patch_file=patch_file, **kwargs) + if args.stdout: +diff --git a/rust2rpm/templates/main.spec b/rust2rpm/templates/main.spec +index 0d9a80b..d901e6d 100644 +--- a/rust2rpm/templates/main.spec ++++ b/rust2rpm/templates/main.spec +@@ -65,6 +65,9 @@ BuildRequires: {{ req }} + {% endfor %} + %endif + {% endif %} ++{% for req in to_list(distconf.get("buildrequires"))|sort %} ++BuildRequires: {{ req }} ++{% endfor %} + + %global _description \ + {% if md.description is none %} +@@ -81,6 +84,9 @@ Summary: %{summary} + {% if rust_group is defined %} + Group: # FIXME + {% endif %} ++ {% for req in to_list(distconf.get("bin.requires"))|sort %} ++Requires: {{ req }} ++ {% endfor %} + + %description -n %{crate} + %{summary}. +@@ -106,7 +112,13 @@ Group: # FIXME + {% do features.insert(0, None) %} + {% do features.insert(1, "default") %} + {% for feature in features %} +- {% set pkg = "-n %%{name}+%s-devel"|format(feature) if feature is not none else " devel" %} ++ {% if feature is none %} ++ {% set pkg = " devel" %} ++ {% set conf_prefix = "lib" %} ++ {% else %} ++ {% set pkg = "-n %%{name}+%s-devel"|format(feature) %} ++ {% set conf_prefix = "lib+%s"|format(feature) %} ++ {% endif %} + %package {{ pkg }} + Summary: %{summary} + {% if rust_group is defined %} +@@ -122,6 +134,9 @@ Requires: cargo + Requires: {{ req }} + {% endfor %} + {% endif %} ++ {% for req in to_list(distconf.get("%s.requires"|format(conf_prefix)))|sort %} ++Requires: {{ req }} ++ {% endfor %} + + %description {{ pkg }} %{_description} + +-- +2.19.1 + diff --git a/0010-trivial-use-f-strings-everywhere.patch b/0010-trivial-use-f-strings-everywhere.patch new file mode 100644 index 0000000..3d8ca14 --- /dev/null +++ b/0010-trivial-use-f-strings-everywhere.patch @@ -0,0 +1,94 @@ +From 00ed1ce05d9dd4c8042f27ca959350ce34fb1be5 Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +Date: Wed, 31 Oct 2018 17:00:58 +0100 +Subject: [PATCH 10/10] trivial: use f-strings everywhere + +Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +--- + rust2rpm/__main__.py | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py +index 18fac5c..b4eb624 100644 +--- a/rust2rpm/__main__.py ++++ b/rust2rpm/__main__.py +@@ -79,7 +79,7 @@ def detect_packager(): + if git is not None: + name = subprocess.check_output([git, "config", "user.name"], universal_newlines=True).strip() + email = subprocess.check_output([git, "config", "user.email"], universal_newlines=True).strip() +- return "{} <{}>".format(name, email) ++ return f"{name} <{email}>" + + return None + +@@ -108,23 +108,23 @@ def local_crate(crate, version): + def download(crate, version): + if version is None: + # Now we need to get latest version +- url = requests.compat.urljoin(API_URL, "crates/{}/versions".format(crate)) ++ url = requests.compat.urljoin(API_URL, f"crates/{crate}/versions") + req = requests.get(url) + req.raise_for_status() + versions = req.json()["versions"] + version = next(version["num"] for version in versions if not version["yanked"]) + + os.makedirs(CACHEDIR, exist_ok=True) +- cratef_base = "{}-{}.crate".format(crate, version) ++ cratef_base = f"{crate}-{version}.crate" + cratef = os.path.join(CACHEDIR, cratef_base) + if not os.path.isfile(cratef): +- url = requests.compat.urljoin(API_URL, "crates/{}/{}/download#".format(crate, version)) ++ url = requests.compat.urljoin(API_URL, f"crates/{crate}/{version}/download#") + req = requests.get(url, stream=True) + req.raise_for_status() + total = int(req.headers["Content-Length"]) + with remove_on_error(cratef), \ + open(cratef, "wb") as f: +- for chunk in tqdm.tqdm(req.iter_content(), "Downloading {}".format(cratef_base), ++ for chunk in tqdm.tqdm(req.iter_content(), f"Downloading {cratef_base}".format(cratef_base), + total=total, unit="B", unit_scale=True): + f.write(chunk) + return cratef, crate, version +@@ -132,14 +132,14 @@ def download(crate, version): + @contextlib.contextmanager + def toml_from_crate(cratef, crate, version): + with tempfile.TemporaryDirectory() as tmpdir: +- target_dir = "{}/".format(tmpdir) ++ target_dir = f"{tmpdir}/" + with tarfile.open(cratef, "r") as archive: + for n in archive.getnames(): + if not os.path.abspath(os.path.join(target_dir, n)).startswith(target_dir): + raise Exception("Unsafe filenames!") + archive.extractall(target_dir) +- toml_relpath = "{}-{}/Cargo.toml".format(crate, version) +- toml = "{}/{}".format(tmpdir, toml_relpath) ++ toml_relpath = f"{crate}-{version}/Cargo.toml" ++ toml = f"{tmpdir}/{toml_relpath}" + if not os.path.isfile(toml): + raise IOError("crate does not contain Cargo.toml file") + yield toml +@@ -270,7 +270,7 @@ def main(): + kwargs["include_provides"] = True + kwargs["include_requires"] = True + else: +- assert False, "Unknown target {!r}".format(args.target) ++ assert False, f"Unknown target {args.target!r}" + + if args.target == "mageia": + kwargs["pkg_release"] = "%mkrel 1" +@@ -303,10 +303,10 @@ def main(): + spec_file = f"rust-{metadata.name}.spec" + spec_contents = template.render(md=metadata, patch_file=patch_file, **kwargs) + if args.stdout: +- print("# {}".format(spec_file)) ++ print(f"# {spec_file}") + print(spec_contents) + if patch_file is not None: +- print("# {}".format(patch_file)) ++ print(f"# {patch_file}") + print("".join(diff), end="") + else: + with open(spec_file, "w") as fobj: +-- +2.19.1 + diff --git a/rust-packaging.spec b/rust-packaging.spec index 21198c6..524b739 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -4,7 +4,7 @@ Name: rust-packaging Version: 6 -Release: 14%{?dist} +Release: 15%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT @@ -19,6 +19,8 @@ Patch0006: 0006-Throw-an-error-if-s-is-used-without-a-crate.patch # Still in PR Patch0007: 0007-split-features-into-subpackages.patch Patch0008: 0008-add-support-for-dependencies-with-same-name.patch +Patch0009: 0009-add-support-for-feeding-user-configuration.patch +Patch0010: 0010-trivial-use-f-strings-everywhere.patch BuildArch: noarch ExclusiveArch: %{rust_arches} noarch @@ -80,6 +82,9 @@ py.test-%{python3_version} -vv test.py %{python3_sitelib}/rust2rpm/ %changelog +* Fri Nov 02 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-15 +- Support .rust2rpm.conf + * Wed Oct 31 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-14 - Fix syntax error commit a31cf1d2bad4be6805604ffb0230bf09d4f3f45f Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Wed Oct 31 11:40:04 2018 +0100 fix syntax error Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/0008-add-support-for-dependencies-with-same-name.patch b/0008-add-support-for-dependencies-with-same-name.patch index 5d8af44..dbbad89 100644 --- a/0008-add-support-for-dependencies-with-same-name.patch +++ b/0008-add-support-for-dependencies-with-same-name.patch @@ -1,4 +1,4 @@ -From 6b5c116b0369a0a6c6ecb40c8bcc0974a36fa714 Mon Sep 17 00:00:00 2001 +From 129d556d19d2e41135f5e98ed028d7d00e66b524 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Tue, 30 Oct 2018 20:37:38 +0100 Subject: [PATCH 8/8] add support for dependencies with same name @@ -11,7 +11,7 @@ Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/rust2rpm/metadata.py b/rust2rpm/metadata.py -index 119dea5..10c0011 100644 +index 119dea5..febf1e5 100644 --- a/rust2rpm/metadata.py +++ b/rust2rpm/metadata.py @@ -1,5 +1,6 @@ @@ -57,7 +57,7 @@ index 119dea5..10c0011 100644 - deps_by_feature[dep.name] = ({None}, {copy.deepcopy(dep)}) - else: - mandatory_deps.add(copy.deepcopy(dep)) -+ for deps in deps_by_name.values(): ++ for name, deps in deps_by_name.items(): + fdeps = set() + for dep in deps: + if dep.optional: diff --git a/rust-packaging.spec b/rust-packaging.spec index c5bd19c..21198c6 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -4,7 +4,7 @@ Name: rust-packaging Version: 6 -Release: 13%{?dist} +Release: 14%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT @@ -80,6 +80,9 @@ py.test-%{python3_version} -vv test.py %{python3_sitelib}/rust2rpm/ %changelog +* Wed Oct 31 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-14 +- Fix syntax error + * Tue Oct 30 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-13 - Support multiple dependencies with same name commit 7b23eaea0455f811e2ffad86346e9470612f9e8a Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Tue Oct 30 20:47:39 2018 +0100 support multiple dependencies with same name Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/0001-name-spec-patch_file-by-real-crate-name.patch b/0001-name-spec-patch_file-by-real-crate-name.patch index 7a14de3..27fbbfa 100644 --- a/0001-name-spec-patch_file-by-real-crate-name.patch +++ b/0001-name-spec-patch_file-by-real-crate-name.patch @@ -1,7 +1,7 @@ From 0dc9fc182edf0791ca697f587e48dd39948d63c1 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Mon, 10 Sep 2018 23:37:40 +0200 -Subject: [PATCH 1/7] name spec/patch_file by real crate name +Subject: [PATCH 1/8] name spec/patch_file by real crate name When renaming using patch file, we really want to change file names too. diff --git a/0002-generate-doc-statements.patch b/0002-generate-doc-statements.patch index 3bb4409..fb5ec59 100644 --- a/0002-generate-doc-statements.patch +++ b/0002-generate-doc-statements.patch @@ -1,7 +1,7 @@ From 561280a0ea35f226ef243526be2bbb656db44af6 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Mon, 10 Sep 2018 23:40:18 +0200 -Subject: [PATCH 2/7] generate %doc statements +Subject: [PATCH 2/8] generate %doc statements Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> --- diff --git a/0003-do-better-for-renamed-crates.patch b/0003-do-better-for-renamed-crates.patch index a501e87..0c9c3fd 100644 --- a/0003-do-better-for-renamed-crates.patch +++ b/0003-do-better-for-renamed-crates.patch @@ -1,7 +1,7 @@ From 2050880140d4953b9ebdc7211e30df3ccf5dd61d Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Tue, 11 Sep 2018 00:06:50 +0200 -Subject: [PATCH 3/7] do better for renamed crates +Subject: [PATCH 3/8] do better for renamed crates Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> --- diff --git a/0004-remove-pre-3.6-leftovers.patch b/0004-remove-pre-3.6-leftovers.patch index 5e7848c..79d041d 100644 --- a/0004-remove-pre-3.6-leftovers.patch +++ b/0004-remove-pre-3.6-leftovers.patch @@ -1,7 +1,7 @@ From e6e9cbbb71199c2773b47fa21f1c917a167c1743 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Tue, 11 Sep 2018 10:43:53 +0200 -Subject: [PATCH 4/7] remove pre-3.6 leftovers +Subject: [PATCH 4/8] remove pre-3.6 leftovers Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> --- diff --git a/0005-Remove-half-downloaded-crate-on-C.patch b/0005-Remove-half-downloaded-crate-on-C.patch index d822219..ef0eb21 100644 --- a/0005-Remove-half-downloaded-crate-on-C.patch +++ b/0005-Remove-half-downloaded-crate-on-C.patch @@ -1,7 +1,7 @@ From 2f12c83d14afe71e9efed2d1be62e1e610e602e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl> Date: Fri, 17 Aug 2018 10:03:48 +0200 -Subject: [PATCH 5/7] Remove half-downloaded crate on ^C +Subject: [PATCH 5/8] Remove half-downloaded crate on ^C Subsequent invocations would fail with an error about a corrupted file. We don't have support for resuming a failed download, so let's remove the diff --git a/0006-Throw-an-error-if-s-is-used-without-a-crate.patch b/0006-Throw-an-error-if-s-is-used-without-a-crate.patch index 44219dd..44bc5b1 100644 --- a/0006-Throw-an-error-if-s-is-used-without-a-crate.patch +++ b/0006-Throw-an-error-if-s-is-used-without-a-crate.patch @@ -1,7 +1,7 @@ From 5a1cde5b8dcaea74ebb2050879036bf46df63adc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl> Date: Fri, 17 Aug 2018 10:18:59 +0200 -Subject: [PATCH 6/7] Throw an error if -s is used without a crate +Subject: [PATCH 6/8] Throw an error if -s is used without a crate In the future we might want to be smarter and find the crate, but let's at least not ignore the option completely. diff --git a/0007-split-features-into-subpackages.patch b/0007-split-features-into-subpackages.patch index 5455ccc..fe96334 100644 --- a/0007-split-features-into-subpackages.patch +++ b/0007-split-features-into-subpackages.patch @@ -1,7 +1,7 @@ -From a61a367883b7cd60f600d25958fb634c530500fa Mon Sep 17 00:00:00 2001 +From d7caa1148d5fcac70030e3fb1eb698927e69960f Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Fri, 26 Oct 2018 11:20:13 +0200 -Subject: [PATCH 7/7] split features into subpackages +Subject: [PATCH 7/8] split features into subpackages References:
https://discussion.fedoraproject.org/t/rfc-new-crates-packaging-design-feat…
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> @@ -11,8 +11,8 @@ Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> rust2rpm/__main__.py | 11 +- rust2rpm/inspector.py | 22 ++- rust2rpm/metadata.py | 315 +++++++++++++++++------------------ - rust2rpm/templates/main.spec | 141 ++++++++-------- - 6 files changed, 259 insertions(+), 244 deletions(-) + rust2rpm/templates/main.spec | 142 ++++++++-------- + 6 files changed, 260 insertions(+), 244 deletions(-) diff --git a/data/cargo.attr b/data/cargo.attr index 392a72b..4910b5c 100644 @@ -512,10 +512,10 @@ index 5adeb65..119dea5 100644 +def normalize_deps(deps): + return set().union(*(d.normalize() for d in deps)) diff --git a/rust2rpm/templates/main.spec b/rust2rpm/templates/main.spec -index 7dbcc3f..27a448f 100644 +index 7dbcc3f..0d9a80b 100644 --- a/rust2rpm/templates/main.spec +++ b/rust2rpm/templates/main.spec -@@ -48,82 +48,101 @@ Patch0: {{ patch_file }} +@@ -48,82 +48,102 @@ Patch0: {{ patch_file }} ExclusiveArch: %{rust_arches} BuildRequires: rust-packaging @@ -586,6 +586,7 @@ index 7dbcc3f..27a448f 100644 + {% for bin in bins %} +%{_bindir}/{{ bin.name }} + {% endfor %} ++ +{% endif -%} + {% if include_devel %} @@ -666,7 +667,7 @@ index 7dbcc3f..27a448f 100644 %prep {% if md.name != crate %} %autosetup -n %{real_crate}-%{version} -p1 -@@ -143,29 +162,5 @@ which use %{crate} from crates.io. +@@ -143,29 +163,5 @@ which use %{crate} from crates.io. %cargo_test %endif diff --git a/0008-add-support-for-dependencies-with-same-name.patch b/0008-add-support-for-dependencies-with-same-name.patch new file mode 100644 index 0000000..5d8af44 --- /dev/null +++ b/0008-add-support-for-dependencies-with-same-name.patch @@ -0,0 +1,74 @@ +From 6b5c116b0369a0a6c6ecb40c8bcc0974a36fa714 Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +Date: Tue, 30 Oct 2018 20:37:38 +0100 +Subject: [PATCH 8/8] add support for dependencies with same name + +Reported-by: Josh Stone <jistone(a)redhat.com> +References:
https://internals.rust-lang.org/t/optional-dependencies-with-same-name/8728
+Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +--- + rust2rpm/metadata.py | 32 ++++++++++++++++++++------------ + 1 file changed, 20 insertions(+), 12 deletions(-) + +diff --git a/rust2rpm/metadata.py b/rust2rpm/metadata.py +index 119dea5..10c0011 100644 +--- a/rust2rpm/metadata.py ++++ b/rust2rpm/metadata.py +@@ -1,5 +1,6 @@ + __all__ = ["Dependency", "Metadata"] + ++import collections + import copy + import json + import subprocess +@@ -124,9 +125,11 @@ class Metadata: + self.description = md.get("description") + + # dependencies + build-dependencies runtime +- deps_by_name = {dep["name"]: Dependency.from_json(dep) +- for dep in md["dependencies"] +- if dep["kind"] != "dev"} ++ deps_by_name = collections.defaultdict(list) ++ for dep in md["dependencies"]: ++ if dep["kind"] == "dev": ++ continue ++ deps_by_name[dep["name"]].append(Dependency.from_json(dep)) + + deps_by_feature = {} + for feature, f_deps in md["features"].items(): +@@ -137,18 +140,23 @@ class Metadata: + features.add(dep) + else: + pkg, _, f = dep.partition("/") +- dep = copy.deepcopy(deps_by_name[pkg]) +- if f: +- dep.features = {f} +- deps.add(dep) ++ for dep in deps_by_name[pkg]: ++ dep = copy.deepcopy(dep) ++ if f: ++ dep.features = {f} ++ deps.add(dep) + deps_by_feature[feature] = (features, deps) + + mandatory_deps = set() +- for dep in deps_by_name.values(): +- if dep.optional: +- deps_by_feature[dep.name] = ({None}, {copy.deepcopy(dep)}) +- else: +- mandatory_deps.add(copy.deepcopy(dep)) ++ for deps in deps_by_name.values(): ++ fdeps = set() ++ for dep in deps: ++ if dep.optional: ++ fdeps.add(copy.deepcopy(dep)) ++ else: ++ mandatory_deps.add(copy.deepcopy(dep)) ++ if fdeps: ++ deps_by_feature[name] = ({None}, fdeps) + deps_by_feature[None] = (set(), mandatory_deps) + + if "default" not in deps_by_feature: +-- +2.19.1 + diff --git a/rust-packaging.spec b/rust-packaging.spec index 157a08e..c5bd19c 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -4,7 +4,7 @@ Name: rust-packaging Version: 6 -Release: 12%{?dist} +Release: 13%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT @@ -18,6 +18,7 @@ Patch0005: 0005-Remove-half-downloaded-crate-on-C.patch Patch0006: 0006-Throw-an-error-if-s-is-used-without-a-crate.patch # Still in PR Patch0007: 0007-split-features-into-subpackages.patch +Patch0008: 0008-add-support-for-dependencies-with-same-name.patch BuildArch: noarch ExclusiveArch: %{rust_arches} noarch @@ -79,6 +80,9 @@ py.test-%{python3_version} -vv test.py %{python3_sitelib}/rust2rpm/ %changelog +* Tue Oct 30 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-13 +- Support multiple dependencies with same name + * Sat Oct 27 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-12 - Fix requirements with space commit 28d6d0d63a2ba1fc30449fb504ba7cdbe9bee3c2 Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Sat Oct 27 12:57:42 2018 +0200 fix dependencies with space Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/0007-split-features-into-subpackages.patch b/0007-split-features-into-subpackages.patch index 79909ab..5455ccc 100644 --- a/0007-split-features-into-subpackages.patch +++ b/0007-split-features-into-subpackages.patch @@ -1,4 +1,4 @@ -From 571ba6b1f2a886b40a7de76980cd8c479015cc9e Mon Sep 17 00:00:00 2001 +From a61a367883b7cd60f600d25958fb634c530500fa Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Fri, 26 Oct 2018 11:20:13 +0200 Subject: [PATCH 7/7] split features into subpackages @@ -143,7 +143,7 @@ index 2d488b2..9e79e88 100644 if __name__ == "__main__": main() diff --git a/rust2rpm/metadata.py b/rust2rpm/metadata.py -index 5adeb65..95aa142 100644 +index 5adeb65..119dea5 100644 --- a/rust2rpm/metadata.py +++ b/rust2rpm/metadata.py @@ -1,208 +1,205 @@ @@ -262,7 +262,7 @@ index 5adeb65..95aa142 100644 + def _normalize_req(req): + if "*" in req: + return NotImplemented -+ spec = semver.Spec(req) ++ spec = semver.Spec(req.replace(" ", "")) + reqs = [] for req in spec.specs: - ver = req.spec diff --git a/rust-packaging.spec b/rust-packaging.spec index e206b06..157a08e 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -4,7 +4,7 @@ Name: rust-packaging Version: 6 -Release: 11%{?dist} +Release: 12%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT @@ -79,6 +79,9 @@ py.test-%{python3_version} -vv test.py %{python3_sitelib}/rust2rpm/ %changelog +* Sat Oct 27 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-12 +- Fix requirements with space + * Fri Oct 26 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-11 - Trivial fixes to last patchset commit c28b58679db5bd1910f1edc87c2c0c0231805cd4 Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Fri Oct 26 20:57:20 2018 +0200 trivial fixes to last patchset Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/0007-split-features-into-subpackages.patch b/0007-split-features-into-subpackages.patch index 58e5e8d..79909ab 100644 --- a/0007-split-features-into-subpackages.patch +++ b/0007-split-features-into-subpackages.patch @@ -1,4 +1,4 @@ -From 83a9b92d68e8c5d6f2ab75b287be7ea69275fb90 Mon Sep 17 00:00:00 2001 +From 571ba6b1f2a886b40a7de76980cd8c479015cc9e Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Fri, 26 Oct 2018 11:20:13 +0200 Subject: [PATCH 7/7] split features into subpackages @@ -512,7 +512,7 @@ index 5adeb65..95aa142 100644 +def normalize_deps(deps): + return set().union(*(d.normalize() for d in deps)) diff --git a/rust2rpm/templates/main.spec b/rust2rpm/templates/main.spec -index 7dbcc3f..4acfab7 100644 +index 7dbcc3f..27a448f 100644 --- a/rust2rpm/templates/main.spec +++ b/rust2rpm/templates/main.spec @@ -48,82 +48,101 @@ Patch0: {{ patch_file }} @@ -613,7 +613,7 @@ index 7dbcc3f..4acfab7 100644 -{% endif %} -{% if include_requires %} + {% if include_provides %} -+Provides: {{ md.provides() }} ++Provides: {{ md.provides(feature) }} + {% endif %} + {% if include_requires %} Requires: cargo @@ -644,7 +644,7 @@ index 7dbcc3f..4acfab7 100644 This package contains library source intended for building other packages -which use %{crate} from crates.io. -+which use {% if feature is not none %}"{{ feature }}" of {% endif %}"%{crate}" crate. ++which use {% if feature is not none %}"{{ feature }}" feature of {% endif %}"%{crate}" crate. + +%files {{ pkg }} + {% if feature is none %} diff --git a/rust-packaging.spec b/rust-packaging.spec index a7ba418..e206b06 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -4,7 +4,7 @@ Name: rust-packaging Version: 6 -Release: 10%{?dist} +Release: 11%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT @@ -79,6 +79,9 @@ py.test-%{python3_version} -vv test.py %{python3_sitelib}/rust2rpm/ %changelog +* Fri Oct 26 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-11 +- Trivial fixes to last patchset + * Fri Oct 26 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-10 - Split features into subpackages commit 0cf7c3e18ab067d1fc0a7d37e901914c64b48d1e Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Fri Oct 26 15:59:03 2018 +0200 split features into subpackages Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/0001-name-spec-patch_file-by-real-crate-name.patch b/0001-name-spec-patch_file-by-real-crate-name.patch new file mode 100644 index 0000000..7a14de3 --- /dev/null +++ b/0001-name-spec-patch_file-by-real-crate-name.patch @@ -0,0 +1,37 @@ +From 0dc9fc182edf0791ca697f587e48dd39948d63c1 Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +Date: Mon, 10 Sep 2018 23:37:40 +0200 +Subject: [PATCH 1/7] name spec/patch_file by real crate name + +When renaming using patch file, we really want to change file names too. + +Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +--- + rust2rpm/__main__.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py +index dc78828..1575ce6 100644 +--- a/rust2rpm/__main__.py ++++ b/rust2rpm/__main__.py +@@ -218,7 +218,7 @@ def main(): + template = JINJA_ENV.get_template("main.spec") + + if args.patch and len(diff) > 0: +- patch_file = "{}-fix-metadata.diff".format(crate) ++ patch_file = "{}-fix-metadata.diff".format(metadata.name) + else: + patch_file = None + +@@ -269,7 +269,7 @@ def main(): + kwargs["license"] = license + kwargs["license_comments"] = comments + +- spec_file = "rust-{}.spec".format(crate) ++ spec_file = "rust-{}.spec".format(metadata.name) + spec_contents = template.render(md=metadata, patch_file=patch_file, **kwargs) + if args.stdout: + print("# {}".format(spec_file)) +-- +2.19.1 + diff --git a/0002-generate-doc-statements.patch b/0002-generate-doc-statements.patch new file mode 100644 index 0000000..3bb4409 --- /dev/null +++ b/0002-generate-doc-statements.patch @@ -0,0 +1,58 @@ +From 561280a0ea35f226ef243526be2bbb656db44af6 Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +Date: Mon, 10 Sep 2018 23:40:18 +0200 +Subject: [PATCH 2/7] generate %doc statements + +Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +--- + rust2rpm/metadata.py | 2 ++ + rust2rpm/templates/main.spec | 6 ++++++ + 2 files changed, 8 insertions(+) + +diff --git a/rust2rpm/metadata.py b/rust2rpm/metadata.py +index 5dae1d3..f52d968 100644 +--- a/rust2rpm/metadata.py ++++ b/rust2rpm/metadata.py +@@ -140,6 +140,7 @@ class Metadata(object): + self.name = None + self.license = None + self.license_file = None ++ self.readme = None + self.description = None + self.version = None + self._targets = [] +@@ -156,6 +157,7 @@ class Metadata(object): + self.name = md["name"] + self.license = md["license"] + self.license_file = md["license_file"] ++ self.readme = md["readme"] + self.description = md.get("description") + self.version = md["version"] + version = "={}".format(self.version) +diff --git a/rust2rpm/templates/main.spec b/rust2rpm/templates/main.spec +index 1aeb969..2e9f841 100644 +--- a/rust2rpm/templates/main.spec ++++ b/rust2rpm/templates/main.spec +@@ -137,6 +137,9 @@ which use %{crate} from crates.io. + {% if md.license_file is not none %} + %license {{ md.license_file }} + {% endif %} ++{% if md.readme is not none %} ++%doc {{ md.readme }} ++{% endif %} + {% for bin in bins %} + %{_bindir}/{{ bin.name }} + {% endfor %} +@@ -147,6 +150,9 @@ which use %{crate} from crates.io. + {% if md.license_file is not none %} + %license {{ md.license_file }} + {% endif %} ++{% if md.readme is not none %} ++%doc {{ md.readme }} ++{% endif %} + %{cargo_registry}/%{crate}-%{version}/ + + {% endif %} +-- +2.19.1 + diff --git a/0003-do-better-for-renamed-crates.patch b/0003-do-better-for-renamed-crates.patch new file mode 100644 index 0000000..a501e87 --- /dev/null +++ b/0003-do-better-for-renamed-crates.patch @@ -0,0 +1,90 @@ +From 2050880140d4953b9ebdc7211e30df3ccf5dd61d Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +Date: Tue, 11 Sep 2018 00:06:50 +0200 +Subject: [PATCH 3/7] do better for renamed crates + +Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +--- + rust2rpm/__main__.py | 7 ++++--- + rust2rpm/templates/main.spec | 13 ++++++++++++- + 2 files changed, 16 insertions(+), 4 deletions(-) + +diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py +index 1575ce6..e993e7b 100644 +--- a/rust2rpm/__main__.py ++++ b/rust2rpm/__main__.py +@@ -180,7 +180,7 @@ def make_diff_metadata(crate, version, patch=False, store=False): + diff = make_patch(toml, enabled=patch) + metadata = Metadata.from_file(toml) + if store: +- shutil.copy2(cratef, os.path.join(os.getcwd(), f"{crate}-{version}.crate")) ++ shutil.copy2(cratef, os.path.join(os.getcwd(), f"{metadata.name}-{version}.crate")) + return crate, diff, metadata + + def main(): +@@ -218,11 +218,12 @@ def main(): + template = JINJA_ENV.get_template("main.spec") + + if args.patch and len(diff) > 0: +- patch_file = "{}-fix-metadata.diff".format(metadata.name) ++ patch_file = f"{metadata.name}-fix-metadata.diff" + else: + patch_file = None + + kwargs = {} ++ kwargs["crate"] = crate + kwargs["target"] = args.target + bins = [tgt for tgt in metadata.targets if tgt.kind == "bin"] + libs = [tgt for tgt in metadata.targets if tgt.kind in ("lib", "rlib", "proc-macro")] +@@ -269,7 +270,7 @@ def main(): + kwargs["license"] = license + kwargs["license_comments"] = comments + +- spec_file = "rust-{}.spec".format(metadata.name) ++ spec_file = f"rust-{metadata.name}.spec" + spec_contents = template.render(md=metadata, patch_file=patch_file, **kwargs) + if args.stdout: + print("# {}".format(spec_file)) +diff --git a/rust2rpm/templates/main.spec b/rust2rpm/templates/main.spec +index 2e9f841..7dbcc3f 100644 +--- a/rust2rpm/templates/main.spec ++++ b/rust2rpm/templates/main.spec +@@ -6,6 +6,9 @@ + {% endif %} + + %global crate {{ md.name }} ++{% if md.name != crate %} ++%global real_crate {{ crate }} ++{% endif %} + + Name: rust-%{crate} + Version: {{ md.version }} +@@ -27,8 +30,12 @@ License: {{ license|default("# FIXME") }} + {% if license_comments is not none %} + {{ license_comments }} + {% endif %} +-URL:
https://crates.io/crates/{{
md.name }} ++URL:
https://crates.io/crates/{{
crate }} ++{% if md.name != crate %} ++Source0:
https://crates.io/api/v1/crates/%{real_crate}/%{version}/download#/%{crate}…
++{% else %} + Source0:
https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{ve…
++{% endif %} + {% if patch_file is not none %} + {% if target == "opensuse" %} + # PATCH-FIX-OPENSUSE {{ patch_file }} -- Initial patched metadata +@@ -118,7 +125,11 @@ which use %{crate} from crates.io. + + {% endif %} + %prep ++{% if md.name != crate %} ++%autosetup -n %{real_crate}-%{version} -p1 ++{% else %} + %autosetup -n %{crate}-%{version} -p1 ++{% endif %} + %cargo_prep + + %build +-- +2.19.1 + diff --git a/0004-remove-pre-3.6-leftovers.patch b/0004-remove-pre-3.6-leftovers.patch new file mode 100644 index 0000000..5e7848c --- /dev/null +++ b/0004-remove-pre-3.6-leftovers.patch @@ -0,0 +1,27 @@ +From e6e9cbbb71199c2773b47fa21f1c917a167c1743 Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +Date: Tue, 11 Sep 2018 10:43:53 +0200 +Subject: [PATCH 4/7] remove pre-3.6 leftovers + +Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +--- + rust2rpm/metadata.py | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/rust2rpm/metadata.py b/rust2rpm/metadata.py +index f52d968..5adeb65 100644 +--- a/rust2rpm/metadata.py ++++ b/rust2rpm/metadata.py +@@ -203,8 +203,6 @@ class Metadata(object): + + @classmethod + def from_file(cls, path): +- do_decode = sys.version_info < (3, 6) + metadata = subprocess.check_output(["cargo", "read-manifest", +- "--manifest-path={}".format(path)], +- universal_newlines=do_decode) ++ "--manifest-path={}".format(path)]) + return cls.from_json(json.loads(metadata)) +-- +2.19.1 + diff --git a/0005-Remove-half-downloaded-crate-on-C.patch b/0005-Remove-half-downloaded-crate-on-C.patch new file mode 100644 index 0000000..d822219 --- /dev/null +++ b/0005-Remove-half-downloaded-crate-on-C.patch @@ -0,0 +1,44 @@ +From 2f12c83d14afe71e9efed2d1be62e1e610e602e9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl> +Date: Fri, 17 Aug 2018 10:03:48 +0200 +Subject: [PATCH 5/7] Remove half-downloaded crate on ^C + +Subsequent invocations would fail with an error about a corrupted file. +We don't have support for resuming a failed download, so let's remove the +partial download results. +--- + rust2rpm/__main__.py | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py +index e993e7b..8e6f6eb 100644 +--- a/rust2rpm/__main__.py ++++ b/rust2rpm/__main__.py +@@ -83,6 +83,14 @@ def file_mtime(path): + t = datetime.fromtimestamp(os.stat(path).st_mtime, timezone.utc) + return t.astimezone().isoformat() + ++(a)contextlib.contextmanager ++def remove_on_error(path): ++ try: ++ yield ++ except: # this is supposed to include ^C ++ os.unlink(path) ++ raise ++ + def local_toml(toml, version): + if os.path.isdir(toml): + toml = os.path.join(toml, "Cargo.toml") +@@ -110,7 +118,8 @@ def download(crate, version): + req = requests.get(url, stream=True) + req.raise_for_status() + total = int(req.headers["Content-Length"]) +- with open(cratef, "wb") as f: ++ with remove_on_error(cratef), \ ++ open(cratef, "wb") as f: + for chunk in tqdm.tqdm(req.iter_content(), "Downloading {}".format(cratef_base), + total=total, unit="B", unit_scale=True): + f.write(chunk) +-- +2.19.1 + diff --git a/0006-Throw-an-error-if-s-is-used-without-a-crate.patch b/0006-Throw-an-error-if-s-is-used-without-a-crate.patch new file mode 100644 index 0000000..44219dd --- /dev/null +++ b/0006-Throw-an-error-if-s-is-used-without-a-crate.patch @@ -0,0 +1,28 @@ +From 5a1cde5b8dcaea74ebb2050879036bf46df63adc Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl> +Date: Fri, 17 Aug 2018 10:18:59 +0200 +Subject: [PATCH 6/7] Throw an error if -s is used without a crate + +In the future we might want to be smarter and find the crate, but let's at least +not ignore the option completely. +--- + rust2rpm/__main__.py | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py +index 8e6f6eb..f23ebbc 100644 +--- a/rust2rpm/__main__.py ++++ b/rust2rpm/__main__.py +@@ -178,6 +178,9 @@ def make_diff_metadata(crate, version, patch=False, store=False): + if crate.endswith(".crate"): + cratef, crate, version = local_crate(crate, version) + else: ++ if store: ++ raise ValueError('--store-crate can only be used for a crate') ++ + toml, crate, version = local_toml(crate, version) + diff = make_patch(toml, enabled=patch, tmpfile=True) + metadata = Metadata.from_file(toml) +-- +2.19.1 + diff --git a/0007-split-features-into-subpackages.patch b/0007-split-features-into-subpackages.patch new file mode 100644 index 0000000..58e5e8d --- /dev/null +++ b/0007-split-features-into-subpackages.patch @@ -0,0 +1,701 @@ +From 83a9b92d68e8c5d6f2ab75b287be7ea69275fb90 Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +Date: Fri, 26 Oct 2018 11:20:13 +0200 +Subject: [PATCH 7/7] split features into subpackages + +References:
https://discussion.fedoraproject.org/t/rfc-new-crates-packaging-design-feat…
+Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +--- + data/cargo.attr | 4 +- + data/macros.cargo | 10 ++ + rust2rpm/__main__.py | 11 +- + rust2rpm/inspector.py | 22 ++- + rust2rpm/metadata.py | 315 +++++++++++++++++------------------ + rust2rpm/templates/main.spec | 141 ++++++++-------- + 6 files changed, 259 insertions(+), 244 deletions(-) + +diff --git a/data/cargo.attr b/data/cargo.attr +index 392a72b..4910b5c 100644 +--- a/data/cargo.attr ++++ b/data/cargo.attr +@@ -1,3 +1,3 @@ +-%__cargo_provides %{_bindir}/cargo-inspector --provides +-%__cargo_requires %{_bindir}/cargo-inspector --requires ++%__cargo_provides %{_bindir}/cargo-inspector --provides --feature=%{__cargo_feature_from_name -n %{name}} ++%__cargo_requires %{_bindir}/cargo-inspector --requires --feature=%{__cargo_feature_from_name -n %{name}} + %__cargo_path ^%{cargo_registry}/[^/]+/Cargo\\.toml$ +diff --git a/data/macros.cargo b/data/macros.cargo +index a0c456a..7fb025b 100644 +--- a/data/macros.cargo ++++ b/data/macros.cargo +@@ -84,3 +84,13 @@ if %__cargo_is_bin; then \ + %{__rm} %{buildroot}%{_prefix}/.crates.toml \ + fi \ + ) ++ ++%__cargo_feature_from_name(n:) %{lua: ++local name = rpm.expand("%{-n*}") ++local feature = string.match(name, "^.+%+(.+)-devel$") ++if feature == nil then ++ print() ++else ++ print(feature) ++end ++} +diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py +index f23ebbc..d19cb47 100644 +--- a/rust2rpm/__main__.py ++++ b/rust2rpm/__main__.py +@@ -18,15 +18,19 @@ import requests + import tqdm + + from . import Metadata, licensing ++from .metadata import normalize_deps + + DEFAULT_EDITOR = "vi" + XDG_CACHE_HOME = os.getenv("XDG_CACHE_HOME", os.path.expanduser("~/.cache")) + CACHEDIR = os.path.join(XDG_CACHE_HOME, "rust2rpm") + API_URL = "
https://crates.io/api/v1/
" + JINJA_ENV = jinja2.Environment(loader=jinja2.ChoiceLoader([ +- jinja2.FileSystemLoader(["/"]), +- jinja2.PackageLoader("rust2rpm", "templates"), ]), +- trim_blocks=True, lstrip_blocks=True) ++ jinja2.FileSystemLoader(["/"]), ++ jinja2.PackageLoader("rust2rpm", "templates"), ++ ]), ++ extensions=["jinja2.ext.do"], ++ trim_blocks=True, ++ lstrip_blocks=True) + + def get_default_target(): + # TODO: add fallback for /usr/lib/os-release +@@ -227,6 +231,7 @@ def main(): + patch=args.patch, + store=args.store_crate) + ++ JINJA_ENV.globals["normalize_deps"] = normalize_deps + template = JINJA_ENV.get_template("main.spec") + + if args.patch and len(diff) > 0: +diff --git a/rust2rpm/inspector.py b/rust2rpm/inspector.py +index 2d488b2..9e79e88 100644 +--- a/rust2rpm/inspector.py ++++ b/rust2rpm/inspector.py +@@ -1,8 +1,8 @@ + import argparse +-import itertools + import sys + + from . import Metadata ++from .metadata import normalize_deps + + def main(): + parser = argparse.ArgumentParser() +@@ -10,18 +10,23 @@ def main(): + group.add_argument("-n", "--name", action="store_true", help="Print name") + group.add_argument("-v", "--version", action="store_true", help="Print version") + group.add_argument("-t", "--target-kinds", action="store_true", help="Print target kinds") ++ group.add_argument("-l", "--list-features", action="store_true", help="Print features") + group.add_argument("-P", "--provides", action="store_true", help="Print Provides") + group.add_argument("-R", "--requires", action="store_true", help="Print Requires") + group.add_argument("-BR", "--build-requires", action="store_true", help="Print BuildRequires") + group.add_argument("-TR", "--test-requires", action="store_true", help="Print TestRequires") ++ parser.add_argument("-f", "--feature", help="Feature to work on") + parser.add_argument("file", nargs="*", help="Path(s) to Cargo.toml") + args = parser.parse_args() + + files = args.file or sys.stdin.readlines() + ++ if not args.feature: ++ args.feature = None ++ + def print_deps(deps): + if len(deps) > 0: +- print("\n".join(str(dep) for dep in deps)) ++ print("\n".join(sorted(normalize_deps(deps)))) + + for f in files: + f = f.rstrip() +@@ -32,17 +37,20 @@ def main(): + print(md.version) + if args.target_kinds: + print("\n".join(set(tgt.kind for tgt in md.targets))) ++ if args.list_features: ++ for f in sorted(f for f in md.dependencies if f is not None): ++ print(f) + if args.provides: +- print_deps(md.provides) +- if args.requires or args.build_requires: +- print_deps(list(itertools.chain(md.requires, md.build_requires))) +- if args.test_requires: +- print_deps(md.test_requires) ++ print(md.provides(args.feature)) + if args.requires: + # Someone should own /usr/share/cargo/registry + print("cargo") ++ print_deps(md.requires(args.feature)) + if args.build_requires: + print("rust-packaging") ++ print_deps(md.requires(args.feature or "default", resolve=True)) ++ if args.test_requires: ++ print_deps(md.dev_dependencies) + + if __name__ == "__main__": + main() +diff --git a/rust2rpm/metadata.py b/rust2rpm/metadata.py +index 5adeb65..95aa142 100644 +--- a/rust2rpm/metadata.py ++++ b/rust2rpm/metadata.py +@@ -1,208 +1,205 @@ + __all__ = ["Dependency", "Metadata"] + +-import itertools ++import copy + import json + import subprocess +-import sys + + import semantic_version as semver + import rustcfg + +-class Target(object): +- def __init__(self, kind, name): +- self.kind = kind ++class Target: ++ def __init__(self, name, kind): + self.name = name ++ self.kind = kind + + def __repr__(self): +- return "<Target {self.kind}|{self.name}>".format(self=self) +- +- +-def _req_to_str(name, spec=None, feature=None): +- f_part = "/{}".format(feature) if feature is not None else "" +- basestr = "crate({}{})".format(name, f_part) +- if spec is None: +- return basestr +- if spec.kind == spec.KIND_EQUAL: +- spec.kind = spec.KIND_SHORTEQ +- if spec.kind == spec.KIND_ANY: +- if spec.spec == "": +- # Just wildcard +- return basestr +- else: +- # Wildcard in string +- assert False, spec.spec +- version = str(spec.spec).replace("-", "~") +- return "{} {} {}".format(basestr, spec.kind, version) ++ return f"<Target {self.name} ({self.kind})>" + +-class Dependency(object): +- def __init__(self, name, req, features=(), provides=False): ++class Dependency: ++ def __init__(self, name, req=None, features=(), optional=False): + self.name = name +- self.spec = self._parse_req(req) ++ self.req = req + self.features = features +- self.provides = provides +- if self.provides: +- if len(self.spec.specs) > 1 or \ +- (len(self.spec.specs) == 1 and self.spec.specs[0].kind != self.spec.specs[0].KIND_EQUAL): +- raise Exception("Provides can't be applied to ranged version, {!r}".format(self.spec)) +- +- def __repr__(self): +- if self.provides: +- spec = self.spec.specs[0] +- provs = [_req_to_str(self.name, spec)] +- for feature in self.features: +- provs.append(_req_to_str(self.name, spec, feature)) +- return " and ".join(provs) +- +- reqs = [_req_to_str(self.name, spec=req) for req in self.spec.specs] +- features = [_req_to_str(self.name, feature=feature) for feature in self.features] ++ self.optional = optional + +- use_rich = False +- if len(reqs) > 1: +- reqstr = "({})".format(" with ".join(reqs)) +- use_rich = True +- elif len(reqs) == 1: +- reqstr = reqs[0] +- else: +- reqstr = "" +- if len(features) > 0: +- featurestr = " with ".join(features) +- use_rich = True +- else: +- featurestr = "" +- +- if use_rich: +- if reqstr and featurestr: +- return "({} with {})".format(reqstr, featurestr) +- elif reqstr and not featurestr: +- return reqstr +- elif not reqstr and featurestr: +- return "({})".format(featurestr) +- else: +- assert False +- else: +- return reqstr ++ @classmethod ++ def from_json(cls, metadata): ++ features = set(metadata['features']) ++ if metadata['uses_default_features']: ++ features.add('default') ++ kwargs = {'name': metadata['name'], ++ 'req': metadata['req'], ++ 'optional': metadata['optional'], ++ 'features': features} ++ return cls(**kwargs) + + @staticmethod +- def _parse_req(s): +- if "*" in s and s != "*": +- # XXX:
https://github.com/rbarrois/python-semanticversion/issues/51
+- s = "~{}".format(s.replace(".*", "", 1)) +- if ".*" in s: +- s = s.replace(".*", "") +- spec = semver.Spec(s.replace(" ", "")) +- parsed = [] ++ def _normalize_req(req): ++ if "*" in req: ++ return NotImplemented ++ spec = semver.Spec(req) ++ reqs = [] + for req in spec.specs: +- ver = req.spec + if req.kind == req.KIND_ANY: +- parsed.append("*") ++ # Any means any + continue ++ ver = req.spec ++ if ver.prerelease or req.kind in (req.KIND_NEQ, req.KIND_EMPTY): ++ return NotImplemented + coerced = semver.Version.coerce(str(ver)) +- if req.kind in (req.KIND_CARET, req.KIND_TILDE): +- if ver.prerelease: +- # pre-release versions only match the same x.y.z +- if ver.patch is not None: +- upper = ver.next_patch() +- elif ver.minor is not None: +- upper = ver.next_minor() +- else: +- upper = ver.next_major() +- elif req.kind == req.KIND_CARET: +- if ver.major == 0: +- if ver.minor is not None: +- if ver.patch is None or ver.minor != 0: +- upper = ver.next_minor() +- else: +- upper = ver.next_patch() ++ if req.kind == req.KIND_EQUAL: ++ req.kind = req.KIND_SHORTEQ ++ if req.kind in (req.KIND_CARET, req.KIND_COMPATIBLE): ++ if ver.major == 0: ++ if ver.minor is not None: ++ if ver.minor != 0 or ver.patch is None: ++ upper = ver.next_minor() + else: +- upper = ver.next_major() ++ upper = ver.next_patch() + else: + upper = ver.next_major() +- elif req.kind == req.KIND_TILDE: +- if ver.minor is None: +- upper = ver.next_major() +- else: +- upper = ver.next_minor() + else: +- assert False +- parsed.append(">={}".format(coerced)) +- parsed.append("<{}".format(upper)) +- elif req.kind == req.KIND_NEQ: +- parsed.append(">{}".format(coerced)) +- parsed.append("<{}".format(coerced)) +- elif req.kind in (req.KIND_EQUAL, req.KIND_GT, req.KIND_GTE, req.KIND_LT, req.KIND_LTE): +- parsed.append("{}{}".format(req.kind, coerced)) ++ upper = ver.next_major() ++ reqs.append((">=", coerced)) ++ reqs.append(("<", upper)) ++ elif req.kind == req.KIND_TILDE: ++ if ver.minor is None: ++ upper = ver.next_major() ++ else: ++ upper = ver.next_minor() ++ reqs.append((">=", coerced)) ++ reqs.append(("<", upper)) ++ elif req.kind in (req.KIND_SHORTEQ, ++ req.KIND_GT, ++ req.KIND_GTE, ++ req.KIND_LT, ++ req.KIND_LTE): ++ reqs.append((str(req.kind), coerced)) + else: +- assert False, req.kind +- return semver.Spec(",".join(parsed)) ++ raise AssertionError(f"Found unhandled kind: {req.kind}") ++ return reqs + +-class Metadata(object): +- def __init__(self): +- self.name = None ++ @staticmethod ++ def _apply_reqs(name, reqs, feature=None): ++ fstr = f"/{feature}" if feature is not None else "" ++ cap = f"crate({name}{fstr})" ++ if not reqs: ++ return cap ++ deps = " with ".join(f"{cap} {op} {version}" for op, version in reqs) ++ if len(reqs) > 1: ++ return f"({deps})" ++ else: ++ return deps ++ ++ def normalize(self): ++ return [self._apply_reqs(self.name, self._normalize_req(self.req), feature) ++ for feature in self.features or (None,)] ++ ++ def __repr__(self): ++ return f"<Dependency: {self.name} {self.req} ({', '.join(sorted(self.features))})>" ++ ++ def __str__(self): ++ return "\n".join(self.normalize()) ++ ++class Metadata: ++ def __init__(self, name, version): ++ self.name = name ++ self.version = version + self.license = None + self.license_file = None + self.readme = None + self.description = None +- self.version = None +- self._targets = [] +- self.provides = [] +- self.requires = [] +- self.build_requires = [] +- self.test_requires = [] ++ self.targets = set() ++ self.dependencies = {} ++ self.dev_dependencies = set() + + @classmethod + def from_json(cls, metadata): +- self = cls() +- + md = metadata +- self.name = md["name"] ++ self = cls(md["name"], md["version"]) ++ + self.license = md["license"] + self.license_file = md["license_file"] + self.readme = md["readme"] + self.description = md.get("description") +- self.version = md["version"] +- version = "={}".format(self.version) +- +- # Targets +- self.targets = [Target(tgt["kind"][0], tgt["name"]) for tgt in md["targets"]] +- +- # Provides +- # All optional dependencies are also features +- #
https://github.com/rust-lang/cargo/issues/4911
+- features = itertools.chain((x["name"] for x in md["dependencies"] if x["optional"]), +- md["features"]) +- provides = Dependency(self.name, version, features=features, provides=True) +- self.provides = str(provides).split(" and ") +- +- ev = rustcfg.Evaluator.platform() +- +- # Dependencies +- for dep in md["dependencies"]: +- kind = dep["kind"] +- if kind is None: +- requires = self.requires +- elif kind == "build": +- requires = self.build_requires +- elif kind == "dev": +- requires = self.test_requires +- else: +- raise ValueError("Unknown kind: {!r}, please report bug.".format(kind)) + +- target = dep["target"] +- if target is None: +- pass ++ # dependencies + build-dependencies runtime ++ deps_by_name = {dep["name"]: Dependency.from_json(dep) ++ for dep in md["dependencies"] ++ if dep["kind"] != "dev"} ++ ++ deps_by_feature = {} ++ for feature, f_deps in md["features"].items(): ++ features = {None} ++ deps = set() ++ for dep in f_deps: ++ if dep in md["features"]: ++ features.add(dep) ++ else: ++ pkg, _, f = dep.partition("/") ++ dep = copy.deepcopy(deps_by_name[pkg]) ++ if f: ++ dep.features = {f} ++ deps.add(dep) ++ deps_by_feature[feature] = (features, deps) ++ ++ mandatory_deps = set() ++ for dep in deps_by_name.values(): ++ if dep.optional: ++ deps_by_feature[dep.name] = ({None}, {copy.deepcopy(dep)}) + else: +- cond = ev.parse_and_eval(target) +- if not cond: +- print(f'Dependency {dep["name"]} for target {target!r} is not needed, ignoring.', +- file=sys.stderr) +- continue ++ mandatory_deps.add(copy.deepcopy(dep)) ++ deps_by_feature[None] = (set(), mandatory_deps) ++ ++ if "default" not in deps_by_feature: ++ deps_by_feature["default"] = ({None}, set()) + +- requires.append(Dependency(dep["name"], dep["req"], features=dep["features"])) ++ self.dependencies = deps_by_feature ++ self.dev_dependencies = {Dependency.from_json(dep) ++ for dep in md["dependencies"] ++ if dep["kind"] == "dev"} ++ ++ self.targets = {Target(tgt["name"], tgt["kind"][0]) ++ for tgt in md["targets"]} + + return self + + @classmethod + def from_file(cls, path): + metadata = subprocess.check_output(["cargo", "read-manifest", +- "--manifest-path={}".format(path)]) ++ f"--manifest-path={path}"]) + return cls.from_json(json.loads(metadata)) ++ ++ @property ++ def all_dependencies(self): ++ return set().union(*(x[1] for x in self.dependencies.values())) ++ ++ def provides(self, feature=None): ++ if feature not in self.dependencies: ++ raise KeyError(f"Feature {feature!r} doesn't exist") ++ return Dependency(self.name, f"={self.version}", features={feature}) ++ ++ @classmethod ++ def _resolve(cls, deps_by_feature, feature): ++ all_features = set() ++ all_deps = set() ++ ff, dd = copy.deepcopy(deps_by_feature[feature]) ++ all_features |= ff ++ all_deps |= dd ++ for f in ff: ++ ff1, dd1 = cls._resolve(deps_by_feature, f) ++ all_features |= ff1 ++ all_deps |= dd1 ++ return all_features, all_deps ++ ++ def requires(self, feature=None, resolve=False): ++ if resolve: ++ return self._resolve(self.dependencies, feature)[1] ++ else: ++ features, deps = self.dependencies[feature] ++ fdeps = set(Dependency(self.name, f"={self.version}", features={feature}) ++ for feature in features) ++ return fdeps | deps ++ ++def normalize_deps(deps): ++ return set().union(*(d.normalize() for d in deps)) +diff --git a/rust2rpm/templates/main.spec b/rust2rpm/templates/main.spec +index 7dbcc3f..4acfab7 100644 +--- a/rust2rpm/templates/main.spec ++++ b/rust2rpm/templates/main.spec +@@ -48,82 +48,101 @@ Patch0: {{ patch_file }} + ExclusiveArch: %{rust_arches} + + BuildRequires: rust-packaging +-{% if include_build_requires %} +-{% if md.requires|length > 0 %} +-# [dependencies] +-{% for req in md.requires|sort(attribute="name") %} ++{# We will put all non-optional and optional dependencies until ++
https://github.com/rust-lang/cargo/issues/5133
++ is solved ++{% set buildrequires = normalize_deps(md.requires("default", resolve=True))|sort %} ++#} ++{% set buildrequires = normalize_deps(md.all_dependencies)|sort %} ++{% for req in buildrequires %} + BuildRequires: {{ req }} + {% endfor %} +-{% endif %} +-{% if md.build_requires|length > 0 %} +-# [build-dependencies] +-{% for req in md.build_requires|sort(attribute="name") %} +-BuildRequires: {{ req }} +-{% endfor %} +-{% endif %} +-{% if md.test_requires|length > 0 %} ++{% set testrequires = normalize_deps(md.dev_dependencies)|sort %} ++{% if testrequires|length > 0 %} + %if %{with check} +-# [dev-dependencies] +-{% for req in md.test_requires|sort(attribute="name") %} ++ {% for req in testrequires %} + BuildRequires: {{ req }} +-{% endfor %} ++ {% endfor %} + %endif + {% endif %} +-{% endif %} + +-%description ++%global _description \ ++{% if md.description is none %} + %{summary}. ++{% else %} ++{{ md.description|wordwrap(wrapstring="\\\n")|trim }} ++{% endif %} ++ ++%description %{_description} + + {% if include_main %} + %package -n %{crate} + Summary: %{summary} +-{% if rust_group is defined %} ++ {% if rust_group is defined %} + Group: # FIXME +-{% endif %} ++ {% endif %} + + %description -n %{crate} + %{summary}. + +-{% endif %} ++%files -n %{crate} ++ {% if md.license_file is not none %} ++%license {{ md.license_file }} ++ {% endif %} ++ {% if md.readme is not none %} ++%doc {{ md.readme }} ++ {% endif %} ++ {% for bin in bins %} ++%{_bindir}/{{ bin.name }} ++ {% endfor %} ++{% endif -%} ++ + {% if include_devel %} +-%package devel ++ {% set features = md.dependencies.keys()|list %} ++ {% do features.remove(None) %} ++ {% do features.remove("default") %} ++ {% set features = features|sort %} ++ {% do features.insert(0, None) %} ++ {% do features.insert(1, "default") %} ++ {% for feature in features %} ++ {% set pkg = "-n %%{name}+%s-devel"|format(feature) if feature is not none else " devel" %} ++%package {{ pkg }} + Summary: %{summary} +-{% if rust_group is defined %} ++ {% if rust_group is defined %} + Group: {{ rust_group }} +-{% endif %} ++ {% endif %} + BuildArch: noarch +-{% if include_provides %} +-{% for prv in md.provides %} +-Provides: {{ prv }} +-{% endfor %} +-{% endif %} +-{% if include_requires %} ++ {% if include_provides %} ++Provides: {{ md.provides() }} ++ {% endif %} ++ {% if include_requires %} + Requires: cargo +-{% if md.requires|length > 0 %} +-# [dependencies] +-{% for req in md.requires|sort(attribute="name") %} +-Requires: {{ req }} +-{% endfor %} +-{% endif %} +-{% if md.build_requires|length > 0 %} +-# [build-dependencies] +-{% for req in md.build_requires|sort(attribute="name") %} ++ {% for req in md.requires(feature)|map("string")|sort %} + Requires: {{ req }} +-{% endfor %} +-{% endif %} +-{% endif %} ++ {% endfor %} ++ {% endif %} + +-%description devel +-{% if md.description is none %} +-%{summary}. +-{% else %} +-{{ md.description|wordwrap|trim }} +-{% endif %} ++%description {{ pkg }} %{_description} + + This package contains library source intended for building other packages +-which use %{crate} from crates.io. ++which use {% if feature is not none %}"{{ feature }}" of {% endif %}"%{crate}" crate. ++ ++%files {{ pkg }} ++ {% if feature is none %} ++ {% if md.license_file is not none %} ++%license {{ md.license_file }} ++ {% endif %} ++ {% if md.readme is not none %} ++%doc {{ md.readme }} ++ {% endif %} ++%{cargo_registry}/%{crate}-%{version}/ ++ {% else %} ++%ghost %{cargo_registry}/%{crate}-%{version}/Cargo.toml ++ {% endif %} ++ ++ {% endfor %} ++{% endif -%} + +-{% endif %} + %prep + {% if md.name != crate %} + %autosetup -n %{real_crate}-%{version} -p1 +@@ -143,29 +162,5 @@ which use %{crate} from crates.io. + %cargo_test + %endif + +-{% if include_main %} +-%files -n %{crate} +-{% if md.license_file is not none %} +-%license {{ md.license_file }} +-{% endif %} +-{% if md.readme is not none %} +-%doc {{ md.readme }} +-{% endif %} +-{% for bin in bins %} +-%{_bindir}/{{ bin.name }} +-{% endfor %} +- +-{% endif %} +-{% if include_devel %} +-%files devel +-{% if md.license_file is not none %} +-%license {{ md.license_file }} +-{% endif %} +-{% if md.readme is not none %} +-%doc {{ md.readme }} +-{% endif %} +-%{cargo_registry}/%{crate}-%{version}/ +- +-{% endif %} + %changelog + {% include target ~ "-changelog.spec.inc" %} +-- +2.19.1 + diff --git a/rust-packaging.spec b/rust-packaging.spec index 98159e2..a7ba418 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -1,14 +1,23 @@ -%bcond_without check +# Tests need fixing after patches +%bcond_with check %{?python_enable_dependency_generator} Name: rust-packaging Version: 6 -Release: 1%{?dist} +Release: 10%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT URL:
https://pagure.io/fedora-rust/rust2rpm
Source0:
https://releases.pagure.org/fedora-rust/rust2rpm/rust2rpm-%{version}.tar.xz
+Patch0001: 0001-name-spec-patch_file-by-real-crate-name.patch +Patch0002: 0002-generate-doc-statements.patch +Patch0003: 0003-do-better-for-renamed-crates.patch +Patch0004: 0004-remove-pre-3.6-leftovers.patch +Patch0005: 0005-Remove-half-downloaded-crate-on-C.patch +Patch0006: 0006-Throw-an-error-if-s-is-used-without-a-crate.patch +# Still in PR +Patch0007: 0007-split-features-into-subpackages.patch BuildArch: noarch ExclusiveArch: %{rust_arches} noarch @@ -70,6 +79,9 @@ py.test-%{python3_version} -vv test.py %{python3_sitelib}/rust2rpm/ %changelog +* Fri Oct 26 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-10 +- Split features into subpackages + * Sun Sep 02 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-1 - Update to 6 commit faa0f2d171638d6bf82d36c487101cf54abd384c Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Sun Sep 2 18:43:27 2018 +0200 add missing BR back Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/rust-packaging.spec b/rust-packaging.spec index 495e71d..98159e2 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -31,6 +31,7 @@ BuildRequires: python3-setuptools %if %{with check} BuildRequires: python3-pytest BuildRequires: cargo +BuildRequires: python3dist(semantic-version) BuildRequires: python3dist(rustcfg) %endif Requires: cargo commit a85e0d862fa1796d526f242b974c9e5e67fe9567 Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Sun Sep 2 18:29:13 2018 +0200 Update to 6 Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/.gitignore b/.gitignore index d47206f..388ca95 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /rust2rpm-4.tar.xz /rust2rpm-5.tar.xz +/rust2rpm-6.tar.xz diff --git a/0001-macros-remove-Cargo.lock.patch b/0001-macros-remove-Cargo.lock.patch deleted file mode 100644 index 57069a3..0000000 --- a/0001-macros-remove-Cargo.lock.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 5313b352712486b4001827b04d906bdb91be2314 Mon Sep 17 00:00:00 2001 -From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> -Date: Mon, 8 Jan 2018 23:57:03 +0100 -Subject: [PATCH 1/5] macros: remove Cargo.lock - -cargo-package automatically strips it out, but we package also some -things directly from git. - -Acked-by: Josh Stone <jistone(a)redhat.com> -Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> ---- - data/macros.cargo | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/data/macros.cargo b/data/macros.cargo -index ebf3edb..288554c 100644 ---- a/data/macros.cargo -+++ b/data/macros.cargo -@@ -27,7 +27,8 @@ directory = "%{cargo_registry}"\ - [source.crates-io]\ - registry = "
https://crates.io
"\ - replace-with = "local-registry"\ --EOF\ -+EOF \ -+%{__rm} -f Cargo.lock \ - %if ! %{with check} \ - #
https://github.com/rust-lang/cargo/issues/3732
\ - %{__awk} -i inplace -v INPLACE_SUFFIX=.orig '/^\\\[dev-dependencies/{f=1;next} /^\\\[/{f=0}; !f' Cargo.toml \ --- -2.18.0.rc2 - diff --git a/0002-macros-remove-spurious-whitespace.patch b/0002-macros-remove-spurious-whitespace.patch deleted file mode 100644 index 9e11804..0000000 --- a/0002-macros-remove-spurious-whitespace.patch +++ /dev/null @@ -1,28 +0,0 @@ -From cd6329635329fc7742a18f7ed0933298a0c56cf7 Mon Sep 17 00:00:00 2001 -From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> -Date: Tue, 9 Jan 2018 06:52:36 +0100 -Subject: [PATCH 2/5] macros: remove spurious whitespace - -Fixes:
https://pagure.io/fedora-rust/rust2rpm/issue/48
-Reported-by: Josh Stone <jistone(a)redhat.com> -Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> ---- - data/macros.cargo | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/data/macros.cargo b/data/macros.cargo -index 288554c..67b1950 100644 ---- a/data/macros.cargo -+++ b/data/macros.cargo -@@ -27,7 +27,7 @@ directory = "%{cargo_registry}"\ - [source.crates-io]\ - registry = "
https://crates.io
"\ - replace-with = "local-registry"\ --EOF \ -+EOF\ - %{__rm} -f Cargo.lock \ - %if ! %{with check} \ - #
https://github.com/rust-lang/cargo/issues/3732
\ --- -2.18.0.rc2 - diff --git a/0003-macros-pass-__cargo_common_opts-to-cargo_install.patch b/0003-macros-pass-__cargo_common_opts-to-cargo_install.patch deleted file mode 100644 index c5ff4b6..0000000 --- a/0003-macros-pass-__cargo_common_opts-to-cargo_install.patch +++ /dev/null @@ -1,50 +0,0 @@ -From c5bab762f56bf07cd0f4a2e2d58b7c295cddedd8 Mon Sep 17 00:00:00 2001 -From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> -Date: Tue, 20 Feb 2018 22:04:35 +0100 -Subject: [PATCH 3/5] macros: pass %__cargo_common_opts to %cargo_install - -Reason this has not been done before is that cargo-install doesn't -understand --release. Let's just add it to other commands and be done -with it. - -Reported-by: Josh Stone <jistone(a)redhat.com> -Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> ---- - data/macros.cargo | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/data/macros.cargo b/data/macros.cargo -index 67b1950..22721e9 100644 ---- a/data/macros.cargo -+++ b/data/macros.cargo -@@ -1,5 +1,5 @@ - %__cargo %{_bindir}/cargo --%__cargo_common_opts --release %{?_smp_mflags} -+%__cargo_common_opts %{?_smp_mflags} - %__cargo_inspector %{_bindir}/cargo-inspector - - %cargo_registry %{_datadir}/cargo/registry -@@ -35,9 +35,9 @@ EOF\ - %endif \ - ) - --%cargo_build %__cargo build %{__cargo_common_opts} -+%cargo_build %__cargo build --release %{__cargo_common_opts} - --%cargo_test %__cargo test %{__cargo_common_opts} --no-fail-fast -+%cargo_test %__cargo test --release %{__cargo_common_opts} --no-fail-fast - - %cargo_install (\ - set -eu \ -@@ -53,7 +53,7 @@ if %__cargo_is_lib; then \ - echo '{"files":{},"package":""}' > $REG_DIR/.cargo-checksum.json \ - fi \ - if %__cargo_is_bin; then \ -- %__cargo install %{?_smp_mflags} --path . --root %{buildroot}%{_prefix} \ -+ %__cargo install %{__cargo_common_opts} --path . --root %{buildroot}%{_prefix} \ - %{__rm} %{buildroot}%{_prefix}/.crates.toml \ - fi \ - ) --- -2.18.0.rc2 - diff --git a/0004-macros-make-cargo_-macros-parametric.patch b/0004-macros-make-cargo_-macros-parametric.patch deleted file mode 100644 index 8d8028a..0000000 --- a/0004-macros-make-cargo_-macros-parametric.patch +++ /dev/null @@ -1,96 +0,0 @@ -From c9ce952e260ec0adb166bd6e1de652a0277d2437 Mon Sep 17 00:00:00 2001 -From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> -Date: Fri, 22 Jun 2018 21:04:59 +0200 -Subject: [PATCH 4/5] macros: make %cargo_* macros parametric -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Unfortunately cargo-install doesn't accept --target-dir, so have to pass -setting through envvar. - -Also %{shrink:} them so it looks nicer in build log. - -Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> ---- - data/macros.cargo | 62 ++++++++++++++++++++++++++++++++++------------- - 1 file changed, 45 insertions(+), 17 deletions(-) - -diff --git a/data/macros.cargo b/data/macros.cargo -index 22721e9..96a2931 100644 ---- a/data/macros.cargo -+++ b/data/macros.cargo -@@ -35,25 +35,53 @@ EOF\ - %endif \ - ) - --%cargo_build %__cargo build --release %{__cargo_common_opts} -+%__cargo_parse_opts(t:naf:) %{shrink:\ -+%{-f:%{-a:%{error:Can't specify both -f(%{-f*}) and -a}}} \ -+ %{-t:--target-dir %{-t*}} \ -+ %{-n:--no-default-features} \ -+ %{-a:--all-features} \ -+ %{-f:--features %{-f*}} \ -+ %{nil} -+} - --%cargo_test %__cargo test --release %{__cargo_common_opts} --no-fail-fast -+%cargo_build(t:naf:) %{shrink:\ -+%{__cargo} build \ -+ %{__cargo_common_opts} \ -+ --release \ -+ %{__cargo_parse_opts %{-t:-t%{-t*}} %{-n} %{-a} %{-f:-f%{-f*}}} \ -+ %* \ -+} - --%cargo_install (\ --set -eu \ --if %__cargo_is_lib; then \ -- CRATE_NAME=$(%__cargo_inspector --name Cargo.toml) \ -- CRATE_VERSION=$(%__cargo_inspector --version Cargo.toml) \ -- REG_DIR=%{buildroot}%{cargo_registry}/$CRATE_NAME-$CRATE_VERSION \ -- %{__mkdir} -p $REG_DIR \ -- %__cargo package -l | xargs %{__cp} --parents -a -t $REG_DIR \ --%if ! %{with check} \ -- %{__cp} -a Cargo.toml.orig $REG_DIR/Cargo.toml \ --%endif \ -- echo '{"files":{},"package":""}' > $REG_DIR/.cargo-checksum.json \ -+%cargo_test(t:naf:) %{shrink:\ -+%{__cargo} test \ -+ %{__cargo_common_opts} \ -+ --release \ -+ --no-fail-fast \ -+ %{__cargo_parse_opts %{-t:-t%{-t*}} %{-n} %{-a} %{-f:-f%{-f*}}} \ -+ %* \ -+} -+ -+%cargo_install(t:naf:) (\ -+set -eu \ -+if %__cargo_is_lib; then \ -+ CRATE_NAME=$(%__cargo_inspector --name Cargo.toml) \ -+ CRATE_VERSION=$(%__cargo_inspector --version Cargo.toml) \ -+ REG_DIR=%{buildroot}%{cargo_registry}/$CRATE_NAME-$CRATE_VERSION \ -+ %{__mkdir} -p $REG_DIR \ -+ %{__cargo} package -l | xargs %{__cp} --parents -a -t $REG_DIR \ -+%if ! %{with check} \ -+ %{__cp} -a Cargo.toml.orig $REG_DIR/Cargo.toml \ -+%endif \ -+ echo '{"files":{},"package":""}' > $REG_DIR/.cargo-checksum.json \ - fi \ --if %__cargo_is_bin; then \ -- %__cargo install %{__cargo_common_opts} --path . --root %{buildroot}%{_prefix} \ -- %{__rm} %{buildroot}%{_prefix}/.crates.toml \ -+if %__cargo_is_bin; then \ -+ %{shrink:%{-t:CARGO_TARGET_DIR=%{-t*}} %{__cargo} install \ -+ %{__cargo_common_opts} \ -+ --path . \ -+ --root %{buildroot}%{_prefix} \ -+ %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \ -+ %* \ -+ }\ -+ %{__rm} %{buildroot}%{_prefix}/.crates.toml \ - fi \ - ) --- -2.18.0.rc2 - diff --git a/0005-macros-remove-support-for-target-dir.patch b/0005-macros-remove-support-for-target-dir.patch deleted file mode 100644 index e8fbfcc..0000000 --- a/0005-macros-remove-support-for-target-dir.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 80237720ae3397fc66d8f06e13f868c4bd2723c1 Mon Sep 17 00:00:00 2001 -From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> -Date: Fri, 22 Jun 2018 21:53:09 +0200 -Subject: [PATCH 5/5] macros: remove support for target-dir - -Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> ---- - data/macros.cargo | 31 +++++++++++++++---------------- - 1 file changed, 15 insertions(+), 16 deletions(-) - -diff --git a/data/macros.cargo b/data/macros.cargo -index 96a2931..a0c456a 100644 ---- a/data/macros.cargo -+++ b/data/macros.cargo -@@ -35,30 +35,29 @@ EOF\ - %endif \ - ) - --%__cargo_parse_opts(t:naf:) %{shrink:\ -+%__cargo_parse_opts(naf:) %{shrink:\ - %{-f:%{-a:%{error:Can't specify both -f(%{-f*}) and -a}}} \ -- %{-t:--target-dir %{-t*}} \ - %{-n:--no-default-features} \ - %{-a:--all-features} \ - %{-f:--features %{-f*}} \ - %{nil} - } - --%cargo_build(t:naf:) %{shrink:\ --%{__cargo} build \ -- %{__cargo_common_opts} \ -- --release \ -- %{__cargo_parse_opts %{-t:-t%{-t*}} %{-n} %{-a} %{-f:-f%{-f*}}} \ -- %* \ -+%cargo_build(naf:) %{shrink:\ -+%{__cargo} build \ -+ %{__cargo_common_opts} \ -+ --release \ -+ %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \ -+ %* \ - } - --%cargo_test(t:naf:) %{shrink:\ --%{__cargo} test \ -- %{__cargo_common_opts} \ -- --release \ -- --no-fail-fast \ -- %{__cargo_parse_opts %{-t:-t%{-t*}} %{-n} %{-a} %{-f:-f%{-f*}}} \ -- %* \ -+%cargo_test(naf:) %{shrink:\ -+%{__cargo} test \ -+ %{__cargo_common_opts} \ -+ --release \ -+ --no-fail-fast \ -+ %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \ -+ %* \ - } - - %cargo_install(t:naf:) (\ -@@ -75,7 +74,7 @@ if %__cargo_is_lib; then \ - echo '{"files":{},"package":""}' > $REG_DIR/.cargo-checksum.json \ - fi \ - if %__cargo_is_bin; then \ -- %{shrink:%{-t:CARGO_TARGET_DIR=%{-t*}} %{__cargo} install \ -+ %{shrink:%{__cargo} install \ - %{__cargo_common_opts} \ - --path . \ - --root %{buildroot}%{_prefix} \ --- -2.18.0.rc2 - diff --git a/rust-packaging.spec b/rust-packaging.spec index 016f782..495e71d 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -1,18 +1,14 @@ %bcond_without check +%{?python_enable_dependency_generator} Name: rust-packaging -Version: 5 -Release: 11%{?dist} +Version: 6 +Release: 1%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT URL:
https://pagure.io/fedora-rust/rust2rpm
Source0:
https://releases.pagure.org/fedora-rust/rust2rpm/rust2rpm-%{version}.tar.xz
-Patch0001: 0001-macros-remove-Cargo.lock.patch -Patch0002: 0002-macros-remove-spurious-whitespace.patch -Patch0003: 0003-macros-pass-__cargo_common_opts-to-cargo_install.patch -Patch0004: 0004-macros-make-cargo_-macros-parametric.patch -Patch0005: 0005-macros-remove-support-for-target-dir.patch BuildArch: noarch ExclusiveArch: %{rust_arches} noarch @@ -23,8 +19,6 @@ Requires: python3-rust2rpm = %{?epoch:%{epoch}:}%{version}-%{release} Requires: rust-srpm-macros = %{version} Requires: rust Requires: cargo -# Remove in F29 -Obsoletes: rust-rpm-macros < 2-2 %description The package provides macros for building projects in Rust @@ -37,14 +31,9 @@ BuildRequires: python3-setuptools %if %{with check} BuildRequires: python3-pytest BuildRequires: cargo -BuildRequires: python3-semantic_version +BuildRequires: python3dist(rustcfg) %endif Requires: cargo -Requires: python3-semantic_version -Requires: python3-jinja2 -Requires: python3-requests -Requires: python3-tqdm -Obsoletes: rust2rpm < 1-8 Provides: rust2rpm = %{version}-%{release} %{?python_provide:%python_provide python3-rust2rpm} @@ -80,6 +69,9 @@ py.test-%{python3_version} -vv test.py %{python3_sitelib}/rust2rpm/ %changelog +* Sun Sep 02 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-1 +- Update to 6 + * Sat Jul 14 2018 Fedora Release Engineering <releng(a)fedoraproject.org> - 5-11 - Rebuilt for
https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
diff --git a/sources b/sources index 0745d57..9f6fa6f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rust2rpm-5.tar.xz) = e61c0c9351b3bc76b576fc57950b96793f805109e56d1021da94e5dfceb9d299c868f980de298d6a7f85e1b3477f785df7b5615c702e6a0ac25070fbffc013f3 +SHA512 (rust2rpm-6.tar.xz) = 408988351156d858f7429d990d7330f216b54add671c6e90e54917e717ad6f2b3b99e414289c252e6a2b5dfad73ce430ac73f03265f6e174ef53edcee34d0fe2 commit 84bf5595e3951aa209c83c79c4564d69cf8d32bd Author: Fedora Release Engineering <releng(a)fedoraproject.org> Date: Sat Jul 14 05:20:48 2018 +0000 - Rebuilt for
https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng(a)fedoraproject.org> diff --git a/rust-packaging.spec b/rust-packaging.spec index 73d8668..016f782 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -2,7 +2,7 @@ Name: rust-packaging Version: 5 -Release: 10%{?dist} +Release: 11%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT @@ -80,6 +80,9 @@ py.test-%{python3_version} -vv test.py %{python3_sitelib}/rust2rpm/ %changelog +* Sat Jul 14 2018 Fedora Release Engineering <releng(a)fedoraproject.org> - 5-11 +- Rebuilt for
https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
+ * Mon Jul 02 2018 Miro Hronok <mhroncok(a)redhat.com> - 5-10 - Rebuilt for Python 3.7 commit b5750174ce98b9754d480856c3662e6a910bef83 Author: Miro Hronok <miro(a)hroncok.cz> Date: Mon Jul 2 18:24:06 2018 +0200 Rebuilt for Python 3.7 diff --git a/rust-packaging.spec b/rust-packaging.spec index 1b4c7c2..73d8668 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -2,7 +2,7 @@ Name: rust-packaging Version: 5 -Release: 9%{?dist} +Release: 10%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT @@ -80,6 +80,9 @@ py.test-%{python3_version} -vv test.py %{python3_sitelib}/rust2rpm/ %changelog +* Mon Jul 02 2018 Miro Hronok <mhroncok(a)redhat.com> - 5-10 +- Rebuilt for Python 3.7 + * Mon Jul 02 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 5-9 - Rebuilt for Python 3.7 commit 104d9fcc10c4002f0e0f3f39e93c8e9737f08487 Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Mon Jul 2 17:19:07 2018 +0100 Rebuilt for Python 3.7 Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/rust-packaging.spec b/rust-packaging.spec index dabffa1..1b4c7c2 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -2,7 +2,7 @@ Name: rust-packaging Version: 5 -Release: 8%{?dist} +Release: 9%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT @@ -80,6 +80,9 @@ py.test-%{python3_version} -vv test.py %{python3_sitelib}/rust2rpm/ %changelog +* Mon Jul 02 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 5-9 +- Rebuilt for Python 3.7 + * Fri Jun 22 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 5-8 - Various improvements for %%cargo_* macros commit fb6d2b02177659c987b42014f5d457cdc76221ed Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Fri Jun 22 21:57:54 2018 +0200 Various improvements for %%cargo_* macros Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/0001-macros-remove-Cargo.lock.patch b/0001-macros-remove-Cargo.lock.patch index eac95b4..57069a3 100644 --- a/0001-macros-remove-Cargo.lock.patch +++ b/0001-macros-remove-Cargo.lock.patch @@ -1,7 +1,7 @@ From 5313b352712486b4001827b04d906bdb91be2314 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Mon, 8 Jan 2018 23:57:03 +0100 -Subject: [PATCH 1/3] macros: remove Cargo.lock +Subject: [PATCH 1/5] macros: remove Cargo.lock cargo-package automatically strips it out, but we package also some things directly from git. @@ -27,5 +27,5 @@ index ebf3edb..288554c 100644 #
https://github.com/rust-lang/cargo/issues/3732
\ %{__awk} -i inplace -v INPLACE_SUFFIX=.orig '/^\\\[dev-dependencies/{f=1;next} /^\\\[/{f=0}; !f' Cargo.toml \ -- -2.16.2 +2.18.0.rc2 diff --git a/0002-macros-remove-spurious-whitespace.patch b/0002-macros-remove-spurious-whitespace.patch index 2033124..9e11804 100644 --- a/0002-macros-remove-spurious-whitespace.patch +++ b/0002-macros-remove-spurious-whitespace.patch @@ -1,7 +1,7 @@ From cd6329635329fc7742a18f7ed0933298a0c56cf7 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Tue, 9 Jan 2018 06:52:36 +0100 -Subject: [PATCH 2/3] macros: remove spurious whitespace +Subject: [PATCH 2/5] macros: remove spurious whitespace Fixes:
https://pagure.io/fedora-rust/rust2rpm/issue/48
Reported-by: Josh Stone <jistone(a)redhat.com> @@ -24,5 +24,5 @@ index 288554c..67b1950 100644 %if ! %{with check} \ #
https://github.com/rust-lang/cargo/issues/3732
\ -- -2.16.2 +2.18.0.rc2 diff --git a/0003-macros-pass-__cargo_common_opts-to-cargo_install.patch b/0003-macros-pass-__cargo_common_opts-to-cargo_install.patch index f719a78..c5ff4b6 100644 --- a/0003-macros-pass-__cargo_common_opts-to-cargo_install.patch +++ b/0003-macros-pass-__cargo_common_opts-to-cargo_install.patch @@ -1,7 +1,7 @@ From c5bab762f56bf07cd0f4a2e2d58b7c295cddedd8 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Tue, 20 Feb 2018 22:04:35 +0100 -Subject: [PATCH 3/3] macros: pass %__cargo_common_opts to %cargo_install +Subject: [PATCH 3/5] macros: pass %__cargo_common_opts to %cargo_install Reason this has not been done before is that cargo-install doesn't understand --release. Let's just add it to other commands and be done @@ -46,5 +46,5 @@ index 67b1950..22721e9 100644 fi \ ) -- -2.16.2 +2.18.0.rc2 diff --git a/0004-macros-make-cargo_-macros-parametric.patch b/0004-macros-make-cargo_-macros-parametric.patch new file mode 100644 index 0000000..8d8028a --- /dev/null +++ b/0004-macros-make-cargo_-macros-parametric.patch @@ -0,0 +1,96 @@ +From c9ce952e260ec0adb166bd6e1de652a0277d2437 Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +Date: Fri, 22 Jun 2018 21:04:59 +0200 +Subject: [PATCH 4/5] macros: make %cargo_* macros parametric +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Unfortunately cargo-install doesn't accept --target-dir, so have to pass +setting through envvar. + +Also %{shrink:} them so it looks nicer in build log. + +Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +--- + data/macros.cargo | 62 ++++++++++++++++++++++++++++++++++------------- + 1 file changed, 45 insertions(+), 17 deletions(-) + +diff --git a/data/macros.cargo b/data/macros.cargo +index 22721e9..96a2931 100644 +--- a/data/macros.cargo ++++ b/data/macros.cargo +@@ -35,25 +35,53 @@ EOF\ + %endif \ + ) + +-%cargo_build %__cargo build --release %{__cargo_common_opts} ++%__cargo_parse_opts(t:naf:) %{shrink:\ ++%{-f:%{-a:%{error:Can't specify both -f(%{-f*}) and -a}}} \ ++ %{-t:--target-dir %{-t*}} \ ++ %{-n:--no-default-features} \ ++ %{-a:--all-features} \ ++ %{-f:--features %{-f*}} \ ++ %{nil} ++} + +-%cargo_test %__cargo test --release %{__cargo_common_opts} --no-fail-fast ++%cargo_build(t:naf:) %{shrink:\ ++%{__cargo} build \ ++ %{__cargo_common_opts} \ ++ --release \ ++ %{__cargo_parse_opts %{-t:-t%{-t*}} %{-n} %{-a} %{-f:-f%{-f*}}} \ ++ %* \ ++} + +-%cargo_install (\ +-set -eu \ +-if %__cargo_is_lib; then \ +- CRATE_NAME=$(%__cargo_inspector --name Cargo.toml) \ +- CRATE_VERSION=$(%__cargo_inspector --version Cargo.toml) \ +- REG_DIR=%{buildroot}%{cargo_registry}/$CRATE_NAME-$CRATE_VERSION \ +- %{__mkdir} -p $REG_DIR \ +- %__cargo package -l | xargs %{__cp} --parents -a -t $REG_DIR \ +-%if ! %{with check} \ +- %{__cp} -a Cargo.toml.orig $REG_DIR/Cargo.toml \ +-%endif \ +- echo '{"files":{},"package":""}' > $REG_DIR/.cargo-checksum.json \ ++%cargo_test(t:naf:) %{shrink:\ ++%{__cargo} test \ ++ %{__cargo_common_opts} \ ++ --release \ ++ --no-fail-fast \ ++ %{__cargo_parse_opts %{-t:-t%{-t*}} %{-n} %{-a} %{-f:-f%{-f*}}} \ ++ %* \ ++} ++ ++%cargo_install(t:naf:) (\ ++set -eu \ ++if %__cargo_is_lib; then \ ++ CRATE_NAME=$(%__cargo_inspector --name Cargo.toml) \ ++ CRATE_VERSION=$(%__cargo_inspector --version Cargo.toml) \ ++ REG_DIR=%{buildroot}%{cargo_registry}/$CRATE_NAME-$CRATE_VERSION \ ++ %{__mkdir} -p $REG_DIR \ ++ %{__cargo} package -l | xargs %{__cp} --parents -a -t $REG_DIR \ ++%if ! %{with check} \ ++ %{__cp} -a Cargo.toml.orig $REG_DIR/Cargo.toml \ ++%endif \ ++ echo '{"files":{},"package":""}' > $REG_DIR/.cargo-checksum.json \ + fi \ +-if %__cargo_is_bin; then \ +- %__cargo install %{__cargo_common_opts} --path . --root %{buildroot}%{_prefix} \ +- %{__rm} %{buildroot}%{_prefix}/.crates.toml \ ++if %__cargo_is_bin; then \ ++ %{shrink:%{-t:CARGO_TARGET_DIR=%{-t*}} %{__cargo} install \ ++ %{__cargo_common_opts} \ ++ --path . \ ++ --root %{buildroot}%{_prefix} \ ++ %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \ ++ %* \ ++ }\ ++ %{__rm} %{buildroot}%{_prefix}/.crates.toml \ + fi \ + ) +-- +2.18.0.rc2 + diff --git a/0005-macros-remove-support-for-target-dir.patch b/0005-macros-remove-support-for-target-dir.patch new file mode 100644 index 0000000..e8fbfcc --- /dev/null +++ b/0005-macros-remove-support-for-target-dir.patch @@ -0,0 +1,71 @@ +From 80237720ae3397fc66d8f06e13f868c4bd2723c1 Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +Date: Fri, 22 Jun 2018 21:53:09 +0200 +Subject: [PATCH 5/5] macros: remove support for target-dir + +Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +--- + data/macros.cargo | 31 +++++++++++++++---------------- + 1 file changed, 15 insertions(+), 16 deletions(-) + +diff --git a/data/macros.cargo b/data/macros.cargo +index 96a2931..a0c456a 100644 +--- a/data/macros.cargo ++++ b/data/macros.cargo +@@ -35,30 +35,29 @@ EOF\ + %endif \ + ) + +-%__cargo_parse_opts(t:naf:) %{shrink:\ ++%__cargo_parse_opts(naf:) %{shrink:\ + %{-f:%{-a:%{error:Can't specify both -f(%{-f*}) and -a}}} \ +- %{-t:--target-dir %{-t*}} \ + %{-n:--no-default-features} \ + %{-a:--all-features} \ + %{-f:--features %{-f*}} \ + %{nil} + } + +-%cargo_build(t:naf:) %{shrink:\ +-%{__cargo} build \ +- %{__cargo_common_opts} \ +- --release \ +- %{__cargo_parse_opts %{-t:-t%{-t*}} %{-n} %{-a} %{-f:-f%{-f*}}} \ +- %* \ ++%cargo_build(naf:) %{shrink:\ ++%{__cargo} build \ ++ %{__cargo_common_opts} \ ++ --release \ ++ %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \ ++ %* \ + } + +-%cargo_test(t:naf:) %{shrink:\ +-%{__cargo} test \ +- %{__cargo_common_opts} \ +- --release \ +- --no-fail-fast \ +- %{__cargo_parse_opts %{-t:-t%{-t*}} %{-n} %{-a} %{-f:-f%{-f*}}} \ +- %* \ ++%cargo_test(naf:) %{shrink:\ ++%{__cargo} test \ ++ %{__cargo_common_opts} \ ++ --release \ ++ --no-fail-fast \ ++ %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \ ++ %* \ + } + + %cargo_install(t:naf:) (\ +@@ -75,7 +74,7 @@ if %__cargo_is_lib; then \ + echo '{"files":{},"package":""}' > $REG_DIR/.cargo-checksum.json \ + fi \ + if %__cargo_is_bin; then \ +- %{shrink:%{-t:CARGO_TARGET_DIR=%{-t*}} %{__cargo} install \ ++ %{shrink:%{__cargo} install \ + %{__cargo_common_opts} \ + --path . \ + --root %{buildroot}%{_prefix} \ +-- +2.18.0.rc2 + diff --git a/rust-packaging.spec b/rust-packaging.spec index 9f6162f..dabffa1 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -2,7 +2,7 @@ Name: rust-packaging Version: 5 -Release: 7%{?dist} +Release: 8%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT @@ -11,6 +11,8 @@ Source0:
https://releases.pagure.org/fedora-rust/rust2rpm/rust2rpm-%{vers
Patch0001: 0001-macros-remove-Cargo.lock.patch Patch0002: 0002-macros-remove-spurious-whitespace.patch Patch0003: 0003-macros-pass-__cargo_common_opts-to-cargo_install.patch +Patch0004: 0004-macros-make-cargo_-macros-parametric.patch +Patch0005: 0005-macros-remove-support-for-target-dir.patch BuildArch: noarch ExclusiveArch: %{rust_arches} noarch @@ -78,6 +80,9 @@ py.test-%{python3_version} -vv test.py %{python3_sitelib}/rust2rpm/ %changelog +* Fri Jun 22 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 5-8 +- Various improvements for %%cargo_* macros + * Tue Jun 19 2018 Miro Hronok <mhroncok(a)redhat.com> - 5-7 - Rebuilt for Python 3.7 commit fe7dc1b94a637386dbda072d8f7ceede532637c8 Author: Miro Hronok <miro(a)hroncok.cz> Date: Tue Jun 19 11:27:00 2018 +0200 Rebuilt for Python 3.7 diff --git a/rust-packaging.spec b/rust-packaging.spec index f6ce2e1..9f6162f 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -2,7 +2,7 @@ Name: rust-packaging Version: 5 -Release: 6%{?dist} +Release: 7%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT @@ -78,6 +78,9 @@ py.test-%{python3_version} -vv test.py %{python3_sitelib}/rust2rpm/ %changelog +* Tue Jun 19 2018 Miro Hronok <mhroncok(a)redhat.com> - 5-7 +- Rebuilt for Python 3.7 + * Wed Feb 21 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 5-6 - Pass %%__cargo_common_opts to %%cargo_install commit 6e2f4c83784eb959fcfafea022f6c78770dadf3d Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Wed Feb 21 08:15:29 2018 +0100 Pass %__cargo_common_opts to %cargo_install Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/0001-macros-remove-Cargo.lock.patch b/0001-macros-remove-Cargo.lock.patch index 435710c..eac95b4 100644 --- a/0001-macros-remove-Cargo.lock.patch +++ b/0001-macros-remove-Cargo.lock.patch @@ -1,7 +1,7 @@ From 5313b352712486b4001827b04d906bdb91be2314 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Mon, 8 Jan 2018 23:57:03 +0100 -Subject: [PATCH 1/2] macros: remove Cargo.lock +Subject: [PATCH 1/3] macros: remove Cargo.lock cargo-package automatically strips it out, but we package also some things directly from git. @@ -27,5 +27,5 @@ index ebf3edb..288554c 100644 #
https://github.com/rust-lang/cargo/issues/3732
\ %{__awk} -i inplace -v INPLACE_SUFFIX=.orig '/^\\\[dev-dependencies/{f=1;next} /^\\\[/{f=0}; !f' Cargo.toml \ -- -2.15.1 +2.16.2 diff --git a/0002-macros-remove-spurious-whitespace.patch b/0002-macros-remove-spurious-whitespace.patch index 522e2b0..2033124 100644 --- a/0002-macros-remove-spurious-whitespace.patch +++ b/0002-macros-remove-spurious-whitespace.patch @@ -1,7 +1,7 @@ From cd6329635329fc7742a18f7ed0933298a0c56cf7 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Tue, 9 Jan 2018 06:52:36 +0100 -Subject: [PATCH 2/2] macros: remove spurious whitespace +Subject: [PATCH 2/3] macros: remove spurious whitespace Fixes:
https://pagure.io/fedora-rust/rust2rpm/issue/48
Reported-by: Josh Stone <jistone(a)redhat.com> @@ -24,5 +24,5 @@ index 288554c..67b1950 100644 %if ! %{with check} \ #
https://github.com/rust-lang/cargo/issues/3732
\ -- -2.15.1 +2.16.2 diff --git a/0003-macros-pass-__cargo_common_opts-to-cargo_install.patch b/0003-macros-pass-__cargo_common_opts-to-cargo_install.patch new file mode 100644 index 0000000..f719a78 --- /dev/null +++ b/0003-macros-pass-__cargo_common_opts-to-cargo_install.patch @@ -0,0 +1,50 @@ +From c5bab762f56bf07cd0f4a2e2d58b7c295cddedd8 Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +Date: Tue, 20 Feb 2018 22:04:35 +0100 +Subject: [PATCH 3/3] macros: pass %__cargo_common_opts to %cargo_install + +Reason this has not been done before is that cargo-install doesn't +understand --release. Let's just add it to other commands and be done +with it. + +Reported-by: Josh Stone <jistone(a)redhat.com> +Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +--- + data/macros.cargo | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/data/macros.cargo b/data/macros.cargo +index 67b1950..22721e9 100644 +--- a/data/macros.cargo ++++ b/data/macros.cargo +@@ -1,5 +1,5 @@ + %__cargo %{_bindir}/cargo +-%__cargo_common_opts --release %{?_smp_mflags} ++%__cargo_common_opts %{?_smp_mflags} + %__cargo_inspector %{_bindir}/cargo-inspector + + %cargo_registry %{_datadir}/cargo/registry +@@ -35,9 +35,9 @@ EOF\ + %endif \ + ) + +-%cargo_build %__cargo build %{__cargo_common_opts} ++%cargo_build %__cargo build --release %{__cargo_common_opts} + +-%cargo_test %__cargo test %{__cargo_common_opts} --no-fail-fast ++%cargo_test %__cargo test --release %{__cargo_common_opts} --no-fail-fast + + %cargo_install (\ + set -eu \ +@@ -53,7 +53,7 @@ if %__cargo_is_lib; then \ + echo '{"files":{},"package":""}' > $REG_DIR/.cargo-checksum.json \ + fi \ + if %__cargo_is_bin; then \ +- %__cargo install %{?_smp_mflags} --path . --root %{buildroot}%{_prefix} \ ++ %__cargo install %{__cargo_common_opts} --path . --root %{buildroot}%{_prefix} \ + %{__rm} %{buildroot}%{_prefix}/.crates.toml \ + fi \ + ) +-- +2.16.2 + diff --git a/rust-packaging.spec b/rust-packaging.spec index 1d5bfbc..f6ce2e1 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -2,7 +2,7 @@ Name: rust-packaging Version: 5 -Release: 5%{?dist} +Release: 6%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT @@ -10,6 +10,7 @@ URL:
https://pagure.io/fedora-rust/rust2rpm
Source0:
https://releases.pagure.org/fedora-rust/rust2rpm/rust2rpm-%{version}.tar.xz
Patch0001: 0001-macros-remove-Cargo.lock.patch Patch0002: 0002-macros-remove-spurious-whitespace.patch +Patch0003: 0003-macros-pass-__cargo_common_opts-to-cargo_install.patch BuildArch: noarch ExclusiveArch: %{rust_arches} noarch @@ -41,9 +42,6 @@ Requires: python3-semantic_version Requires: python3-jinja2 Requires: python3-requests Requires: python3-tqdm -%if 0%{?mageia} -Requires: locales-en -%endif Obsoletes: rust2rpm < 1-8 Provides: rust2rpm = %{version}-%{release} %{?python_provide:%python_provide python3-rust2rpm} @@ -53,15 +51,6 @@ Provides: rust2rpm = %{version}-%{release} %prep %autosetup -n rust2rpm-%{version} -p1 -lang= -%if 0%{?rhel} && 0%{?rhel} <= 7 -lang=C.UTF-8 -%else -%if 0%{?mageia} -lang=en_US.UTF-8 -%endif -%endif -[ -z "$lang" ] || sed -r -i -e "s|(%\{_bindir\}/cargo-inspector)|env LANG=$lang \1|" data/cargo.attr data/macros.cargo %build %py3_build @@ -89,6 +78,9 @@ py.test-%{python3_version} -vv test.py %{python3_sitelib}/rust2rpm/ %changelog +* Wed Feb 21 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 5-6 +- Pass %%__cargo_common_opts to %%cargo_install + * Tue Feb 20 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 5-5 - Explicitly require rust/cargo commit 210d2aa95c2dbda70e4081d015e87a297a268ece Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Tue Feb 20 14:21:10 2018 +0100 Explicitly require rust/cargo Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/rust-packaging.spec b/rust-packaging.spec index eade1ea..1d5bfbc 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -2,7 +2,7 @@ Name: rust-packaging Version: 5 -Release: 4%{?dist} +Release: 5%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT @@ -18,6 +18,8 @@ ExclusiveArch: %{rust_arches} noarch Requires: gawk >= 4.1.0 Requires: python3-rust2rpm = %{?epoch:%{epoch}:}%{version}-%{release} Requires: rust-srpm-macros = %{version} +Requires: rust +Requires: cargo # Remove in F29 Obsoletes: rust-rpm-macros < 2-2 @@ -87,6 +89,9 @@ py.test-%{python3_version} -vv test.py %{python3_sitelib}/rust2rpm/ %changelog +* Tue Feb 20 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 5-5 +- Explicitly require rust/cargo + * Fri Feb 09 2018 Fedora Release Engineering <releng(a)fedoraproject.org> - 5-4 - Rebuilt for
https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
commit 7edf0c5e79fa9747ef661cc8bd8f3b7ab6acbc81 Author: Fedora Release Engineering <releng(a)fedoraproject.org> Date: Fri Feb 9 15:38:01 2018 +0000 - Rebuilt for
https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng(a)fedoraproject.org> diff --git a/rust-packaging.spec b/rust-packaging.spec index 7b3ccea..eade1ea 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -2,7 +2,7 @@ Name: rust-packaging Version: 5 -Release: 3%{?dist} +Release: 4%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT @@ -87,6 +87,9 @@ py.test-%{python3_version} -vv test.py %{python3_sitelib}/rust2rpm/ %changelog +* Fri Feb 09 2018 Fedora Release Engineering <releng(a)fedoraproject.org> - 5-4 +- Rebuilt for
https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
+ * Tue Jan 09 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 5-3 - Fix syntax error commit 1f1f7784f40645adf884f8c18f3c1f09920a5f9c Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Sun Jan 14 17:01:28 2018 +0100 use %_rpmmacrodir and %_fileattrsdir Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/rust-packaging.spec b/rust-packaging.spec index 9bef763..7b3ccea 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -66,8 +66,8 @@ lang=en_US.UTF-8 %install %py3_install -install -D -p -m 0644 -t %{buildroot}%{_rpmconfigdir}/macros.d data/macros.rust data/macros.cargo -install -D -p -m 0644 -t %{buildroot}%{_rpmconfigdir}/fileattrs data/cargo.attr +install -D -p -m 0644 -t %{buildroot}%{_rpmmacrodir} data/macros.rust data/macros.cargo +install -D -p -m 0644 -t %{buildroot}%{_fileattrsdir} data/cargo.attr %if %{with check} %check @@ -75,9 +75,9 @@ py.test-%{python3_version} -vv test.py %endif %files -%{_rpmconfigdir}/macros.d/macros.rust -%{_rpmconfigdir}/macros.d/macros.cargo -%{_rpmconfigdir}/fileattrs/cargo.attr +%{_rpmmacrodir}/macros.rust +%{_rpmmacrodir}/macros.cargo +%{_fileattrsdir}/cargo.attr %files -n python3-rust2rpm %license LICENSE commit e99965a091ab45b9013cc9b8cfe68e1682d66682 Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Sun Jan 14 17:01:10 2018 +0100 remove obsolete conditions Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/rust-packaging.spec b/rust-packaging.spec index a47ac1f..9bef763 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -52,7 +52,7 @@ Provides: rust2rpm = %{version}-%{release} %prep %autosetup -n rust2rpm-%{version} -p1 lang= -%if (0%{?fedora} && 0%{?fedora} <= 25) || (0%{?rhel} && 0%{?rhel} <= 7) +%if 0%{?rhel} && 0%{?rhel} <= 7 lang=C.UTF-8 %else %if 0%{?mageia} commit 0e91fb3355fe994f41b16165a44b0e20ba16d8a3 Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Sun Jan 14 09:07:34 2018 +0100 be super-verbose in tests Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/rust-packaging.spec b/rust-packaging.spec index 20d6cc3..a47ac1f 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -71,7 +71,7 @@ install -D -p -m 0644 -t %{buildroot}%{_rpmconfigdir}/fileattrs data/cargo.attr %if %{with check} %check -py.test-%{python3_version} -v test.py +py.test-%{python3_version} -vv test.py %endif %files commit f45176f7dee892d1048a4f71c762ec74900da55b Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Tue Jan 9 06:54:39 2018 +0100 Fix syntax error Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/0001-macros-remove-Cargo.lock.patch b/0001-macros-remove-Cargo.lock.patch index c86f872..435710c 100644 --- a/0001-macros-remove-Cargo.lock.patch +++ b/0001-macros-remove-Cargo.lock.patch @@ -1,7 +1,7 @@ From 5313b352712486b4001827b04d906bdb91be2314 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Mon, 8 Jan 2018 23:57:03 +0100 -Subject: [PATCH] macros: remove Cargo.lock +Subject: [PATCH 1/2] macros: remove Cargo.lock cargo-package automatically strips it out, but we package also some things directly from git. diff --git a/0002-macros-remove-spurious-whitespace.patch b/0002-macros-remove-spurious-whitespace.patch new file mode 100644 index 0000000..522e2b0 --- /dev/null +++ b/0002-macros-remove-spurious-whitespace.patch @@ -0,0 +1,28 @@ +From cd6329635329fc7742a18f7ed0933298a0c56cf7 Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +Date: Tue, 9 Jan 2018 06:52:36 +0100 +Subject: [PATCH 2/2] macros: remove spurious whitespace + +Fixes:
https://pagure.io/fedora-rust/rust2rpm/issue/48
+Reported-by: Josh Stone <jistone(a)redhat.com> +Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +--- + data/macros.cargo | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/data/macros.cargo b/data/macros.cargo +index 288554c..67b1950 100644 +--- a/data/macros.cargo ++++ b/data/macros.cargo +@@ -27,7 +27,7 @@ directory = "%{cargo_registry}"\ + [source.crates-io]\ + registry = "
https://crates.io
"\ + replace-with = "local-registry"\ +-EOF \ ++EOF\ + %{__rm} -f Cargo.lock \ + %if ! %{with check} \ + #
https://github.com/rust-lang/cargo/issues/3732
\ +-- +2.15.1 + diff --git a/rust-packaging.spec b/rust-packaging.spec index af03432..20d6cc3 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -2,13 +2,14 @@ Name: rust-packaging Version: 5 -Release: 2%{?dist} +Release: 3%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT URL:
https://pagure.io/fedora-rust/rust2rpm
Source0:
https://releases.pagure.org/fedora-rust/rust2rpm/rust2rpm-%{version}.tar.xz
Patch0001: 0001-macros-remove-Cargo.lock.patch +Patch0002: 0002-macros-remove-spurious-whitespace.patch BuildArch: noarch ExclusiveArch: %{rust_arches} noarch @@ -86,6 +87,9 @@ py.test-%{python3_version} -v test.py %{python3_sitelib}/rust2rpm/ %changelog +* Tue Jan 09 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 5-3 +- Fix syntax error + * Tue Jan 09 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 5-2 - Remove Cargo.lock commit b22849eefe9f75d9e5e5e364ab740c768324002e Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Tue Jan 9 00:02:01 2018 +0100 Remove Cargo.lock Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/0001-macros-remove-Cargo.lock.patch b/0001-macros-remove-Cargo.lock.patch new file mode 100644 index 0000000..c86f872 --- /dev/null +++ b/0001-macros-remove-Cargo.lock.patch @@ -0,0 +1,31 @@ +From 5313b352712486b4001827b04d906bdb91be2314 Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +Date: Mon, 8 Jan 2018 23:57:03 +0100 +Subject: [PATCH] macros: remove Cargo.lock + +cargo-package automatically strips it out, but we package also some +things directly from git. + +Acked-by: Josh Stone <jistone(a)redhat.com> +Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +--- + data/macros.cargo | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/data/macros.cargo b/data/macros.cargo +index ebf3edb..288554c 100644 +--- a/data/macros.cargo ++++ b/data/macros.cargo +@@ -27,7 +27,8 @@ directory = "%{cargo_registry}"\ + [source.crates-io]\ + registry = "
https://crates.io
"\ + replace-with = "local-registry"\ +-EOF\ ++EOF \ ++%{__rm} -f Cargo.lock \ + %if ! %{with check} \ + #
https://github.com/rust-lang/cargo/issues/3732
\ + %{__awk} -i inplace -v INPLACE_SUFFIX=.orig '/^\\\[dev-dependencies/{f=1;next} /^\\\[/{f=0}; !f' Cargo.toml \ +-- +2.15.1 + diff --git a/rust-packaging.spec b/rust-packaging.spec index 651c352..af03432 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -2,12 +2,13 @@ Name: rust-packaging Version: 5 -Release: 1%{?dist} +Release: 2%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT URL:
https://pagure.io/fedora-rust/rust2rpm
Source0:
https://releases.pagure.org/fedora-rust/rust2rpm/rust2rpm-%{version}.tar.xz
+Patch0001: 0001-macros-remove-Cargo.lock.patch BuildArch: noarch ExclusiveArch: %{rust_arches} noarch @@ -85,6 +86,9 @@ py.test-%{python3_version} -v test.py %{python3_sitelib}/rust2rpm/ %changelog +* Tue Jan 09 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 5-2 +- Remove Cargo.lock + * Mon Jan 08 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 5-1 - Update to 5 commit 2ce47297c5751f725f2fc720355ef8025225d44b Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Mon Jan 8 20:52:27 2018 +0100 commit sources Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/.gitignore b/.gitignore index aaa8cf4..d47206f 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /rust2rpm-4.tar.xz +/rust2rpm-5.tar.xz diff --git a/sources b/sources index a81110b..0745d57 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rust2rpm-4.tar.xz) = d8527c72f34b31086d3c6dbfae7fd25709525e5aa941d9de47efaefb07a04782d8f7c561b258145df1413fbfee5cd76e24d7d3787107aa36e2d9d1a1e6577637 +SHA512 (rust2rpm-5.tar.xz) = e61c0c9351b3bc76b576fc57950b96793f805109e56d1021da94e5dfceb9d299c868f980de298d6a7f85e1b3477f785df7b5615c702e6a0ac25070fbffc013f3 commit f0f5561dea6f3667228f30880e0622f418f2618b Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Mon Jan 8 20:32:16 2018 +0100 Update to 5 Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/0001-inspector-inject-cargo-dependency-in-runtime.patch b/0001-inspector-inject-cargo-dependency-in-runtime.patch deleted file mode 100644 index 675f2ca..0000000 --- a/0001-inspector-inject-cargo-dependency-in-runtime.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 9e0a872ece6f5aedf76ffd67044f22c7d0cba8aa Mon Sep 17 00:00:00 2001 -From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> -Date: Fri, 20 Oct 2017 18:04:31 +0200 -Subject: [PATCH 1/3] inspector: inject cargo dependency in runtime - -Fixes:
https://pagure.io/fedora-rust/rust2rpm/issue/42
-Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> ---- - rust2rpm/__main__.py | 1 + - rust2rpm/inspector.py | 3 +++ - 2 files changed, 4 insertions(+) - -diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py -index 0121a33..bb92fa3 100644 ---- a/rust2rpm/__main__.py -+++ b/rust2rpm/__main__.py -@@ -91,6 +91,7 @@ Provides: {{ prv }} - {% endfor %} - {% endif %} - {% if include_requires %} -+Requires: cargo - {% if md.requires|length > 0 %} - # [dependencies] - {% for req in md.requires|sort(attribute="name") %} -diff --git a/rust2rpm/inspector.py b/rust2rpm/inspector.py -index d08f1aa..6ccdbc2 100644 ---- a/rust2rpm/inspector.py -+++ b/rust2rpm/inspector.py -@@ -38,6 +38,9 @@ def main(): - print_deps(list(itertools.chain(md.requires, md.build_requires))) - if args.test_requires: - print_deps(md.test_requires) -+ if args.requires: -+ # Someone should own /usr/share/cargo/registry -+ print("cargo") - - if __name__ == "__main__": - main() --- -2.15.0 - diff --git a/0002-inspector-inject-rust-packaging-dependency-in-buildt.patch b/0002-inspector-inject-rust-packaging-dependency-in-buildt.patch deleted file mode 100644 index bfa9764..0000000 --- a/0002-inspector-inject-rust-packaging-dependency-in-buildt.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 45a5caf30060c182fb0ae03a1a7e4e707599aaa3 Mon Sep 17 00:00:00 2001 -From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> -Date: Sat, 21 Oct 2017 09:45:30 +0200 -Subject: [PATCH 2/3] inspector: inject rust-packaging dependency in buildtime - -For consistency with previous commit. - -Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> ---- - rust2rpm/inspector.py | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/rust2rpm/inspector.py b/rust2rpm/inspector.py -index 6ccdbc2..2d488b2 100644 ---- a/rust2rpm/inspector.py -+++ b/rust2rpm/inspector.py -@@ -41,6 +41,8 @@ def main(): - if args.requires: - # Someone should own /usr/share/cargo/registry - print("cargo") -+ if args.build_requires: -+ print("rust-packaging") - - if __name__ == "__main__": - main() --- -2.15.0 - diff --git a/0003-use-cp-instead-of-install.patch b/0003-use-cp-instead-of-install.patch deleted file mode 100644 index 7c7b726..0000000 --- a/0003-use-cp-instead-of-install.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 59809d4940822edaa361507ecea93b84e3c43ec0 Mon Sep 17 00:00:00 2001 -From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> -Date: Sat, 4 Nov 2017 15:32:39 +0100 -Subject: [PATCH 3/3] use cp instead of install - -We want to preserve original modes and so on. - -Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> ---- - data/macros.cargo | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/data/macros.cargo b/data/macros.cargo -index 09bbcea..e52f87c 100644 ---- a/data/macros.cargo -+++ b/data/macros.cargo -@@ -45,9 +45,9 @@ if %__cargo_is_lib; then \ - CRATE_VERSION=$(%__cargo_inspector --version Cargo.toml) \ - REG_DIR=%{buildroot}%{cargo_registry}/$CRATE_NAME-$CRATE_VERSION \ - %{__mkdir} -p $REG_DIR \ -- %__cargo package -l | xargs cp --parents -p -t $REG_DIR \ -+ %__cargo package -l | xargs %{__cp} --parents -a -t $REG_DIR \ - %if ! %{with check} \ -- %{__install} -p Cargo.toml.orig $REG_DIR/Cargo.toml \ -+ %{__cp} -a Cargo.toml.orig $REG_DIR/Cargo.toml \ - %endif \ - echo '{"files":{},"package":""}' > $REG_DIR/.cargo-checksum.json \ - fi \ --- -2.15.0 - diff --git a/rust-packaging.spec b/rust-packaging.spec index bbc94f3..651c352 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -1,17 +1,13 @@ %bcond_without check Name: rust-packaging -Version: 4 -Release: 7%{?dist} +Version: 5 +Release: 1%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT URL:
https://pagure.io/fedora-rust/rust2rpm
Source0:
https://releases.pagure.org/fedora-rust/rust2rpm/rust2rpm-%{version}.tar.xz
-# Commits since last release -Patch0001: 0001-inspector-inject-cargo-dependency-in-runtime.patch -Patch0002: 0002-inspector-inject-rust-packaging-dependency-in-buildt.patch -Patch0003: 0003-use-cp-instead-of-install.patch BuildArch: noarch ExclusiveArch: %{rust_arches} noarch @@ -89,6 +85,9 @@ py.test-%{python3_version} -v test.py %{python3_sitelib}/rust2rpm/ %changelog +* Mon Jan 08 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 5-1 +- Update to 5 + * Sat Nov 04 2017 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 4-7 - Add Obsoletes for rust-rpm-macros commit 1b0abb676f4af171ba164700431e8362f45e5c69 Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Sat Nov 4 15:48:01 2017 +0100 Add Obsoletes for rust-rpm-macros Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/rust-packaging.spec b/rust-packaging.spec index 4ee9c1f..bbc94f3 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -2,7 +2,7 @@ Name: rust-packaging Version: 4 -Release: 6%{?dist} +Release: 7%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT @@ -20,6 +20,8 @@ ExclusiveArch: %{rust_arches} noarch Requires: gawk >= 4.1.0 Requires: python3-rust2rpm = %{?epoch:%{epoch}:}%{version}-%{release} Requires: rust-srpm-macros = %{version} +# Remove in F29 +Obsoletes: rust-rpm-macros < 2-2 %description The package provides macros for building projects in Rust @@ -87,6 +89,9 @@ py.test-%{python3_version} -v test.py %{python3_sitelib}/rust2rpm/ %changelog +* Sat Nov 04 2017 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 4-7 +- Add Obsoletes for rust-rpm-macros + * Sat Nov 04 2017 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 4-6 - Use cp instead of install commit d98b1ace2dd0352476b0409f833b6a1d5073c00f Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Sat Nov 4 15:35:35 2017 +0100 Use cp instead of install Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/0001-inspector-inject-cargo-dependency-in-runtime.patch b/0001-inspector-inject-cargo-dependency-in-runtime.patch index 35e2831..675f2ca 100644 --- a/0001-inspector-inject-cargo-dependency-in-runtime.patch +++ b/0001-inspector-inject-cargo-dependency-in-runtime.patch @@ -1,7 +1,7 @@ From 9e0a872ece6f5aedf76ffd67044f22c7d0cba8aa Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Fri, 20 Oct 2017 18:04:31 +0200 -Subject: [PATCH 1/2] inspector: inject cargo dependency in runtime +Subject: [PATCH 1/3] inspector: inject cargo dependency in runtime Fixes:
https://pagure.io/fedora-rust/rust2rpm/issue/42
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> @@ -37,5 +37,5 @@ index d08f1aa..6ccdbc2 100644 if __name__ == "__main__": main() -- -2.14.2 +2.15.0 diff --git a/0002-inspector-inject-rust-packaging-dependency-in-buildt.patch b/0002-inspector-inject-rust-packaging-dependency-in-buildt.patch index 44777cf..bfa9764 100644 --- a/0002-inspector-inject-rust-packaging-dependency-in-buildt.patch +++ b/0002-inspector-inject-rust-packaging-dependency-in-buildt.patch @@ -1,7 +1,7 @@ From 45a5caf30060c182fb0ae03a1a7e4e707599aaa3 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Sat, 21 Oct 2017 09:45:30 +0200 -Subject: [PATCH 2/2] inspector: inject rust-packaging dependency in buildtime +Subject: [PATCH 2/3] inspector: inject rust-packaging dependency in buildtime For consistency with previous commit. @@ -24,5 +24,5 @@ index 6ccdbc2..2d488b2 100644 if __name__ == "__main__": main() -- -2.14.2 +2.15.0 diff --git a/0003-use-cp-instead-of-install.patch b/0003-use-cp-instead-of-install.patch new file mode 100644 index 0000000..7c7b726 --- /dev/null +++ b/0003-use-cp-instead-of-install.patch @@ -0,0 +1,31 @@ +From 59809d4940822edaa361507ecea93b84e3c43ec0 Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +Date: Sat, 4 Nov 2017 15:32:39 +0100 +Subject: [PATCH 3/3] use cp instead of install + +We want to preserve original modes and so on. + +Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +--- + data/macros.cargo | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/data/macros.cargo b/data/macros.cargo +index 09bbcea..e52f87c 100644 +--- a/data/macros.cargo ++++ b/data/macros.cargo +@@ -45,9 +45,9 @@ if %__cargo_is_lib; then \ + CRATE_VERSION=$(%__cargo_inspector --version Cargo.toml) \ + REG_DIR=%{buildroot}%{cargo_registry}/$CRATE_NAME-$CRATE_VERSION \ + %{__mkdir} -p $REG_DIR \ +- %__cargo package -l | xargs cp --parents -p -t $REG_DIR \ ++ %__cargo package -l | xargs %{__cp} --parents -a -t $REG_DIR \ + %if ! %{with check} \ +- %{__install} -p Cargo.toml.orig $REG_DIR/Cargo.toml \ ++ %{__cp} -a Cargo.toml.orig $REG_DIR/Cargo.toml \ + %endif \ + echo '{"files":{},"package":""}' > $REG_DIR/.cargo-checksum.json \ + fi \ +-- +2.15.0 + diff --git a/rust-packaging.spec b/rust-packaging.spec index edae99b..4ee9c1f 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -2,15 +2,16 @@ Name: rust-packaging Version: 4 -Release: 5%{?dist} +Release: 6%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT URL:
https://pagure.io/fedora-rust/rust2rpm
Source0:
https://releases.pagure.org/fedora-rust/rust2rpm/rust2rpm-%{version}.tar.xz
-#
https://pagure.io/fedora-rust/rust2rpm/pull-request/43
+# Commits since last release Patch0001: 0001-inspector-inject-cargo-dependency-in-runtime.patch Patch0002: 0002-inspector-inject-rust-packaging-dependency-in-buildt.patch +Patch0003: 0003-use-cp-instead-of-install.patch BuildArch: noarch ExclusiveArch: %{rust_arches} noarch @@ -86,6 +87,9 @@ py.test-%{python3_version} -v test.py %{python3_sitelib}/rust2rpm/ %changelog +* Sat Nov 04 2017 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 4-6 +- Use cp instead of install + * Sat Oct 21 2017 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 4-5 - Generate runtime dependencyon cargo for devel subpackages commit 6b81b17f09c4168a13a81f0c305ddd13117ef61d Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Sat Oct 21 09:58:43 2017 +0200 Generate runtime dependencyon cargo for devel subpackages Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/0001-inspector-inject-cargo-dependency-in-runtime.patch b/0001-inspector-inject-cargo-dependency-in-runtime.patch new file mode 100644 index 0000000..35e2831 --- /dev/null +++ b/0001-inspector-inject-cargo-dependency-in-runtime.patch @@ -0,0 +1,41 @@ +From 9e0a872ece6f5aedf76ffd67044f22c7d0cba8aa Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +Date: Fri, 20 Oct 2017 18:04:31 +0200 +Subject: [PATCH 1/2] inspector: inject cargo dependency in runtime + +Fixes:
https://pagure.io/fedora-rust/rust2rpm/issue/42
+Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +--- + rust2rpm/__main__.py | 1 + + rust2rpm/inspector.py | 3 +++ + 2 files changed, 4 insertions(+) + +diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py +index 0121a33..bb92fa3 100644 +--- a/rust2rpm/__main__.py ++++ b/rust2rpm/__main__.py +@@ -91,6 +91,7 @@ Provides: {{ prv }} + {% endfor %} + {% endif %} + {% if include_requires %} ++Requires: cargo + {% if md.requires|length > 0 %} + # [dependencies] + {% for req in md.requires|sort(attribute="name") %} +diff --git a/rust2rpm/inspector.py b/rust2rpm/inspector.py +index d08f1aa..6ccdbc2 100644 +--- a/rust2rpm/inspector.py ++++ b/rust2rpm/inspector.py +@@ -38,6 +38,9 @@ def main(): + print_deps(list(itertools.chain(md.requires, md.build_requires))) + if args.test_requires: + print_deps(md.test_requires) ++ if args.requires: ++ # Someone should own /usr/share/cargo/registry ++ print("cargo") + + if __name__ == "__main__": + main() +-- +2.14.2 + diff --git a/0002-inspector-inject-rust-packaging-dependency-in-buildt.patch b/0002-inspector-inject-rust-packaging-dependency-in-buildt.patch new file mode 100644 index 0000000..44777cf --- /dev/null +++ b/0002-inspector-inject-rust-packaging-dependency-in-buildt.patch @@ -0,0 +1,28 @@ +From 45a5caf30060c182fb0ae03a1a7e4e707599aaa3 Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +Date: Sat, 21 Oct 2017 09:45:30 +0200 +Subject: [PATCH 2/2] inspector: inject rust-packaging dependency in buildtime + +For consistency with previous commit. + +Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> +--- + rust2rpm/inspector.py | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/rust2rpm/inspector.py b/rust2rpm/inspector.py +index 6ccdbc2..2d488b2 100644 +--- a/rust2rpm/inspector.py ++++ b/rust2rpm/inspector.py +@@ -41,6 +41,8 @@ def main(): + if args.requires: + # Someone should own /usr/share/cargo/registry + print("cargo") ++ if args.build_requires: ++ print("rust-packaging") + + if __name__ == "__main__": + main() +-- +2.14.2 + diff --git a/rust-packaging.spec b/rust-packaging.spec index 5de07c4..edae99b 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -2,12 +2,15 @@ Name: rust-packaging Version: 4 -Release: 3%{?dist} +Release: 5%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT URL:
https://pagure.io/fedora-rust/rust2rpm
Source0:
https://releases.pagure.org/fedora-rust/rust2rpm/rust2rpm-%{version}.tar.xz
+#
https://pagure.io/fedora-rust/rust2rpm/pull-request/43
+Patch0001: 0001-inspector-inject-cargo-dependency-in-runtime.patch +Patch0002: 0002-inspector-inject-rust-packaging-dependency-in-buildt.patch BuildArch: noarch ExclusiveArch: %{rust_arches} noarch @@ -83,6 +86,9 @@ py.test-%{python3_version} -v test.py %{python3_sitelib}/rust2rpm/ %changelog +* Sat Oct 21 2017 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 4-5 +- Generate runtime dependencyon cargo for devel subpackages + * Thu Jul 27 2017 Fedora Release Engineering <releng(a)fedoraproject.org> - 4-3 - Rebuilt for
https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
commit 46f705671d983393718d94f489070362fe07317a Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> Date: Sat Oct 21 09:57:46 2017 +0200 adopt to new RPM 4.14 behavior for returning proper exit status Since RPM 4.14, it started to return exit status of last executed statement which on rawhide returns false so right condition doesn't run. Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> diff --git a/rust-packaging.spec b/rust-packaging.spec index fe71057..5de07c4 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -55,7 +55,7 @@ lang=C.UTF-8 lang=en_US.UTF-8 %endif %endif -[ -n "$lang" ] && sed -r -i -e "s|(%\{_bindir\}/cargo-inspector)|env LANG=$lang \1|" data/cargo.attr data/macros.cargo +[ -z "$lang" ] || sed -r -i -e "s|(%\{_bindir\}/cargo-inspector)|env LANG=$lang \1|" data/cargo.attr data/macros.cargo %build %py3_build commit 85772b9e87a16911d2365af1dd20ce50100e2587 Author: Fedora Release Engineering <releng(a)fedoraproject.org> Date: Thu Jul 27 18:01:59 2017 +0000 - Rebuilt for
https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
diff --git a/rust-packaging.spec b/rust-packaging.spec index 91e4eb9..fe71057 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -2,7 +2,7 @@ Name: rust-packaging Version: 4 -Release: 2%{?dist} +Release: 3%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT @@ -83,6 +83,9 @@ py.test-%{python3_version} -v test.py %{python3_sitelib}/rust2rpm/ %changelog +* Thu Jul 27 2017 Fedora Release Engineering <releng(a)fedoraproject.org> - 4-3 +- Rebuilt for
https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
+ * Sat Jul 08 2017 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 4-2 - Include license commit 4e5904b9ac6f208d08f51fd46059878856a03db4 Author: Igor Gnatenko <ignatenko(a)redhat.com> Date: Sun Jul 9 09:22:14 2017 +0200 initial import Signed-off-by: Igor Gnatenko <ignatenko(a)redhat.com> diff --git a/.gitignore b/.gitignore index e69de29..aaa8cf4 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/rust2rpm-4.tar.xz diff --git a/rust-packaging.spec b/rust-packaging.spec new file mode 100644 index 0000000..91e4eb9 --- /dev/null +++ b/rust-packaging.spec @@ -0,0 +1,105 @@ +%bcond_without check + +Name: rust-packaging +Version: 4 +Release: 2%{?dist} +Summary: RPM macros for building Rust packages on various architectures + +License: MIT +URL:
https://pagure.io/fedora-rust/rust2rpm
+Source0:
https://releases.pagure.org/fedora-rust/rust2rpm/rust2rpm-%{version}.tar.xz
+ +BuildArch: noarch +ExclusiveArch: %{rust_arches} noarch + +# gawk is needed for stripping dev-deps in macro, 4.1.0 is needed for inplace feature +Requires: gawk >= 4.1.0 +Requires: python3-rust2rpm = %{?epoch:%{epoch}:}%{version}-%{release} +Requires: rust-srpm-macros = %{version} + +%description +The package provides macros for building projects in Rust +on various architectures. + +%package -n python3-rust2rpm +Summary: Convert Rust packages to RPM +BuildRequires: python3-devel +BuildRequires: python3-setuptools +%if %{with check} +BuildRequires: python3-pytest +BuildRequires: cargo +BuildRequires: python3-semantic_version +%endif +Requires: cargo +Requires: python3-semantic_version +Requires: python3-jinja2 +Requires: python3-requests +Requires: python3-tqdm +%if 0%{?mageia} +Requires: locales-en +%endif +Obsoletes: rust2rpm < 1-8 +Provides: rust2rpm = %{version}-%{release} +%{?python_provide:%python_provide python3-rust2rpm} + +%description -n python3-rust2rpm +%{summary}. + +%prep +%autosetup -n rust2rpm-%{version} -p1 +lang= +%if (0%{?fedora} && 0%{?fedora} <= 25) || (0%{?rhel} && 0%{?rhel} <= 7) +lang=C.UTF-8 +%else +%if 0%{?mageia} +lang=en_US.UTF-8 +%endif +%endif +[ -n "$lang" ] && sed -r -i -e "s|(%\{_bindir\}/cargo-inspector)|env LANG=$lang \1|" data/cargo.attr data/macros.cargo + +%build +%py3_build + +%install +%py3_install +install -D -p -m 0644 -t %{buildroot}%{_rpmconfigdir}/macros.d data/macros.rust data/macros.cargo +install -D -p -m 0644 -t %{buildroot}%{_rpmconfigdir}/fileattrs data/cargo.attr + +%if %{with check} +%check +py.test-%{python3_version} -v test.py +%endif + +%files +%{_rpmconfigdir}/macros.d/macros.rust +%{_rpmconfigdir}/macros.d/macros.cargo +%{_rpmconfigdir}/fileattrs/cargo.attr + +%files -n python3-rust2rpm +%license LICENSE +%{_bindir}/rust2rpm +%{_bindir}/cargo-inspector +%{python3_sitelib}/rust2rpm-*.egg-info/ +%{python3_sitelib}/rust2rpm/ + +%changelog +* Sat Jul 08 2017 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 4-2 +- Include license + +* Sat Jul 08 2017 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 4-1 +- Update to 4 + +* Fri Jun 23 2017 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 3-5 +- Explicitly set rustdoc path + +* Wed Jun 21 2017 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 3-4 +- Mageia doesn't have C.UTF-8 lang + +* Wed Jun 21 2017 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 3-3 +- Switch cargo_registry to /usr/share/cargo/registry + +* Wed Jun 14 2017 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 3-2 +- Set C.UTF-8 for cargo inspector where python doesn't do locale coercing + +* Tue Jun 13 2017 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 3-1 +- Initial package diff --git a/sources b/sources index e69de29..a81110b 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +SHA512 (rust2rpm-4.tar.xz) = d8527c72f34b31086d3c6dbfae7fd25709525e5aa941d9de47efaefb07a04782d8f7c561b258145df1413fbfee5cd76e24d7d3787107aa36e2d9d1a1e6577637
1
0
0
0
Architecture specific change in rpms/perl-Test-LeakTrace.git
by githook-noreply@fedoraproject.org
02 Apr '19
02 Apr '19
The package rpms/perl-Test-LeakTrace.git has added or updated architecture specific content in its spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/perl-Test-LeakTrace.git/commit/?id=…
. Change: +%ifarch %{ix86} x86_64 ppc s390x %{arm} aarch64 ppc64 ppc64le Thanks. Full change: ============ commit 9119bc3b46180a049e5fcd07d149203d1343f57b Author: Paul Howarth <paul(a)city-fan.org> Date: Tue Apr 2 14:05:54 2019 +0100 Re-enable valgrind on ppc64 and ppc64le (see #1470030) diff --git a/.rpmlint b/.rpmlint deleted file mode 100644 index 0ab4812..0000000 --- a/.rpmlint +++ /dev/null @@ -1,4 +0,0 @@ -from Config import * - -addFilter("spelling-error %description -l en_US ok -> ") -addFilter("spelling-error %description -l en_US cmp -> ") diff --git a/perl-Test-LeakTrace.rpmlintrc b/perl-Test-LeakTrace.rpmlintrc new file mode 100644 index 0000000..0ab4812 --- /dev/null +++ b/perl-Test-LeakTrace.rpmlintrc @@ -0,0 +1,4 @@ +from Config import * + +addFilter("spelling-error %description -l en_US ok -> ") +addFilter("spelling-error %description -l en_US cmp -> ") diff --git a/perl-Test-LeakTrace.spec b/perl-Test-LeakTrace.spec index 9eda15b..409f602 100644 --- a/perl-Test-LeakTrace.spec +++ b/perl-Test-LeakTrace.spec @@ -1,25 +1,25 @@ # some arches don't have valgrind so we need to disable its support on them # Note: ppc64 and ppc64le currently have broken valgrind: #
https://bugzilla.redhat.com/show_bug.cgi?id=1470030
-%ifarch %{ix86} x86_64 ppc s390x %{arm} aarch64 +%ifarch %{ix86} x86_64 ppc s390x %{arm} aarch64 ppc64 ppc64le %global with_valgrind 1 %endif Name: perl-Test-LeakTrace Summary: Trace memory leaks Version: 0.16 -Release: 10%{?dist} +Release: 11%{?dist} License: GPL+ or Artistic URL:
https://metacpan.org/release/Test-LeakTrace
-Source0:
https://cpan.metacpan.org/authors/id/L/LE/LEEJO/Test-LeakTrace-%{version}.t…
+Source0:
https://cpan.metacpan.org/modules/by-module/Test/Test-LeakTrace-%{version}.…
# Module Build BuildRequires: coreutils BuildRequires: findutils BuildRequires: gcc BuildRequires: make -BuildRequires: perl-interpreter BuildRequires: perl-devel BuildRequires: perl-generators +BuildRequires: perl-interpreter BuildRequires: perl(ExtUtils::MakeMaker) BuildRequires: perl(inc::Module::Install) BuildRequires: perl(Module::Install::AuthorTests) @@ -106,6 +106,9 @@ make test %{_mandir}/man3/Test::LeakTrace::Script.3* %changelog +* Tue Apr 2 2019 Paul Howarth <paul(a)city-fan.org> - 0.16-11 +- Re-enable valgrind on ppc64 and ppc64le (see #1470030) + * Sat Feb 02 2019 Fedora Release Engineering <releng(a)fedoraproject.org> - 0.16-10 - Rebuilt for
https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
1
0
0
0
Architecture specific change in rpms/perl-Test-LeakTrace.git
by githook-noreply@fedoraproject.org
02 Apr '19
02 Apr '19
The package rpms/perl-Test-LeakTrace.git has added or updated architecture specific content in its spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/perl-Test-LeakTrace.git/commit/?id=…
. Change: +%ifarch %{ix86} x86_64 ppc s390x %{arm} aarch64 ppc64 ppc64le Thanks. Full change: ============ commit 9119bc3b46180a049e5fcd07d149203d1343f57b Author: Paul Howarth <paul(a)city-fan.org> Date: Tue Apr 2 14:05:54 2019 +0100 Re-enable valgrind on ppc64 and ppc64le (see #1470030) diff --git a/.rpmlint b/.rpmlint deleted file mode 100644 index 0ab4812..0000000 --- a/.rpmlint +++ /dev/null @@ -1,4 +0,0 @@ -from Config import * - -addFilter("spelling-error %description -l en_US ok -> ") -addFilter("spelling-error %description -l en_US cmp -> ") diff --git a/perl-Test-LeakTrace.rpmlintrc b/perl-Test-LeakTrace.rpmlintrc new file mode 100644 index 0000000..0ab4812 --- /dev/null +++ b/perl-Test-LeakTrace.rpmlintrc @@ -0,0 +1,4 @@ +from Config import * + +addFilter("spelling-error %description -l en_US ok -> ") +addFilter("spelling-error %description -l en_US cmp -> ") diff --git a/perl-Test-LeakTrace.spec b/perl-Test-LeakTrace.spec index 9eda15b..409f602 100644 --- a/perl-Test-LeakTrace.spec +++ b/perl-Test-LeakTrace.spec @@ -1,25 +1,25 @@ # some arches don't have valgrind so we need to disable its support on them # Note: ppc64 and ppc64le currently have broken valgrind: #
https://bugzilla.redhat.com/show_bug.cgi?id=1470030
-%ifarch %{ix86} x86_64 ppc s390x %{arm} aarch64 +%ifarch %{ix86} x86_64 ppc s390x %{arm} aarch64 ppc64 ppc64le %global with_valgrind 1 %endif Name: perl-Test-LeakTrace Summary: Trace memory leaks Version: 0.16 -Release: 10%{?dist} +Release: 11%{?dist} License: GPL+ or Artistic URL:
https://metacpan.org/release/Test-LeakTrace
-Source0:
https://cpan.metacpan.org/authors/id/L/LE/LEEJO/Test-LeakTrace-%{version}.t…
+Source0:
https://cpan.metacpan.org/modules/by-module/Test/Test-LeakTrace-%{version}.…
# Module Build BuildRequires: coreutils BuildRequires: findutils BuildRequires: gcc BuildRequires: make -BuildRequires: perl-interpreter BuildRequires: perl-devel BuildRequires: perl-generators +BuildRequires: perl-interpreter BuildRequires: perl(ExtUtils::MakeMaker) BuildRequires: perl(inc::Module::Install) BuildRequires: perl(Module::Install::AuthorTests) @@ -106,6 +106,9 @@ make test %{_mandir}/man3/Test::LeakTrace::Script.3* %changelog +* Tue Apr 2 2019 Paul Howarth <paul(a)city-fan.org> - 0.16-11 +- Re-enable valgrind on ppc64 and ppc64le (see #1470030) + * Sat Feb 02 2019 Fedora Release Engineering <releng(a)fedoraproject.org> - 0.16-10 - Rebuilt for
https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
1
0
0
0
Architecture specific change in rpms/python-pillow.git
by githook-noreply@fedoraproject.org
02 Apr '19
02 Apr '19
The package rpms/python-pillow.git has added or updated architecture specific content in its spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/python-pillow.git/commit/?id=e91194…
. Change: +%ifarch s390x Thanks. Full change: ============ commit e91194e0eeb28cac4abefa24a2b81f10de4a113c Author: Sandro Mani <manisandro(a)gmail.com> Date: Tue Apr 2 14:15:18 2019 +0200 Update to 6.0.0 diff --git a/.gitignore b/.gitignore index 42cb62e..8b8c609 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,4 @@ /Pillow-5.2.0.tar.gz /Pillow-5.3.0.tar.gz /Pillow-5.4.1.tar.gz +/Pillow-6.0.0.tar.gz diff --git a/python-pillow.spec b/python-pillow.spec index 7a990c7..141d7a3 100644 --- a/python-pillow.spec +++ b/python-pillow.spec @@ -13,8 +13,8 @@ %global with_docs 1 Name: python-%{srcname} -Version: 5.4.1 -Release: 4%{?dist} +Version: 6.0.0 +Release: 1%{?dist} Summary: Python image processing library # License: see
http://www.pythonware.com/products/pil/license.htm
@@ -28,6 +28,7 @@ BuildRequires: ghostscript BuildRequires: lcms2-devel BuildRequires: libimagequant-devel BuildRequires: libjpeg-devel +BuildRequires: libraqm-devel BuildRequires: libtiff-devel BuildRequires: libwebp-devel BuildRequires: openjpeg2-devel @@ -229,7 +230,11 @@ ln -s $PWD/Images $PWD/build/%py2_libbuilddir/Images cp -R $PWD/Tests $PWD/build/%py2_libbuilddir/Tests cp -R $PWD/selftest.py $PWD/build/%py2_libbuilddir/selftest.py pushd build/%py2_libbuilddir +%ifarch s390x +PYTHONPATH=$PWD %{__python2} selftest.py || : +%else PYTHONPATH=$PWD %{__python2} selftest.py +%endif popd %if 0%{?with_python3} @@ -238,7 +243,11 @@ ln -s $PWD/Images $PWD/build/%py3_libbuilddir/Images cp -R $PWD/Tests $PWD/build/%py3_libbuilddir/Tests cp -R $PWD/selftest.py $PWD/build/%py3_libbuilddir/selftest.py pushd build/%py3_libbuilddir +%ifarch s390x +PYTHONPATH=$PWD %{__python3} selftest.py || : +%else PYTHONPATH=$PWD %{__python3} selftest.py +%endif popd %endif @@ -300,6 +309,9 @@ popd %changelog +* Tue Apr 02 2019 Sandro Mani <manisandro(a)gmail.com> - 6.0.0-1 +- Update to 6.0.0 + * Sun Mar 10 2019 Sandro Mani <manisandro(a)gmail.com> - 5.4.1-4 - Drop python2-pillow-doc diff --git a/sources b/sources index 2d7df53..c0db099 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Pillow-5.4.1.tar.gz) = 20b75ab50df7e9545c76d66ad585922d1f86fbcf8df9d2566882ab8929c3122573b9ec622766523ec46f5e7a98740cc78ff192e3e8f08ab0b77a7f2b033a7f62 +SHA512 (Pillow-6.0.0.tar.gz) = c5fbe1432d576fe4a70a15fa7a70a446ccbcb247fbd4c3605917fa26a6345eb9319c0153dba7637d521c358963f2f06f525219aa1af1502da2565d54dceef4c5
1
0
0
0
Architecture specific change in rpms/reactfx.git
by githook-noreply@fedoraproject.org
02 Apr '19
02 Apr '19
The package rpms/reactfx.git has added or updated architecture specific content in its spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/reactfx.git/commit/?id=6aa0669002c3…
. Change: +ExclusiveArch: %{ix86} x86_64 noarch Thanks. Full change: ============ commit 6aa0669002c34c39d1bfc82798bc981ffd96224e Author: Jonny Heggheim <hegjon(a)gmail.com> Date: Tue Apr 2 10:25:48 2019 +0200 initial package diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5de0c33 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/reactfx-2.0.tar.gz diff --git a/reactfx.spec b/reactfx.spec new file mode 100644 index 0000000..b51347c --- /dev/null +++ b/reactfx.spec @@ -0,0 +1,69 @@ +Name: reactfx +Version: 2.0 +Release: 1.M5%{?dist} +Summary: Reactive event streams for JavaFX + +License: BSD +URL:
http://www.reactfx.org/
+Source0:
https://github.com/TomasMikula/ReactFX/archive/v%{version}-M5.tar.gz#/%{nam…
+Patch0: remove-missing-test-dependencies.patch + +#openjfx is x86 and x86_64 only +ExclusiveArch: %{ix86} x86_64 noarch +BuildArch: noarch +BuildRequires: gradle-local + +Requires: javafx +BuildRequires: javafx +BuildRequires: javafx-devel +BuildRequires: mvn(org.hamcrest:hamcrest-library) + +%description +ReactFX is an exploration of (functional) reactive programming techniques for +JavaFX. These techniques usually result in more concise code, less side effects +and less inversion of control, all of which improve the readability of code. + +Initial inspiration came from the Principles of Reactive Programming course and +the RxJava library. There are, however, important differences from RxJava. + +%package javadoc +Summary: Javadoc for %{name} + +%description javadoc +This package contains the API documentation for %{name}. + +%prep +%setup -q -n ReactFX-%{version}-M5 + +%patch0 -p1 + +%build +#Missing test dependencies: +#mvn(com.pholser:junit-quickcheck-core) +#mvn(com.pholser:junit-quickcheck-generators) +#mvn(org.junit.contrib:junit-theories) +rm -f reactfx/src/test/java/org/reactfx/util/SparseListTest.java + +#Swing Tests +rm -f reactfx/src/test/java/org/reactfx/AwaitTest.java \ + reactfx/src/test/java/org/reactfx/SuccessionReducingTest.java \ + reactfx/src/test/java/org/reactfx/TicksTest.java \ + reactfx/src/test/java/org/reactfx/value/AnimatedValTest.java + + +%gradle_build + +%install +%mvn_install -J reactfx/build/docs/javadoc + +%files -f .mfiles +%doc README.md +%license LICENSE + +%files javadoc -f .mfiles-javadoc +%doc README.md +%license LICENSE + +%changelog +* Fri Jul 14 2017 Jonny Heggheim <hegjon(a)gmail.com> - 2.0-1.M5 +- initial package diff --git a/remove-missing-test-dependencies.patch b/remove-missing-test-dependencies.patch new file mode 100644 index 0000000..9aa5f36 --- /dev/null +++ b/remove-missing-test-dependencies.patch @@ -0,0 +1,14 @@ +diff --git a/reactfx/build.gradle b/reactfx/build.gradle +index cc8e5e1..e9edbc1 100644 +--- a/reactfx/build.gradle ++++ b/reactfx/build.gradle +@@ -6,9 +6,6 @@ group = 'org.reactfx' + dependencies { + testCompile group: 'junit', name: 'junit', version: '4.12' + testCompile group: 'org.hamcrest', name: 'hamcrest-library', version: '1.3' +- testCompile group: 'org.junit.contrib', name: 'junit-theories', version: '4.12' +- testCompile group: 'com.pholser', name: 'junit-quickcheck-core', version: '0.4' +- testCompile group: 'com.pholser', name: 'junit-quickcheck-generators', version: '0.4' + } + + javadoc { diff --git a/sources b/sources new file mode 100644 index 0000000..0b1269c --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (reactfx-2.0.tar.gz) = 9be85f26ed20a5cea260c39b65e250c054277782d17497b1df504fe56dd26e777d3dc77d41a6ff9170e580c184958617051e4c15ff53133bbb3c0e33fb02f65f
1
0
0
0
← Newer
1
...
22
23
24
25
26
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Results per page:
10
25
50
100
200