Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ wheels/
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
!rpm/*.spec

# Installer logs
pip-log.txt
Expand Down Expand Up @@ -113,4 +114,9 @@ debian/.debhelper
debian/files
debian/safeeyes.substvars
debian/safeeyes.prerm.debhelper
debian/safeeyes.postinst.debhelper
debian/safeeyes.postinst.debhelper

# rpm build
rpm/*.tar.gz
rpm/*.src.rpm
rpm/noarch
100 changes: 100 additions & 0 deletions rpm/python-safeeyes.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
Name: python-safeeyes
Version: 3.2.0
Release: %autorelease
Summary: Take periodic breaks to protect your eyes

License: GPL-3.0-or-later
URL: https://github.com/slgobinath/SafeEyes
Source: %{pypi_source safeeyes}

BuildArch: noarch

BuildRequires: cairo-gobject-devel
BuildRequires: gobject-introspection-devel
BuildRequires: gtk4
BuildRequires: python3-devel
BuildRequires: desktop-file-utils
BuildRequires: gettext

# for notification plugin
BuildRequires: libnotify
Requires: libnotify

# for audiblealert plugin
Requires: (ffmpeg-free or pipewire-utils)

# for smartpause plugin (optional in pyproject.toml)
BuildRequires: python3-pywayland
Requires: python3-pywayland

# xprintidle does not exist on fedora
#Suggests: xprintidle

# for healthstats plugin (optional in pyproject.toml)
BuildRequires: python3-croniter
Comment on lines +19 to +34
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of these extra requires appear to do nothing at runtime.
Running rpm --query --package rpm/noarch/python3-safeeyes-3.2.0-1.fc44.noarch.rpm --requires gives:

/usr/bin/python3
python(abi) = 3.13
python3.13dist(babel)
python3.13dist(packaging)
python3.13dist(pygobject)
python3.13dist(python-xlib)
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PartialHardlinkSets) <= 4.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsZstd) <= 5.4.18-1

These are only the dependencies from %generate_buildrequires, but none of the manually added ones here.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not understand. Did you mean, despite adding dependencies in the spec file, they are actually not dependencies of RPM?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's what I meant - and I also don't understand why it doesn't work.



# Fill in the actual package description to submit package to Fedora
%global _description %{expand:
Protect your eyes from eye strain using this simple and beautiful, yet extensible break reminder.}

%description %_description

%package -n python3-safeeyes
Summary: %{summary}

%description -n python3-safeeyes %_description


%prep
%autosetup -p1 -n safeeyes-%{version}


%generate_buildrequires
%pyproject_buildrequires


%build
%pyproject_wheel


%install
%pyproject_install
# Add top-level Python module names here as arguments, you can use globs
%pyproject_save_files -l safeeyes

# add metainfo
mkdir -p %{buildroot}%{_metainfodir}
install -m 644 safeeyes/platform/io.github.slgobinath.SafeEyes.metainfo.xml %{buildroot}%{_metainfodir}

# add icons
for SIZE_APP in 16 24 32 48 64 128
do
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/${SIZE_APP}x${SIZE_APP}/apps
install -p -m 644 safeeyes/platform/icons/hicolor/${SIZE_APP}x${SIZE_APP}/apps/io.github.slgobinath.SafeEyes.png \
%{buildroot}%{_datadir}/icons/hicolor/${SIZE_APP}x${SIZE_APP}/apps/io.github.slgobinath.SafeEyes.png
done

for SIZE_STATUS in 16 24 32 48
do
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/${SIZE_STATUS}x${SIZE_STATUS}/status
install -p -m 644 safeeyes/platform/icons/hicolor/${SIZE_STATUS}x${SIZE_STATUS}/status/* \
%{buildroot}%{_datadir}/icons/hicolor/${SIZE_STATUS}x${SIZE_STATUS}/status/
done

desktop-file-install \
--dir=%{buildroot}%{_datadir}/applications \
safeeyes/platform/io.github.slgobinath.SafeEyes.desktop

%check
%pyproject_check_import


%files -n python3-safeeyes -f %{pyproject_files}
%_bindir/safeeyes
%{_datadir}/icons/*
%{_datadir}/applications/*
%{_metainfodir}/*

%changelog
%autochangelog