The code works on those distributions now; there was still nothing to install. This adds the two packages and, more to the point, somewhere for them to live that hands out updates - a package a user has to notice a new version of and download again is not much better than a checkout. Both are built from `make install` and nothing else. A packaging script that lists the installed files a second time is a second description of the layout, and the two drift the first time a file moves; here the Makefile stays the only place that says where anything goes. The .deb is staged and wrapped with dpkg-deb, the .rpm goes through a spec whose %install is the same make invocation. Both are architecture-independent, so one file each covers Debian, Ubuntu and their derivatives on one side and Fedora, RHEL and openSUSE on the other. The version is not written down twice either. The Makefile has it, the control file and the spec take it as a placeholder, and check-version.sh refuses a tag that disagrees - otherwise a v1.0.4 release quietly ships a program that reports 1.0.3. The release workflow builds both in a Debian and a Fedora container, signs the RPM where there is a native rpm-sign, attaches both to the GitHub release, and then adds them to an APT and a DNF repository on gh-pages, regenerating the indexes over every version ever published so that pinning and going back to one still work. Missing the signing key is not an error: it builds, it says in the log that the repositories were left alone, and the packages are still on the release. There is also a check workflow, which is the first time shellcheck actually runs on this. Neither package carries a maintainer script. The units are enabled per user by the program itself, so there is nothing for a package to do as root - and nothing it could do about the changes in a user's home either, which is why both descriptions say to run `disable` before removing. packaging/README.md has the two things that cannot be automated: making the signing key, and pointing Pages at the branch.
73 lines
2.4 KiB
RPMSpec
73 lines
2.4 KiB
RPMSpec
# Built with `packaging/build-rpm.sh`, which passes the version in rather than
|
|
# editing this file: the Makefile is where the version is written down, and two
|
|
# places that have to agree are one place too many.
|
|
%global upstream_version %{?_version}%{!?_version:1.0.3}
|
|
|
|
Name: middleclick-autoscroll
|
|
Version: %{upstream_version}
|
|
Release: 1%{?dist}
|
|
Summary: Middle-click autoscroll for Chromium-based applications
|
|
|
|
License: GPL-3.0-or-later
|
|
URL: https://github.com/Felitendo/middleclick-autoscroll
|
|
Source0: %{name}-%{version}.tar.gz
|
|
|
|
BuildArch: noarch
|
|
BuildRequires: make
|
|
BuildRequires: gettext
|
|
BuildRequires: scdoc
|
|
# For %{_userunitdir}, which is where the watcher's user units belong.
|
|
BuildRequires: systemd-rpm-macros
|
|
|
|
Requires: bash >= 4.2
|
|
Requires: coreutils
|
|
Requires: findutils
|
|
Requires: grep
|
|
Requires: sed
|
|
Requires: gawk
|
|
|
|
# The interface falls back to English without gettext and picks up new
|
|
# applications at the next `apply` without systemd, so neither is required.
|
|
Recommends: /usr/bin/gettext
|
|
Recommends: systemd
|
|
Recommends: desktop-file-utils
|
|
|
|
%description
|
|
Blink - the engine inside Chromium, Electron and CEF - has had Windows-style
|
|
autoscroll for years: hold the middle mouse button, move the pointer, the page
|
|
scrolls. On Linux it is switched off, because middle click is already taken by
|
|
primary-selection paste.
|
|
|
|
This turns it back on for every application on the system that can do it, and
|
|
for anything installed later. There is no list of supported applications to keep
|
|
up to date: every launcher is examined, the ones running on Chromium underneath
|
|
are identified by what they ship rather than by their name, and the argument goes
|
|
wherever that particular application will actually read it.
|
|
|
|
Nothing outside the user's home directory is ever written to. Run
|
|
"middleclick-autoscroll disable" before removing this package, so that everything
|
|
it changed is put back.
|
|
|
|
%prep
|
|
%autosetup -n %{name}-%{version}
|
|
|
|
%build
|
|
%make_build VERSION=%{upstream_version}
|
|
|
|
%install
|
|
%make_install PREFIX=%{_prefix} VERSION=%{upstream_version} \
|
|
USERUNITDIR=%{_userunitdir}
|
|
|
|
%find_lang %{name}
|
|
|
|
%files -f %{name}.lang
|
|
%license LICENSE
|
|
%doc %{_datadir}/doc/%{name}/README.md
|
|
%{_bindir}/%{name}
|
|
%{_datadir}/%{name}/
|
|
%{_userunitdir}/%{name}.path
|
|
%{_userunitdir}/%{name}.service
|
|
%{_mandir}/man1/%{name}.1*
|
|
|
|
%changelog
|