1 %define name hal-api-common
2 %define devel_name hal-api-common-devel
3 %define test_name hal-api-common-haltests
5 ### main package #########
7 Summary: %{name} interface
10 Group: Development/Libraries
12 Source0: %{name}-%{version}.tar.gz
13 Source1: %{name}.manifest
14 Source2: libhal-api.conf
15 Source3: systemd-hal-firmware-generator
16 Source4: macros.hal-api
17 Source5: haltest.target
18 Source6: reboot-haltest
19 Source7: reboot-normal
20 Source8: hal-rpmdb-checker.service
21 Source9: hal-rpmdb-checker
23 Requires(post): /sbin/ldconfig
24 Requires(postun): /sbin/ldconfig
26 BuildRequires: pkgconfig(dlog)
27 BuildRequires: pkgconfig(gio-2.0)
28 BuildRequires: pkgconfig(glib-2.0)
29 BuildRequires: pkgconfig(json-c)
30 BuildRequires: pkgconfig(gmock)
31 BuildRequires: pkgconfig(systemd)
36 ### devel package #########
37 %package -n %{devel_name}
38 Summary: %{name} interface
39 Group: Development/Libraries
40 Requires: %{name} = %{version}-%{release}
42 %description -n %{devel_name}
43 %{name} Interface for product vendor developer
45 ### test package #########
46 %package -n %{test_name}
47 Summary: tests for hal-api-common
48 Requires: hal-api-common = %{version}
50 %description -n %{test_name}
51 Haltests for hal-api-common
53 ### build and install #########
57 %define hal_rpmdb_checker_path /opt/etc/hal
59 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DCMAKE_LIBDIR_PREFIX=%{_libdir}
66 (cd tests/unittest && LD_LIBRARY_PATH=../../ ctest -V)
72 mkdir -p %{buildroot}/hal
73 mkdir -p %{buildroot}%{hal_rpmdb_checker_path}
74 install -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/ld.so.conf.d/libhal-api.conf
75 install -D -m 0755 %{SOURCE3} %{buildroot}%{_systemdgeneratordir}/systemd-hal-firmware-generator
76 install -D -m 0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/rpm/macros.hal-api
77 install -D -m 0644 %{SOURCE5} %{buildroot}%{_unitdir}/haltest.target
78 install -D -m 0755 %{SOURCE6} %{buildroot}%{_bindir}/reboot-haltest
79 install -D -m 0755 %{SOURCE7} %{buildroot}%{_bindir}/reboot-normal
80 install -D -m 0644 %{SOURCE8} %{buildroot}%{_unitdir}/hal-rpmdb-checker.service
81 install -D -m 0755 %{SOURCE9} %{buildroot}%{_bindir}/hal-rpmdb-checker
83 %install_service sysinit.target.wants hal-rpmdb-checker.service
90 chsmack -a "System" -t %{hal_rpmdb_checker_path}
95 ### contain files to package #########
98 %manifest %{name}.manifest
99 %defattr(-,root,root,-)
102 %{_sysconfdir}/ld.so.conf.d/libhal-api.conf
103 %{_systemdgeneratordir}/systemd-hal-firmware-generator
105 %files -n %{devel_name}
106 %defattr(-,root,root,-)
107 %{_includedir}/hal/*.h
108 %{_libdir}/pkgconfig/*.pc
109 %{_sysconfdir}/rpm/macros.hal-api
111 %files -n %{test_name}
112 %dir %{hal_rpmdb_checker_path}
113 %attr(0755,system_fw,system_fw) %{hal_rpmdb_checker_path}
114 %{_bindir}/hal/common-haltests
115 %{_unitdir}/haltest.target
116 %{_bindir}/reboot-haltest
117 %{_bindir}/reboot-normal
118 %{_unitdir}/sysinit.target.wants/hal-rpmdb-checker.service
119 %{_unitdir}/hal-rpmdb-checker.service
120 %{_bindir}/hal-rpmdb-checker