middleclickclose icon indicating copy to clipboard operation
middleclickclose copied to clipboard

Shipping extension in RPM format

Open fiftydinar opened this issue 8 months ago • 9 comments

EDIT:

I removed the RPM that I hosted, as I use system-wide gnome-extensions BlueBuild module to install extensions now. It's much easier to maintain this than fiddling with RPM & COPR. https://blue-build.org/reference/modules/gnome-extensions/

I wanted to make Gnome extensions that I used, which installed system-wide for custom OS images based on Fedora.

So I originally made RPM because there was no other way to achieve what I want at the time I made the issue.

Another issue was the appliance as a Fedora packager, which is even more tedious process than making simple RPMs imo.

For anyone who wants to help on this instead of me, feel free to do so.

Here's the solid spec file example if anyone wants to continue this effort:

%global extension   middleclickclose
%global uuid        %{extension}@paolo.tranquilli.gmail.com
%global gettext     org.gnome.shell.extensions-%{extension}
%global version     30

Name:           gnome-shell-extension-%{extension}
Version:        %{version}
Release:        1%{?dist}
Summary:        Close windows with a button click (the middle one by default) when in overview mode
License:        GPLv2
URL:            https://github.com/p91paul/middleclickclose
Source0:        %{url}/archive/refs/tags/%{version}.tar.gz
BuildArch:      noarch
BuildRequires:  gettext
Requires:       gnome-shell >= 45, gnome-shell < 47

%description
Close windows with a button click (the middle one by default) when in overview mode

%prep
%autosetup -n %{extension}-%{version}

%install
# install main extension files
install -d -m 0755 %{buildroot}%{_datadir}/gnome-shell/extensions/%{uuid}
find src -mindepth 1 -maxdepth 1 ! -path "*po*" ! -path "*schemas*" -exec cp -r {} %{buildroot}%{_datadir}/gnome-shell/extensions/%{uuid}/ \;

# install the schema file
install -D -p -m 0644 \
    src/schemas/org.gnome.shell.extensions.%{extension}.gschema.xml \
    %{buildroot}%{_datadir}/glib-2.0/schemas/org.gnome.shell.extensions.%{extension}.gschema.xml

# install locale files
pushd src/po
for po in *.po; do
    install -d -m 0755 %{buildroot}%{_datadir}/locale/${po%.po}/LC_MESSAGES
    msgfmt -o %{buildroot}%{_datadir}/locale/${po%.po}/LC_MESSAGES/%{gettext}.mo $po
done
popd
%find_lang %{gettext}

%files -f %{gettext}.lang
%doc README.md
%license LICENSE
%{_datadir}/glib-2.0/schemas/*.gschema.xml
%{_datadir}/gnome-shell/extensions/%{uuid}/

%changelog
* Sat Apr 06 2024 Your Name <[email protected]> - 30
- improvement: Added Gnome 46 support

fiftydinar avatar Oct 09 '23 17:10 fiftydinar