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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
|
--- Install.orig Thu Nov 13 10:02:58 2003
+++ Install Mon Feb 2 02:56:41 2004
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# Install script for the Darwin Streaming Server
# source release
@@ -16,6 +16,7 @@
if [ $USERID = 0 ]; then
+if false; then
echo Checking for and Killing currently running Darwin Streaming Server
if [ `uname` = "FreeBSD" ]; then
ps -ax | awk '/DarwinStreamingServer/ {print $1}' | xargs kill -9
@@ -113,14 +114,15 @@
fi
echo
+fi
## CHANGE PERL PATH IN streamingadminserver.pl AND parse_xml.cgi ##
# Look for perl in the default locations
if [ -x /usr/freeware/bin/perl ]; then
perldef=/usr/freeware/bin/perl
-elif [ -x /usr/local/bin/perl ]; then
- perldef=/usr/local/bin/perl
+elif [ -x ${LOCALBASE}/bin/perl ]; then
+ perldef=${LOCALBASE}/bin/perl
elif [ -x /usr/bin/perl ]; then
perldef=/usr/bin/perl
else
@@ -189,159 +191,160 @@
fi
# Add the unprivileged user qtss as the server's run user
+if false; then
echo "Creating unprivileged user to run the server = \"qtss\"."
if [ $INSTALL_OS = "Linux" ]; then
/usr/sbin/useradd -M qtss > /dev/null 2>&1
else
/usr/sbin/useradd qtss > /dev/null 2>&1
fi
+fi
## INSTALL NEW VERSION ##
- if [ ! -d /usr/local/sbin ]; then
- echo creating "/usr/local/sbin" directory
- mkdir -p /usr/local/sbin
+ if [ ! -d ${PREFIX}/sbin ]; then
+ echo creating "${PREFIX}/sbin" directory
+ mkdir -p ${PREFIX}/sbin
fi
- if [ ! -d /usr/local/bin ]; then
- echo creating "/usr/local/bin" directory
- mkdir -p /usr/local/bin
+ if [ ! -d ${PREFIX}/bin ]; then
+ echo creating "${PREFIX}/bin" directory
+ mkdir -p ${PREFIX}/bin
fi
- echo copying "DarwinStreamingServer" to "/usr/local/sbin/DarwinStreamingServer"
- cp -f DarwinStreamingServer /usr/local/sbin/
+ echo copying "DarwinStreamingServer" to "${PREFIX}/sbin/DarwinStreamingServer"
+ ${BSD_INSTALL_PROGRAM} DarwinStreamingServer ${PREFIX}/sbin/
- echo copying "PlaylistBroadcaster" to "/usr/local/bin/PlaylistBroadcaster"
- cp -f PlaylistBroadcaster /usr/local/bin/
+ echo copying "PlaylistBroadcaster" to "${PREFIX}/bin/PlaylistBroadcaster"
+ ${BSD_INSTALL_PROGRAM} PlaylistBroadcaster ${PREFIX}/bin/
- echo copying "MP3Broadcaster" to "/usr/local/bin/MP3Broadcaster"
- cp -f MP3Broadcaster /usr/local/bin/
+ echo copying "MP3Broadcaster" to "${PREFIX}/bin/MP3Broadcaster"
+ ${BSD_INSTALL_PROGRAM} MP3Broadcaster ${PREFIX}/bin/
- echo copying "qtpasswd" to "/usr/local/bin/qtpasswd"
- cp -f qtpasswd /usr/local/bin/
+ echo copying "qtpasswd" to "${PREFIX}/bin/qtpasswd"
+ ${BSD_INSTALL_PROGRAM} qtpasswd ${PREFIX}/bin/
# For now, do not copy modules as there are no supported dynamic modules
- # echo copying modules to "/usr/local/sbin/StreamingServerModules"
- if [ ! -d /usr/local/sbin/StreamingServerModules ]; then
- echo creating "/usr/local/sbin/StreamingServerModules" directory
- mkdir /usr/local/sbin/StreamingServerModules
+ # echo copying modules to "${PREFIX}/libexec/StreamingServerModules"
+ if [ ! -d ${PREFIX}/libexec/StreamingServerModules ]; then
+ echo creating "${PREFIX}/libexec/StreamingServerModules" directory
+ mkdir ${PREFIX}/libexec/StreamingServerModules
fi
- cp -f StreamingServerModules/* /usr/local/sbin/StreamingServerModules/
+ ${BSD_INSTALL_PROGRAM} StreamingServerModules/* ${PREFIX}/libexec/StreamingServerModules/
- if [ -e /usr/local/sbin/StreamingServerModules/QTSSHomeDirectoryModule ]; then
- echo copying "createuserstreamingdir" to "/usr/local/bin/createuserstreamingdir"
- cp -f createuserstreamingdir $INSTALLROOT/usr/local/bin/
+ if [ -e ${PREFIX}/libexec/StreamingServerModules/QTSSHomeDirectoryModule ]; then
+ echo copying "createuserstreamingdir" to "${PREFIX}/bin/createuserstreamingdir"
+ ${BSD_INSTALL_SCRIPT} createuserstreamingdir ${PREFIX}/bin/
fi
- if [ ! -d /etc/streaming ]; then
- echo creating "/etc/streaming" directory
- mkdir -p /etc/streaming
+ if [ ! -d ${PREFIX}/etc/streaming ]; then
+ echo creating "${PREFIX}/etc/streaming" directory
+ mkdir -p ${PREFIX}/etc/streaming
fi
- if [ ! -e /etc/streaming/streamingserver.xml ]; then
- /usr/local/sbin/DarwinStreamingServer -x
+ echo;echo copying "streamingserver.xml" to "${PREFIX}/etc/streaming/streamingserver.xml-dist"
+ ${BSD_INSTALL_DATA} streamingserver.xml ${PREFIX}/etc/streaming/streamingserver.xml-dist
+ if [ ! -e ${PREFIX}/etc/streaming/streamingserver.xml ]; then
+ echo;echo copying "streamingserver.xml" to "${PREFIX}/etc/streaming/streamingserver.xml"
+ ${BSD_INSTALL_DATA} streamingserver.xml ${PREFIX}/etc/streaming/streamingserver.xml
fi
- chmod 600 /etc/streaming/streamingserver.xml
- chown qtss /etc/streaming/streamingserver.xml
+ chmod 600 ${PREFIX}/etc/streaming/streamingserver.xml ${PREFIX}/etc/streaming/streamingserver.xml-dist
+ chown qtss:qtss ${PREFIX}/etc/streaming/streamingserver.xml ${PREFIX}/etc/streaming/streamingserver.xml-dist
- echo;echo copying "relayconfig.xml-Sample" to "/etc/streaming/relayconfig.xml-Sample"
- cp -f relayconfig.xml-Sample /etc/streaming/relayconfig.xml-Sample
- chmod 600 /etc/streaming/relayconfig.xml-Sample
- if [ -e /etc/streaming/relayconfig.xml ]; then
- chown qtss /etc/streaming/relayconfig.xml
+ echo;echo copying "relayconfig.xml-Sample" to "${PREFIX}/etc/streaming/relayconfig.xml-dist"
+ ${BSD_INSTALL_DATA} relayconfig.xml-Sample ${PREFIX}/etc/streaming/relayconfig.xml-dist
+ if [ ! -e ${PREFIX}/etc/streaming/relayconfig.xml ]; then
+ echo;echo copying "relayconfig.xml-Sample" to "${PREFIX}/etc/streaming/relayconfig.xml"
+ ${BSD_INSTALL_DATA} relayconfig.xml-Sample ${PREFIX}/etc/streaming/relayconfig.xml
fi
- echo;echo copying "qtusers" to "/etc/streaming/qtusers"
- cp -f qtusers /etc/streaming/qtusers
- chmod 600 /etc/streaming/qtusers
- chown qtss /etc/streaming/qtusers
+ echo;echo copying "qtusers" to "${PREFIX}/etc/streaming/qtusers-dist"
+ install -c -o qtss -g qtss -m 0600 qtusers ${PREFIX}/etc/streaming/qtusers-dist
- echo;echo copying "qtgroups" to "/etc/streaming/qtgroups"
- cp -f qtgroups /etc/streaming/qtgroups
- chmod 600 /etc/streaming/qtgroups
- chown qtss /etc/streaming/qtgroups
+ echo;echo copying "qtgroups" to "/etc/streaming/qtgroups-dist"
+ install -c -o qtss -g qtss -m 0600 qtgroups ${PREFIX}/etc/streaming/qtgroups-dist
- #echo;echo copying "streamingadminserver.pem" to "/etc/streaming/streamingadminserver.pem"
- #cp -f streamingadminserver.pem /etc/streaming/streamingadminserver.pem
- #chmod 400 /etc/streaming/streamingadminserver.pem
+ #echo;echo copying "streamingadminserver.pem" to "${PREFIX}/etc/streaming/streamingadminserver.pem"
+ #install -c -o qtss -g qtss -m 0400 streamingadminserver.pem ${PREFIX}/etc/streaming/streamingadminserver.pem
- if [ ! -d /var/streaming ]; then
- echo creating "/var/streaming" directory
- mkdir -p /var/streaming
+ if [ ! -d ${DATADIR} ]; then
+ echo creating "${DATADIR}" directory
+ mkdir -p ${DATADIR}
fi
- echo copying "readme.txt" to "/var/streaming/readme.txt"
- cp -f readme.txt /var/streaming/readme.txt
+ echo copying "readme.txt" to "${DATADIR}/readme.txt"
+ ${BSD_INSTALL_DATA} readme.txt ${DATADIR}/readme.txt
- echo copying "3rdPartyAcknowledgements.rtf" to "/var/streaming/3rdPartyAcknowledgements.rtf"
- cp -f 3rdPartyAcknowledgements.rtf /var/streaming/3rdPartyAcknowledgements.rtf
+ echo copying "3rdPartyAcknowledgements.rtf" to "${DATADIR}/3rdPartyAcknowledgements.rtf"
+ ${BSD_INSTALL_DATA} 3rdPartyAcknowledgements.rtf ${DATADIR}/3rdPartyAcknowledgements.rtf
- if [ ! -d /var/streaming/logs ]; then
- echo creating "/var/streaming/logs" directory
- mkdir -p /var/streaming/logs
+ if [ ! -d /var/log/streaming ]; then
+ echo creating "/var/log/streaming" directory
+ mkdir -p /var/log/streaming
fi
- if [ ! -d /usr/local/movies ]; then
- echo creating "/usr/local/movies" directory
- mkdir -p /usr/local/movies
+ if [ ! -d ${DATADIR}/movies ]; then
+ echo creating "${DATADIR}/movies" directory
+ mkdir -p ${DATADIR}/movies
fi
- if [ ! -d /var/streaming/playlists ]; then
- echo creating "/var/streaming/playlists" directory
- mkdir -p /var/streaming/playlists
+ if [ ! -d /var/spool/streaming.playlists ]; then
+ echo creating "/var/spool/streaming.playlists" directory
+ mkdir -p /var/spool/streaming.playlists
fi
- chmod 770 /var/streaming/playlists
- chmod 775 /usr/local/movies
+ chown qtss:qtss /var/spool/streaming.playlists
+ chmod 770 /var/spool/streaming.playlists
+ chmod 775 ${PREFIX}/movies
- echo copying "sample_100kbit.mov" into "/usr/local/movies/sample_100kbit.mov"
- cp -f sample_100kbit.mov /usr/local/movies/
+ echo copying "sample_100kbit.mov" into "${DATADIR}/movies/sample_100kbit.mov"
+ ${BSD_INSTALL_DATA} sample_100kbit.mov ${DATADIR}/movies/
- echo copying "sample_300kbit.mov" into "/usr/local/movies/sample_300kbit.mov"
- cp -f sample_300kbit.mov /usr/local/movies/
+ echo copying "sample_300kbit.mov" into "${DATADIR}/movies/sample_300kbit.mov"
+ ${BSD_INSTALL_DATA} sample_300kbit.mov ${DATADIR}/movies/
- echo copying "sample_100kbit.mp4" into "/usr/local/movies/sample_100kbit.mp4"
- cp -f sample_100kbit.mp4 /usr/local/movies/
+ echo copying "sample_100kbit.mp4" into "${DATADIR}/movies/sample_100kbit.mp4"
+ ${BSD_INSTALL_DATA} sample_100kbit.mp4 ${DATADIR}/movies/
- echo copying "sample_300kbit.mp4" into "/usr/local/movies/sample_300kbit.mp4"
- cp -f sample_300kbit.mp4 /usr/local/movies/
+ echo copying "sample_300kbit.mp4" into "${DATADIR}/movies/sample_300kbit.mp4"
+ ${BSD_INSTALL_DATA} sample_300kbit.mp4 ${DATADIR}/movies/
- echo copying "sample.mp3" into "/usr/local/movies/sample.mp3"
- cp -f sample.mp3 /usr/local/movies/
+ echo copying "sample.mp3" into "${DATADIR}/movies/sample.mp3"
+ ${BSD_INSTALL_DATA} sample.mp3 ${DATADIR}/movies/
if [ -e StreamingLoadTool ]; then
- echo copying "StreamingLoadTool" to "/usr/local/bin/StreamingLoadTool"
- cp -f StreamingLoadTool /usr/local/bin/
+ echo copying "StreamingLoadTool" to "${PREFIX}/bin/StreamingLoadTool"
+ ${BSD_INSTALL_PROGRAM} StreamingLoadTool ${PREFIX}/bin/
- echo copying "streamingloadtool.conf" to "/etc/streaming/streamingloadtool.conf"
- cp -f streamingloadtool.conf /etc/streaming/
+ echo copying "streamingloadtool.conf" to "${PREFIX}/etc/streaming/streamingloadtool.conf"
+ ${BSD_INSTALL_DATA} streamingloadtool.conf ${PREFIX}/etc/streaming/
fi
#WebAdmin install
- echo copying "streamingadminserver.pl" into "/usr/local/sbin/streamingadminserver.pl"
- cp -f streamingadminserver.pl /usr/local/sbin/streamingadminserver.pl
+ echo copying "streamingadminserver.pl" into "${PREFIX}/sbin/streamingadminserver.pl"
+ ${BSD_INSTALL_SCRIPT} streamingadminserver.pl ${PREFIX}/sbin/streamingadminserver.pl
- if [ -d /var/streaming/AdminHtml/ ]; then
- echo removing old version of html from "/var/streaming/AdminHtml"
- rm -r -f /var/streaming/AdminHtml/*
+ if [ -d ${DATADIR}/AdminHtml/ ]; then
+ echo removing old version of html from "/${DATADIR}/AdminHtml"
+ rm -r -f ${DATADIR}/AdminHtml/*
fi
- if [ ! -d /var/streaming/ ]; then
- echo creating "/var/streaming/AdminHtml" directory
- mkdir -p /var/streaming/AdminHtml
+ if [ ! -d ${DATADIR}/AdminHtml ]; then
+ echo creating "${DATADIR}/AdminHtml" directory
+ mkdir -p ${DATADIR}/AdminHtml
fi
- echo copying Admin HTML to "/var/streaming/AdminHtml" directory
- cp -f -r AdminHtml /var/streaming/
+ echo copying Admin HTML to "${DATADIR}/AdminHtml" directory
+ tar -cf - AdminHtml | tar -xf - -C ${DATADIR}
- chown -R -f qtss /var/streaming/
- chown -R -f qtss /etc/streaming/
- chown -R -f qtss /usr/local/movies/
+ chown -R -f qtss:qtss ${DATADIR}/
+ chown -R -f qtss:qtss ${PREFIX}/etc/streaming/
- echo;echo "Launching streamingadminserver.pl"
- /usr/local/sbin/streamingadminserver.pl
+# echo;echo "Launching streamingadminserver.pl"
+# ${PREFIX}/sbin/streamingadminserver.pl
echo;echo Installation Complete
+if false; then
# Setup for DSS
# Prompts for a username and password
# that can be used to administer the server
@@ -391,7 +394,7 @@
echo ""
# Add the new admin username to /etc/streaming/qtusers
- /usr/local/bin/qtpasswd -p $password $username
+ ${PREFIX}/bin/qtpasswd -p $password $username
# Add the new admin username to /etc/streaming/qtgroups
# and delete the default admin username
@@ -399,11 +402,12 @@
mv /etc/streaming/qtgroups.tmp /etc/streaming/qtgroups
# Remove the default admin username to /etc/streaming/qtusers
- /usr/local/bin/qtpasswd -F -d 'aGFja21l' > /dev/null
+ ${PREFIX}/bin/qtpasswd -F -d 'aGFja21l' > /dev/null
chown -R -f qtss /etc/streaming/
echo Setup Complete!
+fi
else
|