~ubuntu-branches/ubuntu/oneiric/firebird2.5/oneiric-security

« back to all changes in this revision

Viewing changes to builds/install/arch-specific/freebsd/install.sh.in

  • Committer: Bazaar Package Importer
  • Author(s): Damyan Ivanov
  • Date: 2010-07-27 18:12:34 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100727181234-88lvl2nuord9ysx5
Tags: 2.5.0.26054~ReleaseCandidate3.ds2-1
* New upstream release candidate

* update d/copyright to reflect changes in upstream sources
* drop patches applied/implemented upstream
  + refresh the rest to apply cleanly
* Standards-Version: 3.9.1 (no changes necessary)

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
BuiltFBDir=./firebird  # Where the just build fb exists.
40
40
TargetDir=             # Install in real FS
41
41
SecurityDatabase=security2.fdb
 
42
RunUser=firebird
 
43
RunGroup=firebird
42
44
 
43
45
 
44
46
#------------------------------------------------------------------------
54
56
 
55
57
        rm -f $libTarget
56
58
        touch $libTarget
57
 
        for i in posixLibrary.sh @FIREBIRD_ARCH_TYPE@Library.sh linuxLibrary.sh
 
59
        for i in posixLibrary.sh @FIREBIRD_ARCH_TYPE@Library.sh freebsdLibrary.sh
58
60
        do
59
61
                echo "# $i" >>$libTarget
60
62
                cat $libSdir/$i >>$libTarget
100
102
        fi
101
103
 
102
104
        for file in $Files; do
 
105
                rm -f $To/$file
103
106
                ln -s $From/$file $To/$file
104
107
        done
105
108
}
116
119
                if [ ! -d $Dir ]; then
117
120
                        rm -f $Dir
118
121
                        mkdir -p $Dir
119
 
                        chown root:root $Dir
 
122
                        chown root:wheel $Dir
120
123
                        chmod 0755 $Dir
121
124
                fi
122
125
        done
154
157
    cp $BuiltFBDir/bin/isql ${TargetDir}@FB_BINDIR@/isql
155
158
    cp $BuiltFBDir/bin/qli ${TargetDir}@FB_BINDIR@/qli
156
159
 
157
 
        chown root:root ${TargetDir}@FB_BINDIR@/*
 
160
        chown root:wheel ${TargetDir}@FB_BINDIR@/*
158
161
        chmod 0755 ${TargetDir}@FB_BINDIR@/*
159
162
 
160
163
        #sbin
173
176
    cp $BuiltFBDir/bin/createAliasDB.sh ${TargetDir}@FB_SBINDIR@
174
177
    cp $BuiltFBDir/bin/fb_config ${TargetDir}@FB_SBINDIR@
175
178
 
176
 
        chown root:root ${TargetDir}@FB_SBINDIR@/*
 
179
        chown root:wheel ${TargetDir}@FB_SBINDIR@/*
177
180
        chmod 0755 ${TargetDir}@FB_SBINDIR@/*
178
181
        chmod 0700 ${TargetDir}@FB_SBINDIR@/*.sh
179
182
 
197
200
 
198
201
            for i in `find ${TargetDir}@FB_SAMPLEDIR@ -type d -print`
199
202
            do
200
 
                        chown root:root $i
 
203
                        chown root:wheel $i
201
204
                chmod 0555 $i
202
205
            done
203
206
            for i in `find ${TargetDir}@FB_SAMPLEDIR@ -type f -print`
204
207
            do
205
 
                        chown root:root $i
 
208
                        chown root:wheel $i
206
209
                chmod 0444 $i
207
210
            done
208
211
 
209
212
                makeDirs @FB_SAMPLEDBDIR@
210
213
                cp $BuiltFBDir/examples/empbuild/*.fdb ${TargetDir}@FB_SAMPLEDBDIR@
211
214
 
212
 
                chown root:root ${TargetDir}@FB_SAMPLEDBDIR@/*.fdb
 
215
                chown root:wheel ${TargetDir}@FB_SAMPLEDBDIR@/*.fdb
213
216
                chmod 0444 ${TargetDir}@FB_SAMPLEDBDIR@/*.fdb
214
217
    fi
215
218
 
217
220
    copyIfExists $BuiltFBDir/help/help.gbak ${TargetDir}@FB_HELPDIR@
218
221
    cp $BuiltFBDir/help/help.fdb ${TargetDir}@FB_HELPDIR@
219
222
 
220
 
        chown root:root ${TargetDir}@FB_HELPDIR@/*.fdb
 
223
        chown root:wheel ${TargetDir}@FB_HELPDIR@/*.fdb
221
224
        chmod 0444 ${TargetDir}@FB_HELPDIR@/*.fdb
222
225
 
223
226
        #message file
224
227
    cp $BuiltFBDir/*.msg ${TargetDir}@FB_MSGDIR@
225
228
 
226
 
        chown root:root ${TargetDir}@FB_MSGDIR@/*.msg
 
229
        chown root:wheel ${TargetDir}@FB_MSGDIR@/*.msg
227
230
        chmod 0444 ${TargetDir}@FB_MSGDIR@/*.msg
228
231
 
229
232
        #secureDB (access rights will be set at install time)
232
235
        #.h files
233
236
    cp $BuiltFBDir/include/*.h ${TargetDir}@FB_INCDIR@
234
237
 
235
 
        chown root:root ${TargetDir}@FB_INCDIR@/*.h
 
238
        chown root:wheel ${TargetDir}@FB_INCDIR@/*.h
236
239
        chmod 0444 ${TargetDir}@FB_INCDIR@/*.h
237
240
 
238
241
        #lib
239
242
    copyIfExists $BuiltFBDir/lib/libfbembed.so* ${TargetDir}@FB_LIBDIR@
240
 
    cp -df $BuiltFBDir/lib/libfbclient.so* ${TargetDir}@FB_LIBDIR@
 
243
    cp -f $BuiltFBDir/lib/libfbclient.so* ${TargetDir}@FB_LIBDIR@
241
244
    cp -f $BuiltFBDir/lib/libib_util.so ${TargetDir}@FB_LIBDIR@/libib_util.so
242
245
    copyIfExists $BuiltFBDir/lib/libicu*.so* ${TargetDir}@FB_LIBDIR@
243
246
 
244
 
        chown root:root ${TargetDir}@FB_LIBDIR@/*.so*
 
247
        chown root:wheel ${TargetDir}@FB_LIBDIR@/*.so*
245
248
        chmod 0755 ${TargetDir}@FB_LIBDIR@/*.so*
246
249
 
247
250
        #plugins
248
 
        cp -df $BuiltFBDir/plugins/* ${TargetDir}@FB_PLUGDIR@
 
251
        cp -f $BuiltFBDir/plugins/* ${TargetDir}@FB_PLUGDIR@
249
252
 
250
 
        chown root:root ${TargetDir}@FB_PLUGDIR@/*.so*
 
253
        chown root:wheel ${TargetDir}@FB_PLUGDIR@/*.so*
251
254
        chmod 0755 ${TargetDir}@FB_PLUGDIR@/*.so*
252
255
 
253
256
        #intl
254
257
    cp $BuiltFBDir/intl/libfbintl.so ${TargetDir}@FB_INTLDIR@/fbintl
255
 
    cp $BuiltFBDir/intl/fbintl.conf ${TargetDir}@FB_INTLDIR@
 
258
    cp  $BuildRootDir/gen/install/misc/fbintl.conf ${TargetDir}@FB_INTLDIR@
256
259
 
257
 
        chown root:root ${TargetDir}@FB_INTLDIR@/fbintl*
 
260
        chown root:wheel ${TargetDir}@FB_INTLDIR@/fbintl*
258
261
        chmod 0755 ${TargetDir}@FB_INTLDIR@/fbintl
259
262
        chmod 0644 ${TargetDir}@FB_INTLDIR@/fbintl.conf
260
263
 
267
270
    cp $BuildRootDir/src/extlib/ib_udf2.sql ${TargetDir}@FB_UDFDIR@
268
271
    cp $BuildRootDir/src/extlib/fbudf/fbudf.sql ${TargetDir}@FB_UDFDIR@
269
272
 
270
 
        chown root:root ${TargetDir}@FB_UDFDIR@/*.so ${TargetDir}@FB_UDFDIR@/*.sql
 
273
        chown root:wheel ${TargetDir}@FB_UDFDIR@/*.so ${TargetDir}@FB_UDFDIR@/*.sql
271
274
        chmod 0755 ${TargetDir}@FB_UDFDIR@/*.so
272
275
        chmod 0644 ${TargetDir}@FB_UDFDIR@/*.sql
273
276
 
274
277
        #doc
275
 
    cp $BuildRootDir/doc/*.pdf ${TargetDir}@FB_DOCDIR@
276
278
    cp $BuildRootDir/doc/README.* ${TargetDir}@FB_DOCDIR@
277
279
    cp $BuildRootDir/doc/sql.extensions/README* ${TargetDir}@FB_DOCDIR@/sql.extensions
278
280
    cp $BuildRootDir/doc/WhatsNew ${TargetDir}@FB_CONFDIR@/WhatsNew
279
281
    cp $BuildRootDir/doc/README.user ${TargetDir}@FB_CONFDIR@/README
280
282
 
281
 
        chown -R root:root ${TargetDir}@FB_MISCDIR@
 
283
        chown -R root:wheel ${TargetDir}@FB_MISCDIR@
282
284
        for i in `find ${TargetDir}@FB_MISCDIR@ -print`; do
283
 
                chown root:root $i
 
285
                chown root:wheel $i
284
286
                if [ -d $i ]; then
285
287
                        chmod 0755 $i
286
288
                else
293
295
    cp $BuildRootDir/src/misc/upgrade/v2/ib_udf*                                ${TargetDir}@FB_MISCDIR@/upgrade/ib_udf
294
296
    cp $BuildRootDir/src/misc/upgrade/v2/security_database*             ${TargetDir}@FB_MISCDIR@/upgrade/security
295
297
    cp $BuildRootDir/src/misc/upgrade/v2.1/metadata_charset*    ${TargetDir}@FB_MISCDIR@/upgrade/metadata
296
 
    cp $BuildRootDir/gen/install/misc/firebird.xinetd                   ${TargetDir}@FB_MISCDIR@
297
 
        cp $BuildRootDir/gen/install/misc/firebird.init.d.*                     ${TargetDir}@FB_MISCDIR@
298
 
        cp $BuildRootDir/gen/install/misc/rc.config.firebird            ${TargetDir}@FB_MISCDIR@
299
298
 
300
 
        chown -R root:root ${TargetDir}@FB_MISCDIR@
301
 
        chmod -R go-rwx ${TargetDir}@FB_MISCDIR@
 
299
    chown -R root:wheel ${TargetDir}@FB_MISCDIR@
 
300
    chmod -R go-rwx ${TargetDir}@FB_MISCDIR@
302
301
 
303
302
        #conf
304
 
    cp $BuiltFBDir/firebird.conf ${TargetDir}@FB_CONFDIR@
305
 
    cp $BuiltFBDir/aliases.conf ${TargetDir}@FB_CONFDIR@
306
 
    cp $BuiltFBDir/fbtrace.conf ${TargetDir}@FB_CONFDIR@
 
303
    cp $BuildRootDir/gen/install/misc/firebird.conf ${TargetDir}@FB_CONFDIR@
 
304
    cp $BuildRootDir/gen/install/misc/aliases.conf ${TargetDir}@FB_CONFDIR@
 
305
    cp $BuildRootDir/gen/install/misc/fbtrace.conf ${TargetDir}@FB_CONFDIR@
307
306
 
308
 
        chown root:root ${TargetDir}@FB_CONFDIR@/*.conf
 
307
        chown root:wheel ${TargetDir}@FB_CONFDIR@/*.conf
309
308
        chmod 0644 ${TargetDir}@FB_CONFDIR@/*.conf
310
309
 
311
310
# Create links from @libdir@ to install area.
427
426
# remove any existing gds service
428
427
cp /etc/services /etc/services.old
429
428
cp /etc/inetd.conf /etc/inetd.conf.old
430
 
cat /etc/services |grep -v gds_db >/etc/services.new
431
 
cat /etc/inetd.conf |grep -v gds_db >/etc/inetd.conf.new
 
429
cat /etc/services |grep -v @FB_SERVICE_NAME@ >/etc/services.new
 
430
cat /etc/inetd.conf |grep -v @FB_SERVICE_NAME@ >/etc/inetd.conf.new
432
431
mv /etc/services.new /etc/services
433
432
mv /etc/inetd.conf.new /etc/inetd.conf
434
433
 
435
434
# add the gds service and restart inetd
436
435
cat >>/etc/services <<EOF
437
 
gds_db          3050/tcp  #Firebird Database Remote Protocol
 
436
@FB_SERVICE_NAME@               @FB_SERVICE_PORT@/tcp  #Firebird Database Remote Protocol
438
437
EOF
439
438
cat >>/etc/inetd.conf <<EOF
440
 
gds_db  stream  tcp     nowait  firebird        $InstallFirebirdPrefix/bin/fb_inet_server  fb_inet_server
 
439
@FB_SERVICE_NAME@       stream  tcp     nowait  firebird        ${TargetDir}@FB_SBINDIR@/fb_inet_server  fb_inet_server
441
440
EOF
442
441
if [ -f /var/run/inetd.pid ]; then
443
442
        kill -HUP `cat /var/run/inetd.pid`