-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
177 lines (153 loc) · 6.36 KB
/
Makefile
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
169
170
171
172
173
174
175
176
177
##############Compiler and JVM info#####################################
JC = javac
JRT = java
JAR = jar
JCFLAGS = -d ./
###############Paths####################################################
DESTDIR =
DESTDIR_B4 = $(DESTDIR)/..
PREFIX = $(DESTDIR)/usr/lib
STARTDIR = $(DESTDIR)/usr/bin
ICONDIR = $(DESTDIR)/usr/share/doc/$(JPACKAGE)
DESKTOPDIR = $(DESTDIR)/usr/share/applications
MANDIR = $(DESTDIR)/usr/share/man/man7
#Desktop file paths
DESTDIRI = $(DESTDIR)
PREFIXI = $(PREFIX)
STARTDIRI = $(STARTDIR)
ICONDIRI = $(ICONDIR)
##############Program specific info.####################################
JPACKAGE = iestelemetry
CP = ./lib/bsaf.jar:./lib/swing-worker-1.1.jar:./lib/nrjavaserial.jar
CPI = $(PREFIXI)/$(JPACKAGE)/lib/bsaf.jar:$(PREFIXI)/$(JPACKAGE)/lib/nrjavaserial.jar:$(PREFIXI)/$(JPACKAGE)/lib/swing-worker-1.1.jar
MAIN = IESTelemetryApp
SOURCEDIR = src/$(JPACKAGE)
FILENAME = IESTelemetry.jar
SOURCEFILES = $(SOURCEDIR)/ClearUDB9000DataLogger.java \
$(SOURCEDIR)/configureDeckBox_DS7000.java \
$(SOURCEDIR)/configureDeckBox.java \
$(SOURCEDIR)/configureDeckBox_UDB9000_DS7000_Mode.java \
$(SOURCEDIR)/configureDeckBox_UDB9000.java \
$(SOURCEDIR)/configureDeckBox_UTS.java \
$(SOURCEDIR)/ConvertIncommingFreq2Data.java \
$(SOURCEDIR)/DeckBox.java \
$(SOURCEDIR)/FileChooserJFrame.java \
$(SOURCEDIR)/IESTelemetryAboutBox.java \
$(SOURCEDIR)/IESTelemetryApp.java \
$(SOURCEDIR)/IESTelemetryView.java \
$(SOURCEDIR)/LaunchDesktopDocument.java \
$(SOURCEDIR)/ReadSerialPort.java \
$(SOURCEDIR)/SendSinglePing.java \
$(SOURCEDIR)/SendURICommand.java \
$(SOURCEDIR)/SetChannelReceiveSensitivity.java \
$(SOURCEDIR)/SetRXThreshold.java \
$(SOURCEDIR)/SetTXPowerLevel.java
##############Desktop file fields#######################################
TITLE = "IES Telemetry Application"
COMMENT = "IES Telemetry Application"
CATEGORIES = "Application;Science;Education"
##############control file##############################################
# Source section
SOURCE = $(JPACKAGE)
SECTION = "x11"
PRIORITY = "optional"
MAINTAINER = "Pedro Pena"
EMAIL = "[email protected]"
STDVER = "3.9.7"
BUILDDEPENDS = "gzip (>=1.5), debhelper (>=9), default-jre | \
java7-runtime , librxtx-java (>= 2.2pre2-3),libbetter-appframework-java"
# Package section
DESCRIPTION = "Telemeter data from URI IES's\n A platform independent \
program to download data from\n URI CPIES/PIES/IES via acoustic telemetry."
ARCH = "all"
HOMEPAGE = "https://github.com/pedrolpena/iestelemetry"
DEPENDS = "\$${misc:Depends}, jarwrapper, default-jre | \
java7-runtime , librxtx-java (>= 2.2pre2-3), libbetter-appframework-java"
##############MISC######################################################
MAKEDEB = 0
all: buildit copyres archive dist desktop
buildit:
$(JC) $(JCFLAGS) -cp $(CP) $(JDP) $(SOURCEFILES)
copyres:
cp -R $(SOURCEDIR)/resources $(JPACKAGE)
archive:
cp manifest_2.txt manifest.txt
$(JAR) cfm $(FILENAME) manifest.txt $(JPACKAGE)/*.class
$(JAR) vfu $(FILENAME) $(JPACKAGE)/resources
dist:
mkdir dist
cp $(FILENAME) dist
rm $(FILENAME)
desktop:
echo "[Desktop Entry]" > $(JPACKAGE).desktop
echo "Comment="$(COMMENT) >> $(JPACKAGE).desktop
echo "Terminal=false" >> $(JPACKAGE).desktop
echo "Name="$(TITLE) >> $(JPACKAGE).desktop
echo "Exec=$(STARTDIRI)/$(JPACKAGE)" >> $(JPACKAGE).desktop
echo "Type=Application" >> $(JPACKAGE).desktop
echo "Icon=$(ICONDIRI)/icon.png" >> $(JPACKAGE).desktop
echo "NoDisplay=false" >> $(JPACKAGE).desktop
echo "Categories="$(CATEGORIES) >> $(JPACKAGE).desktop
run:
$(JRT) -cp $(CP):dist/$(FILENAME) $(JPACKAGE).$(MAIN)
install:
mkdir -p $(PREFIX)/$(JPACKAGE)
mkdir -p $(ICONDIR)
mkdir -p $(STARTDIR)
mkdir -p $(DESKTOPDIR)
mkdir -p $(MANDIR)
cp -R ./dist/* $(PREFIX)/$(JPACKAGE)
cp -R ./lib $(PREFIX)/$(JPACKAGE)
chmod +x $(PREFIX)/$(JPACKAGE)/$(FILENAME)
echo "#!/bin/bash" > $(STARTDIR)/$(JPACKAGE)
echo "java -cp $(CPI):$(PREFIXI)/$(JPACKAGE)/$(FILENAME) $(JPACKAGE).$(MAIN)" >> $(STARTDIR)/$(JPACKAGE)
chmod +x $(STARTDIR)/$(JPACKAGE)
cp icon.png $(ICONDIR)
cp copyright $(ICONDIR)
cp share/doc/$(JPACKAGE)/* $(ICONDIR)
cp $(JPACKAGE).desktop $(DESKTOPDIR)
gzip -9 --no-name -c changelog > $(ICONDIR)/changelog.gz
gzip -9 --no-name -c $(JPACKAGE).7 > $(MANDIR)/$(JPACKAGE).7.gz
uninstall:
$(RM) $(STARTDIR)/$(JPACKAGE)
$(RM) -rf $(PREFIX)/$(JPACKAGE)
$(RM) $(ICONDIR)/*
rmdir $(ICONDIR)
deb:
mkdir -p $(DESTDIR)/usr/lib
mkdir -p $(DESTDIR)/usr/bin
mkdir -p $(DESTDIR)/usr/share/applications
mkdir -p $(DESTDIR)/DEBIAN
mkdir -p $(DESTDIR_B4)/source
echo "Source: "$(SOURCE) > $(DESTDIR_B4)/control
echo "Section: "$(SECTION) >> $(DESTDIR_B4)/control
echo "Priority: "$(PRIORITY) >> $(DESTDIR_B4)/control
echo "Maintainer: "$(MAINTAINER)" <"$(EMAIL)">" >> $(DESTDIR_B4)/control
echo "Standards-Version: "$(STDVER) >> $(DESTDIR_B4)/control
echo "Build-Depends: "$(BUILDDEPENDS) >> $(DESTDIR_B4)/control
echo "" >> $(DESTDIR_B4)/control
echo "Package: "$(JPACKAGE) >> $(DESTDIR_B4)/control
echo "Description: "$(DESCRIPTION) >> $(DESTDIR_B4)/control
echo "Architecture: "$(ARCH) >> $(DESTDIR_B4)/control
echo "Homepage: "$(HOMEPAGE) >> $(DESTDIR_B4)/control
echo "Depends: "$(DEPENDS) >> $(DESTDIR_B4)/control
echo "#!/usr/bin/make -f" > $(DESTDIR_B4)/rules
echo "%:" >> $(DESTDIR_B4)/rules
echo " dh \$$@" >> $(DESTDIR_B4)/rules
echo "" >> $(DESTDIR_B4)/rules
echo "binary:" >> $(DESTDIR_B4)/rules
echo " make install DESTDIR=$(DESTDIR) DESTDIRI=/usr PREFIXI=/usr/lib STARTDIRI=/usr/bin MAKEDEB=1" >> $(DESTDIR_B4)/rules
echo " dh_gencontrol" >> $(DESTDIR_B4)/rules
echo " dh_builddeb" >> $(DESTDIR_B4)/rules
chmod +x $(DESTDIR_B4)/rules
echo "1.0" > $(DESTDIR_B4)/source/format
echo "9" > $(DESTDIR_B4)/compat
cp changelog $(DESTDIR_B4)/changelog
cp copyright $(DESTDIR_B4)/copyright
cp LICENSE $(DESTDIR_B4)/LICENSE
cp license.txt $(DESTDIR_B4)
clean:
$(RM) -r ./$(JPACKAGE)
$(RM) -r ./dist
$(RM) $(JPACKAGE).desktop
$(RM) ./manifest.txt