diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a2e8028 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/exa-0.8.0.crate diff --git a/0001-Update-log-to-0.4-and-env_logger-to-0.5.patch b/0001-Update-log-to-0.4-and-env_logger-to-0.5.patch new file mode 100644 index 0000000..1749fe9 --- /dev/null +++ b/0001-Update-log-to-0.4-and-env_logger-to-0.5.patch @@ -0,0 +1,39 @@ +From eff7122bb25f9fdad836785d3b2a6f29cdcdd040 Mon Sep 17 00:00:00 2001 +From: Laurent Arnoud +Date: Thu, 3 May 2018 19:34:20 +0200 +Subject: [PATCH] Update log to 0.4 and env_logger to 0.5 + +No change needed for ansi_term to 0.11 +--- + src/bin/main.rs | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +diff --git a/src/bin/main.rs b/src/bin/main.rs +index 4140a27..ffb40a8 100644 +--- a/src/bin/main.rs ++++ b/src/bin/main.rs +@@ -62,17 +62,15 @@ pub fn configure_logger() { + None => false, + }; + +- let mut logs = env_logger::LogBuilder::new(); ++ let mut logs = env_logger::Builder::new(); + if present { +- logs.filter(None, log::LogLevelFilter::Debug); ++ logs.filter(None, log::LevelFilter::Debug); + } + else { +- logs.filter(None, log::LogLevelFilter::Off); ++ logs.filter(None, log::LevelFilter::Off); + } + +- if let Err(e) = logs.init() { +- writeln!(stderr(), "Failed to initialise logger: {}", e).unwrap(); +- } ++ logs.init() + } + + +-- +2.20.1 + diff --git a/0001-Upgrade-libgit2.patch b/0001-Upgrade-libgit2.patch new file mode 100644 index 0000000..6915a25 --- /dev/null +++ b/0001-Upgrade-libgit2.patch @@ -0,0 +1,54 @@ +From f757300718b1861852d4a33459385eaf921d69e7 Mon Sep 17 00:00:00 2001 +From: Benjamin Sago +Date: Sun, 11 Mar 2018 11:25:06 +0000 +Subject: [PATCH] Upgrade libgit2 + +The ogham/git2-rs repository that exa uses in the Vagrant VM has also been updated. The only casualty was that some constants got namespaced. +--- + src/fs/feature/git.rs | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +diff --git a/src/fs/feature/git.rs b/src/fs/feature/git.rs +index 6ecf8e9..9cc1b7f 100644 +--- a/src/fs/feature/git.rs ++++ b/src/fs/feature/git.rs +@@ -274,12 +274,12 @@ fn reorient(path: &Path) -> PathBuf { + /// The character to display if the file has been modified, but not staged. + fn working_tree_status(status: git2::Status) -> f::GitStatus { + match status { +- s if s.contains(git2::STATUS_WT_NEW) => f::GitStatus::New, +- s if s.contains(git2::STATUS_WT_MODIFIED) => f::GitStatus::Modified, +- s if s.contains(git2::STATUS_WT_DELETED) => f::GitStatus::Deleted, +- s if s.contains(git2::STATUS_WT_RENAMED) => f::GitStatus::Renamed, +- s if s.contains(git2::STATUS_WT_TYPECHANGE) => f::GitStatus::TypeChange, +- _ => f::GitStatus::NotModified, ++ s if s.contains(git2::Status::WT_NEW) => f::GitStatus::New, ++ s if s.contains(git2::Status::WT_MODIFIED) => f::GitStatus::Modified, ++ s if s.contains(git2::Status::WT_DELETED) => f::GitStatus::Deleted, ++ s if s.contains(git2::Status::WT_RENAMED) => f::GitStatus::Renamed, ++ s if s.contains(git2::Status::WT_TYPECHANGE) => f::GitStatus::TypeChange, ++ _ => f::GitStatus::NotModified, + } + } + +@@ -287,11 +287,11 @@ fn working_tree_status(status: git2::Status) -> f::GitStatus { + /// has been staged. + fn index_status(status: git2::Status) -> f::GitStatus { + match status { +- s if s.contains(git2::STATUS_INDEX_NEW) => f::GitStatus::New, +- s if s.contains(git2::STATUS_INDEX_MODIFIED) => f::GitStatus::Modified, +- s if s.contains(git2::STATUS_INDEX_DELETED) => f::GitStatus::Deleted, +- s if s.contains(git2::STATUS_INDEX_RENAMED) => f::GitStatus::Renamed, +- s if s.contains(git2::STATUS_INDEX_TYPECHANGE) => f::GitStatus::TypeChange, +- _ => f::GitStatus::NotModified, ++ s if s.contains(git2::Status::INDEX_NEW) => f::GitStatus::New, ++ s if s.contains(git2::Status::INDEX_MODIFIED) => f::GitStatus::Modified, ++ s if s.contains(git2::Status::INDEX_DELETED) => f::GitStatus::Deleted, ++ s if s.contains(git2::Status::INDEX_RENAMED) => f::GitStatus::Renamed, ++ s if s.contains(git2::Status::INDEX_TYPECHANGE) => f::GitStatus::TypeChange, ++ _ => f::GitStatus::NotModified, + } + } +-- +2.16.2 + diff --git a/README.md b/README.md new file mode 100644 index 0000000..6fb7907 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# rust-exa + +The rust-exa package \ No newline at end of file diff --git a/dead.package b/dead.package deleted file mode 100644 index c14523d..0000000 --- a/dead.package +++ /dev/null @@ -1 +0,0 @@ -Module-only diff --git a/exa-fix-metadata.diff b/exa-fix-metadata.diff new file mode 100644 index 0000000..29c9e46 --- /dev/null +++ b/exa-fix-metadata.diff @@ -0,0 +1,63 @@ +--- exa-0.8.0/Cargo.toml 1970-01-01T01:00:00+01:00 ++++ exa-0.8.0/Cargo.toml 2019-02-10T11:25:06.307236+01:00 +@@ -40,7 +40,7 @@ + version = "0.4.5" + + [dependencies.lazy_static] +-version = "0.2" ++version = "1" + + [dependencies.term_grid] + version = "0.1.6" +@@ -51,26 +51,23 @@ + [dependencies.unicode-width] + version = "0.1.4" + +-[dependencies.getopts] +-version = "0.2.14" +- + [dependencies.glob] + version = "0.2" + + [dependencies.log] +-version = "0.3" ++version = "0.4" + + [dependencies.num_cpus] + version = "1.3.0" + + [dependencies.users] +-version = "0.5.2" ++version = "0.7" + + [dependencies.term_size] + version = "0.3.0" + + [dependencies.ansi_term] +-version = "0.8.0" ++version = "0.11" + + [dependencies.libc] + version = "0.2.9" +@@ -79,18 +76,18 @@ + version = "1.0.7" + + [dependencies.git2] +-version = "0.6.4" ++version = "0.8" + optional = true + default-features = false + + [dependencies.env_logger] +-version = "0.3" ++version = "0.6" + + [dependencies.locale] + version = "0.2.1" + + [dependencies.scoped_threadpool] +-version = "0.1.*" ++version = "0.1" + + [dependencies.number_prefix] + version = "0.2.3" diff --git a/rust-exa.spec b/rust-exa.spec new file mode 100644 index 0000000..f9a217c --- /dev/null +++ b/rust-exa.spec @@ -0,0 +1,139 @@ +# Generated by rust2rpm +%bcond_without check +# Exa is not supposed to be used as a library +%global __cargo_is_lib() false + +%global crate exa + +Name: rust-%{crate} +Version: 0.8.0 +Release: 13%{?dist} +Summary: Modern replacement for ls + +License: MIT +URL: https://crates.io/crates/exa +Source: %{crates_source} +# Initial patched metadata +# * Bump ansi_term to 0.11, remove getopts, https://github.com/ogham/exa/commit/4c3fd5483d2eff2ea1e623878ede54eaa396e09e +# * Bump env_logger to 0.6, https://github.com/ogham/exa/pull/315 +# https://github.com/ogham/exa/pull/469 +# * Bump users to 0.6, https://github.com/ogham/exa/pull/395 +# * Bump lazy_static, https://github.com/ogham/exa/pull/322 +# * Bump git2 to 0.8, https://github.com/ogham/exa/commit/f757300718b1861852d4a33459385eaf921d69e7 +# https://github.com/ogham/exa/pull/461 +Patch0: exa-fix-metadata.diff +# Make it work with new git2 +Patch1: 0001-Upgrade-libgit2.patch +# Make it work with new env_logger +Patch2: 0001-Update-log-to-0.4-and-env_logger-to-0.5.patch + +ExclusiveArch: %{rust_arches} + +BuildRequires: rust-packaging +BuildRequires: (crate(ansi_term/default) >= 0.11.0 with crate(ansi_term/default) < 0.12.0) +BuildRequires: (crate(datetime/default) >= 0.4.5 with crate(datetime/default) < 0.5.0) +BuildRequires: (crate(env_logger/default) >= 0.6.0 with crate(env_logger/default) < 0.7.0) +BuildRequires: (crate(git2) >= 0.8.0 with crate(git2) < 0.9.0) +BuildRequires: (crate(glob/default) >= 0.2.0 with crate(glob/default) < 0.3.0) +BuildRequires: (crate(lazy_static/default) >= 1.0.0 with crate(lazy_static/default) < 2.0.0) +BuildRequires: (crate(libc/default) >= 0.2.9 with crate(libc/default) < 0.3.0) +BuildRequires: (crate(locale/default) >= 0.2.1 with crate(locale/default) < 0.3.0) +BuildRequires: (crate(log/default) >= 0.4.0 with crate(log/default) < 0.5.0) +BuildRequires: (crate(natord/default) >= 1.0.7 with crate(natord/default) < 2.0.0) +BuildRequires: (crate(num_cpus/default) >= 1.3.0 with crate(num_cpus/default) < 2.0.0) +BuildRequires: (crate(number_prefix/default) >= 0.2.3 with crate(number_prefix/default) < 0.3.0) +BuildRequires: (crate(scoped_threadpool/default) >= 0.1.0 with crate(scoped_threadpool/default) < 0.2.0) +BuildRequires: (crate(term_grid/default) >= 0.1.6 with crate(term_grid/default) < 0.2.0) +BuildRequires: (crate(term_size/default) >= 0.3.0 with crate(term_size/default) < 0.4.0) +BuildRequires: (crate(unicode-width/default) >= 0.1.4 with crate(unicode-width/default) < 0.2.0) +BuildRequires: (crate(users/default) >= 0.7.0 with crate(users/default) < 0.8.0) +BuildRequires: (crate(zoneinfo_compiled/default) >= 0.4.5 with crate(zoneinfo_compiled/default) < 0.5.0) + +%global _description \ +A modern replacement for ls. + +%description %{_description} + +%package -n %{crate} +Summary: %{summary} + +%description -n %{crate} +%{summary}. + +%files -n %{crate} +%license LICENCE +%doc README.md +%{_bindir}/exa +%{_mandir}/man1/exa.1* +%dir %{_datadir}/bash-completion +%dir %{_datadir}/bash-completion/completions +%{_datadir}/bash-completion/completions/exa.bash +%dir %{_datadir}/fish +%dir %{_datadir}/fish/vendor_functions.d +%{_datadir}/fish/vendor_functions.d/exa.fish +%dir %{_datadir}/zsh +%dir %{_datadir}/zsh/site-functions +%{_datadir}/zsh/site-functions/_exa + +%prep +%autosetup -n %{crate}-%{version_no_tilde} -p1 +%cargo_prep + +%build +%cargo_build + +%install +%cargo_install +%{__install} -Dpm0644 -t %{buildroot}%{_mandir}/man1 contrib/man/exa.1 +%{__install} -Dpm0644 -T contrib/completions.bash \ + %{buildroot}%{_datadir}/bash-completion/completions/exa.bash +%{__install} -Dpm0644 -T contrib/completions.fish \ + %{buildroot}%{_datadir}/fish/vendor_functions.d/exa.fish +%{__install} -Dpm0644 -T contrib/completions.zsh \ + %{buildroot}%{_datadir}/zsh/site-functions/_exa + +%if %{with check} +%check +# https://github.com/ogham/exa/issues/318 +%cargo_test || : +%endif + +%changelog +* Sun Feb 10 2019 Igor Gnatenko - 0.8.0-13 +- Update git2 and env_logger deps + +* Sat Feb 02 2019 Fedora Release Engineering - 0.8.0-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Wed Nov 14 2018 Igor Gnatenko - 0.8.0-11 +- Adapt to new packaging + +* Fri Aug 10 2018 Josh Stone - 0.8.0-10 +- Rebuild with fixed rust-libgit2-sys-0.7.7 + +* Fri Aug 10 2018 Igor Gnatenko - 0.8.0-9 +- Rebuild for libgit2 0.27.x + +* Sat Jul 14 2018 Fedora Release Engineering - 0.8.0-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Mon Jun 25 2018 Igor Gnatenko - 0.8.0-7 +- Bump users to 0.7 + +* Mon Mar 26 2018 Josh Stone - 0.8.0-6 +- Bump ansi_term to 0.11 + +* Mon Mar 12 2018 Igor Gnatenko - 0.8.0-5 +- Bump git2 to 0.7 + +* Fri Feb 09 2018 Fedora Release Engineering - 0.8.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Mon Jan 08 2018 Igor Gnatenko - 0.8.0-3 +- Rebuild for rust-packaging v5 + +* Thu Nov 30 2017 Igor Gnatenko - 0.8.0-2 +- Bump lazy_static to 1 + +* Tue Nov 21 2017 Igor Gnatenko - 0.8.0-1 +- Initial package diff --git a/sources b/sources new file mode 100644 index 0000000..981df52 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (exa-0.8.0.crate) = 96671429c4b4a56021eb0f33a6a84eb332946690fe1bfde273ccbfa3b86d0cf0d1a47a5f28677dcd39bbfcf77d20070355428eaf6226b27313a7752ce09e773c