source: common/libs/func_blfs_deps@ 55d2c3e

experimental
Last change on this file since 55d2c3e was 55d2c3e, checked in by Manuel Canales Esparcia <manuel@…>, 17 years ago

Updated blfs-tool-deps targets creation.

  • Property mode set to 100644
File size: 5.1 KB
Line 
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 fi
22
23 if [[ "${DEP_UNZIP}" = "y" ]] ; then
24 echo "${UNZIP_URL} ${BLFS_SERVER}unzip/${UNZIP_PKG} ${UNZIP_MD5}" >> urls.lst
25 echo "${UNZIP_PATCH_URL} ${BLFS_SERVER}unzip/${UNZIP_PATCH} ${UNZIP_PATCH_MD5}" >> urls.lst
26 fi
27
28 if [[ "${DEP_DBXML}" = "y" ]] ; then
29 echo "${DBXML_URL} ${BLFS_SERVER}docbook-xml/${DBXML_PKG} ${DBXML_MD5}" >> urls.lst
30 fi
31
32# if [[ "${DEP_DBXSL}" = "y" ]] ; then
33# echo "${DBXSL_URL} ${BLFS_SERVER}docbook-xsl/${DBXSL_PKG} ${DBXSL_MD5}" >> urls.lst
34# fi
35
36 if [[ "${DEP_LYNX}" = "y" ]] ; then
37 echo "${LYNX_URL} ${BLFS_SERVER}lynx/${LYNX_PKG} ${LYNX_MD5}" >> urls.lst
38 fi
39
40 if [[ "${DEP_SUDO}" = "y" ]] ; then
41 echo "${SUDO_URL} ${BLFS_SERVER}sudo/${SUDO_PKG} ${SUDO_MD5}" >> urls.lst
42 echo "${SUDO_PATCH_URL} ${BLFS_SERVER}sudo/${SUDO_PATCH} ${SUDO_PATCH_MD5}" >> urls.lst
43 fi
44
45 if [[ "${DEP_WGET}" = "y" ]] ; then
46 echo "${WGET_URL} ${BLFS_SERVER}wget/${WGET_PKG} ${WGET_MD5}" >> urls.lst
47 fi
48
49 if [[ "${DEP_SVN}" = "y" ]] ; then
50 echo "${SVN_URL} ${BLFS_SERVER}subversion/${SVN_PKG} ${SVN_MD5}" >> urls.lst
51 fi
52
53 if [[ "${DEP_GPM}" = "y" ]] ; then
54 echo "${GPM_URL} ${BLFS_SERVER}gpm/${GPM_PKG} ${GPM_MD5}" >> urls.lst
55 echo "${GPM_PATCH_1_URL} ${BLFS_SERVER}gpm/${GPM_PATCH_1} ${GPM_PATCH_1_MD5}" >> urls.lst
56 echo "${GPM_PATCH_2_URL} ${BLFS_SERVER}gpm/${GPM_PATCH_2} ${GPM_PATCH_2_MD5}" >> urls.lst
57 fi
58
59}
60
61
62#----------------------------------#
63blfs_tool_clean_scripts() { # Remove unselected dependencies scripts
64#----------------------------------#
65
66 for file in ${PROGNAME}-commands/blfs-tool-deps/* ; do
67 # Keep the script file name
68 this_script=`basename $file`
69
70 # Skip non selected dependencies.
71 case "${this_script}" in
72 *libxml2 ) [[ "${DEP_LIBXML}" = "n" ]] && rm ${file} ;;
73 *libxslt ) [[ "${DEP_LIBXSLT}" = "n" ]] && rm ${file} ;;
74 *tidy ) [[ "${DEP_TIDY}" = "n" ]] && rm ${file} ;;
75 *unzip ) [[ "${DEP_UNZIP}" = "n" ]] && rm ${file} ;;
76 *docbook-xml ) [[ "${DEP_DBXML}" = "n" ]] && rm ${file} ;;
77 *docbook-xsl ) [[ "${DEP_DBXSL}" = "n" ]] && rm ${file} ;;
78 *gpm ) [[ "${DEP_GPM}" = "n" ]] && rm ${file} ;;
79 *lynx ) [[ "${DEP_LYNX}" = "n" ]] && rm ${file} ;;
80 *sudo ) [[ "${DEP_SUDO}" = "n" ]] && rm ${file} ;;
81 *wget ) [[ "${DEP_WGET}" = "n" ]] && rm ${file} ;;
82 *subversion ) [[ "${DEP_SVN}" = "n" ]] && rm ${file} ;;
83 esac
84 done
85}
86
87
88#----------------------------------#
89wrt_blfs_tool_targets() { #
90#----------------------------------#
91 PREV=""
92
93 echo "${tab_}${GREEN}Processing... ${L_arrow}BLFS_TOOL ${R_arrow}"
94
95 for file in blfs-tool-deps/* ; do
96 # Keep the script file name
97 this_script=`basename $file`
98
99 # Grab the phase name to be used with INSTALL_LOG and tracking dir touch
100 name=`grep "^PKG_PHASE=" ${file} | sed -e 's@PKG_PHASE=@@'`
101 # Grab also the package version
102 pkg_ver=`grep "^VERSION=" ${file} | sed -e 's@VERSION=@@'`
103
104 # Append each name of the script files to a list (this will become
105 # the names of the targets in the Makefile)
106 blfs_tool="$blfs_tool ${this_script}"
107
108 #--------------------------------------------------------------------#
109 # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
110 #--------------------------------------------------------------------#
111 #
112 # Drop in the name of the target on a new line, and the previous target
113 # as a dependency. Also call the echo_message function.
114 wrt_target "${this_script}" "$PREV"
115
116 # Touch timestamp file if installed files logs will be created.
117 if [ "$name" != "" ] && [ "${INSTALL_LOG}" = "y" ] ; then
118 wrt_TouchTimestamp
119 fi
120
121 # Run the script.
122 wrt_RunScript "$file"
123
124 # Write installed files log
125 if [ "$name" != "" ] && [ "${INSTALL_LOG}" = "y" ] ; then
126 wrt_LogNewFiles "$name"
127 fi
128
129 # Touch the tracking file.
130 if [ "$PROGNAME" = "clfs2" ]; then
131 echo -e "\t@touch \$(MOUNT_PT)$TRACKING_DIR/${name}-${pkg_ver}" >> $MKFILE.tmp
132 else
133 echo -e "\t@touch $TRACKING_DIR/${name}-${pkg_ver}" >> $MKFILE.tmp
134 fi
135
136 # Include a touch of the target name so make can check
137 # if it's already been made.
138 wrt_touch
139 #
140 #--------------------------------------------------------------------#
141 # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
142 #--------------------------------------------------------------------#
143
144 # Keep the script file name for Makefile dependencies.
145 PREV=${this_script}
146 done
147}
Note: See TracBrowser for help on using the repository browser.