Skip to content

Commit

Permalink
ssu-repos: Initial packaging
Browse files Browse the repository at this point in the history
[ssu-repos] Initial packaging. Resolves SailfishOS-SonyXperia/bugs#28

Signed-off-by: Björn Bidar <bjorn.bidar@thaodan.de>
  • Loading branch information
Thaodan committed Aug 9, 2022
0 parents commit 5723169
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 0 deletions.
73 changes: 73 additions & 0 deletions rpm/ssu-repos.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Build options
# These build options should be set in the obs project configuration this package
# belongs to like this:
# %%global <option> <value>

# Buildflavour
# On build.sailfishos.org the same build flavour that is used
# for devices that are in rnd is also used on devices that are in release mode.
# This because of the repositories there are usually used as an addition to existing
# repositories and not to replace them.
# Since we can can't use ssu to set the mode for each repository by default we do this:
#
# Set `sailfishosorg_flavour` to one of these below:
# - devel - bleeding edge, latest features straight from source code changes,
# along with all the new bugs :)
# - testing - cutting edge, less instability
# - stable - currently not used
#
# On device this can be orriden by using:
# ssu set sailfishosorg_flavour <flavour>
#
%if 0%{!?sailfishosorg_flavour:1}
%global sailfishosorg_flavour testing
%endif

# Adaptation Organisation
# Right now Adaptations are build under the nemo Organisation.
# In case the layout differs `sailfishosorg_adaptationOrg` can be set to any organisation.
# For example project foobar with subproject bar this would be 'foobar:/bar'.

%if 0%{!?sailfishosorg_adaptationOrg:1}
%global sailfishosorg_adaptationOrg nemo
%endif

Name: ssu-repos
Version: 0.1
Release: 1
Summary: SSU repositories
BuildArch: noarch
License: GPLv2
Source0: %{name}-%{version}.tar.gz
%define keydir /etc/pki/rpm-gpg


%description
%{summary}.

%package -n ssu-vendor-data-sailfishosorg
Summary: BuildSailfishosorg vendor configuration data
Requires: ssu >= 0.44.7

%description -n ssu-vendor-data-sailfishosorg
%{summary}. A vendor (including Nemo) is supposed to put those configuration on device.

%prep
%setup -q

%build

%install
mkdir -p %{buildroot}%{_datadir}/ssu/repos.d/
sed \
-e s/@FLAVOUR@/%{sailfishosorg_flavour}/g \
-e s/@sailfishorgAdaptationOrg@/%{sailfishosorg_adaptationOrg}/g \
ssu/20-sailfishosorg.ini.in > %{buildroot}%{_datadir}/ssu/repos.d/20-sailfishosorg.ini


%files
%defattr(-,root,root,-)

%files -n ssu-vendor-data-sailfishosorg
%defattr(-,root,root,-)
%verify (not mtime) %{_datadir}/ssu/repos.d/20-sailfishosorg.ini
13 changes: 13 additions & 0 deletions ssu/20-sailfishosorg.ini.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# -*- conf -*-
[all]
adaptation = %(releaseProtocol)://%(sailfishosorgDomain)/%(sailfishosorgPath)%(sailfishorgAdaptationOrg):/%(sailfishosorgFlavour):/hw:/%(vendor):/%(%(sailfishosorgFlavour):=testing?%(deviceFamily):/%(release)|%(deviceFamily))/latest_%(arch)

[default-domain]
sailfishosorgDomain = repo.sailfishos.org
sailfishosorgFlavour = @FLAVOUR@
sailfishosorgPath = obs/
sailfishorgAdaptationOrg = @sailfishorgAdaptationOrg@

[jolla-domain]
sailfishosorgDomain = %(rndDomain)
sailfishosorgPath =

0 comments on commit 5723169

Please sign in to comment.