aboutsummaryrefslogtreecommitdiffstats
path: root/rpm-local/spec/osmocom-bb/osmocom-bb.spec
blob: da4f380f404e120811a425f692ebdf47700c36ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#
# spec file for package osmocom-bb
#
# Copyright (c) 2017, Martin Hauke <mardnh@gmx.de>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

%ifarch %{ix86} x86_64
%define build_firmware 1
%else
%define build_firmware 0
%endif

%if 0%{?centos_ver}
%define build_firmware 0
%endif

%define osmocom_bb_dir /opt/osmocom-bb

Name:           osmocom-bb
Version:        0.0.0.git1588674152.901ac897
Release:        0
Summary:        OsmocomBB MS-side GSM Protocol stack (L1, L2, L3)
License:        GPL-2.0
Group:          Productivity/Telephony/Utilities
URL:            http://bb.osmocom.org/trac/
Source:         %{name}-%{version}.tar.xz
Patch2:         osmocom-bb-enable-tx.patch
Patch3:         osmocom-bb-pkgconfig-find-lua.patch
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  gcc-c++
BuildRequires:  git-core
BuildRequires:  libtool
BuildRequires:  pkgconfig
BuildRequires:  python3
# SLES does not provide gpsd-devel, so build without gps-support on those systems
%if 0%{?is_opensuse}
BuildRequires:  pkgconfig(libgps)
%endif
BuildRequires:  pkgconfig(libosmocodec)
BuildRequires:  pkgconfig(libosmocoding)
BuildRequires:  pkgconfig(libosmocore)
BuildRequires:  pkgconfig(libosmogb)
BuildRequires:  pkgconfig(libosmogsm)
BuildRequires:  pkgconfig(libosmovty)
%if 0%{?suse_version} >= 1500
BuildRequires:  pkgconfig(lua) >= 5.3
%endif
%if 0%{?build_firmware}
BuildRequires:  arm-elf-binutils
BuildRequires:  arm-elf-gcc
# HACK: Disable all post-build-checks
BuildRequires:  -post-build-checks
%endif

%description
OsmocomBB MS-side GSM Protocol stack (L1, L2, L3) including firmware

%package firmware
Summary:        OsmocomBB MS-side GSM Protocol stack - firmware
Group:          Productivity/Telephony/Utilities
Requires:       %{name} = %{version}

%description firmware
OsmocomBB MS-side GSM Protocol stack (L1, L2, L3) including firmware.

This subpackage provides firmware-images for various TI-calypto based
phones.

%prep
%setup -q
%patch2 -p1
%patch3 -p1

# fix python shebangs
find . -type f -name "*.py" -exec sed -i '/^#!/ s|.*|#!%{__python3}|' {} \;

%build
echo "%{version}" >src/host/osmocon/.tarball-version
echo "%{version}" >src/host/gsmmap/.tarball-version
echo "%{version}" >src/shared/libosmocore/.tarball-version
#
%if 0%{?build_firmware}
export PATH=$PATH:/opt/arm-elf-toolchain/bin
make V=1 -C src/ %{?_smp_mflags}
%else
make V=1 nofirmware -C src/ %{?_smp_mflags}
%endif

%install
mkdir -p %{buildroot}/%{osmocom_bb_dir}
install -Dm 0755 src/host/osmocon/osmocon %{buildroot}/%{osmocom_bb_dir}/host/osmocon/osmocon
install -Dm 0755 src/host/osmocon/osmoload %{buildroot}/%{osmocom_bb_dir}/host/osmocon/osmoload
install -Dm 0755 src/host/layer23/src/misc/bcch_scan %{buildroot}/%{osmocom_bb_dir}/host/layer23/src/misc/bcch_scan
install -Dm 0755 src/host/layer23/src/misc/cbch_sniff %{buildroot}/%{osmocom_bb_dir}/host/layer23/src/misc/cbch_sniff
install -Dm 0755 src/host/layer23/src/misc/ccch_scan %{buildroot}/%{osmocom_bb_dir}/host/layer23/src/misc/ccch_scan
install -Dm 0755 src/host/layer23/src/misc/cell_log %{buildroot}/%{osmocom_bb_dir}/host/layer23/src/misc/cell_log
install -Dm 0755 src/host/layer23/src/misc/echo_test %{buildroot}/%{osmocom_bb_dir}/host/layer23/src/misc/echo_test
install -Dm 0755 src/host/layer23/src/mobile/mobile %{buildroot}/%{osmocom_bb_dir}/host/layer23/src/mobile/mobile
install -Dm 0755 src/host/gsmmap/gsmmap %{buildroot}/%{osmocom_bb_dir}/host/gsmmap/gsmmap
install -Dm 0755 src/host/virt_phy/src/virtphy %{buildroot}/%{osmocom_bb_dir}/host/virt_phy/src/virtphy
install -Dm 0755 src/host/gprsdecode/gprsdecode %{buildroot}/%{osmocom_bb_dir}/host/gprsdecode/gprsdecode
install -Dm 0755 src/host/trxcon/trxcon %{buildroot}/%{osmocom_bb_dir}/host/trxcon/trxcon
install -d %{buildroot}/%{osmocom_bb_dir}/target/trx_toolkit/
install -m 0755 src/target/trx_toolkit/*.py %{buildroot}/%{osmocom_bb_dir}/target/trx_toolkit/

%if 0%{?build_firmware}
### Firmware
# Compal E86
mkdir -p %{buildroot}/%{osmocom_bb_dir}/target/firmware/board/compal_e86/
cp src/target/firmware/board/compal_e86/*.bin %{buildroot}/%{osmocom_bb_dir}/target/firmware/board/compal_e86/
# Compal E88
mkdir -p %{buildroot}/%{osmocom_bb_dir}/target/firmware/board/compal_e88/
cp src/target/firmware/board/compal_e88/*.bin %{buildroot}/%{osmocom_bb_dir}/target/firmware/board/compal_e88/
# Compal E99
mkdir -p %{buildroot}/%{osmocom_bb_dir}/target/firmware/board/compal_e99/
cp src/target/firmware/board/compal_e99/*.bin %{buildroot}/%{osmocom_bb_dir}/target/firmware/board/compal_e99/
# FreeCalpyso FCDEV3B
mkdir -p %{buildroot}/%{osmocom_bb_dir}/target/firmware/board/fcdev3b
cp src/target/firmware/board/fcdev3b/*.bin %{buildroot}/%{osmocom_bb_dir}/target/firmware/board/fcdev3b
# OpenMoko GTA0x
mkdir -p %{buildroot}/%{osmocom_bb_dir}/target/firmware/board/gta0x/
cp src/target/firmware/board/gta0x/*.bin %{buildroot}/%{osmocom_bb_dir}/target/firmware/board/gta0x/
# Huawei GTM900-B
mkdir -p %{buildroot}/%{osmocom_bb_dir}/target/firmware/board/gtm900b/
cp src/target/firmware/board/gtm900b/*.bin %{buildroot}/%{osmocom_bb_dir}/target/firmware/board/gtm900b/
# Pirelli DP-L10
mkdir -p %{buildroot}/%{osmocom_bb_dir}/target/firmware/board/pirelli_dpl10/
cp src/target/firmware/board/pirelli_dpl10/*.bin %{buildroot}/%{osmocom_bb_dir}/target/firmware/board/pirelli_dpl10/
# Sony Erricson J100
mkdir -p %{buildroot}/%{osmocom_bb_dir}/target/firmware/board/se_j100/
cp src/target/firmware/board/se_j100/*.bin %{buildroot}/%{osmocom_bb_dir}/target/firmware/board/se_j100/
%endif

%files
%dir %{osmocom_bb_dir}
%{osmocom_bb_dir}/host
%dir %{osmocom_bb_dir}/target
%{osmocom_bb_dir}/target/trx_toolkit

%if 0%{?build_firmware}
%files firmware
%exclude %{osmocom_bb_dir}/target/trx_toolkit
%{osmocom_bb_dir}/target
%endif

%changelog