/
ssu.spec
172 lines (134 loc) · 3.54 KB
1
Name: ssu
2
Version: 0.33
3
4
5
Release: 1
Summary: SSU enabler for RND
Group: System/Base
6
License: GPLv2
7
8
Source0: %{name}-%{version}.tar.gz
URL: https://github.com/nemomobile/ssu
9
BuildRequires: pkgconfig(boardname)
10
11
12
13
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5DBus)
BuildRequires: pkgconfig(Qt5Network)
BuildRequires: pkgconfig(Qt5Xml)
14
BuildRequires: pkgconfig(Qt5Test)
15
BuildRequires: pkgconfig(Qt5SystemInfo)
16
BuildRequires: pkgconfig(libzypp)
17
BuildRequires: pkgconfig(libsystemd-journal)
18
BuildRequires: pkgconfig(libshadowutils)
19
BuildRequires: pkgconfig(connman-qt5)
20
21
BuildRequires: oneshot
BuildRequires: doxygen
22
Requires(pre): shadow-utils
23
Requires(pre): /usr/bin/groupadd-user
24
25
Requires(postun): shadow-utils
Requires: ssu-vendor-data
26
Requires: ssu-network-proxy
27
28
29
30
31
32
33
34
%description
%{summary}.
%files
%defattr(-,root,root,-)
%{_libdir}/zypp/plugins/urlresolver/*
%{_bindir}/rndssu
35
%{_bindir}/ssu
36
%{_libdir}/libssu.so.*
37
%dir %{_sysconfdir}/zypp/credentials.d
38
39
40
# ssu itself does not use the package-update triggers, but provides
# them for the vendor data packages to use
%attr(0755, -, -) %{_oneshotdir}/*
41
42
43
%{_bindir}/ssud
%{_datadir}/dbus-1/system-services/*.service
%{_sysconfdir}/dbus-1/system.d/*.conf
44
45
46
47
48
49
50
51
52
53
54
55
56
%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
57
58
59
%package vendor-data-example
Summary: Sample vendor configuration data
Group: System/Base
60
Provides: ssu-vendor-data
61
62
63
64
65
66
67
68
69
70
%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
71
72
73
%package ks
Summary: Kickstart generator using %{name} data
Group: System/Base
74
75
# required for QA to pick up new macros
Provides: rpm-macros
76
77
78
79
80
81
%description ks
%{summary}. With ponies!
%files ks
%defattr(-,root,root,-)
82
%config %{_sysconfdir}/rpm/macros.ssuks
83
84
85
%{_bindir}/ssuks
86
87
88
89
90
91
92
93
94
95
96
%package devel
Summary: Development files for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description devel
%{summary}.
%files devel
%defattr(-,root,root,-)
%{_libdir}/*.so
97
%{_includedir}/ssu*.h
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
%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
126
127
128
129
130
131
132
133
134
135
136
137
%package doc
Summary: Documentation for %{name}
Group: Documentation
%description doc
%{summary}.
%files doc
%defattr(-,root,root,-)
%{_docdir}/%{name}
138
%prep
139
%setup -q -n %{name}-%{version}
140
141
142
%build
143
mkdir -p build && cd build
144
%qmake5 DEFINES+='TARGET_ARCH=\\\"\"%{_target_cpu}\"\\\"' -recursive ..
145
make %{?_smp_mflags}
146
cd .. && doxygen doc/Doxyfile
147
148
149
%install
150
cd build && make INSTALL_ROOT=%{buildroot} install
151
mkdir -p %{buildroot}/%{_sysconfdir}/zypp/credentials.d
152
ln -s %{_bindir}/ssu %{buildroot}/%{_bindir}/rndssu
153
mkdir -p %{buildroot}/%{_docdir}/%{name}
154
cd .. && cp -R doc/html/* %{buildroot}/%{_docdir}/%{name}/
155
156
157
158
%pre
groupadd -rf ssu
159
groupadd-user ssu
160
161
162
163
164
165
166
167
168
169
170
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
171
172
%post
/sbin/ldconfig