connman.spec 6.34 KB
Newer Older
Carsten Munk's avatar
Carsten Munk committed
1 2
Name:       connman
Summary:    Connection Manager
3
Version:    1.32
Carsten Munk's avatar
Carsten Munk committed
4 5 6 7 8
Release:    1
Group:      Communications/ConnMan
License:    GPLv2
URL:        http://connman.net/
Source0:    %{name}-%{version}.tar.bz2
9
Source1:    main.conf
Carsten Munk's avatar
Carsten Munk committed
10 11 12 13 14 15
Requires:   dbus >= 1.4
Requires:   wpa_supplicant >= 0.7.1
Requires:   ofono
Requires:   pacrunner
Requires:   connman-configs
Requires:   systemd
16
Requires:   iptables >= 1.6.1
17
Requires:   iptables-ipv6 >= 1.6.1
18
Requires:   libgofono >= 2.0.0
19
Requires:   libglibutil >= 1.0.21
20
Requires:   libdbusaccess >= 1.0.2
21
Requires:   libgsupplicant >= 1.0.4
Carsten Munk's avatar
Carsten Munk committed
22 23 24
Requires(preun): systemd
Requires(post): systemd
Requires(postun): systemd
25 26
BuildRequires:  pkgconfig(xtables) >= 1.6.1
BuildRequires:	pkgconfig(libiptc)
Carsten Munk's avatar
Carsten Munk committed
27 28 29 30 31 32 33
BuildRequires:  pkgconfig(glib-2.0) >= 2.28
BuildRequires:  pkgconfig(gthread-2.0) >= 2.16
BuildRequires:  pkgconfig(dbus-1) >= 1.4
BuildRequires:  pkgconfig(gnutls)
BuildRequires:  openconnect
BuildRequires:  openvpn
BuildRequires:  readline-devel
34
BuildRequires:  pkgconfig(libsystemd)
35
BuildRequires:  pkgconfig(libiphb)
36 37
BuildRequires:  pkgconfig(libgofono) >= 2.0.0
BuildRequires:  pkgconfig(libgofonoext)
38
BuildRequires:  pkgconfig(libglibutil) >= 1.0.21
39
BuildRequires:  pkgconfig(libdbuslogserver-dbus)
40
BuildRequires:  pkgconfig(libdbusaccess) >= 1.0.3
41
BuildRequires:  pkgconfig(libmce-glib)
42
BuildRequires:  pkgconfig(libgsupplicant) >= 1.0.6
43
BuildRequires:  ppp-devel
44
BuildRequires:  libtool
Carsten Munk's avatar
Carsten Munk committed
45 46 47 48 49

%description
Connection Manager provides a daemon for managing Internet connections
within embedded devices running the Linux operating system.

50 51 52 53 54 55 56
%package wait-online
Summary:    Wait for network to be configured by ConnMan
Group:      Communications/ConnMan

%description wait-online
A systemd service that can be enabled so that the system waits until a
network connection is established before reaching network-online.target.
Carsten Munk's avatar
Carsten Munk committed
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74

%package devel
Summary:    Development files for Connection Manager
Group:      Development/Libraries

%description devel
connman-devel contains development files for use with connman.

%package test
Summary:    Test Scripts for Connection Manager
Group:      Development/Tools
Requires:   %{name} = %{version}-%{release}
Requires:   dbus-python
Requires:   pygobject2

%description test
Scripts for testing Connman and its functionality

75 76 77 78 79 80 81 82
%package tools
Summary:    Development tools for Connection Manager
Group:      Development/Tools
Requires:   %{name} = %{version}-%{release}

%description tools
Programs for debugging Connman

Carsten Munk's avatar
Carsten Munk committed
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
%package configs-mer
Summary:    Package to provide default configs for connman
Group:      Development/Tools
Requires:   %{name} = %{version}-%{release}
Provides:   connman-configs

%description configs-mer
This package provides default configs for connman, such as
FallbackTimeservers.


%package docs
Summary:    Documentation for connman
Group:      Documentation
Requires:   %{name} = %{version}-%{release}
Requires:   %{name} = %{version}

%description docs
Documentation for connman.


%prep
%setup -q -n %{name}-%{version}/connman

%build
%reconfigure --disable-static \
109
    --with-version=%{version} \
Carsten Munk's avatar
Carsten Munk committed
110
    --enable-ethernet=builtin \
111
    --disable-wifi \
Carsten Munk's avatar
Carsten Munk committed
112 113 114
    --enable-bluetooth=builtin \
    --enable-openconnect=builtin \
    --enable-openvpn=builtin \
115
    --enable-vpnc=builtin \
116 117
    --enable-l2tp=builtin \
    --enable-pptp=builtin \
Carsten Munk's avatar
Carsten Munk committed
118 119 120 121
    --enable-loopback=builtin \
    --enable-pacrunner=builtin \
    --enable-client \
    --enable-test \
122 123
    --enable-sailfish-gps \
    --enable-sailfish-wakeup-timer \
124
    --enable-sailfish-debuglog \
125
    --enable-sailfish-ofono \
126
    --enable-sailfish-usb-tethering \
127
    --enable-sailfish-wifi \
128
    --enable-sailfish-access \
129
    --disable-gadget \
Pekka Lundstrom's avatar
Pekka Lundstrom committed
130
    --with-systemdunitdir=/%{_lib}/systemd/system \
131
    --enable-systemd \
132
    --with-tmpfilesdir=%{_libdir}/tmpfiles.d
Carsten Munk's avatar
Carsten Munk committed
133

134
make %{?_smp_mflags}
Carsten Munk's avatar
Carsten Munk committed
135

Slava Monich's avatar
Slava Monich committed
136 137 138
%check
make check

Carsten Munk's avatar
Carsten Munk committed
139 140 141
%install
rm -rf %{buildroot}
%make_install
142 143 144

mkdir -p %{buildroot}%{_libdir}/%{name}/tools
cp -a tools/stats-tool %{buildroot}%{_libdir}/%{name}/tools
145 146 147 148
cp -a tools/*-test %{buildroot}%{_libdir}/%{name}/tools
cp -a tools/iptables-unit %{buildroot}%{_libdir}/%{name}/tools
cp -a tools/wispr %{buildroot}%{_libdir}/%{name}/tools

Carsten Munk's avatar
Carsten Munk committed
149
mkdir -p %{buildroot}%{_sysconfdir}/connman/
150
cp -a %{SOURCE1} %{buildroot}%{_sysconfdir}/connman/
Carsten Munk's avatar
Carsten Munk committed
151 152 153 154 155 156

mkdir -p %{buildroot}/%{_lib}/systemd/system/network.target.wants
ln -s ../connman.service %{buildroot}/%{_lib}/systemd/system/network.target.wants/connman.service

%preun
if [ "$1" -eq 0 ]; then
157
systemctl stop connman.service || :
Carsten Munk's avatar
Carsten Munk committed
158 159 160
fi

%post
161 162 163 164 165 166 167 168 169 170 171 172
# These should match connman_resolvconf.conf rules
%define connman_run_dir /var/run/connman
%define run_resolv_conf %{connman_run_dir}/resolv.conf
%define etc_resolv_conf %{_sysconfdir}/resolv.conf

mkdir -p %{connman_run_dir} || :
if [ -f %{etc_resolv_conf} -a ! -f %{run_resolv_conf} ]; then
cp %{etc_resolv_conf} %{run_resolv_conf} || :
fi
rm -f %{etc_resolv_conf} || :
ln -s %{run_resolv_conf} %{etc_resolv_conf} || :

173
systemctl daemon-reload || :
Carsten Munk's avatar
Carsten Munk committed
174 175 176 177 178
# Do not restart connman here or network breaks.
# We can't reload it either as connman doesn't
# support that feature.

%postun
179 180 181
if [ "$1" -eq 0 -a -L %{etc_resolv_conf} ]; then
rm %{etc_resolv_conf} || :
fi
182
systemctl daemon-reload || :
Carsten Munk's avatar
Carsten Munk committed
183 184 185

%files
%defattr(-,root,root,-)
186
%doc COPYING
187 188 189
%{_sbindir}/connman-vpnd
%{_sbindir}/connmand
%{_bindir}/connmanctl
Carsten Munk's avatar
Carsten Munk committed
190
%{_libdir}/%{name}/scripts/*
191
%{_libdir}/tmpfiles.d/connman_resolvconf.conf
Carsten Munk's avatar
Carsten Munk committed
192 193 194 195
%config %{_sysconfdir}/dbus-1/system.d/*.conf
/%{_lib}/systemd/system/connman.service
/%{_lib}/systemd/system/network.target.wants/connman.service
/%{_lib}/systemd/system/connman-vpn.service
196
/%{_datadir}/dbus-1/system-services/net.connman.vpn.service
Carsten Munk's avatar
Carsten Munk committed
197

198 199 200 201
%files wait-online
%{_sbindir}/connmand-wait-online
/%{_lib}/systemd/system/connman-wait-online.service

Carsten Munk's avatar
Carsten Munk committed
202 203
%files devel
%defattr(-,root,root,-)
204
%doc AUTHORS COPYING ChangeLog README
Carsten Munk's avatar
Carsten Munk committed
205
%{_includedir}/%{name}/*.h
206 207
%{_includedir}/%{name}/vpn/*.h
%{_includedir}/%{name}/vpn/plugins/*.h
Carsten Munk's avatar
Carsten Munk committed
208 209 210 211 212 213
%{_libdir}/pkgconfig/*.pc

%files test
%defattr(-,root,root,-)
%{_libdir}/%{name}/test/*

214 215 216 217
%files tools
%defattr(-,root,root,-)
%{_libdir}/%{name}/tools/*

Carsten Munk's avatar
Carsten Munk committed
218 219 220 221 222 223 224
%files configs-mer
%defattr(-,root,root,-)
%config %{_sysconfdir}/connman/main.conf

%files docs
%defattr(-,root,root,-)
%{_datadir}/man/man5/connman.conf.5.gz
225 226 227
%{_datadir}/man/man5/connman-service.config.5.gz
%{_datadir}/man/man5/connman-vpn-provider.config.5.gz
%{_datadir}/man/man5/connman-vpn.conf.5.gz
Carsten Munk's avatar
Carsten Munk committed
228
%{_datadir}/man/man8/connman.8.gz
229
%{_datadir}/man/man8/connman-vpn.8.gz
230
%{_datadir}/man/man1/connmanctl.1.gz