Use pre-built files for packaging
[platform/upstream/connectedhomeip.git] / packaging / connectedhomeip.spec
1 Name:       connectedhomeip
2 Summary:    Project Connected Home over IP
3 Version:    0.0.1
4 Release:    1
5 Group:      Network & Connectivity/Other
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8 Source1:    %{name}.manifest
9 Source2:    %{name}.pc
10
11 BuildRequires: pkgconfig(dbus-1)
12 BuildRequires: pkgconfig(gio-2.0)
13 BuildRequires: pkgconfig(glib-2.0)
14 BuildRequires: pkgconfig(gio-unix-2.0)
15 BuildRequires: pkgconfig(dns_sd)
16
17 BuildRequires: python3
18 BuildRequires: gn
19 BuildRequires: ninja
20 Requires(post): /sbin/ldconfig
21 Requires(postun): /sbin/ldconfig
22
23 %description
24 Project Connected Home over IP is a new Working Group within the Zigbee Alliance.
25 This Working Group plans to develop and promote the adoption of a new, royalty-free
26 connectivity standard to increase compatibility among smart home products, with security as a fundamental design tenet
27
28 %package devel
29 Summary: Connected Home over IP for development
30 Requires: %{name} = %{version}-%{release}
31
32 %description devel
33 This package is for CHIP development
34
35 %package test
36 Summary: Connected Home over IP Test applications
37 Requires: %{name} = %{version}-%{release}
38
39 %description test
40 This package is for CHIP test applications
41
42 %prep
43 %setup -q
44 chmod 644 %{SOURCE0}
45 cp %{SOURCE1} ./%{name}.manifest
46 cp %{SOURCE2} ./%{name}.pc
47
48 %build
49 #gn gen out/host --args='is_debug=true target_os="linux" current_cpu="arm"'
50 #ninja -C out/host
51
52 %install
53 # ninja install
54
55 # install libraries
56 mkdir -p %{buildroot}%{_libdir}/chip/
57 find ./out/host/lib -name "*.a" -exec cp '{}' %{buildroot}%{_libdir}/chip/ \;
58
59 cd out/host/obj
60 find ./ -type d -exec mkdir -p %{buildroot}%{_libdir}/chip/{} \;
61 find ./ -name "*.a" -exec cp '{}' %{buildroot}%{_libdir}/chip/{} \;
62 cd -
63
64 # install header files
65 mkdir -p %{buildroot}%{_includedir}/chip/
66 find ./ -type d -exec mkdir -p %{buildroot}%{_includedir}/chip/{} \;
67 find ./ -name "*.h" -exec cp '{}' %{buildroot}%{_includedir}/chip/{} \;
68 find ./ -name "*.hpp" -exec cp '{}' %{buildroot}%{_includedir}/chip/{} \;
69
70 # install examples
71 mkdir -p %{buildroot}%{_bindir}
72
73 cp out/host/chip-tool %{buildroot}%{_bindir}/
74 cp out/host/chip-lighting-app %{buildroot}%{_bindir}/
75 #cp out/host/chip-all-clusters-app %{buildroot}%{_bindir}/
76 cp out/host/chip-shell %{buildroot}%{_bindir}/
77
78 # install pkg-config file
79 mkdir -p %{buildroot}%{_libdir}/pkgconfig
80 cp %{name}.pc %{buildroot}%{_libdir}/pkgconfig 
81
82 %post
83
84 %files
85 %manifest %{name}.manifest
86 %license LICENSE
87
88 %files devel
89 %manifest %{name}.manifest
90 %{_includedir}/chip/*
91 %{_libdir}/chip/*
92 %{_libdir}/pkgconfig/*.pc
93
94 %files test
95 %manifest %{name}.manifest
96 %{_bindir}/chip-tool
97 %{_bindir}/chip-lighting-app
98 #%{_bindir}/chip-all-clusters-app
99 %{_bindir}/chip-shell