source: src-sh/pbi-manager/install.sh @ 84b1299

9.1-release9.2-releasereleng/10.0releng/10.0.1releng/10.0.2
Last change on this file since 84b1299 was 84b1299, checked in by Kris Moore <kris@…>, 15 months ago

Fix to include the pbiwraper binaries in the resulting pkg

  • Property mode set to 100755
File size: 3.6 KB
Line 
1#!/bin/sh
2# pbi-manager installation script
3
4DEFAULT="/usr/local"
5
6if [ -z "$1" ] ; then
7        LB="${DEFAULT}" 
8else
9        LB="${1}" 
10fi
11
12DIR=`dirname $0`
13cd ${DIR}
14
15# Install the app
16mkdir ${LB}/sbin >/dev/null 2>/dev/null
17cp pbi-manager ${LB}/sbin/pbi_create
18ln -f ${LB}/sbin/pbi_create ${LB}/sbin/pbi_add
19ln -f ${LB}/sbin/pbi_create ${LB}/sbin/pbi_addrepo
20ln -f ${LB}/sbin/pbi_create ${LB}/sbin/pbi_browser
21ln -f ${LB}/sbin/pbi_create ${LB}/sbin/pbi_autobuild
22ln -f ${LB}/sbin/pbi_create ${LB}/sbin/pbi_delete
23ln -f ${LB}/sbin/pbi_create ${LB}/sbin/pbi_deleterepo
24ln -f ${LB}/sbin/pbi_create ${LB}/sbin/pbi_icon
25ln -f ${LB}/sbin/pbi_create ${LB}/sbin/pbi_info
26ln -f ${LB}/sbin/pbi_create ${LB}/sbin/pbi_indextool
27ln -f ${LB}/sbin/pbi_create ${LB}/sbin/pbi_listrepo
28ln -f ${LB}/sbin/pbi_create ${LB}/sbin/pbi_makepatch
29ln -f ${LB}/sbin/pbi_create ${LB}/sbin/pbi_makeport
30ln -f ${LB}/sbin/pbi_create ${LB}/sbin/pbi_makerepo
31ln -f ${LB}/sbin/pbi_create ${LB}/sbin/pbi_metatool
32ln -f ${LB}/sbin/pbi_create ${LB}/sbin/pbi_patch
33ln -f ${LB}/sbin/pbi_create ${LB}/sbin/pbi_update
34ln -f ${LB}/sbin/pbi_create ${LB}/sbin/pbi_update_hashdir
35ln -f ${LB}/sbin/pbi_create ${LB}/sbin/pbid
36ln -f ${LB}/sbin/pbi_create ${LB}/sbin/pbi-crashhandler
37
38# Set the new PREFIX / LOCALBASE
39if [ "$LB" != /usr/local ] ; then
40  sed -i '' "s|PROGBASE=/usr/local|PROGBASE=$LB|g" ${LB}/sbin/pbi_create
41fi
42
43# Install manpages
44mkdir -p ${LB}/man/man1 >/dev/null 2>/dev/null
45for i in `ls man1/`
46do
47  rm ${LB}/man/man1/${i}.gz >/dev/null 2>/dev/null
48  cp man1/${i} ${LB}/man/man1/${i}
49done
50
51mkdir -p ${LB}/man/man5 >/dev/null 2>/dev/null
52for i in `ls man5/`
53do
54  rm ${LB}/man/man5/${i}.gz >/dev/null 2>/dev/null
55  cp man5/${i} ${LB}/man/man5/${i}
56done
57
58
59mkdir -p ${LB}/man/man8 >/dev/null 2>/dev/null
60for i in `ls man8/`
61do
62  rm ${LB}/man/man8/${i}.gz >/dev/null 2>/dev/null
63  cp man8/${i} ${LB}/man/man8/${i}
64done
65
66if [ -d "${LB}/share/pbi-manager" ] ; then rm -rf "${LB}/share/pbi-manager" ; fi
67
68# Copy over the examples
69mkdir -p ${LB}/share/pbi-manager/ >/dev/null 2>/dev/null
70cp -r ${DIR}/module-examples ${LB}/share/pbi-manager/
71
72# Copy the icon
73mkdir -p ${LB}/share/pbi-manager/icons >/dev/null 2>/dev/null
74cp ${DIR}/icons/default.png ${LB}/share/pbi-manager/icons
75cp ${DIR}/icons/patch.png ${LB}/share/pbi-manager/icons
76
77# If this is a new install, add the PC-BSD master repo
78if [ ! -d "/var/db/pbi/keys" ] ; then
79        pbi_addrepo ${DIR}/repo/pcbsd.rpo
80fi
81
82# Copy the default PC-BSD repo file
83cp ${DIR}/repo/pcbsd.rpo ${LB}/share/pbi-manager/pcbsd.rpo
84
85# Tickle the info command to setup default dirs
86${LB}/sbin/pbi_info >/dev/null 2>/dev/null
87
88# Copy pbid / pbi.conf
89cp ${DIR}/rc.d/pbid ${LB}/etc/rc.d/pbid
90cp ${DIR}/etc/pbi.conf ${LB}/etc/pbi.conf
91
92if [ ! -d "/usr/pbi" ] ; then mkdir /usr/pbi ; fi
93
94# Create the wrapper binary
95cd ${DIR}/wrapper
96if [ `uname -m` = "amd64" ] ; then
97  # Build 32bit wrapper
98  echo "Building i386 wrapper..."
99  rm .pbiwrapper >/dev/null 2>/dev/null
100  make clean
101  make DEFINES="-mtune=i386 -march=i386 -m32"
102  make install
103  chown root:wheel /usr/pbi/.pbiwrapper
104  chmod 644 /usr/pbi/.pbiwrapper
105  cp /usr/pbi/.pbiwrapper ${LB}/share/pbi-manager/.pbi-wrapper-i386
106  mv /usr/pbi/.pbiwrapper /usr/pbi/.pbiwrapper-i386
107else
108  touch ${LB}/share/pbi-manager/.pbi-wrapper-i386
109fi
110
111# Build system arch wrapper
112echo "Building `uname -m` wrapper..."
113DEFINES=""
114export DEFINES
115rm .pbiwrapper >/dev/null 2>/dev/null
116make clean
117make DEFINES=""
118make install DEFINES=""
119chown root:wheel /usr/pbi/.pbiwrapper
120chmod 644 /usr/pbi/.pbiwrapper
121cp /usr/pbi/.pbiwrapper ${LB}/share/pbi-manager/.pbi-wrapper-`uname -m`
122mv /usr/pbi/.pbiwrapper /usr/pbi/.pbiwrapper-`uname -m`
Note: See TracBrowser for help on using the repository browser.