]>
Commit | Line | Data |
---|---|---|
f72891e2 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without dist_kernel # allow non-distribution kernel | |
4 | %bcond_without kernel # don't build kernel modules | |
5 | %bcond_without userspace # don't build userspace programs | |
6 | %bcond_with verbose # verbose build (V=1) | |
7 | # | |
8 | %if %{without kernel} | |
9 | %undefine with_dist_kernel | |
10 | %endif | |
11 | ||
2b368ad7 | 12 | %define rel 14 |
9f4e5300 | 13 | %define pname linux-one |
f72891e2 JB |
14 | Summary: One IPC Linux kernel module |
15 | Summary(pl.UTF-8): Moduł IPC One dla jądra Linuksa | |
9f4e5300 | 16 | Name: %{pname}%{_alt_kernel} |
f72891e2 | 17 | Version: 1.6.0 |
f72891e2 JB |
18 | Release: %{rel} |
19 | License: GPL v2+ | |
20 | Group: Base/Kernel | |
21 | # when packaged in DirectFB tarball | |
22 | #Source0: http://www.directfb.org/downloads/Core/DirectFB/DirectFB-%{version}.tar.gz | |
23 | # but currently: | |
24 | # $ git clone git://git.directfb.org/git/directfb/core/DirectFB.git DirectFB.git | |
25 | # $ tar cf linux-one.tar -C DirectFB.git/lib/One linux-one | |
9f4e5300 | 26 | Source0: %{pname}.tar.xz |
f72891e2 JB |
27 | # Source0-md5: d794442fccb99b82c9c3d0b2d5609aaa |
28 | Source1: OneTypes.h | |
29 | URL: http://www.directfb.org/ | |
30 | %if %{with kernel} | |
31 | %{?with_dist_kernel:BuildRequires: kernel-module-build >= 3:2.6.20.2} | |
32 | BuildRequires: rpmbuild(macros) >= 1.379 | |
33 | %endif | |
34 | BuildRequires: sed >= 4.0 | |
35 | BuildRequires: tar >= 1:1.22 | |
36 | BuildRequires: xz | |
37 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
38 | ||
39 | %description | |
40 | One IPC Linux kernel module. | |
41 | ||
42 | Linux One is the new IPC API used by Coma. | |
43 | ||
44 | %description -l pl.UTF-8 | |
45 | Moduł IPC One dla jądra Linuksa. | |
46 | ||
47 | Linux One to nowe API IPC wykorzystywane przez Comę. | |
48 | ||
49 | %package devel | |
50 | Summary: Header file for One IPC device | |
51 | Summary(pl.UTF-8): Plik nagłówkowy dla urządzenia IPC One | |
52 | Group: Development/Libraries | |
53 | Requires: linux-libc-headers | |
54 | ||
55 | %description devel | |
56 | Header file for One IPC device. | |
57 | ||
58 | Linux One is the new IPC API used by Coma. | |
59 | ||
60 | %description devel -l pl.UTF-8 | |
61 | Plik nagłówkowy dla urządzenia IPC One. | |
62 | ||
63 | Linux One to nowe API IPC wykorzystywane przez Comę. | |
64 | ||
c2aa6016 | 65 | %package -n kernel%{_alt_kernel}-misc-one |
f72891e2 JB |
66 | Summary: One IPC module for Linux kernel |
67 | Summary(pl.UTF-8): Moduł IPC One dla jądra Linuksa | |
68 | Release: %{rel}@%{_kernel_ver_str} | |
69 | Group: Base/Kernel | |
70 | Requires(post,postun): /sbin/depmod | |
71 | %if %{with dist_kernel} | |
9f4e5300 JR |
72 | %requires_releq_kernel |
73 | Requires(postun): %releq_kernel | |
f72891e2 | 74 | %endif |
9f4e5300 | 75 | Obsoletes: kernel-one |
f72891e2 | 76 | |
c2aa6016 | 77 | %description -n kernel%{_alt_kernel}-misc-one |
f72891e2 JB |
78 | One IPC module for Linux kernel. |
79 | ||
80 | Linux One is the new IPC API used by Coma. | |
81 | ||
c2aa6016 | 82 | %description -n kernel%{_alt_kernel}-misc-one -l pl.UTF-8 |
f72891e2 JB |
83 | Moduł IPC One dla jądra Linuksa. |
84 | ||
85 | Linux One to nowe API IPC wykorzystywane przez Comę. | |
86 | ||
87 | %prep | |
9f4e5300 | 88 | %setup -q -n %{pname} |
f72891e2 JB |
89 | |
90 | sed -i -e 's/^obj-[^ ]*/obj-m/' src/Makefile-2.6 | |
91 | echo "EXTRA_CFLAGS = -I`pwd`/include -I`pwd`/src/single" >> src/Makefile-2.6 | |
92 | ||
93 | cp %{SOURCE1} include | |
94 | ||
95 | %build | |
96 | %if %{with kernel} | |
97 | cd src | |
98 | ln -sf Makefile-2.6 Makefile | |
99 | # NOTE: build_kernel_modules (as of rpm macros 1.649) doesn't allow line breaking | |
100 | %build_kernel_modules -m linux-one ONECORE=single | |
101 | %endif | |
102 | ||
103 | %install | |
104 | rm -rf $RPM_BUILD_ROOT | |
105 | ||
106 | %if %{with userspace} | |
107 | install -d $RPM_BUILD_ROOT%{_includedir}/linux | |
108 | install include/linux/one.h $RPM_BUILD_ROOT%{_includedir}/linux | |
109 | %endif | |
110 | ||
111 | %if %{with kernel} | |
112 | cd src | |
9f4e5300 | 113 | %install_kernel_modules -m linux-one -d misc |
f72891e2 JB |
114 | %endif |
115 | ||
116 | %clean | |
117 | rm -rf $RPM_BUILD_ROOT | |
118 | ||
c070e9ae | 119 | %post -n kernel%{_alt_kernel}-misc-one |
f72891e2 JB |
120 | %depmod %{_kernel_ver} |
121 | ||
c070e9ae | 122 | %postun -n kernel%{_alt_kernel}-misc-one |
f72891e2 JB |
123 | %depmod %{_kernel_ver} |
124 | ||
125 | %if %{with userspace} | |
126 | %files devel | |
127 | %defattr(644,root,root,755) | |
128 | %doc README TODO | |
129 | %{_includedir}/linux/one.h | |
130 | %endif | |
131 | ||
132 | %if %{with kernel} | |
c2aa6016 | 133 | %files -n kernel%{_alt_kernel}-misc-one |
f72891e2 | 134 | %defattr(644,root,root,755) |
9f4e5300 | 135 | /lib/modules/%{_kernel_ver}/misc/linux-one.ko* |
f72891e2 | 136 | %endif |