1 | #!/bin/bash
|
---|
2 |
|
---|
3 | # $Id$
|
---|
4 |
|
---|
5 |
|
---|
6 | #----------------------------------#
|
---|
7 | blfs_tool_clean_scripts() { # Remove unselected dependencies scripts
|
---|
8 | #----------------------------------#
|
---|
9 |
|
---|
10 | for file in ${PROGNAME}-commands/blfs-tool-deps/* ; do
|
---|
11 | # Keep the script file name
|
---|
12 | this_script=`basename $file`
|
---|
13 |
|
---|
14 | case "${this_script}" in
|
---|
15 | *libxml2 ) [[ "${DEP_LIBXML}" = "n" ]] && rm ${file} ;;
|
---|
16 | *libxslt ) [[ "${DEP_LIBXSLT}" = "n" ]] && rm ${file} ;;
|
---|
17 | *tidy ) [[ "${DEP_TIDY}" = "n" ]] && rm ${file} ;;
|
---|
18 | *unzip ) [[ "${DEP_UNZIP}" = "n" ]] && rm ${file} ;;
|
---|
19 | *docbook-xml ) [[ "${DEP_DBXML}" = "n" ]] && rm ${file} ;;
|
---|
20 | *docbook-xsl ) [[ "${DEP_DBXSL}" = "n" ]] && rm ${file} ;;
|
---|
21 | *gpm ) [[ "${DEP_GPM}" = "n" ]] && rm ${file} ;;
|
---|
22 | *lynx ) [[ "${DEP_LYNX}" = "n" ]] && rm ${file} ;;
|
---|
23 | *sudo ) [[ "${DEP_SUDO}" = "n" ]] && rm ${file} ;;
|
---|
24 | *wget ) [[ "${DEP_WGET}" = "n" ]] && rm ${file} ;;
|
---|
25 | *subversion ) [[ "${DEP_SVN}" = "n" ]] && rm ${file} ;;
|
---|
26 | esac
|
---|
27 | done
|
---|
28 | }
|
---|
29 |
|
---|
30 | #----------------------------#
|
---|
31 | add_blfs_deps_urls() { #
|
---|
32 | #----------------------------#
|
---|
33 | local saveIFS=$IFS
|
---|
34 | local IFS file line package tarball download md5sum patchurl patchname patchmd5
|
---|
35 |
|
---|
36 | local BLFS_SERVER="${SERVER}/pub/blfs/conglomeration/"
|
---|
37 |
|
---|
38 | for file in ${PROGNAME}-commands/blfs-tool-deps/* ; do
|
---|
39 | # Keep the script file name
|
---|
40 | this_script=`basename $file`
|
---|
41 |
|
---|
42 | # Grab the package name, tarball, download URL and MD5SUM
|
---|
43 | package=`grep "^PACKAGE=" ${file} | sed -e 's@PACKAGE=@@'`
|
---|
44 | tarball=`grep "^TARBALL=" ${file} | sed -e 's@TARBALL=@@'`
|
---|
45 | download=`grep "^DOWNLOAD=" ${file} | sed -e 's@DOWNLOAD=@@'`
|
---|
46 | md5sum=`grep "^MD5SUM=" ${file} | sed -e 's@MD5SUM=@@'`
|
---|
47 |
|
---|
48 | # Write the package entry
|
---|
49 | echo "${download} ${BLFS_SERVER}${package}/${tarball} ${md5sum}" >> ../sources/urls.lst
|
---|
50 |
|
---|
51 | # Handle the patches, if any
|
---|
52 | IFS=$'\x0A'
|
---|
53 | for line in `grep "^PATCH=" ${file}` ; do
|
---|
54 | IFS=$saveIFS
|
---|
55 | patchurl=`echo ${line} | sed -e 's@PATCH="@@' -e 's@ .*@@'`
|
---|
56 | patchname=${patchurl##*/}
|
---|
57 | patchmd5=`echo ${line} | sed -e 's@.* @@' -e 's@"@@'`
|
---|
58 |
|
---|
59 | # Write the patch entry
|
---|
60 | echo "${patchurl} ${BLFS_SERVER}${package}/${patchname} ${patchmd5}" >> ../sources/urls.lst
|
---|
61 | done
|
---|
62 |
|
---|
63 | done
|
---|
64 | }
|
---|
65 |
|
---|
66 |
|
---|
67 | #----------------------------------#
|
---|
68 | wrt_blfs_tool_targets() { #
|
---|
69 | #----------------------------------#
|
---|
70 | PREV=""
|
---|
71 |
|
---|
72 | echo "${tab_}${GREEN}Processing... ${L_arrow}BLFS_TOOL ${R_arrow}"
|
---|
73 |
|
---|
74 | for file in blfs-tool-deps/* ; do
|
---|
75 | # Keep the script file name
|
---|
76 | this_script=`basename $file`
|
---|
77 |
|
---|
78 | # Grab the phase name to be used with INSTALL_LOG and tracking dir touch
|
---|
79 | name=`grep "^PKG_PHASE=" ${file} | sed -e 's@PKG_PHASE=@@'`
|
---|
80 | # Grab also the package version
|
---|
81 | pkg_ver=`grep "^VERSION=" ${file} | sed -e 's@VERSION=@@'`
|
---|
82 |
|
---|
83 | # Append each name of the script files to a list (this will become
|
---|
84 | # the names of the targets in the Makefile)
|
---|
85 | blfs_tool="$blfs_tool ${this_script}"
|
---|
86 |
|
---|
87 | #--------------------------------------------------------------------#
|
---|
88 | # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
|
---|
89 | #--------------------------------------------------------------------#
|
---|
90 | #
|
---|
91 | # Drop in the name of the target on a new line, and the previous target
|
---|
92 | # as a dependency. Also call the echo_message function.
|
---|
93 | wrt_target "${this_script}" "$PREV"
|
---|
94 |
|
---|
95 | # Touch timestamp file if installed files logs will be created.
|
---|
96 | if [ "$name" != "" ] && [ "${INSTALL_LOG}" = "y" ] ; then
|
---|
97 | wrt_TouchTimestamp
|
---|
98 | fi
|
---|
99 |
|
---|
100 | # Run the script.
|
---|
101 | wrt_RunScript "$file"
|
---|
102 |
|
---|
103 | # Write installed files log
|
---|
104 | if [ "$name" != "" ] && [ "${INSTALL_LOG}" = "y" ] ; then
|
---|
105 | wrt_LogNewFiles "$name"
|
---|
106 | fi
|
---|
107 |
|
---|
108 | # Touch the tracking file.
|
---|
109 | if [ "$PROGNAME" = "clfs2" ]; then
|
---|
110 | echo -e "\t@touch \$(MOUNT_PT)$TRACKING_DIR/${name}-${pkg_ver}" >> $MKFILE.tmp
|
---|
111 | else
|
---|
112 | echo -e "\t@touch $TRACKING_DIR/${name}-${pkg_ver}" >> $MKFILE.tmp
|
---|
113 | fi
|
---|
114 |
|
---|
115 | # Include a touch of the target name so make can check
|
---|
116 | # if it's already been made.
|
---|
117 | wrt_touch
|
---|
118 | #
|
---|
119 | #--------------------------------------------------------------------#
|
---|
120 | # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
|
---|
121 | #--------------------------------------------------------------------#
|
---|
122 |
|
---|
123 | # Keep the script file name for Makefile dependencies.
|
---|
124 | PREV=${this_script}
|
---|
125 | done
|
---|
126 | }
|
---|