/
ssu.spec
206 lines (163 loc) · 4.49 KB
/
ssu.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
Name: ssu
Version: 0.44.6
Release: 1
Summary: SSU enabler for RND
Group: System/Base
License: GPLv2+ and LGPLv2.1+ and BSD-3-clause
Source0: %{name}-%{version}.tar.gz
URL: https://git.merproject.org/mer-core/ssu
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5DBus)
BuildRequires: pkgconfig(Qt5Network)
BuildRequires: pkgconfig(Qt5Xml)
BuildRequires: pkgconfig(Qt5Test)
BuildRequires: pkgconfig(libzypp)
BuildRequires: pkgconfig(libsystemd-journal)
BuildRequires: pkgconfig(libshadowutils)
BuildRequires: pkgconfig(connman-qt5)
BuildRequires: oneshot
BuildRequires: doxygen
Requires(pre): sailfish-setup
Requires(pre): shadow-utils
Requires(pre): /usr/bin/groupadd-user
Requires(postun): shadow-utils
Requires: ssu-vendor-data
Requires: ssu-network-proxy
%description
%{summary}.
%files
%defattr(-,root,root,-)
%{_libdir}/zypp/plugins/urlresolver/*
%{_bindir}/ssu
%{_libdir}/libssu.so.*
%{_libdir}/ssu/libsandboxhook.so
%dir %{_sysconfdir}/zypp/credentials.d
# ssu itself does not use the package-update triggers, but provides
# them for the vendor data packages to use
%attr(0755, -, -) %{_oneshotdir}/*
%{_bindir}/ssud
/lib/systemd/system/*.service
%{_datadir}/dbus-1/system-services/*.service
%dir %{_datarootdir}/%{name}
%dir %{_datarootdir}/%{name}/board-mappings.d
%dir %{_datarootdir}/%{name}/features.d
%dir %{_datarootdir}/%{name}/repos.d
%dir %{_sysconfdir}/%{name}/
%{_sysconfdir}/dbus-1/system.d/*.conf
%doc COPYING.GPL COPYING.LGPL COPYING.BSD
%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
%package vendor-data-example
Summary: Sample vendor configuration data
Group: System/Base
Provides: ssu-vendor-data
%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 %{_sysconfdir}/ssu/ssu.ini
%{_datadir}/ssu/*.ini
%package ks
Summary: Kickstart generator using %{name} data
Group: System/Base
# required for QA to pick up new macros
Provides: rpm-macros
%description ks
%{summary}. With ponies!
%files ks
%defattr(-,root,root,-)
%config %{_sysconfdir}/rpm/macros.ssuks
%{_bindir}/ssuks
%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
%package declarative
Summary: QML plugin for libssu
Group: System/Base
BuildRequires: pkgconfig(Qt5Qml)
%description declarative
%{summary}
%files declarative
%{_libdir}/qt5/qml/Nemo/Ssu/*
%package devel
Summary: Development files for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description devel
%{summary}.
%files devel
%defattr(-,root,root,-)
%{_libdir}/libssu.so
%{_includedir}/ssu*.h
%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
%package doc
Summary: Documentation for %{name}
Group: Documentation
%description doc
%{summary}.
%files doc
%defattr(-,root,root,-)
%{_docdir}/%{name}
%prep
%setup -q -n %{name}-%{version}
%build
mkdir -p build && cd build
%qmake5 DEFINES+='TARGET_ARCH=\\\"\"%{_target_cpu}\"\\\"' -recursive ..
make %{?_smp_mflags}
if [ -f ../.nodocs ]; then
echo "Skip building documentation"
else
cd .. && doxygen doc/Doxyfile
fi
%install
cd build && make INSTALL_ROOT=%{buildroot} install
mkdir -p %{buildroot}/%{_sysconfdir}/zypp/credentials.d
mkdir -p %{buildroot}/%{_datarootdir}/%{name}/board-mappings.d
mkdir -p %{buildroot}/%{_datarootdir}/%{name}/features.d
mkdir -p %{buildroot}/%{_datarootdir}/%{name}/repos.d
mkdir -p %{buildroot}/%{_docdir}/%{name}
mkdir -p %{buildroot}/%{_sysconfdir}/%{name}
cd .. && cp -R doc/html/* %{buildroot}/%{_docdir}/%{name}/
%pre
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
%post
/sbin/ldconfig
# make sure an old ssud isn't still running
killall ssud