aa37947
# -*-Mode: rpm-spec-mode; -*-
aa37947
a8a8185
%undefine __cmake_in_source_build
e8cf31b
e8cf31b
%global github_url https://github.com
e8cf31b
%global iodash_name IODash
e8cf31b
%global iodash_version 0.1.0
e8cf31b
%global libevdevplus_name libevdevPlus
e8cf31b
%global libevdevplus_version 0.2.1
e8cf31b
%global libuinputplus_name libuInputPlus
e8cf31b
%global libuinputplus_version 0.2.1
e8cf31b
%global cxxopts_name cxxopts
e8cf31b
%global cxxopts_version 3.0.0
e8cf31b
%global cxxopts_commit 2d8e17c4f88efce80e274cb03eeb902e055a91d3
e8cf31b
%global cpm_cmake_name cpm.cmake
e8cf31b
%global cpm_cmake_version 0.27.5
e8cf31b
%global debug_package %{nil}
aa37947
aa37947
Name:     ydotool
e8cf31b
Version:  0.2.0
1834f83
Release:  5%{?dist}
aa37947
Summary:  Generic command-line automation tool (no X!)
e8cf31b
License:  AGPLv3, Public Domain
e8cf31b
URL:      %github_url/ReimuNotMoe/%{name}
aa37947
c36228d
# lacks support for TCGETS2:
c36228d
ExcludeArch: ppc64le
c36228d
c36228d
# failure in rpmbuild toolchain:
c36228d
# Checking for unpackaged file(s): /usr/lib/rpm/check-files /builddir/build/BUILDROOT/ydotool-0.2.0-1.fc34.s390x
c36228d
# Child return code was: -11
c36228d
# EXCEPTION: [Error()]
c36228d
# Traceback (most recent call last):
c36228d
#   File "/usr/lib/python3.9/site-packages/mockbuild/trace_decorator.py", line 93, in trace
c36228d
#     result = func(*args, **kw)
c36228d
#   File "/usr/lib/python3.9/site-packages/mockbuild/util.py", line 600, in do_with_status
c36228d
#     raise exception.Error("Command failed: \n # %s\n%s" % (command, output), child.returncode)
c36228d
# mockbuild.exception.Error: Command failed: 
c36228d
ExcludeArch: s390x
c36228d
e8cf31b
Source0:  %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
e8cf31b
Source1:  %{github_url}/YukiWorkshop/%{iodash_name}/archive/v%{iodash_version}/%(c=%{iodash_name}; echo ${c,,})-%{iodash_version}.tar.gz
e8cf31b
Source2:  %{github_url}/YukiWorkshop/%{libevdevplus_name}/archive/v%{libevdevplus_version}/%{libevdevplus_name}-%{libevdevplus_version}.tar.gz
e8cf31b
Source3:  %{github_url}/YukiWorkshop/%{libuinputplus_name}/archive/v%{libuinputplus_version}/%{libuinputplus_name}-%{libuinputplus_version}.tar.gz
e8cf31b
Source4:  %{github_url}/jarro2783/%{cxxopts_name}/archive/%{cxxopts_commit}/%{cxxopts_name}-%{cxxopts_commit}.tar.gz
e8cf31b
Source5:  %{github_url}/TheLartians/%{cpm_cmake_name}/archive/v%{cpm_cmake_version}/%{cpm_cmake_name}-%{cpm_cmake_version}.tar.gz
e8cf31b
Source6:  https://gist.githubusercontent.com/panzi/6856583/raw/1eca2ab34f2301b9641aa73d1016b951fff3fc39/portable_endian.h
aa37947
e8cf31b
Patch0:   ydotool-cpm.cmake.patch
e8cf31b
Patch1:   ydotool-new-man-pages.patch
aa37947
aa37947
BuildRequires: cmake
aa37947
BuildRequires: gcc-c++
aa37947
BuildRequires: make
aa37947
BuildRequires: scdoc
aa37947
BuildRequires: systemd-rpm-macros
aa37947
aa37947
%description
aa37947
aa37947
Performs some of the functions of xdotool(1) without requiring X11 -
aa37947
however, it generally requires root permission (to open /dev/uinput)
aa37947
e8cf31b
NOTE: changes in this release:
e8cf31b
NOTE: --delay option is now --next-delay
e8cf31b
NOTE: mousemove is now relative unless --absolute is given
e8cf31b
NOTE: mouseup, mousedown, mousemove_relative is removed
e8cf31b
NOTE: click accepts left, right, middle instead of 1, 2, 3
e8cf31b
NOTE: sleep is a new command
e8cf31b
e8cf31b
SEE: ydotool <cmd> --help for latest info
e8cf31b
aa37947
Currently implemented command(s):
aa37947
aa37947
- type - Type a string
aa37947
- key - Press keys
aa37947
- mousemove - Move mouse pointer to absolute position
aa37947
- click - Click on mouse buttons
aa37947
- recorder - Record/replay input events
e8cf31b
- sleep - sleep ms
aa37947
e8cf31b
N.B. it is strongly recommended to start the ydotoold daemon with:
aa37947
aa37947
- systemctl enable ydotool
aa37947
- systemctl start ydotool
aa37947
aa37947
%prep
e8cf31b
%setup -q
e8cf31b
%patch0 -p1
e8cf31b
%patch1 -p1
e8cf31b
gzip -dc %{S:1} | tar xf -
e8cf31b
gzip -dc %{S:2} | tar xf -
e8cf31b
gzip -dc %{S:3} | tar xf -
e8cf31b
gzip -dc %{S:4} | tar xf -
e8cf31b
gzip -dc %{S:5} | tar xf -
e8cf31b
e8cf31b
# this is missing from IODash - I have logged a bug report upstream
c36228d
# https://github.com/YukiWorkshop/IODash/issues/1
e8cf31b
# it is licenced 'public domain':
e8cf31b
cp %{S:6} %{iodash_name}-%{iodash_version}/portable-endian.h
aa37947
aa37947
%build
c36228d
%cmake -DBUILD_SHARED_LIBS:BOOL=OFF \
e8cf31b
-DCPM_%{iodash_name}_SOURCE=$PWD/%{iodash_name}-%{iodash_version} \
e8cf31b
-DCPM_%{libevdevplus_name}_SOURCE=$PWD/%{libevdevplus_name}-%{libevdevplus_version} \
e8cf31b
-DCPM_%{libuinputplus_name}_SOURCE=$PWD/%{libuinputplus_name}-%{libuinputplus_version} \
e8cf31b
-DCPM_%{cxxopts_name}_SOURCE=$PWD/%{cxxopts_name}-%{cxxopts_commit}
e8cf31b
e8cf31b
make -C %{_vpath_builddir} -j `nproc`
aa37947
aa37947
%install
e8cf31b
mkdir -p %{buildroot}/%{_bindir}
e8cf31b
strip */%{name}
e8cf31b
strip */%{name}d
e8cf31b
install -p -m 0755 */%{name} %{buildroot}/%{_bindir}
e8cf31b
install -p -m 0755 */%{name}d %{buildroot}/%{_bindir}
aa37947
mkdir -p %{buildroot}/%{_unitdir}
aa37947
install -p -m 0644 Daemon/%{name}.service %{buildroot}/%{_unitdir}
aa37947
mkdir -p %{buildroot}/%{_mandir}/man1
aa37947
mkdir -p %{buildroot}/%{_mandir}/man8
aa37947
scdoc < manpage/%{name}.1.scd > %{buildroot}/%{_mandir}/man1/%{name}.1
aa37947
scdoc < manpage/%{name}d.8.scd > %{buildroot}/%{_mandir}/man8/%{name}d.8
aa37947
aa37947
%post
aa37947
%systemd_post %{name}.service
aa37947
aa37947
%preun
aa37947
%systemd_preun %{name}.service
aa37947
aa37947
%postun
aa37947
%systemd_postun_with_restart %{name}.service
aa37947
aa37947
%files
aa37947
%{_unitdir}/%{name}.service
aa37947
%{_bindir}/%{name}*
aa37947
%license LICENSE
aa37947
%doc README.md
aa37947
%{_mandir}/man1/%{name}.1.*
aa37947
%{_mandir}/man8/%{name}d.8.*
aa37947
aa37947
%changelog
1834f83
* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.2.0-5
1834f83
- Rebuilt for updated systemd-rpm-macros
1834f83
  See https://pagure.io/fesco/issue/2583.
1834f83
d8b14c0
* Thu Jan 28 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.0-4
d8b14c0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
d8b14c0
5ced80f
* Fri Jan 22 2021 Jonathan Wakely <jwakely@redhat.com> - 0.2.0-3
5ced80f
- Rebuilt for Boost 1.75
5ced80f
c36228d
* Wed Jan 20 2021 Bob Hepple <bob.hepple@gmail.com> - 0.2.0-2
c36228d
- rebuilt excluding s390x and ppc64le
c36228d
e8cf31b
* Mon Jan 11 2021 Bob Hepple <bob.hepple@gmail.com> - 0.2.0-1
e8cf31b
- new version
e8cf31b
- upstream has dropped the idea of -devel libraries so we are only
e8cf31b
  distributing the regular package now; also libevdevPlus-devel and
e8cf31b
  libuInputPlus-devel are no longer needed as they are now compiled
e8cf31b
  in.
e8cf31b
9c8c794
* Sat Aug 15 2020 Bob Hepple <bob.hepple@gmail.com> - 0.1.9-0.4.20200815.git.787fd25
9c8c794
- most recent version
9c8c794
a84e0f1
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.9-0.3.20200405.git.9c3a4e7
a84e0f1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
a84e0f1
c2d6deb
* Sat May 30 2020 Jonathan Wakely <jwakely@redhat.com> - 0.1.9-0.2.20200405.git.9c3a4e7
c2d6deb
- Rebuilt for Boost 1.73
c2d6deb
aa37947
* Sun Apr 05 2020 Bob Hepple <bob.hepple@gmail.com> - 0.1.9-0.1.20200405.git.9c3a4e7
aa37947
- Changes per RHBZ#1807753 - %{?systemd_requires} and ldconfig are no longer required
aa37947
aa37947
* Fri Apr 03 2020 Bob Hepple <bob.hepple@gmail.com> - 0.1.9-0.1.20200403.git.9c3a4e7
aa37947
- Changes per RHBZ#1807753
aa37947
aa37947
* Wed Apr 01 2020 Bob Hepple <bob.hepple@gmail.com> - 0.1.9-0.1.20200401.git.9c3a4e7
aa37947
- Changes per RHBZ#1807753
aa37947
aa37947
* Mon Mar 30 2020 Bob Hepple <bob.hepple@gmail.com> - 0.1.9-0.1.20200330.git.9c3a4e7
aa37947
- Changes per RHBZ#1807753
aa37947
aa37947
* Sun Mar 22 2020 Bob Hepple <bob.hepple@gmail.com> - 0.1.9-0.1.20200322.git.9c3a4e7
aa37947
- fix Source to get git tag directly
aa37947
aa37947
* Sat Feb 29 2020 Bob Hepple <bob.hepple@gmail.com> - 0.1.9-0.1.20200229.git.9c3a4e7
aa37947
- Add a note on how to get source from upstream
aa37947
- use lib*-devel packages in BuildRequires
aa37947
aa37947
* Tue Feb 18 2020 Bob Hepple <bob.hepple@gmail.com> - 0.1.9-0.1.20200218.git.9c3a4e7
aa37947
- rebuild from head to pick up manuals & service file
aa37947
- remove static build
aa37947
- strip binaries (rpmlint complained about them)
aa37947
aa37947
* Mon Feb 17 2020 Bob Hepple <bob.hepple@gmail.com> - 0.1.8.20200211.3
aa37947
- add BuildRequires: systemd-rpm-macros; add dist to release
aa37947
aa37947
* Sun Feb 16 2020 Bob Hepple <bob.hepple@gmail.com> - 0.1.8.20200211.2
aa37947
- use %%_unitdir
aa37947
aa37947
* Sun Feb 16 2020 Bob Hepple <bob.hepple@gmail.com> - 0.1.8.20200211.1
aa37947
- Initial version of the package