Search
SailfishOS Open Build Service
>
Projects
>
home:olf
:
harbour-storeman
:
cd
:
alpha
>
harbour-storeman-installer
> _service:tar_git:harbour-storeman-installer.spec
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File _service:tar_git:harbour-storeman-installer.spec of Package harbour-storeman-installer
%undefine vendor Summary: Installs Storeman for SailfishOS License: LGPL-2.1-only Name: harbour-storeman-installer # The Git release tag format must adhere to just <version>. The <version> # field adheres to semantic versioning and the <release> field comprises a # natural number greater or equal to 1, which may be prefixed with one of # {alpha,beta,rc,release} (e.g., "beta3"). For details and reasons, see # https://github.com/storeman-developers/harbour-storeman-installer/wiki/Git-tag-format Version: 2.1.5+devel.20230411210957.100.g5fe0883 Release: release3 Group: Applications/System URL: https://github.com/storeman-developers/%{name} # These "Source0:" line below requires that the value of %%{name} is also the # project name at GitHub and the value of %%{version} is also the name of a # correspondingly set git-tag. Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz # Note that the rpmlintrc file must be named so according to # https://en.opensuse.org/openSUSE:Packaging_checks#Building_Packages_in_spite_of_errors Source99: %{name}.rpmlintrc BuildArch: noarch # For details on "Requires:" statements, especially "Requires(a,b,c):", see: # https://rpm-software-management.github.io/rpm/manual/spec.html#requires # Most of the following dependencies are required for both, specifically for # the %%post scriptlet and additionally as a general requirement after the RPM # transaction has finished, but shall be already installed on SailfishOS: Requires: ssu Requires(post): ssu Requires: PackageKit Requires(posttrans): PackageKit # `or` was introduced with RPM 4.13, SailfishOS v2.2.1 started deploying v4.14: # https://together.jolla.com/question/187243/changelog-221-nurmonjoki/#187243-rpm # But the SailfishOS-OBS' does not support `or`, either due to the antique OBS # release or `tar_git`: https://github.com/MeeGoIntegration/obs-service-tar-git # ToDo: Check if the GNU-versions of these packages (named as alternatives below) # also provide the aliases ("virtual packages") denoted here, then these can be # used; ultimately most of these packages shall be already installed, anyway. # 1. `coreutils` (for e.g., `touch` and many other very basic UNIX tools): # Requires: (busybox-symlinks-coreutils or gnu-coreutils) Requires: coreutils # Requires(post,posttrans): (busybox-symlinks-coreutils or gnu-coreutils) Requires(post): coreutils Requires(posttrans): coreutils # 2. `util-linux` for `setsid`: Requires: util-linux Requires(posttrans): util-linux # 3. `psmisc` for `killall`: # Requires: (busybox-symlinks-psmisc or psmisc-tools) Requires: psmisc # Requires(posttrans): (busybox-symlinks-psmisc or psmisc-tools) Requires(posttrans): psmisc # 4. `procps` for `pkill` / `pgrep`: Used `killall` instead, which suits better here. # Requires: (busybox-symlinks-procps or procps-ng) #Requires: procps # Requires(posttrans): (busybox-symlinks-procps or procps-ng) #Requires(posttrans): procps # The oldest SailfishOS release Storeman ≥ 0.2.9 compiles for, plus the oldest # useable DoD-repo at https://build.merproject.org/project/subprojects/sailfishos Requires: sailfish-version >= 3.1.0 # Provide an automatically presented update candidate for an installed Storeman < 0.2.99: Conflicts: harbour-storeman < 0.2.99 Obsoletes: harbour-storeman < 0.2.99 Provides: harbour-storeman = 0.3.0~3 %global screenshots_url https://github.com/storeman-developers/harbour-storeman/raw/master/.xdata/screenshots/ %global logdir %{_localstatedir}/log %global logfile %{logdir}/%{name}.log.txt # This %%description section includes metadata for SailfishOS:Chum, see # https://github.com/sailfishos-chum/main/blob/main/Metadata.md %description Storeman Installer selects, downloads and installs the right variant of the Storeman OpenRepos client application built for the CPU-architecture of the device and its installed SailfishOS release. %if 0%{?_chum} Title: Storeman Installer for SailfishOS Type: desktop-application Categories: - System - Utility - Network - Settings - PackageManager DeveloperName: olf (Olf0) Custom: Repo: %{url} PackageIcon: %{url}/raw/master/.icon/%{name}.svg Screenshots: - %{screenshots_url}screenshot-screenshot-storeman-01.png - %{screenshots_url}screenshot-screenshot-storeman-02.png - %{screenshots_url}screenshot-screenshot-storeman-03.png - %{screenshots_url}screenshot-screenshot-storeman-04.png - %{screenshots_url}screenshot-screenshot-storeman-06.png - %{screenshots_url}screenshot-screenshot-storeman-07.png - %{screenshots_url}screenshot-screenshot-storeman-08.png - %{screenshots_url}screenshot-screenshot-storeman-09.png Links: Homepage: https://openrepos.net/content/olf/storeman-installer Help: %{url}/issues Bugtracker: %{url}/issues Donation: https://openrepos.net/donate %endif %define _binary_payload w6.gzdio %define _source_payload w6.gzdio %prep %setup -q %build %install mkdir -p %{buildroot}%{_bindir} cp bin/%{name} %{buildroot}%{_bindir}/ %post # The %%post scriptlet is deliberately run when installing and updating. # Create a persistent log file, i.e., which is not managed by RPM and hence # is unaffected by removing the %%{name} RPM package: if [ ! -e %{logfile} ] then curmask="$(umask)" umask 022 [ ! -e %{logdir} ] && mkdir -p %{logdir} umask 113 touch %{logfile} # Not necessary, because umask is set: # chmod 0664 %%{logfile} chgrp ssu %{logfile} umask "$curmask" fi # The added harbour-storeman-obs repository is not removed when Storeman Installer # is removed, but when Storeman is removed (before it was added, removed, then # added again when installing Storeman via Storeman Installer), which is far more # fail-safe: If something goes wrong, this SSUs repo entry is now ensured to exist. ssu_ur=no ssu_lr="$(ssu lr | grep '^ - ' | cut -f 3 -d ' ')" if echo "$ssu_lr" | grep -Fq mentaljam-obs then ssu rr mentaljam-obs rm -f /var/cache/ssu/features.ini ssu_ur=yes fi if ! echo "$ssu_lr" | grep -Fq harbour-storeman-obs then ssu ar harbour-storeman-obs 'https://repo.sailfishos.org/obs/home:/olf:/harbour-storeman/%%(release)_%%(arch)/' ssu_ur=yes fi if [ $ssu_ur = yes ] then ssu ur fi # BTW, `ssu`, `rm -f`, `mkdir -p` etc. *always* return with "0" ("success"), hence # no appended `|| true` needed to satisfy `set -e` for failing commands outside of # flow control directives (if, while, until etc.). Furthermore on Fedora Docs it # is indicated that solely the final exit status of a whole scriptlet is crucial: # See https://docs.pagure.org/packaging-guidelines/Packaging%3AScriptlets.html # or https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_syntax # committed on 18 February 2019 by tibbs ( https://pagure.io/user/tibbs ) in # https://pagure.io/packaging-committee/c/8d0cec97aedc9b34658d004e3a28123f36404324 # Hence I have the impression, that only the main section of a spec file is # interpreted in a shell called with the option `-e', but not the scriptlets # (`%%pre*`, `%%post*`, `%%trigger*` and `%%file*`). exit 0 %posttrans # At the very end of every install or upgrade # The harbour-storeman-installer script must be started fully detached # (by a double-fork / "daemonize") to allow for this RPM transaction # to finalise (what waiting for it to finish would prevent). # (Ab)using the %%posttrans' interpreter instance for the preamble: umask 113 # [ "$PWD" = / ] || cd / # Set PWD to /, if not already; omitted, # because the scriptlets are executed with PWD safely set to /. setsid --fork sh -c '(%{_bindir}/%{name} "$1" "$2")' sh_call_inst-storeman "$$" "%{logfile}" >> "%{logfile}" 2>&1 <&- # The first 15 characters of the spawned process' name # (to be used for, e.g., `ps` and `pgrep` / `pkill`) are: # sh_call_inst-st exit 0 %files %attr(0754,root,ssu) %{_bindir}/%{name} %changelog * Thu Sep 9 1999 olf <Olf0@users.noreply.github.com> - 99.99.99 - See %{url}/releases