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(libxml-2.0)
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}
49 Requires(post): /sbin/ldconfig
50 Requires(post): systemd
51 Requires(post): security-config
52 Requires(postun): /sbin/ldconfig
54 %description -n %{test_name}
55 Haltests for hal-api-common
57 ### build and install #########
61 %define hal_rpmdb_checker_path /opt/etc/hal
63 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
64 -DCMAKE_LIBDIR_PREFIX=%{_libdir} \
72 (cd tests/unittest && LD_LIBRARY_PATH=../../ ctest -V)
78 mkdir -p %{buildroot}/hal
79 mkdir -p %{buildroot}%{hal_rpmdb_checker_path}
80 install -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/ld.so.conf.d/libhal-api.conf
81 install -D -m 0755 %{SOURCE3} %{buildroot}%{_systemdgeneratordir}/systemd-hal-firmware-generator
82 install -D -m 0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/rpm/macros.hal-api
83 install -D -m 0644 %{SOURCE5} %{buildroot}%{_unitdir}/haltest.target
84 install -D -m 0755 %{SOURCE6} %{buildroot}%{_bindir}/reboot-haltest
85 install -D -m 0755 %{SOURCE7} %{buildroot}%{_bindir}/reboot-normal
86 install -D -m 0644 %{SOURCE8} %{buildroot}%{_unitdir}/hal-rpmdb-checker.service
87 install -D -m 0755 %{SOURCE9} %{buildroot}%{_bindir}/hal-rpmdb-checker
89 %install_service sysinit.target.wants hal-rpmdb-checker.service
96 chsmack -a "System" -t %{hal_rpmdb_checker_path}
97 systemd-tmpfiles /usr/lib/tmpfiles.d/hal-rpmdb-checker.conf --create
102 ### contain files to package #########
105 %manifest %{name}.manifest
106 %defattr(-,root,root,-)
110 %{_sysconfdir}/ld.so.conf.d/libhal-api.conf
111 %{_systemdgeneratordir}/systemd-hal-firmware-generator
113 %files -n %{devel_name}
114 %defattr(-,root,root,-)
115 %{_includedir}/hal/*.h
116 %{_includedir}/halcc/*.h
117 %{_libdir}/pkgconfig/*.pc
118 %{_sysconfdir}/rpm/macros.hal-api
120 %files -n %{test_name}
121 %dir %{hal_rpmdb_checker_path}
122 %attr(0755,system_fw,system_fw) %{hal_rpmdb_checker_path}
123 %{_unitdir}/haltest.target
124 %{_bindir}/reboot-haltest
125 %{_bindir}/reboot-normal
126 %{_unitdir}/sysinit.target.wants/hal-rpmdb-checker.service
127 %{_unitdir}/hal-rpmdb-checker.service
128 %{_bindir}/hal-rpmdb-checker
129 /usr/lib/tmpfiles.d/hal-rpmdb-checker.conf