-
Notifications
You must be signed in to change notification settings - Fork 27
/
raspi.gradle
170 lines (155 loc) · 4.21 KB
/
raspi.gradle
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
159
160
161
162
163
164
165
166
167
168
import java.text.SimpleDateFormat;
import org.redline_rpm.header.*;
def taskgroup="avnav"
buildscript{
repositories{
mavenCentral()
}
dependencies{
classpath 'com.netflix.nebula:gradle-ospackage-plugin:11.1.0'
}
}
repositories{
mavenCentral()
}
description="Raspberry specfic stuff for avnav"
apply plugin: 'java'
apply plugin: 'com.netflix.nebula.ospackage-base'
def versionFileName="raspi.version"
ospackage {
//release='3'
os = LINUX // only applied to RPM
packageGroup='misc'
requires 'avnav'
requires 'parted'
requires 'bc'
requires 'hostapd'
requires 'dnsmasq'
requires 'mpg123'
requires 'ntp'
requires 'avahi-autoipd'
requires 'python3-smbus' //could basically also directly go to avnav - but outside rpi there is no use case
requires('canboat','4.12',Flags.GREATER|Flags.EQUAL).or('base-files','11',Flags.LESS)
requires 'jq'
packageName='avnav-raspi'
['common','wlan0','wlan1','wlan-ap','wlan-ap2'].each { String ext->
configurationFile("/etc/hostapd/hostapd.conf.$ext")
}
configurationFile("/etc/udev/rules.d/010-avnav-net.rules")
user='root'
into ('/usr/lib/avnav/raspberry') {
from('raspberry'){
fileMode 0755
include 'hostapd'
include 'settime.sh'
include 'restore-iptables.sh'
include 'sound.sh'
include 'iptables-ext.sh'
include 'wpa_supplicant.conf'
include 'startup-check.sh'
include 'setup-*.sh'
include 'prestart.sh'
include 'wpa_action.sh'
include 'rename-interface.sh'
include 'checkLink.sh'
include 'uart_control'
}
from('raspberry') {
include 'avnav_server.xml'
include 'hosts'
include 'ntp.conf'
include 'avnav.conf'
fileMode 0644
}
from('linux'){
include 'patchServerConfig.py'
fileMode 0755
}
}
into('/usr/lib/avnav/raspberry/xui'){
from('raspberry/xui')
}
into ('/usr/lib/avnav/raspberry') {
from(project.buildDir){
include versionFileName
}
}
into('/usr/lib/systemd/system/avnav.service.d'){
from('raspberry'){
include "raspberry.conf"
}
}
into('/usr/lib/systemd/system'){
from('raspberry'){
include('avnav-iptables.service')
include('avnav-startup.service')
}
}
into('/etc/network/interfaces.d'){
from('raspberry'){
include('lo')
include('eth0')
include('usb0')
include('wlan0')
include('wlan1')
include('wlan-av1')
include('wlan-ap')
include('wlan-ap2')
}
}
into('/etc/hostapd'){
from('raspberry'){
include('hostapd.conf*')
}
}
into('/etc/sysctl.d'){
from('raspberry'){
include('99-zzavnavsysctl.conf')
}
}
into('/etc'){
from('raspberry'){
include('iptables.ipv4.nat')
}
}
into('/etc/udev/rules.d'){
from('raspberry'){
include('010-avnav-net.rules')
}
}
into('/etc/dnsmasq.d'){
from('raspberry'){
include('avnav-dnsmasq.conf')
}
}
into('/etc'){
from('raspberry'){
include('dhcpcd.enter-hook')
}
}
into('/etc/modprobe.d'){
from('raspberry'){
include('8192cu.conf')
}
}
into('/etc/avahi/services'){
from('raspberry'){
include('avnav-ssh.service')
}
}
postInstall file('raspberry/postinstall')
preInstall file('raspberry/preinstall')
}
assert project.hasProperty('packageVersion'),"please provide the package version via -PpackageVersion=xxx"
version=project.packageVersion
task raspiDeb(type: Deb) {
group taskgroup
doFirst{
def vFile=file("$buildDir/$versionFileName")
logger.info("vfile=${vFile}")
if (! vFile.getParentFile().exists()) vFile.getParentFile().mkdirs()
vFile.withWriter {wr->
wr.println "AVNAV_VERSION=\"$version\""
}
}
}