Update spec file:
[profile/ivi/connman.git] / packaging / connman.spec
1 Name:       connman
2 Summary:    Connection Manager
3 Version:    1.3
4 Release:    1
5 Group:      System Environment/Daemons
6 License:    GPLv2
7 URL:        http://connman.net/
8 Source0:    %{name}-%{version}.tar.bz2
9 Source1:    settings
10 Source2:    main.conf
11 Requires:   dbus
12 Requires:   wpa_supplicant >= 0.7.1
13 Requires:   bluez
14 Requires:   ofono
15 Requires:   systemd
16 Requires(post):   systemd 
17 Requires(preun):  systemd
18 Requires(postun): systemd
19 BuildRequires:  pkgconfig(libiptc)
20 BuildRequires:  pkgconfig(xtables)
21 %ifarch %{ix86}
22 ##BuildRequires:  pkgconfig(libiWmxSdk-0)
23 %endif
24 BuildRequires:  pkgconfig(glib-2.0)
25 BuildRequires:  pkgconfig(dbus-1)
26 BuildRequires:  pkgconfig(libudev) >= 145
27 ##BuildRequires:  openconnect
28 ##BuildRequires:  openvpn
29 BuildRequires:  iptables-devel
30 BuildRequires:  pkgconfig(gnutls)
31
32
33 %description
34 Connection Manager provides a daemon for managing Internet connections
35 within embedded devices running the Linux operating system.
36
37
38
39 %package devel
40 Summary:    Development files for Connection Manager
41 Group:      Development/Libraries
42 Requires:   %{name} = %{version}-%{release}
43
44 %description devel
45 connman-devel contains development files for use with connman.
46
47 #%package iwmxsdk
48 #Summary:    ConnMan plugin for the Intel WiMAX Network Service
49 #Group:      System/Networking
50 #Requires:   %{name} = %{version}-%{release}
51 #Requires:   WiMAX-Network-Service
52 #
53 #%description iwmxsdk
54 #This plugin allows connman to work with WiMAX devices controlled by
55 #the Intel WiMAX Network Service
56
57
58 %package test
59 Summary:    Test Scripts for Connection Manager
60 Group:      Development/Tools
61 Requires:   %{name} = %{version}-%{release}
62 Requires:   dbus-python
63 Requires:   pygobject
64 Requires:   python-xml
65
66 %description test
67 Scripts for testing Connman and its functionality
68
69
70 %prep
71 %setup -q -n %{name}-%{version}
72
73 %build
74 %configure --disable-static \
75     --enable-ethernet=builtin \
76     --enable-wifi=builtin \
77     --enable-ofono=builtin \
78     --enable-bluetooth=builtin \
79     --enable-loopback=builtin \
80     --enable-threads \
81     --enable-test \
82     --with-systemdunitdir=%{_libdir}/systemd/system
83 # disabled for now:
84 %ifarch %{ix86}
85 ##    --enable-iwmx \
86 %endif
87 ##    --enable-openconnect=builtin \
88 ##    --enable-openvpn=builtin \
89
90 make %{?jobs:-j%jobs}
91
92 %install
93 mkdir -p %{buildroot}%{_sysconfdir}/connman
94 install -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/connman/main.conf
95
96 mkdir -p %{buildroot}%{_libdir}/systemd/system/network.target.wants
97 ln -s ../connman.service %{buildroot}%{_libdir}/systemd/system/network.target.wants/connman.service
98
99 %make_install
100
101 install -d -m 700 %{buildroot}/var/lib/connman
102 install -c -m 600 %{SOURCE1} %{buildroot}/var/lib/connman/settings
103
104 %post
105 if [ $1 -eq 1 ] ; then
106     # Initial installation 
107     /bin/systemctl daemon-reload >/dev/null 2>&1 || :
108 fi
109
110 %preun
111 if [ $1 -eq 0 ] ; then
112     # Package removal, not upgrade
113     /bin/systemctl --no-reload disable %{name}.service > /dev/null 2>&1 || :
114     /bin/systemctl stop %{name}.service > /dev/null 2>&1 || :
115 fi
116
117 %postun
118 /bin/systemctl --system daemon-reload >/dev/null 2>&1 || :
119 if [ $1 -ge 1 ] ; then
120     # Package upgrade, not uninstall
121     /bin/systemctl try-restart %{name}.service >/dev/null 2>&1 || :
122 fi
123
124 %files
125 %defattr(-,root,root,-)
126 %doc AUTHORS COPYING INSTALL ChangeLog NEWS README
127 %{_sbindir}/*
128 #%{_libdir}/%{name}/scripts/*
129 %config %{_sysconfdir}/dbus-1/system.d/*.conf
130 %config %{_sysconfdir}/connman/*.conf
131 %{_libdir}/systemd/system/connman.service
132 %{_libdir}/systemd/system/network.target.wants/connman.service
133 /var/lib/connman/settings
134
135
136 %files devel
137 %defattr(-,root,root,-)
138 %doc AUTHORS COPYING INSTALL
139 %{_includedir}/%{name}/*.h
140 %{_libdir}/pkgconfig/*.pc
141
142 #%files iwmxsdk
143 #%defattr(-,root,root,-)
144 #%ifarch %{ix86}
145 #%{_libdir}/%{name}/plugins/iwmxsdk.so
146 #%doc COPYING README INSTALL
147 #%endif
148
149 %files test
150 %defattr(-,root,root,-)
151 %{_libdir}/%{name}/test/*