%global debug_package %{nil} %global _build_id_links none %global __strip /bin/true %global __provides_exclude_from ^/opt/lanups/ Name: lanups Version: %{lanups_version} Release: 1 Summary: LAN UPS Agent and desktop monitor License: Unspecified Source0: lanups-payload.tar.gz Requires(post): coreutils, glibc-common, shadow-utils, systemd Requires(preun): systemd Requires(postun): systemd Requires: openssl-libs, libicu, libX11, libX11-xcb, libxcb, libXext, libXi, libXrandr, libICE, libSM, fontconfig, libglvnd-glx %description LanUps monitors a network UPS and provides a local desktop application and system service. %install mkdir -p "%{buildroot}/usr/lib/systemd/system" tar -xzf "%{SOURCE0}" -C "%{buildroot}" mv "%{buildroot}/lib/systemd/system/lanups-agent.service" "%{buildroot}/usr/lib/systemd/system/" %post set -e /usr/lib/lanups/configure-agent if [ -d /run/systemd/system ]; then systemctl daemon-reload systemctl enable lanups-agent.service systemctl restart lanups-agent.service else systemctl --root=/ enable lanups-agent.service fi %preun if [ "$1" -eq 0 ]; then if [ -d /run/systemd/system ]; then systemctl stop lanups-agent.service || :; fi systemctl --root=/ disable lanups-agent.service || : fi %postun if [ "$1" -eq 0 ] && [ -d /run/systemd/system ]; then systemctl daemon-reload || :; fi %files /opt/lanups /usr/lib/lanups /usr/lib/systemd/system/lanups-agent.service /etc/xdg/autostart/lanups-desktop.desktop /usr/share/applications/lanups-desktop.desktop /usr/share/icons/hicolor/256x256/apps/lanups.png