Add %sailfishos and %sailfishos_version to development environment

As we can develop our applications in cross-platform way to accommodate different Linux distributions, it would be helpful to have few macros defined that could be used in RPM SPEC. In line with other RPM-based distros, such as Fedora and Suse, please add

  • %sailfishos equal to 1 or some other non-zero value
  • %sailfishos_version equal to the corresponding SFOS version: for the latest

Please make them available in downloadable SDK and OBS.

This will make it possible to check whether the build is running for SFOS and its version.


Piggybacking on this, as a more general approach, support the %{dist}/%{?dist} macros and conditionals which is already well defined and widely used.

1 Like

There is %{_vendor} macro that has value “meego” for Sailfish OS, and for version there is version command.

%if "%{?_vendor}" == "meego"
%global sailfishos 1
%global sailfishos_version %(version | awk '{print $3}')

Kind of hacky, but it works.

1 Like

“hacky” is a good word. Also, I would expect that will all these changes that “have to be done”, meego will disappear. While it would work, I would prefer to keep app SPEC clean from such macro definitions.