1 | # |
---|
2 | # ST-Link Version 1. |
---|
3 | # |
---|
4 | # This configuration file configure's, make's and install's SL-Link. |
---|
5 | # |
---|
6 | |
---|
7 | %if %{release} == %{nil} |
---|
8 | %define release 1 |
---|
9 | %endif |
---|
10 | |
---|
11 | %include %{_configdir}/base.cfg |
---|
12 | |
---|
13 | %define stlink_version 3494c11 |
---|
14 | |
---|
15 | Name: texane-stlink-%{stlink_version}-%{release} |
---|
16 | Summary: ST-Link v%{stlink_version} for host %{_host} |
---|
17 | Version: %{stlink_version} |
---|
18 | Release: %{release} |
---|
19 | URL: https://github.com/texane/stlink/ |
---|
20 | BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n) |
---|
21 | |
---|
22 | # |
---|
23 | # Source |
---|
24 | # |
---|
25 | %source set stlink https://api.github.com/repos/texane/stlink/texane-stlink-%{stlink_version}.tar.gz |
---|
26 | %patch add stlink texane-stlink-3494c11-2.diff |
---|
27 | |
---|
28 | # |
---|
29 | # Prepare the source code. |
---|
30 | # |
---|
31 | %prep |
---|
32 | %source setup stlink -q -c -n %{name}-%{version} |
---|
33 | cd texane-stlink-%{stlink_version} |
---|
34 | %patch setup stlink -p1 |
---|
35 | cd .. |
---|
36 | |
---|
37 | %build |
---|
38 | export PATH="%{_bindir}:${PATH}" |
---|
39 | |
---|
40 | cd texane-stlink-%{stlink_version} |
---|
41 | |
---|
42 | ./autogen.sh |
---|
43 | |
---|
44 | %if "%{_build}" != "%{_host}" |
---|
45 | CFLAGS_FOR_BUILD="-g -O2 -Wall" \ |
---|
46 | %endif |
---|
47 | CPPFLAGS="-I $SB_TMPPREFIX/include/libusb-1.0" \ |
---|
48 | CFLAGS="$SB_CFLAGS" \ |
---|
49 | LDFLAGS="-L $SB_TMPPREFIX/lib" \ |
---|
50 | ./configure \ |
---|
51 | --build=%{_build} --host=%{_host} \ |
---|
52 | --verbose \ |
---|
53 | --prefix=%{_prefix} --bindir=%{_bindir} \ |
---|
54 | --exec-prefix=%{_exec_prefix} \ |
---|
55 | --includedir=%{_includedir} --libdir=%{_libdir} \ |
---|
56 | --mandir=%{_mandir} --infodir=%{_infodir} |
---|
57 | |
---|
58 | %{__make} %{?_smp_mflags} all |
---|
59 | |
---|
60 | cd .. |
---|
61 | |
---|
62 | %install |
---|
63 | export PATH="%{_bindir}:${PATH}" |
---|
64 | rm -rf $SB_BUILD_ROOT |
---|
65 | |
---|
66 | cd texane-stlink-%{stlink_version} |
---|
67 | %{__make} DESTDIR=$SB_BUILD_ROOT install |
---|
68 | |
---|
69 | cd .. |
---|