%global debug_package %{nil} %global uuid netspeedsimplified %global extid %{uuid}@prateekmedia.extension Name: gnome-shell-extension-net-speed-simplified Version: 46 Release: 1%{?dist} Summary: A Net Speed monitor With Loads of Customization License: GPL-3.0-or-later URL: https://github.com/prateekmedia/netspeedsimplified Source0: %{url}/releases/download/%{version}/%{extid}-%{version}.zip BuildArch: noarch BuildRequires: glib2-devel Requires: gnome-shell %description A Net Speed monitor With Loads of Customization. Supports GNOME 45 through 50. For GNOME Shell versions earlier than 45, use previous releases of this extension. %prep # Robust unpack: some upstream zips create a top-level directory with # characters (like '@' or spaces) or include a __MACOSX wrapper. We # extract the archive and locate the directory that contains the # extension (identified by extension.js), then move it to a stable # name (%{uuid}-%{version}) so the rest of the spec can work reliably. rm -rf %{uuid}-%{version} # rpmuncompress is provided by rpm; use it to extract the archive /usr/lib/rpm/rpmuncompress -x %{SOURCE0} # find a directory that contains extension.js found=0 for d in *; do if [ -d "$d" ] && [ -f "$d/extension.js" ]; then mv -- "$d" "%{uuid}-%{version}" found=1 break fi done # if extension.js was extracted at top level (no wrapper dir), move # all files into the stable directory if [ $found -eq 0 ]; then if [ -f extension.js ]; then mkdir -p "%{uuid}-%{version}" for f in *; do [ "$f" = "%{uuid}-%{version}" ] && continue mv -- "$f" "%{uuid}-%{version}/" done found=1 fi fi if [ $found -eq 0 ]; then echo "Could not find extension files after extracting %{SOURCE0}" >&2 exit 1 fi # change into the prepared directory cd "%{uuid}-%{version}" %build # Nothing to build %install mkdir -p %{buildroot}%{_datadir}/gnome-shell/extensions/%{extid} # copy extension files to the buildroot cp -a extension.js metadata.json prefs.js stylesheet.css LICENSE \ %{buildroot}%{_datadir}/gnome-shell/extensions/%{extid}/ if [ -d schemas ]; then cp -a schemas %{buildroot}%{_datadir}/gnome-shell/extensions/%{extid}/ # compile the schemas in the installed schemas directory glib-compile-schemas %{buildroot}%{_datadir}/gnome-shell/extensions/%{extid}/schemas fi %files %license LICENSE %dir %{_datadir}/gnome-shell/extensions/%{extid} %{_datadir}/gnome-shell/extensions/%{extid} %changelog %autochangelog