Commit graph

170 commits

Author SHA1 Message Date
9036039d04 licensing: add MPL-2.0+ as equivalent to MPL-2.0
Permission to use later versions is included in the license, so the
"-or-later" part does not change anything.
https://fedoraproject.org/wiki/Licensing/MPLv2.0 says:
> 10.2. Effect of New Versions
>
> You may distribute the Covered Software under the terms of the version
> of the License under which You originally received the Covered
> Software, or under the terms of any subsequent version published by
> the license steward.

Fixes #88.
2019-11-30 13:48:19 +01:00
Alberto Planas
23e807d8ce metadata: normalize version via CargoSemVer 2019-10-30 17:28:32 +01:00
Alberto Planas
fcbf95a78e metadata: replace semantic-version with a custom parser
The library semantic-version changed a lot during the last versions,
making the Metadata class very fragile.

A custom-made semantic version parsed, based on some Cargo specifics,
has been implemented to replace the old parser.

As a result of that, new features were implemented, like the support for
wildcard expressions, as documented in the Cargo book.

Fix: #93
2019-10-28 11:19:46 +01:00
Igor Gnatenko
aaac4dd0c8
Split summary better if newline happens first
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-09-08 15:44:37 +02:00
Igor Gnatenko
b5e2db003f
Ignore Cargo.lock
Fixes: https://pagure.io/fedora-rust/rust2rpm/issue/90

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-09-08 15:44:37 +02:00
Igor Gnatenko
a9285d66aa
metadata: Split description by sentence
Otherwise things like "HTTP/2.0" will be cut in Summary.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-06-22 10:38:43 +02:00
Igor Gnatenko
e66333b901
Set cargo_args properly with dynamic_buildrequires
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-06-19 12:32:29 +02:00
Igor Gnatenko
7cc44cca85
buildsys: release++
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-06-16 17:14:52 +02:00
Igor Gnatenko
33fdcc82d2
Set BuildArch: noarch with %__cargo_skip_build
We do not need to spawn 7 tasks for each architecture to copy same files
over and over.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-06-09 16:00:25 +02:00
Igor Gnatenko
4c891852b5
Implement %__cargo_skip_build
We need to have an easy way how to skip doing 'cargo build' to speedup a
module builds.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-06-09 16:00:25 +02:00
Igor Gnatenko
adba767c55
Add support for --suffix
For compat packages.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-06-09 16:00:08 +02:00
d9b2cef72e Add --translate-license to translate a specific license
Before, all known licenses would be listed by --show-license-map, so
grepping the list was enough to find a license. But now we support
alternative syntaxes, so this is not enough. Add a call to translate a
specific license:

$ python3 -m rust2rpm --translate-license GPL-3.0+
Upstream license tag GPL-3.0+ (GPL-3.0-or-later) translated to GPLv3+
GPLv3+

$ python3 -m rust2rpm --show-license-map | grep -F GPL-3.0+
(nada)
2019-06-02 15:51:08 +02:00
04f63e0f20 Add AGPL-3.0-or-later and automatically translate "+" suffix into "-or-later"
This way we don't need to add all the deprecated variants with "+" suffix.

Fixes #84.
2019-06-02 15:51:05 +02:00
Igor Gnatenko
e1cfff3216
Remove more common prefixes
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-05-15 20:00:59 +02:00
Igor Gnatenko
16085843c8
Use %{expand:…} for description
So that we stop playing with escaping.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-05-15 08:11:58 +02:00
Igor Gnatenko
216de8e427
Mangle summary automagically
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-05-15 08:11:58 +02:00
3666344959 Bump classifiers
This software is used, so let's at least it's beta.
Seems to work fine with python3.8, let's say that.
2019-05-07 08:41:20 +02:00
6de75b87af Include rust2rpm version info in the generated spec file
Fixes #77.
2019-05-07 08:41:20 +02:00
253d1f6021 Check /usr/lib/os-release in addition to /etc/os-release 2019-05-07 08:41:20 +02:00
aa9fc8646a Move version string to the python code
This way the python module "knows" its own version. To avoid duplication,
read the value back from setup.py. The reader function only needs to
support the specific format used in the code, so it can be very simplistic.
2019-05-07 08:41:20 +02:00
8d21ef1ee4 licensing: add "-or-later" variants for GPL licenses
SPDX actually deprecated the variants with "+" and "-or-later" is now
recommneded. They both map to the same identiefiers on Fedora side.
2019-05-07 08:32:25 +02:00
1f64bd9564 licensing: translate GPL[123]+
The "+" variants were described in the comment, but not explicitly
listed in the table. Let's just replace the comment with
machine-readable lines.

Fixes #79.
2019-05-07 08:31:02 +02:00
Igor Gnatenko
b1df4d587f
templates: Do not put empty line after %changelog
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-05-06 10:43:05 +02:00
Igor Gnatenko
24255ef3ee buildsys: release++
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-05-05 09:11:32 +02:00
Igor Gnatenko
723cd994d4 templates: Always put upstream license
Let's just be consistent across all spec files.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-05-05 09:11:32 +02:00
Igor Gnatenko
880493e4b6 setup.py: Update version to 8
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-05-05 09:11:32 +02:00
Neal Gompa
a41e9755ec Fix packager identity detection to use fallbacks properly
Setting 'None' to the 'packager' field caused generated
spec files to have the packager identity of "None" instead
of using the fallbacks as specified in the spec template.

This adjustment makes the spec template fallbacks for the
packager identity work as expected.

Signed-off-by: Neal Gompa <ngompa13@gmail.com>
2019-05-04 20:43:54 -04:00
Igor Gnatenko
c54d2409da
Remove temporary Cargo.toml.deps
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-04-28 07:47:06 +02:00
Igor Gnatenko
ecc850755e
macros: Use %{build_rustflags} convention
But keep %__global_rustflags around for compatibility.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-04-23 21:14:51 +02:00
Igor Gnatenko
3076bbaa3a
macros: Pass -Ccodegen-units=1 in RUSTFLAGS
This has good impact on performance and binary size at cost of
compilation time. As nice side effect, it fixes bug which breaks
compilation of binaries in Fedora Rawhide.

For example, ffsend binary went from 107M to 70M.

References: https://bugzilla.redhat.com/show_bug.cgi?id=1701339
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-04-23 21:14:51 +02:00
Igor Gnatenko
bbd8cb71d3
buildsys: release++
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-04-23 15:58:16 +02:00
Igor Gnatenko
b8e44897fa
Drop rustcfg req
We don't need it right now since we don't support filtering unneeded
dependencies on cargo level.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-04-23 15:58:16 +02:00
Igor Gnatenko
ea5fcb0dfe
Read '_rust2rpm.conf' as well
OBS doesn't allow importing files starting with `.` so we need another
file name.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
2019-04-23 15:52:35 +02:00
Neal Gompa
f83b3dd937 Allow controlling packager identity through environment variables
In order to support more flexible automation mechanisms, allow
injecting the packager identity through environment variables as an
override from the regular detection mechanisms.

Moreover, there are cases where we want to force the fallback identity,
so we now have a way to force that through an environment variable.

These are intended to be used with multi-user automation systems so
that the correct identity is set regardless of what the host system
is actually configured with.

Signed-off-by: Neal Gompa <ngompa13@gmail.com>
2019-04-23 09:27:37 -04:00
Igor Gnatenko
c57afa88aa
Add support for %generate_buildrequires
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-04-16 11:46:27 +02:00
Neal Gompa
60bfd2da89 Fix the URL to the openSUSE Bugzilla for openSUSE spec headers
Signed-off-by: Neal Gompa <ngompa13@gmail.com>
2019-03-16 12:26:34 -04:00
Igor Gnatenko
95c1954a06
Use new-style date in changelog (with TZ) for Fedora
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-03-16 15:51:26 +01:00
Igor Gnatenko
dd7e794e51
Use UTC for patch files
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-03-16 15:49:36 +01:00
Igor Gnatenko
2b20b9e369
trivial: Use same codestyle
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-03-16 15:15:49 +01:00
Igor Gnatenko
47597fcad7
Add support for --all-features
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-03-16 15:08:43 +01:00
Igor Gnatenko
5d7a0b2444
Do not pull optional dependencies
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-03-14 10:37:37 +01:00
Igor Gnatenko
f53b3e3188
templates: Use %{_description} for %{crate}
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-03-14 10:36:34 +01:00
Igor Gnatenko
7f0a499ff3
data: Escape \n properly
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-03-10 10:14:28 +01:00
Igor Gnatenko
84a73bfa24
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@fedoraproject.org>
2019-02-17 17:19:25 +01:00
Igor Gnatenko
00c0c5cec9 Add support for prerelease versions
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-01-28 09:15:18 +00:00
b0d2756917 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.
2019-01-26 11:22:31 +00:00
7c00b0f290 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.
2019-01-26 11:22:31 +00:00
Josh Stone
a04e95bc4f Set the install root in .cargo/config 2018-12-07 13:59:03 -08:00
Josh Stone
b4e2503829 Set CARGO_HOME to the local .config 2018-12-07 13:58:41 -08:00
Neal Gompa
294c6f571c 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@gmail.com>
2018-11-11 11:06:27 -05:00