1 | #
|
---|
2 | # $Id$
|
---|
3 | #
|
---|
4 | HOW TO ADD CUSTOM SCRIPTS TO THE JHALFS MAKEFILE
|
---|
5 |
|
---|
6 |
|
---|
7 | Normally JHALFS creates a Makefile containing only those scripts found in
|
---|
8 | the {B,C,H}LFS books. An automated construction tool cannot predict the
|
---|
9 | needs of every individual and requests are made "Can you add xxxx package".
|
---|
10 | Rather than adding numerous package scripts and switches for each request it
|
---|
11 | was easier to add a tool for the user(s) to code their own package needs.
|
---|
12 |
|
---|
13 |
|
---|
14 | LAYOUT
|
---|
15 | A new directory has been added to JHALFS tree which will contain the
|
---|
16 | configuration scripts and a few examples. A switch has been added to the
|
---|
17 | configuration file which enables/disables the inclusion of personal scripts.
|
---|
18 |
|
---|
19 | custom
|
---|
20 | /config <-- where to put your scripts.
|
---|
21 | template <-- ALL scripts MUST look like this
|
---|
22 |
|
---|
23 |
|
---|
24 |
|
---|
25 | NOTE::: You are responsible for including all dependencies and ensuring they
|
---|
26 | are built in the proper order.
|
---|
27 |
|
---|
28 | 1. To add a package to the final JHALFS Makefile you must first create a file
|
---|
29 | in the custom/config directory.
|
---|
30 | **All config files MUST follow the naming convention, xxx-PKG, where xxx
|
---|
31 | is the order number and PKG is the name of the package. The file naming
|
---|
32 | format is important as it defines the build order. The example shown
|
---|
33 | below has an order number 950 and log files will list in alphabetical
|
---|
34 | order in the /logs directory after blfs-tools scripts.
|
---|
35 | The simplest method is to copy the template file into the config directory
|
---|
36 | and rename it.
|
---|
37 |
|
---|
38 | 2. Populate the variables with the necessary values.
|
---|
39 | Variable function is self explanitory except for the inclusion of the
|
---|
40 | build cmds. If the package you want to include is found in the BLFS
|
---|
41 | book then you only need to copy/paste the cmd strings between the xEOFx
|
---|
42 | pairs, otherwise you will need to define the build cmds yourself.
|
---|
43 | NOTE::: This script you just created is not usable directly but contains
|
---|
44 | all the information necessary for jhalfs to create a build script
|
---|
45 | and an entry in the jhalfs Makefile.
|
---|
46 |
|
---|
47 | 3. As mentioned previously the build order is dictated by the 3 digit number
|
---|
48 | in the file name. If a package has dependencies it must be numerically
|
---|
49 | larger than the dependency files.
|
---|
50 | ie. The package mc has glib as a dependency and build order is
|
---|
51 | 950-glib
|
---|
52 | 951-mc
|
---|
53 |
|
---|
54 | 4. A config file for BLFS-bootscripts is already created as 999-blfs_bootscripts.
|
---|
55 | If a package requires a bootscript to be installed add the cmd to this
|
---|
56 | file and NOT in the package script. The gpm script is included as an
|
---|
57 | example of multiple patch files and the need for a blfs bootscript.
|
---|
58 |
|
---|
59 | RUNNING:::
|
---|
60 | Although your scripts are added to the generated makefile they are not
|
---|
61 | automatically built. You must tell the makefile to build the tools with
|
---|
62 | the cmd
|
---|
63 | make mk_CUSTOM_TOOLS
|
---|
64 |
|
---|
65 | :::FINAL COMMENT:::
|
---|
66 | This feature was added so users could build the packages necessary to access
|
---|
67 | the internet and was not intended to replace the BLFS install system.
|
---|
68 |
|
---|
69 |
|
---|
70 | #--------- GLIB example -----------
|
---|
71 |
|
---|
72 | #
|
---|
73 | # Filename syntax xxx-PKG ie. 950-glibc
|
---|
74 | # Create a file in the custom/config directory
|
---|
75 | # Populate the file using the following script as an example
|
---|
76 | #
|
---|
77 |
|
---|
78 | PKG="glib"
|
---|
79 | PKG_VERSION="1.2.10"
|
---|
80 | PKG_FILE="glib-1.2.10.tar.gz"
|
---|
81 | URL="http://gd.tuwien.ac.at/graphics/gimp/gtk/v1.2/${PKG_FILE}"
|
---|
82 | MD5="6fe30dad87c77b91b632def29dd69ef9"
|
---|
83 |
|
---|
84 | # Patches are named PATCH[1..10]
|
---|
85 | # This information is used to download the patch only
|
---|
86 | # If you do not have the MD5SUM the download will proceed with a warning.
|
---|
87 | PATCH1="http://www.linuxfromscratch.org/patches/blfs/svn/glib-1.2.10-gcc34-1.patch 0077a1cce5e8a2231ac5a9b08c6263ba"
|
---|
88 |
|
---|
89 |
|
---|
90 | # NOTE::
|
---|
91 | # The convoluted scheme used to write out a temporary file is
|
---|
92 | # a work-around for embedded single and double quotes.
|
---|
93 |
|
---|
94 | ( cat << "xEOFx"
|
---|
95 |
|
---|
96 | patch -Np1 -i ../glib-1.2.10-gcc34-1.patch &&
|
---|
97 | ./configure --prefix=/usr &&
|
---|
98 | make
|
---|
99 | make install &&
|
---|
100 | chmod -v 755 /usr/lib/libgmodule-1.2.so.0.0.10
|
---|
101 |
|
---|
102 | xEOFx
|
---|
103 | ) > tmp
|
---|
104 |
|
---|
105 |
|
---|
106 | #--------- GPM example -----------
|
---|
107 |
|
---|
108 |
|
---|
109 | PKG="gpm"
|
---|
110 | PKG_VERSION="1.20.1"
|
---|
111 | PKG_FILE="gmp-1.20.1.tar.bz2"
|
---|
112 | URL="ftp://arcana.linux.it/pub/gpm/gpm-1.20.1.tar.bz2"
|
---|
113 | MD5="2c63e827d755527950d9d13fe3d87692"
|
---|
114 |
|
---|
115 | PATCH1=" http://www.linuxfromscratch.org/patches/blfs/svn/gpm-1.20.1-segfault-1.patch"
|
---|
116 | PATCH2=" http://www.linuxfromscratch.org/patches/blfs/svn/gpm-1.20.1-silent-1.patch"
|
---|
117 |
|
---|
118 |
|
---|
119 | ( cat << "xEOFx"
|
---|
120 |
|
---|
121 | patch -Np1 -i ../gpm-1.20.1-segfault-1.patch &&
|
---|
122 | patch -Np1 -i ../gpm-1.20.1-silent-1.patch &&
|
---|
123 | ./configure --prefix=/usr --sysconfdir=/etc &&
|
---|
124 | LDFLAGS="-lm" make
|
---|
125 |
|
---|
126 | make install &&
|
---|
127 | cp -v conf/gpm-root.conf /etc &&
|
---|
128 | ldconfig
|
---|
129 |
|
---|
130 | # The normal cmd to install the boot script for gpm
|
---|
131 | # --- PUT THIS CMD INSIDE 999-blfs_bootscripts
|
---|
132 | #make install-gpm
|
---|
133 |
|
---|
134 | cat > /etc/sysconfig/mouse << "EOF"
|
---|
135 | # Begin /etc/sysconfig/mouse
|
---|
136 |
|
---|
137 | MDEVICE="/dev/psaux"
|
---|
138 | PROTOCOL="imps2"
|
---|
139 | GPMOPTS=""
|
---|
140 |
|
---|
141 | # End /etc/sysconfig/mouse
|
---|
142 | EOF
|
---|
143 |
|
---|
144 | xEOFx
|
---|
145 | ) > tmp
|
---|
146 |
|
---|