common: move file paths to spec file
[platform/core/api/system-info.git] / packaging / capi-system-info.spec
1 %bcond_with x
2 %bcond_with wayland
3 Name:           capi-system-info
4 Version:        0.2.0
5 Release:        0
6 License:        Apache-2.0
7 Summary:        A System Information library in Core API
8 Group:          System/API
9 Source0:        %{name}-%{version}.tar.gz
10 Source1001:     %{name}.manifest
11 Source2001:     tizenid.service
12 BuildRequires:  cmake
13 BuildRequires:  pkgconfig(capi-base-common)
14 BuildRequires:  pkgconfig(dlog)
15 BuildRequires:  pkgconfig(iniparser)
16 BuildRequires:  pkgconfig(libxml-2.0)
17 BuildRequires:  pkgconfig(openssl)
18 BuildRequires:  pkgconfig(cryptsvc)
19 %if %{with wayland}
20 BuildRequires:  pkgconfig(ecore-wayland)
21 %endif
22 %if %{with x}
23 BuildRequires:  pkgconfig(x11)
24 BuildRequires:  pkgconfig(xi)
25 BuildRequires:  pkgconfig(xrandr)
26 %endif
27
28 %description
29
30
31 %package devel
32 Summary:  A System Information library in Core API (Development)
33 Group:    Development/System
34 Requires: %{name} = %{version}-%{release}
35
36 %description devel
37
38
39 %prep
40 %setup -q
41 cp %{SOURCE1001} .
42
43 %define config_file_path /etc/config/model-config.xml
44 %define info_file_path /etc/info.ini
45 %define os_release_file_path /etc/os-release
46 %define serial_path /csa/imei/serialno.dat
47 %define tizen_id_path /opt/home/root/tizenid
48
49 %build
50 %cmake . \
51 %if !%{with x} && %{with wayland}
52                 -DENABLE_WAYLAND=TRUE \
53 %endif
54                 -DCONFIG_FILE_PATH=%{config_file_path} \
55                 -DINFO_FILE_PATH=%{info_file_path} \
56                 -DOS_RELEASE_FILE_PATH=%{os_release_file_path} \
57                 -DSERIAL_PATH=%{serial_path} \
58                 -DTIZEN_ID_PATH=%{tizen_id_path}
59
60 %__make %{?_smp_mflags}
61
62 %install
63 %make_install
64 mkdir -p %{buildroot}/etc
65 cp -f script/make_info_file.sh %{buildroot}/etc/make_info_file.sh
66
67 mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants
68 install -m 0644 %SOURCE2001 %{buildroot}%{_libdir}/systemd/system/tizenid.service
69 ln -s ../tizenid.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/tizenid.service
70
71 %post -p /sbin/ldconfig
72
73 %postun -p /sbin/ldconfig
74
75
76 %files
77 %manifest %{name}.manifest
78 %license LICENSE.APLv2
79 %{_libdir}/libcapi-system-info.so.*
80 %attr(0744,root,-) /etc/make_info_file.sh
81 %{_bindir}/tizen_id
82 %{_libdir}/systemd/system/tizenid.service
83 %{_libdir}/systemd/system/multi-user.target.wants/tizenid.service
84
85 %files devel
86 %manifest %{name}.manifest
87 %{_includedir}/system/system_info.h
88 %{_includedir}/system/system_info_type.h
89 %{_libdir}/pkgconfig/*.pc
90 %{_libdir}/libcapi-system-info.so