p-e-w / ternimal

Simulate a lifeform in the terminal
GNU General Public License v3.0
1.06k stars 31 forks source link

include license text #6

Closed ignatenkobrain closed 6 years ago

ignatenkobrain commented 6 years ago

It would help distributions if you could include full license text to repository.

p-e-w commented 6 years ago

Is there a concrete intent to package or is this just a general recommendation?

The license (GPLv3) is already clear for any human user, being stated and linked to in both the README and the source code, so the only reason to include the full license text would be a distro's packaging policy.

If you intend to package for Fedora and the only thing stopping you is the missing license file, I'll happily add it. Otherwise, I'm going to wait until someone is actually about to package it.

Incidentally, from a packaging perspective, what is the preference for Cargo vs. non-Cargo projects? Is buildability with Cargo a requirement for packaging Rust projects? See the discussion in #3.

ignatenkobrain commented 6 years ago

I'm actually packaging it ;)

%global commit 2eea4f4d0ebb94fdb3e7b732a9761198e2085da1
%global shortcommit %(c=%{commit}; echo ${c:0:7})

Name:           ternimal
Version:        0
Release:        1.20171109.git.%{shortcommit}%{?dist}
Summary:        Simulate a lifeform in the terminal

# https://github.com/p-e-w/ternimal/issues/6
License:        GPLv3+
URL:            https://github.com/p-e-w/ternimal
Source0:        %{url}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz

ExclusiveArch:  %{rust_arches}

BuildRequires:  rust-packaging

%description
%{summary}.

%prep
%autosetup -n %{name}-%{commit} -p1

%build
%{__rustc} %{__global_rustflags} ternimal.rs -o ternimal

%install
install -Dpm0755 -t %{buildroot}%{_bindir} ternimal

%files
%doc README.md
%{_bindir}/ternimal

%changelog
* Thu Nov 09 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0-1.20171109.git.2eea4f4
- Initial package

include the full license text would be a distro's packaging policy

In case of GPL-3.0+, yes. Note that for some other licenses (like Apache-2.0) it is mandatory to distribute license text along with source code. So it is always better to include full text of license.

what is the preference for Cargo vs. non-Cargo projects?

For such simple projects (1 .rs file, without dependencies) it is fine even without cargo. If you plan to add any dependencies, obviously cargo is way to go. Also we have macro for cargo stuff, so it looks a bit better. But really, no preference in this case.

Is buildability with Cargo a requirement for packaging Rust projects?

Definitely not.

ignatenkobrain commented 6 years ago

you can read about our guidelines wrt licensing here: https://fedoraproject.org/wiki/Packaging:LicensingGuidelines#License_Text

p-e-w commented 6 years ago

I'm actually packaging it ;)

Ternimal in my favorite distro? Is that really happening?!? I'm so excited! 🎆 🔥 🍾

Give me a day or so and you'll have a license file as well as an official release with a versioned tarball.

I hope that %{__global_rustflags} includes -O (optimize). Ternimal is math-heavy and runs up to ten times slower when not compiled with optimization.

ignatenkobrain commented 6 years ago
[brain@ignatenko-w541 rpms]$ rpm --eval %__global_rustflags
-Copt-level=3 -Cdebuginfo=2 -Clink-arg=-Wl,-z,relro,-z,now
ignatenkobrain commented 6 years ago

btw, one more point about cargo-or-no-cargo... if you upload crate on crates.io, users can easily do cargo install ternimal ;)

p-e-w commented 6 years ago

License text added. Tarball available on the Releases page.

ignatenkobrain commented 6 years ago

@p-e-w \o/ it is available in F27+ since today :P