]>
Commit | Line | Data |
---|---|---|
010acf0c | 1 | # TODO |
8b71ca8d ER |
2 | # - shared lib is not versioned |
3 | # - can't build shared and static in same build. drop shared bcond | |
4 | # | |
5 | # Conditional build: | |
6 | %bcond_without fuse # Build fuse mount helper | |
7 | %bcond_without qt # Build reference Qt application | |
8 | %bcond_without shared # Build shared library | |
9 | %bcond_with static_libs # don't build static libraries | |
10 | ||
11 | # build doesn't support both | |
12 | %if %{with shared} | |
13 | %undefine static_libs | |
14 | %endif | |
15 | ||
010acf0c ER |
16 | Summary: Android File Transfer for Linux |
17 | Name: android-file-transfer | |
18 | Version: 3.4 | |
980259f2 | 19 | Release: 2 |
010acf0c ER |
20 | License: LGPLv2.1 |
21 | Group: X11/Applications | |
22 | Source0: https://github.com/whoozle/android-file-transfer-linux/archive/v%{version}/%{name}-%{version}.tar.gz | |
23 | # Source0-md5: 691142fdbea216676df27bfc94885f71 | |
24 | URL: https://whoozle.github.io/android-file-transfer-linux/ | |
010acf0c | 25 | BuildRequires: build-essential |
8b71ca8d ER |
26 | BuildRequires: cmake >= 2.8 |
27 | %{?with_fuse:BuildRequires: libfuse-devel} | |
28 | BuildRequires: libmagic-devel | |
6c6c3756 | 29 | BuildRequires: libstdc++-devel |
010acf0c | 30 | BuildRequires: ninja |
6c6c3756 | 31 | BuildRequires: pkgconfig |
010acf0c ER |
32 | BuildRequires: readline-devel |
33 | BuildRequires: rpmbuild(macros) >= 1.727 | |
0c55280c ER |
34 | %if %{with qt} |
35 | BuildRequires: Qt5Widgets-devel | |
36 | BuildRequires: qt5-build | |
37 | BuildRequires: qt5-qmake | |
38 | %endif | |
8b71ca8d ER |
39 | %if %{with shared} |
40 | Requires: %{name}-libs = %{version}-%{release} | |
41 | %endif | |
010acf0c ER |
42 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
43 | ||
44 | %description | |
45 | Android File Transfer for Linux - reliable MTP client with | |
46 | minimalistic UI similar to Android File Transfer for Mac. | |
47 | ||
48 | Features: | |
49 | - Simple Qt UI with progress dialogs. | |
50 | - FUSE wrapper (If you'd prefer mounting your device), supporting | |
51 | partial read/writes, allowing instant access to your files. | |
52 | - No file size limits. | |
53 | - Automatically renames album cover to make it visible from media | |
54 | player. | |
55 | - USB 'Zerocopy' support found in recent Linux kernel (no user/kernel | |
56 | data copying) | |
57 | - No extra dependencies (e.g. libptp/libmtp). | |
58 | - Available as static/shared library. | |
59 | - Command line tool (aft-mtp-cli) | |
60 | ||
8b71ca8d ER |
61 | %package libs |
62 | Summary: Shared %{name} library | |
63 | Group: Libraries | |
64 | ||
65 | %description libs | |
66 | Shared %{name} library. | |
67 | ||
68 | %package static | |
69 | Summary: Static %{name} library | |
70 | Summary(pl.UTF-8): Statyczna biblioteka %{name} | |
71 | Group: Development/Libraries | |
72 | ||
73 | %description static | |
74 | Static %{name} library. | |
75 | ||
76 | %description static -l pl.UTF-8 | |
77 | Statyczna biblioteka %{name}. | |
78 | ||
724bec88 ER |
79 | %package fuse |
80 | Summary: aft-mtp-mount fuse wrapper | |
81 | Group: Applications | |
82 | %if %{with shared} | |
83 | Requires: %{name}-libs = %{version}-%{release} | |
84 | %endif | |
85 | ||
86 | %description fuse | |
87 | FUSE wrapper (If you'd prefer mounting your device), supporting | |
88 | partial read/writes, allowing instant access to your files. | |
89 | ||
0c55280c ER |
90 | %package qt |
91 | Summary: Qt GUI | |
92 | Group: X11/Applications | |
724bec88 ER |
93 | %if %{with shared} |
94 | Requires: %{name}-libs = %{version}-%{release} | |
95 | %endif | |
d8b9bd55 ER |
96 | Requires: desktop-file-utils |
97 | Requires: gtk-update-icon-cache | |
98 | Requires: hicolor-icon-theme | |
0c55280c ER |
99 | |
100 | %description qt | |
101 | Qt GUI. | |
102 | ||
010acf0c ER |
103 | %prep |
104 | %setup -q -n %{name}-linux-%{version} | |
105 | ||
106 | %build | |
107 | install -d build | |
108 | cd build | |
8b71ca8d ER |
109 | %cmake -G Ninja \ |
110 | -DBUILD_FUSE=%{!?with_fuse:OFF}%{?with_fuse:ON} \ | |
111 | -DBUILD_QT_UI=%{!?with_qt:OFF}%{?with_qt:ON} \ | |
112 | -DBUILD_SHARED_LIB=%{!?with_shared:OFF}%{?with_shared:ON} \ | |
113 | .. | |
010acf0c ER |
114 | %ninja_build |
115 | ||
116 | %install | |
117 | rm -rf $RPM_BUILD_ROOT | |
118 | %ninja_install -C build | |
119 | ||
120 | %clean | |
121 | rm -rf $RPM_BUILD_ROOT | |
122 | ||
d8b9bd55 ER |
123 | %post qt |
124 | %update_desktop_database | |
125 | %update_icon_cache hicolor | |
126 | ||
127 | %postun qt | |
128 | %update_desktop_database | |
129 | %update_icon_cache hicolor | |
130 | ||
010acf0c ER |
131 | %files |
132 | %defattr(644,root,root,755) | |
133 | %attr(755,root,root) %{_bindir}/aft-mtp-cli | |
724bec88 ER |
134 | |
135 | %if %{with fuse} | |
136 | %files fuse | |
137 | %defattr(644,root,root,755) | |
010acf0c | 138 | %attr(755,root,root) %{_bindir}/aft-mtp-mount |
724bec88 | 139 | %endif |
0c55280c | 140 | |
724bec88 | 141 | %if %{with qt} |
0c55280c ER |
142 | %files qt |
143 | %defattr(644,root,root,755) | |
010acf0c | 144 | %attr(755,root,root) %{_bindir}/android-file-transfer |
010acf0c | 145 | %{_desktopdir}/android-file-transfer.desktop |
d8b9bd55 | 146 | %{_iconsdir}/hicolor/*/apps/android-file-transfer.png |
010acf0c | 147 | %{_datadir}/metainfo/android-file-transfer.appdata.xml |
0c55280c | 148 | %endif |
8b71ca8d ER |
149 | |
150 | %if %{with shared} | |
151 | %files libs | |
152 | %defattr(644,root,root,755) | |
153 | %attr(755,root,root) %{_libdir}/libmtp-ng.so | |
154 | %endif | |
155 | ||
156 | %if %{with static_libs} | |
157 | %files static | |
158 | %defattr(644,root,root,755) | |
159 | %{_libdir}/libmtp-ng-static.a | |
160 | %endif |