Commit graph

243 commits

Author SHA1 Message Date
Igor Raits
b09a48a0c1
fedora-helper: Fixup comment
Signed-off-by: Igor Raits <ignatenkobrain@fedoraproject.org>
2020-05-30 18:58:12 +02:00
Igor Raits
8fee5adf47
fedora-helper: Do not fail if unlink() fails
Signed-off-by: Igor Raits <ignatenkobrain@fedoraproject.org>
2020-05-30 18:43:56 +02:00
Igor Raits
979ccdb601
fedora-helper: Do not create CACHEDIR twice
Signed-off-by: Igor Raits <ignatenkobrain@fedoraproject.org>
2020-05-30 18:40:40 +02:00
Igor Raits
fdf954cd36
fedora-helper: Clarify how to generate binary license with dynamic BuildRequires
Signed-off-by: Igor Raits <ignatenkobrain@fedoraproject.org>
2020-05-30 18:39:58 +02:00
Igor Raits
d1ee7ed95c
Add tool that helps with maintenance in Fedora
Most likely there are some missing checks for None and the program may
segfault, but this can be fixed in future.

Signed-off-by: Igor Raits <ignatenkobrain@fedoraproject.org>
2020-05-30 18:32:28 +02:00
Michel Alexandre Salim
850b1ab5a2 Add mapping for LGPL-3.0-or-later to LGPLv3+
see https://spdx.org/licenses/
2020-05-22 17:09:56 -07:00
Igor Raits
ca9fc7e466
buildsys: release++
Signed-off-by: Igor Raits <ignatenkobrain@fedoraproject.org>
2020-05-22 15:54:31 +02:00
Thomas Jarosch
90d0e85da2
Fix up Cargo.toml.orig error message that started to appear with Rust 1.43.0
+ /usr/bin/env CARGO_HOME=.cargo RUSTC_BOOTSTRAP=1 /opt/rust/bin/cargo package -l
+ grep -w -v Cargo.lock
+ xargs -d '\n' /bin/cp --parents -a -t /user/rpmbuild/BUILDROOT/rust-term_size-0.3.0-1.i2n.x86_64/datastore/dev/rust/cargo/registry/term_size-0.3.0
warning: No (git) VCS found for `/datastore/rpmbuild/BUILD/term_size-0.3.0`
/bin/cp: cannot stat 'Cargo.toml.orig': No such file or directory

Signed-off-by: Igor Raits <ignatenkobrain@fedoraproject.org>
2020-05-02 19:12:54 +02:00
Alberto Planas
aa8f8a1f10 metadata: support versions like X.*.* 2020-02-18 17:50:26 +01:00
Josh Stone
b4581d8f5b Use cargo install --no-track with cargo 1.41
In cargo 1.41, `cargo install` adds a new `.crates2.json` file in the
install root for tracking version upgrades. This would be another file
that `%cargo_install` should remove afterward, but there is also a new
`--no-track` option which disables such metadata files altogether.

This update should be coordinated with the Rust toolchain update in the
distro, e.g. with rust-packaging `Requires: cargo >= 1.41`. The new
option will be rejected as an unstable option on earlier versions.
2020-01-30 22:02:59 -08:00
Igor Gnatenko
e671086e38
buildsys: release++
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-12-20 18:09:46 +01:00
Igor Gnatenko
509c9ca267
metadata: Support "renamed" dependencies
For example,

```toml
[dependencies]
open-ssl = { version="0.10", package = "openssl", optional = true }
[features]
openssl = ["actix-tls/openssl", "awc/openssl", "open-ssl"]
```

would end up previously with just +openssl subpackage with dependency on
crate(openssl). Now we create +open-ssl subpackage with dependency on
crate(openssl) and +openssl subpackage with dependencies on
crate(actix-tls/openssl), crate(awc/openssl) and +open-ssl subpackage.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-12-20 17:46:55 +01:00
Igor Gnatenko
b2d348bd41
inspector: Add support for multiple features
Fixes: https://pagure.io/fedora-rust/rust2rpm/issue/103
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-12-16 08:02:47 +01:00
Igor Gnatenko
94e3528e8f
templates: Generate files entry with no-tilde
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-12-13 22:05:04 +01:00
Igor Gnatenko
d20f990832
buildsys: release++
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-12-13 21:42:31 +01:00
Igor Gnatenko
150aca7d2a
metadata: Fix setting up tilde version in RPM
Fixes: https://pagure.io/fedora-rust/rust2rpm/issue/101
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-12-13 21:41:39 +01:00
Igor Gnatenko
c61d9d6879
Revert "metadata: Set tilde separator for rust2rpm.Metadata.version"
This is not full fix, unfortunately since it breaks cargo-inspect. Paths
on the file system are still with `-`.

This reverts commit cfd3150663.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-12-13 21:17:26 +01:00
Igor Gnatenko
cfd3150663
metadata: Set tilde separator for rust2rpm.Metadata.version
Otherwise we can't really package pre-release versions anymore :/

Fixes: https://pagure.io/fedora-rust/rust2rpm/issue/101
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-12-13 21:09:58 +01:00
Igor Gnatenko
c5e398bca6
buildsys: release++
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-12-04 07:56:50 +01:00
Igor Gnatenko
47c75b2078
Add --no-dynamic-buildrequires options
And set Fedora's default behavior is to enable DynamicBuildRequires.

All Fedora crates use dynamic BuildRequires and are built only in
Rawhide and is unlikely that anybody is building hundreds of crates
outside of Fedora infrastructure.

Closes: https://pagure.io/fedora-rust/rust2rpm/issue/97
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-12-03 19:23:18 +01:00
Igor Gnatenko
a6bde5599a
Pass --cap-lints=warn to the RUSTFLAGS
It is simply impossible to fight against people putting
 #![deny(warnings)] into the code…

Closes: https://pagure.io/fedora-rust/rust2rpm/issue/98
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-12-03 19:11:20 +01:00
dd5bd74495 licensing: add bsd-2-clause-patent
https://fedoraproject.org/wiki/Licensing/BSD-2-Clause-Patent
https://spdx.org/licenses/BSD-2-Clause-Patent
The table is now up-to-date wrt. to
https://fedoraproject.org/wiki/Licensing:Main#SoftwareLicenses.
2019-11-30 14:02:54 +01:00
00570415d4 licensing: add 0BSD
https://www.spinics.net/linux/fedora/fedora-legal/msg03346.html

Fixes #96.
2019-11-30 13:54:20 +01:00
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
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