ssu.spec 4.62 KB
Newer Older
1
Name: ssu
2
Version: 0.40.5
3 4 5
Release: 1
Summary: SSU enabler for RND
Group: System/Base
6
License: GPLv2+ and LGPLv2.1+ and BSD-3-clause
7 8
Source0: %{name}-%{version}.tar.gz
URL: https://github.com/nemomobile/ssu
9 10 11 12
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5DBus)
BuildRequires: pkgconfig(Qt5Network)
BuildRequires: pkgconfig(Qt5Xml)
13
BuildRequires: pkgconfig(Qt5Test)
14
BuildRequires: pkgconfig(libzypp)
15
BuildRequires: pkgconfig(libsystemd-journal)
16
BuildRequires: pkgconfig(libshadowutils)
17
BuildRequires: pkgconfig(connman-qt5)
18 19
BuildRequires: oneshot
BuildRequires: doxygen
20
Requires(pre): shadow-utils
21
Requires(pre): /usr/bin/groupadd-user
22 23
Requires(postun): shadow-utils
Requires: ssu-vendor-data
24
Requires: ssu-network-proxy
25 26 27 28 29 30 31

%description
%{summary}.

%files
%defattr(-,root,root,-)
%{_libdir}/zypp/plugins/urlresolver/*
Aard's avatar
Aard committed
32
%{_bindir}/ssu
33
%{_libdir}/libssu.so.*
34
%{_libdir}/ssu/libsandboxhook.so
35
%dir %{_sysconfdir}/zypp/credentials.d
36 37 38
# ssu itself does not use the package-update triggers, but provides
# them for the vendor data packages to use
%attr(0755, -, -) %{_oneshotdir}/*
39
%{_bindir}/ssud
40
/lib/systemd/system/*.service
41
%{_datadir}/dbus-1/system-services/*.service
42 43 44 45
%dir %{_datarootdir}/%{name}
%dir %{_datarootdir}/%{name}/board-mappings.d
%dir %{_datarootdir}/%{name}/features.d
%dir %{_sysconfdir}/%{name}/
46
%{_sysconfdir}/dbus-1/system.d/*.conf
47
%doc COPYING.GPL COPYING.LGPL COPYING.BSD
48

49 50 51 52 53 54 55 56 57 58 59 60
%package network-proxy-plugin
Summary: Network Proxy support for ssu
Group: System/Base
Provides: ssu-network-proxy

%description network-proxy-plugin
%{summary}.

%files network-proxy-plugin
%defattr(-,root,root,-)
%{_libdir}/libssunetworkproxy.so

61 62 63
%package vendor-data-example
Summary: Sample vendor configuration data
Group: System/Base
64
Provides: ssu-vendor-data
65 66 67 68 69 70 71 72 73 74

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

%files vendor-data-example
%defattr(-,root,root,-)
%attr(0664, root, ssu) %config(noreplace) %{_sysconfdir}/ssu/ssu.ini
%{_datadir}/ssu/*.ini


75 76 77
%package ks
Summary: Kickstart generator using %{name} data
Group: System/Base
78 79
# required for QA to pick up new macros
Provides: rpm-macros
80 81 82 83 84 85

%description ks
%{summary}. With ponies!

%files ks
%defattr(-,root,root,-)
86
%config %{_sysconfdir}/rpm/macros.ssuks
87 88
%{_bindir}/ssuks

Thomas Perl's avatar
Thomas Perl committed
89 90 91 92 93 94 95 96 97 98 99
%package slipstream
Summary: %{name} OS factory snapshot download provider
Group: System/Base

%description slipstream
Helper utility to authenticate downloads of factory snapshot manifests.

%files slipstream
%defattr(-,root,root,-)
%{_bindir}/ssuslipstream

100 101 102 103 104 105 106 107 108 109 110
%package declarative
Summary: QML plugin for libssu
Group: System/Base
BuildRequires: pkgconfig(Qt5Qml)

%description declarative
%{summary}

%files declarative
%{_libdir}/qt5/qml/Nemo/Ssu/*

111 112 113 114 115 116 117 118 119 120 121
%package devel
Summary: Development files for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}

%description devel
%{summary}.

%files devel
%defattr(-,root,root,-)
%{_libdir}/*.so
Aard's avatar
Aard committed
122
%{_includedir}/ssu*.h
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150


%package tests
Summary: Unit tests for %{name}
Group: Development/Libraries
Requires: testrunner-lite

%description tests
%{summary}.

%files tests
%defattr(-,root,root,-)
/opt/tests/%{name}


%package tools
Summary: Tools for %{name}
Group: Development/Libraries
Requires: rpm

%description tools
%{summary}.

%files tools
%defattr(-,root,root,-)
%attr(0755, -, -) /usr/sbin/ssu-repos.sh


151 152 153 154 155 156 157 158 159 160 161 162
%package doc
Summary: Documentation for %{name}
Group: Documentation

%description doc
%{summary}.

%files doc
%defattr(-,root,root,-)
%{_docdir}/%{name}


163
%prep
164
%setup -q -n %{name}-%{version}
165 166 167


%build
168
mkdir -p build && cd build
169
%qmake5 DEFINES+='TARGET_ARCH=\\\"\"%{_target_cpu}\"\\\"' -recursive ..
170
make %{?_smp_mflags}
171 172 173 174 175
if [ -f ../.nodocs ]; then
    echo "Skip building documentation"
else
    cd .. && doxygen doc/Doxyfile
fi
176 177 178


%install
179
cd build && make INSTALL_ROOT=%{buildroot} install
180
mkdir -p %{buildroot}/%{_sysconfdir}/zypp/credentials.d
181 182
mkdir -p %{buildroot}/%{_datarootdir}/%{name}/board-mappings.d
mkdir -p %{buildroot}/%{_datarootdir}/%{name}/features.d
183
mkdir -p %{buildroot}/%{_docdir}/%{name}
184
mkdir -p %{buildroot}/%{_sysconfdir}/%{name}
185
cd .. && cp -R doc/html/* %{buildroot}/%{_docdir}/%{name}/
186

187 188 189

%pre
groupadd -rf ssu
190
groupadd-user ssu
191 192 193 194 195 196 197 198 199 200 201
if [ -f /etc/ssu/ssu.ini ]; then
  chgrp ssu /etc/ssu/ssu.ini
  chmod 664 /etc/ssu/ssu.ini
fi

%postun
/sbin/ldconfig
if [ "$1" == 0 ]; then
  getent group ssu >/dev/null && groupdel ssu
fi

202 203
# Removing autogenerated droplets can be dropped eventually
# Just needed for a transition period
204 205
%post
/sbin/ldconfig
206 207 208 209 210 211
if [ -f /usr/share/ssu/board-mappings.ini ]; then
    rm -f /usr/share/ssu/board-mappings.ini
fi
if [ -f /usr/share/ssu/features.ini ]; then
    rm -f /usr/share/ssu/features.ini
fi