-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·172 lines (154 loc) · 5.06 KB
/
install.sh
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
#!/bin/sh -e
# -*- mode: Shell; tab-width: 4; -*-
#
# install.sh - install fink package
#
# Fink - a package manager that downloads source and installs it
# Copyright (c) 2001 Christoph Pfisterer
# Copyright (c) 2001-2013 The Fink Package Manager Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA.
#
if [ $# -ne 2 ]; then
echo "Usage: ./install.sh <prefix> <architecture>"
echo " Example: ./install.sh /tmp/builddirectory/sw i386"
echo "WARNING: Don't call install.sh directly, use inject.pl instead."
echo " You have been warned."
exit 1
fi
basepath="$1"
architecture="$2"
version=`cat VERSION`
echo "Creating directories..."
mkdir -p "$basepath"
chmod 755 "$basepath"
for dir in bin sbin \
lib lib/perl5 lib/perl5/Fink \
lib/perl5/Fink/{Text,Notify,Checksum,Finally,SelfUpdate} \
lib/fink lib/fink/update lib/fink/update-packages \
etc etc/dpkg \
share share/doc share/doc/fink \
share/man share/man/man{3,5,8} \
share/fink share/fink/images \
var var/run var/run/fink var/run/fink/buildlock \
var/lib var/lib/fink var/lib/fink/path-prefix-g++-{3.3,4.0} \
var/lib/fink/path-prefix-10.6 ; do
mkdir "$basepath/$dir"
chmod 755 "$basepath/$dir"
done
if [ "$architecture" = "i386" ]; then
mkdir "$basepath/etc/profile.d"
chmod 755 "$basepath/etc/profile.d"
fi
echo "Copying files..."
if [ "$architecture" = "i386" ]; then
install -c -p -m 755 fink.csh "$basepath/etc/profile.d"
install -c -p -m 755 fink.sh "$basepath/etc/profile.d"
fi
install -c -p -m 755 postinstall.pl "$basepath/lib/fink/"
install -c -p -m 644 shlibs.default "$basepath/etc/dpkg/"
install -c -p -m 644 fink.8 "$basepath/share/man/man8/"
install -c -p -m 644 fink.conf.5 "$basepath/share/man/man5/"
install -c -p -m 644 images/*.png "$basepath/share/fink/images/"
# copy executables
for bin in fink fink-{virtual-pkgs,instscripts,scanpackages} pathsetup.sh \
{dpkg,apt-get}-lockwait; do
install -c -p -m 755 $bin "$basepath/bin/"
done
install -c -m 755 fink-dpkg-status-cleanup "$basepath/sbin/"
# copy all perl modules
for subdir in . Fink Fink/{Text,Notify,Checksum,Finally,SelfUpdate} ; do
for file in perlmod/${subdir}/*.pm ; do
if [ -f $file ]; then
install -c -p -m 644 $file "$basepath/lib/perl5/$subdir"
fi
done
done
for file in update-packages/* ; do
install -c -p -m 644 $file "$basepath/lib/fink/update-packages/"
done
for file in update/config.guess update/config.sub update/ltconfig ; do
install -c -p -m 755 $file "$basepath/lib/fink/update/"
done
for file in update/ltmain.sh update/Makefile.in.in ; do
install -c -p -m 644 $file "$basepath/lib/fink/update/"
done
for file in AUTHORS COPYING README README.html README.removing-fink-bld readme.*.html \
INSTALL INSTALL.html NEWS STYLE TODO* USAGE USAGE.html ; do
install -c -p -m 644 $file "$basepath/share/doc/fink/"
done
for gccvers in 3.3 4.0; do
install -c -p -m 755 "g++-wrapper-$gccvers" \
"$basepath/var/lib/fink/path-prefix-g++-$gccvers/g++"
ln -s -n -f g++ "$basepath/var/lib/fink/path-prefix-g++-$gccvers/c++"
done
install -c -p -m 755 "compiler_wrapper" \
"$basepath/var/lib/fink/path-prefix-10.6/compiler_wrapper"
for file in \
cc \
c++ c++-4.0 c++-4.2 \
gcc gcc-4.0 gcc-4.2 \
g++ g++-4.0 g++-4.2 \
clang clang++ \
; do
ln -s compiler_wrapper "$basepath/var/lib/fink/path-prefix-10.6/$file"
done
# Gotta do this in install.sh, takes too long for setup.sh
echo "Creating man pages from POD..."
function manify_bin () {
echo " $1.$2"
pod2man --center "Fink documentation" --release "Fink $version" \
--section $2 $1 "$basepath/share/man/man$2/$1.$2"
}
function manify_pm () {
echo " $1.3pm"
pm=`echo $1 | perl -ne 'chomp; s,::,/,g; print "perlmod/$_.pm"'`
pod2man --center "Fink documentation" --release "Fink $version" \
--section 3 "$pm" "$basepath/share/man/man3/$1.3pm"
}
manify_bin fink-scanpackages 8
for p in \
Fink \
Fink::Base \
Fink::Bootstrap \
Fink::Checksum \
Fink::CLI \
Fink::Command \
Fink::Config \
Fink::Configure \
Fink::Engine \
Fink::Finally \
Fink::Finally::BuildConflicts \
Fink::Finally::Buildlock \
Fink::FinkVersion \
Fink::Notify \
Fink::Package \
Fink::PkgVersion \
Fink::Scanpackages \
Fink::SelfUpdate \
Fink::SelfUpdate::Base \
Fink::SelfUpdate::CVS \
Fink::SelfUpdate::rsync \
Fink::SelfUpdate::point \
Fink::Services \
Fink::SysState \
Fink::Text::DelimMatch \
Fink::Text::ParseWords \
Fink::VirtPackage \
; do
manify_pm $p
done
echo "Done."
exit 0