]>
Commit | Line | Data |
---|---|---|
b30439c1 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without dist_kernel # allow non-distribution kernel | |
8249fc65 | 4 | %bcond_with kernel # don't build kernel modules |
b30439c1 ER |
5 | %bcond_without userspace # don't build userspace programs |
6 | %bcond_with verbose # verbose build (V=1) | |
7 | ||
8249fc65 ER |
8 | %if %{without kernel} |
9 | %undefine with_dist_kernel | |
10 | %endif | |
11 | %if "%{_alt_kernel}" != "%{nil}" | |
12 | %undefine with_userspace | |
13 | %endif | |
14 | %if %{without userspace} | |
15 | # nothing to be placed to debuginfo package | |
16 | %define _enable_debug_packages 0 | |
17 | %endif | |
18 | ||
40c58df2 | 19 | %define rel 2 |
8249fc65 | 20 | %define pname ipheth |
b30439c1 | 21 | Summary: iPhone USB Ethernet Driver |
956d0e5c | 22 | Name: %{pname}%{_alt_kernel} |
2e51e059 | 23 | Version: 1.0 |
8249fc65 ER |
24 | Release: %{rel} |
25 | License: BSD/GPL v2 | |
b30439c1 | 26 | Group: X11/Applications |
956d0e5c | 27 | Source0: https://github.com/downloads/dgiagio/ipheth/ipheth-%{version}.tar.gz |
2e51e059 | 28 | # Source0-md5: 80548f0d419ff0c2784d148b40b2aeb6 |
b30439c1 ER |
29 | URL: http://giagio.com/wiki/moin.cgi/iPhoneEthernetDriver |
30 | BuildRequires: libimobiledevice-devel | |
31 | Requires: udev-core | |
40c58df2 | 32 | Requires: usbmuxd |
b30439c1 ER |
33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
34 | ||
35 | %description | |
36 | This is a Linux Kernel driver that adds support for iPhone tethering | |
37 | through USB cables. Unlike other solutions out there, you don't need | |
38 | to jailbreak your phone or install third-party proxy applications. | |
39 | ||
8249fc65 ER |
40 | %package -n kernel%{_alt_kernel}-net-ipheth |
41 | Summary: Linux driver for iPhone USB Ethernet Driver | |
42 | Release: %{rel}@%{_kernel_ver_str} | |
43 | Group: Base/Kernel | |
44 | Requires(post,postun): /sbin/depmod | |
45 | %if %{with dist_kernel} | |
46 | %requires_releq_kernel | |
47 | Requires(postun): %releq_kernel | |
48 | %endif | |
49 | ||
50 | %description -n kernel%{_alt_kernel}-net-ipheth | |
51 | Linux driver for iPhone USB Ethernet Driver. | |
52 | ||
b30439c1 | 53 | %prep |
2e51e059 | 54 | %setup -q |
b30439c1 ER |
55 | |
56 | %build | |
8249fc65 ER |
57 | %if %{with kernel} |
58 | %build_kernel_modules -C ipheth-driver -m ipheth CONFIG_DEBUG_SECTION_MISMATCH=y | |
59 | %endif | |
b30439c1 ER |
60 | %if %{with userspace} |
61 | %{__make} -C ipheth-pair \ | |
62 | CC="%{__cc}" \ | |
63 | CFLAGS="%{rpmcflags}" | |
64 | %endif | |
65 | ||
66 | %install | |
67 | rm -rf $RPM_BUILD_ROOT | |
8249fc65 | 68 | %if %{with kernel} |
0120bdab ER |
69 | %install_kernel_modules -m ipheth-driver/ipheth -d misc -s update -n %{pname} |
70 | cat <<'EOF' >> /etc/modprobe.d/%{_kernel_ver}/%{pname}.conf | |
71 | blacklist %{pname} | |
72 | EOF | |
8249fc65 ER |
73 | %endif |
74 | ||
b30439c1 ER |
75 | %if %{with userspace} |
76 | install -d $RPM_BUILD_ROOT{/lib/udev,/etc/udev/rules.d} | |
77 | install -p ipheth-pair/ipheth-pair $RPM_BUILD_ROOT/lib/udev | |
956d0e5c | 78 | cp -p ipheth-pair/90-iphone-tether.rules $RPM_BUILD_ROOT/etc/udev/rules.d |
b30439c1 ER |
79 | %endif |
80 | ||
81 | %clean | |
82 | rm -rf $RPM_BUILD_ROOT | |
83 | ||
8249fc65 ER |
84 | %post -n kernel%{_alt_kernel}-net-ipheth |
85 | %depmod %{_kernel_ver} | |
86 | ||
87 | %postun -n kernel%{_alt_kernel}-net-ipheth | |
88 | %depmod %{_kernel_ver} | |
89 | ||
b30439c1 ER |
90 | %files |
91 | %defattr(644,root,root,755) | |
92 | %config(noreplace) %verify(not md5 mtime size) /etc/udev/rules.d/90-iphone-tether.rules | |
93 | %attr(755,root,root) /lib/udev/ipheth-pair | |
8249fc65 ER |
94 | |
95 | %if %{with kernel} | |
96 | %files -n kernel%{_alt_kernel}-net-ipheth | |
97 | %defattr(644,root,root,755) | |
0120bdab | 98 | /etc/modprobe.d/%{_kernel_ver}/%{pname}.conf |
8249fc65 ER |
99 | /lib/modules/%{_kernel_ver}/misc/*.ko* |
100 | %endif |