source: common/libs/func_blfs_deps@ ac35c8e

2.3 2.3.x 2.4 ablfs ablfs-more legacy new_features trunk
Last change on this file since ac35c8e was fe30c61, checked in by Manuel Canales Esparcia <manuel@…>, 18 years ago

Splitted common-functions.

  • Property mode set to 100644
File size: 5.8 KB
RevLine 
[fe30c61]1#!/bin/bash
2
3# $Id$
4
5#----------------------------# Hardcoded URLs and MD5.
6add_blfs_deps_urls() { # No easy way to extract it.
7#----------------------------# Some FTP mirrors may not work
8
9 local BLFS_SERVER="${SERVER}/pub/blfs/conglomeration/"
10
11 if [[ "${DEP_LIBXML}" = "y" ]] ; then
12 echo "${LIBXML_URL} ${BLFS_SERVER}libxml2/${LIBXML_PKG} ${LIBXML_MD5}" >> urls.lst
13 fi
14
15 if [[ "${DEP_LIBXSLT}" = "y" ]] ; then
16 echo "${LIBXSLT_URL} ${BLFS_SERVER}libxslt/${LIBXSLT_PKG} ${LIBXSLT_MD5}" >> urls.lst
17 fi
18
19 if [[ "${DEP_TIDY}" = "y" ]] ; then
20 echo "${TIDY_URL} ${BLFS_SERVER}tidy/${TIDY_PKG} ${TIDY_MD5}" >> urls.lst
21 echo "${TIDY_PATCH_URL} ${BLFS_SERVER}tidy/${TIDY_PATCH} ${TIDY_PATCH_MD5}" >> urls.lst
22 echo "${TIDY_DOCS_URL} ${BLFS_SERVER}tidy/${TIDY_DOCS} ${TIDY_DOCS_MD5}" >> urls.lst
23 fi
24
25 if [[ "${DEP_UNZIP}" = "y" ]] ; then
26 echo "${UNZIP_URL} ${BLFS_SERVER}unzip/${UNZIP_PKG} ${UNZIP_MD5}" >> urls.lst
27 fi
28
29 if [[ "${DEP_DBXML}" = "y" ]] ; then
30 echo "${DBXML_URL} ${BLFS_SERVER}docbook-xml/${DBXML_PKG} ${DBXML_MD5}" >> urls.lst
31 fi
32
33 if [[ "${DEP_DBXSL}" = "y" ]] ; then
34 echo "${DBXSL_URL} ${BLFS_SERVER}docbook-xsl/${DBXSL_PKG} ${DBXSL_MD5}" >> urls.lst
35 fi
36
37 if [[ "${DEP_LINKS}" = "y" ]] ; then
38 echo "${LINKS_URL} ${BLFS_SERVER}links/${LINKS_PKG} ${LINKS_MD5}" >> urls.lst
39 fi
40
41 if [[ "${DEP_SUDO}" = "y" ]] ; then
42 echo "${SUDO_URL} ${BLFS_SERVER}sudo/${SUDO_PKG} ${SUDO_MD5}" >> urls.lst
43 echo "${SUDO_PATCH_URL} ${BLFS_SERVER}sudo/${SUDO_PATCH} ${SUDO_PATCH_MD5}" >> urls.lst
44 fi
45
46 if [[ "${DEP_WGET}" = "y" ]] ; then
47 echo "${WGET_URL} ${BLFS_SERVER}wget/${WGET_PKG} ${WGET_MD5}" >> urls.lst
48 fi
49
50 if [[ "${DEP_SVN}" = "y" ]] ; then
51 echo "${SVN_URL} ${BLFS_SERVER}subversion/${SVN_PKG} ${SVN_MD5}" >> urls.lst
52 fi
53
54 if [[ "${DEP_GPM}" = "y" ]] ; then
55 echo "${GPM_URL} ${BLFS_SERVER}gpm/${GPM_PKG} ${GPM_MD5}" >> urls.lst
56 echo "${GPM_PATCH_1_URL} ${BLFS_SERVER}gpm/${GPM_PATCH_1} ${GPM_PATCH_1_MD5}" >> urls.lst
57 echo "${GPM_PATCH_2_URL} ${BLFS_SERVER}gpm/${GPM_PATCH_2} ${GPM_PATCH_2_MD5}" >> urls.lst
58 fi
59
60}
61
62#----------------------------# Maybe there is a better way to do this, but this
63copy_blfs_deps_scripts() { # method avoid to place the test on all
64#----------------------------# $PROGNAME/master.sh scripts.
65
66 mkdir -p ${PROGNAME}-commands/blfs-tool-deps
67
68 if [[ "${DEP_LIBXML}" = "y" ]] ; then
69 mv blfs-tool-deps/901-libxml2 ${PROGNAME}-commands/blfs-tool-deps
70 fi
71
72 if [[ "${DEP_LIBXSLT}" = "y" ]] ; then
73 mv blfs-tool-deps/902-libxslt ${PROGNAME}-commands/blfs-tool-deps
74 fi
75
76 if [[ "${DEP_TIDY}" = "y" ]] ; then
77 mv blfs-tool-deps/903-tidy ${PROGNAME}-commands/blfs-tool-deps
78 fi
79
80 if [[ "${DEP_UNZIP}" = "y" ]] ; then
81 mv blfs-tool-deps/904-unzip ${PROGNAME}-commands/blfs-tool-deps
82 fi
83
84 if [[ "${DEP_DBXML}" = "y" ]] ; then
85 mv blfs-tool-deps/905-docbook-xml ${PROGNAME}-commands/blfs-tool-deps
86 fi
87
88 if [[ "${DEP_DBXSL}" = "y" ]] ; then
89 mv blfs-tool-deps/906-docbook-xsl ${PROGNAME}-commands/blfs-tool-deps
90 fi
91
92 if [[ "${DEP_LINKS}" = "y" ]] ; then
93 mv blfs-tool-deps/908-links ${PROGNAME}-commands/blfs-tool-deps
94 fi
95
96 if [[ "${DEP_SUDO}" = "y" ]] ; then
97 mv blfs-tool-deps/909-sudo ${PROGNAME}-commands/blfs-tool-deps
98 fi
99
100 if [[ "${DEP_WGET}" = "y" ]] ; then
101 mv blfs-tool-deps/910-wget ${PROGNAME}-commands/blfs-tool-deps
102 fi
103
104 if [[ "${DEP_SVN}" = "y" ]] ; then
105 mv blfs-tool-deps/911-subversion ${PROGNAME}-commands/blfs-tool-deps
106 fi
107
108 if [[ "${DEP_GPM}" = "y" ]] ; then
109 mv blfs-tool-deps/907-gpm ${PROGNAME}-commands/blfs-tool-deps
110 fi
111
112 rm -rf blfs-tool-deps
113
114}
115
116
117#----------------------------------#
118wrt_blfs_tool_targets() { #
119#----------------------------------#
120
121 echo "${tab_}${GREEN}Processing... ${L_arrow}BLFS_TOOL ${R_arrow}"
122
123 for file in blfs-tool-deps/* ; do
124 # Keep the script file name
125 this_script=`basename $file`
126
127 # Grab the name of the target
128 name=`echo ${this_script} | sed -e 's@[0-9]\{3\}-@@'`
129
130 # Find the package.
131 case $name in
132 tidy ) pkg_tarball=${TIDY_PKG} ;;
133 unzip ) pkg_tarball=${UNZIP_PKG} ;;
134 * ) pkg_tarball=$(get_package_tarball_name $name) ;;
135 esac
136
137 # Append each name of the script files to a list (this will become
138 # the names of the targets in the Makefile)
139 blfs_tool="$blfs_tool ${this_script}"
140
141 #--------------------------------------------------------------------#
142 # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
143 #--------------------------------------------------------------------#
144 #
145 # Drop in the name of the target on a new line, and the previous target
146 # as a dependency. Also call the echo_message function.
147 CHROOT_wrt_target "${this_script}" "$PREV"
148
149 # Insert instructions for unpacking the package and changing directories
150 # DocBook-XML is a zip, the build script will handle that.
151 [[ ! "$name" = "docbook-xml" ]] && CHROOT_Unpack "$pkg_tarball"
152
153 # Run the script.
154 CHROOT_wrt_RunAsRoot "$file"
155
156 # Remove the build directory(ies) except if the package build fails.
157 [[ ! "$name" = "docbook-xml" ]] && CHROOT_wrt_RemoveBuildDirs "$name"
158
159 # Touch the tracking file.
160 case $name in
161 tidy ) pkg_ver=tidy-051026 ;;
162 unzip ) pkg_ver=unzip-5.52 ;;
163 * ) pkg_ver=$(echo $pkg_tarball | sed -e 's/.tar.*//;s/.tgz//;s/.zip//') ;;
164 esac
165 echo "\$(tab_)@touch $TRACKING_DIR/$pkg_ver" >> $MKFILE.tmp
166
167 # Include a touch of the target name so make can check
168 # if it's already been made.
169 wrt_touch
170 #
171 #--------------------------------------------------------------------#
172 # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
173 #--------------------------------------------------------------------#
174
175 # Keep the script file name for Makefile dependencies.
176 PREV=${this_script}
177 done
178}
Note: See TracBrowser for help on using the repository browser.