source: common/libs/func_install_blfs@ eabc205

ablfs
Last change on this file since eabc205 was d6f2ebf, checked in by Pierre Labastie <pierre@…>, 13 years ago

Change order in func_install_blfs so that wget is installed
with openssl support if selected

  • Property mode set to 100644
File size: 5.0 KB
Line 
1#!/bin/bash
2
3# $Id$
4
5#----------------------------# Prepare BLFS_ROOT and extract
6install_blfs_tools() { # the scriptlets to build
7#----------------------------# the dependency tools
8# Install the files
9[[ ! -d ${BUILDDIR}${BLFS_ROOT} ]] && mkdir -pv ${BUILDDIR}${BLFS_ROOT}
10cp -r BLFS/* ${BUILDDIR}${BLFS_ROOT}
11cp -r menu ${BUILDDIR}${BLFS_ROOT}
12cp $COMMON_DIR/progress_bar.sh ${BUILDDIR}${BLFS_ROOT}
13cp README.BLFS ${BUILDDIR}${BLFS_ROOT}
14
15# Clean-up
16make -C ${BUILDDIR}${BLFS_ROOT}/menu clean
17rm -rf ${BUILDDIR}${BLFS_ROOT}/libs/.svn
18rm -rf ${BUILDDIR}${BLFS_ROOT}/xsl/.svn
19rm -rf ${BUILDDIR}${BLFS_ROOT}/menu/.svn
20rm -rf ${BUILDDIR}${BLFS_ROOT}/menu/lxdialog/.svn
21
22# Set some harcoded envars to their proper values
23sed -i s@tracking-dir@$TRACKING_DIR@ \
24 ${BUILDDIR}${BLFS_ROOT}/{Makefile,gen-makefile.sh}
25
26# Downloads the book, initialize the tracking file and the package database
27# sudo is needed if $BUILDDIR/var/lib is owned by root and /var/lib/jhalfs
28# has to be created
29sudo make -j1 -C $BUILDDIR$BLFS_ROOT TRACKING_DIR=$BUILDDIR$TRACKING_DIR \
30 $BUILDDIR$BLFS_ROOT/packages.xml
31
32# Because the BLFS Makefile is supposed to be used in chroot (or booted)
33# mode, the tracking file has wrong path for DTD. Change it:
34sudo sed -i s@$BUILDDIR@@ $BUILDDIR$TRACKING_DIR/instpkg.xml
35
36# Manually build a 'configuration' file
37if [ "$DEP_LIBXML" = y ]; then
38 LINE_LIBXML='CONFIG_libxml2=y'
39else
40 LINE_LIBXML='#CONFIG_libxml2 is not set'
41fi
42if [ "$DEP_LIBXSLT" = y ]; then
43 LINE_LIBXSLT='CONFIG_libxslt=y'
44else
45 LINE_LIBXSLT='#CONFIG_libxslt is not set'
46fi
47if [ "$DEP_TIDY" = y ]; then
48 LINE_TIDY='CONFIG_html-tidy=y'
49else
50 LINE_TIDY='#CONFIG_html-tidy is not set'
51fi
52if [ "$DEP_DBXML" = y ]; then
53 LINE_DBXML='CONFIG_DocBook=y'
54else
55 LINE_DBXML='#CONFIG_DocBook is not set'
56fi
57if [ "$DEP_LYNX" = y ]; then
58 LINE_LYNX='CONFIG_lynx=y'
59else
60 LINE_LYNX='#CONFIG_lynx is not set'
61fi
62if [ "$DEP_SUDO" = y ]; then
63 LINE_SUDO='CONFIG_sudo=y'
64else
65 LINE_SUDO='#CONFIG_sudo is not set'
66fi
67if [ "$DEP_WGET" = y ]; then
68 LINE_WGET='CONFIG_wget=y'
69else
70 LINE_WGET='#CONFIG_wget is not set'
71fi
72if [ "$DEP_GPM" = y ]; then
73 LINE_GPM='CONFIG_gpm=y'
74else
75 LINE_GPM='#CONFIG_gpm is not set'
76fi
77if [ "$DEP_SVN" = y ]; then
78 LINE_SVN='CONFIG_subversion=y'
79else
80 LINE_SVN='#CONFIG_subversion is not set'
81fi
82if [ "$DEP_OPENSSL" = y ]; then
83 LINE_OPENSSL='CONFIG_openssl=y'
84else
85 LINE_OPENSSL='#CONFIG_openssl is not set'
86fi
87if [ "$DEP_PYTHON" = y ]; then
88 LINE_PYTHON='CONFIG_python2=y'
89else
90 LINE_PYTHON='#CONFIG_python2 is not set'
91fi
92
93cat >$BUILDDIR$BLFS_ROOT/configuration <<EOF
94$LINE_PYTHON
95$LINE_LIBXML
96$LINE_LIBXSLT
97$LINE_TIDY
98$LINE_DBXML
99$LINE_OPENSSL
100$LINE_WGET
101$LINE_SVN
102$LINE_GPM
103$LINE_LYNX
104$LINE_SUDO
105MAIL_SERVER=sendmail
106optDependency=2
107SUDO=n
108EOF
109
110# Generates the scripts for the blfs tools dependencies (in ./scripts)
111yes "yes" | $BUILDDIR$BLFS_ROOT/gen_pkg_book.sh $BUILDDIR$BLFS_ROOT
112
113# Move the scriptlets where they should be
114rm -rf $BUILDDIR$BLFS_ROOT/scripts
115mv scripts $BUILDDIR$BLFS_ROOT
116
117# Generates a list containing download and copying instructions for tarballs
118echo -e '#!/bin/bash\nset -e\n' > $BUILDDIR$BLFS_ROOT/download_script
119sed -n -e '/PACKAGE=/,/md5sum/p' \
120 -e '/PACKAGE1=/,/^fi/p' \
121 -e '/PATCH=/,/^fi/p' \
122 -e '/URL=/,/unpacked/p' \
123 $BUILDDIR$BLFS_ROOT/scripts/* >> $BUILDDIR$BLFS_ROOT/download_script
124chmod u+x $BUILDDIR$BLFS_ROOT/download_script
125
126# Downloads (or copy) to build_dir/sources
127pushd $BUILDDIR/sources
128FTP_SERVER=$SERVER/pub/blfs/ SRC_ARCHIVE=$SRC_ARCHIVE $BUILDDIR$BLFS_ROOT/download_script
129# The blfs-bootscripts package is at the wrong location
130mkdir -p blfs-bootscripts
131mv blfs-bootscripts*tar* blfs-bootscripts
132popd
133rm -v $BUILDDIR$BLFS_ROOT/download_script
134
135# Suppresses unneeded parts of the scriptlets
136if [ "$DEP_WGET" = y ] && ! [ "$DEP_OPENSSL" = y ]; then
137 sed -i s'/-ssl=.*/out-ssl/' $BUILDDIR$BLFS_ROOT/scripts/*wget
138fi
139if [ "$DEP_SUDO" = y ]; then
140 sed -i '/pam.d/i mkdir -p /etc/pam.d' $BUILDDIR$BLFS_ROOT/scripts/*sudo
141fi
142if [ "$DEP_SVN" = y ]; then
143 sed -i -e /javahl/d -e /swig/d $BUILDDIR$BLFS_ROOT/scripts/*subversion
144fi
145if [ "$DEP_PYTHON" = y ]; then
146 sed -i -e '/^make.*Doc/d' -e '/^chmod/{n;N;d}' $BUILDDIR$BLFS_ROOT/scripts/*python2
147fi
148if [ "$DEP_OPENSSL" = y ]; then
149 sed -i 's/^make$/make -j1/' $BUILDDIR$BLFS_ROOT/scripts/*openssl
150fi
151
152# At last generates the build Makefile
153mkdir -p $BUILDDIR$BLFS_ROOT/work
154pushd $BUILDDIR$BLFS_ROOT/work
155../gen-makefile.sh
156sed -i -e '/xsltproc/,+6d' \
157 -e '/^all/s@$@ update@' \
158 -e 's/touch/@touch/' Makefile
159cat >> Makefile << EOF
160update:
161 @echo Updating the tracking file
162 @for file in *-*; do \\
163 xsltproc --stringparam packages ../packages.xml \\
164 --stringparam package \$\${file##*z-} \\
165 -o track.tmp \\
166 ../xsl/bump.xsl \$(TRACKING_FILE); \\
167 sed -i 's@PACKDESC@$BLFS_ROOT/packdesc.dtd@' track.tmp; \\
168 xmllint --format --postvalid track.tmp > \$(TRACKING_FILE); \\
169 rm track.tmp; \\
170 done
171 @touch \$@
172 @echo -e "\n\n "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK
173 @echo --------------------------------------------------------------------------------\$(WHITE)
174EOF
175popd
176}
Note: See TracBrowser for help on using the repository browser.