From f5d6c51e4a0b7a5bc90280c14b11d6bcdc2e3d93 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Sat, 30 Sep 2023 21:36:26 +0200 Subject: [PATCH] Initial Fedora packaging (rhbz#2241553) --- .gitignore | 1 + 0001-Disable-cargo-clippy-test.patch | 38 ++++++++++ snapshot.spec | 104 +++++++++++++++++++++++++++ sources | 1 + 4 files changed, 144 insertions(+) create mode 100644 .gitignore create mode 100644 0001-Disable-cargo-clippy-test.patch create mode 100644 snapshot.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ffe92c0 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/snapshot-45.0.tar.xz diff --git a/0001-Disable-cargo-clippy-test.patch b/0001-Disable-cargo-clippy-test.patch new file mode 100644 index 0000000..ce063b1 --- /dev/null +++ b/0001-Disable-cargo-clippy-test.patch @@ -0,0 +1,38 @@ +From d63c1af96dd20a7d7fabcf7a5e0f0b64944fe28e Mon Sep 17 00:00:00 2001 +From: Kalev Lember +Date: Sat, 30 Sep 2023 20:08:34 +0200 +Subject: [PATCH] Disable cargo clippy test + +Linting doesn't make sense as part of downstream builds. +--- + src/meson.build | 14 -------------- + 1 file changed, 14 deletions(-) + +diff --git a/src/meson.build b/src/meson.build +index 33ff42e..cb86977 100644 +--- a/src/meson.build ++++ b/src/meson.build +@@ -52,20 +52,6 @@ cargo_build = custom_target( + ] + ) + +-test ( +- 'Cargo clippy', +- cargo, +- args: [ +- 'clippy', +- '--no-deps', +- cargo_options, +- ], +- env: [ +- cargo_env, +- ], +- timeout: 400, # cargo might take a bit of time sometimes +-) +- + test ( + 'Cargo tests', + cargo, +-- +2.41.0 + diff --git a/snapshot.spec b/snapshot.spec new file mode 100644 index 0000000..82466cc --- /dev/null +++ b/snapshot.spec @@ -0,0 +1,104 @@ +%bcond_without check + +%global tarball_version %%(echo %{version} | tr '~' '.') + +Name: snapshot +Version: 45.0 +Release: %autorelease +Summary: Take pictures and videos + +# (MIT OR Apache-2.0) AND Unicode-DFS-2016 +# Apache-2.0 OR MIT +# Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT +# GPL-3.0-or-later +# MIT +# MIT OR Apache-2.0 +# MIT OR Apache-2.0 OR Zlib +# MPL-2.0 +# Unlicense OR MIT +# Zlib OR Apache-2.0 OR MIT +License: (MIT OR Apache-2.0) AND Unicode-DFS-2016 AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND GPL-3.0-or-later AND MIT AND (MIT OR Apache-2.0) AND (MIT OR Apache-2.0 OR Zlib) AND MPL-2.0 AND (Unlicense OR MIT) AND (Zlib OR Apache-2.0 OR MIT) +# LICENSE.dependencies contains a full license breakdown +URL: https://gitlab.gnome.org/GNOME/snapshot +Source: https://download.gnome.org/sources/snapshot/45/snapshot-%{tarball_version}.tar.xz + +# Downstream patch to disable linting as part of self tests +Patch: 0001-Disable-cargo-clippy-test.patch + +# https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval +ExcludeArch: %{ix86} + +BuildRequires: cargo-rpm-macros +BuildRequires: meson +BuildRequires: pkgconfig(glib-2.0) +BuildRequires: pkgconfig(gstreamer-1.0) +BuildRequires: pkgconfig(gstreamer-plugins-bad-1.0) +BuildRequires: pkgconfig(gstreamer-video-1.0) +BuildRequires: pkgconfig(gtk4) +BuildRequires: pkgconfig(libadwaita-1) +BuildRequires: /usr/bin/appstream-util +BuildRequires: /usr/bin/desktop-file-validate + +# For camerabin +Requires: gstreamer1-plugins-bad-free%{_isa} +# For hicolor icon theme directories +Requires: hicolor-icon-theme + +Provides: bundled(rust-aperture) = 0.3.1 + +%description +Take pictures and videos on your computer, tablet, or phone. + + +%prep +%autosetup -p1 -n snapshot-%{tarball_version} + +rm -rf vendor +%cargo_prep + + +%generate_buildrequires +%cargo_generate_buildrequires +cd aperture +%cargo_generate_buildrequires +cd ~- + + +%build +%meson +%meson_build + +%cargo_license_summary +%{cargo_license} > LICENSE.dependencies + + +%install +%meson_install + +%find_lang snapshot --with-gnome + + +%if %{with check} +%check +%meson_test + +appstream-util validate-relax --nonet $RPM_BUILD_ROOT%{_metainfodir}/org.gnome.Snapshot.metainfo.xml +desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/org.gnome.Snapshot.desktop +%endif + + +%files -f snapshot.lang +%license LICENSE +%license LICENSE.dependencies +%doc README.md +%{_bindir}/snapshot +%{_datadir}/applications/org.gnome.Snapshot.desktop +%{_datadir}/glib-2.0/schemas/org.gnome.Snapshot.gschema.xml +%{_datadir}/icons/hicolor/scalable/apps/org.gnome.Snapshot*.svg +%{_datadir}/icons/hicolor/symbolic/apps/org.gnome.Snapshot-symbolic.svg +%{_datadir}/snapshot/ +%{_metainfodir}/org.gnome.Snapshot.metainfo.xml + + +%changelog +%autochangelog diff --git a/sources b/sources new file mode 100644 index 0000000..6375a8f --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (snapshot-45.0.tar.xz) = a0cfc7bb45f6fd9b14ab9a4262ee614c3b57bb6e68d16fae0f9cb4ce02fd631316f9be28e86915b74480c1ef2b666ea4b10ea66be46f90ed9d28de77258a50bc