1 | #!/bin/bash
|
---|
2 | #
|
---|
3 | # $Id$
|
---|
4 | #
|
---|
5 | set -e
|
---|
6 |
|
---|
7 | #-----------------------#
|
---|
8 | generate_packages() { # Master packages file
|
---|
9 | #-----------------------#
|
---|
10 | local pkg_id file
|
---|
11 |
|
---|
12 | > packages.tmp
|
---|
13 |
|
---|
14 | # Extract Id and path for sect1 files
|
---|
15 | for file in `find $BLFS_XML -name "*.xml"` ; do
|
---|
16 | pkg_id=`grep "sect1 id" $file | sed -e 's/<sect1 id="//;s/".*//'`
|
---|
17 | [[ ! -z "$pkg_id" ]] && echo -e "$pkg_id\t$file" >> packages.tmp
|
---|
18 | done
|
---|
19 |
|
---|
20 | # IDs clean-up (unuseful pages or commented-out packages, could be more)
|
---|
21 | sed -i '/template/d;/ntroduction/d;/preface/d;/alsa.xml/d' packages.tmp
|
---|
22 | sed -i '/obsolete/d;/postlfs-/d;/-client.xml/d;/xorg7.xml/d' packages.tmp
|
---|
23 | sed -i '/courier.xml/d;/-other\t/d;/others-/d;/other-/d' packages.tmp
|
---|
24 | sed -i '/fw-firewall/d;/gcc2/d;/cvsserver/d;/svnserver/d' packages.tmp
|
---|
25 |
|
---|
26 | # Add header with meta-packages pseudo Id
|
---|
27 | {
|
---|
28 | cat << EOF
|
---|
29 | alsa $BLFS_XML
|
---|
30 | gnome-core $BLFS_XML
|
---|
31 | gnome-full $BLFS_XML
|
---|
32 | kde-core $BLFS_XML
|
---|
33 | kde-full $BLFS_XML
|
---|
34 | kde-koffice $BLFS_XML
|
---|
35 | xorg7 $BLFS_XML
|
---|
36 | EOF
|
---|
37 | } >> packages.tmp
|
---|
38 |
|
---|
39 | # Dump packages list
|
---|
40 | sort packages.tmp -b --key=2 --field-separator=/ --output=packages
|
---|
41 |
|
---|
42 | # Clean up
|
---|
43 | rm packages.tmp
|
---|
44 | }
|
---|
45 |
|
---|
46 | # Pre-made *.dep files for meta-packages
|
---|
47 |
|
---|
48 | #--------------------------#
|
---|
49 | generate_gnome_core() { # GNOME core
|
---|
50 | #--------------------------#
|
---|
51 | local line base_xml package
|
---|
52 |
|
---|
53 | > gnome-core.dep.tmp
|
---|
54 |
|
---|
55 | for line in `grep "xi:include" $BLFS_XML/gnome/core/core.xml` ; do
|
---|
56 | base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
|
---|
57 | package=`grep "gnome/core/$base_xml" packages | cut -f1`
|
---|
58 | [[ -n "$package" ]] && echo $package >> gnome-core.dep.tmp
|
---|
59 | done
|
---|
60 |
|
---|
61 | # Replace dummy packages with the proper ones
|
---|
62 | sed -i 's/GNOME-//g' gnome-core.dep.tmp
|
---|
63 |
|
---|
64 | tac gnome-core.dep.tmp > libs/gnome-core.dep
|
---|
65 | rm gnome-core.dep.tmp
|
---|
66 | }
|
---|
67 |
|
---|
68 | #--------------------------#
|
---|
69 | generate_gnome_full() { # GNOME full
|
---|
70 | #--------------------------#
|
---|
71 | local line base_xml package
|
---|
72 |
|
---|
73 | echo "gnome-core" > gnome-full.dep.tmp
|
---|
74 |
|
---|
75 | for line in `grep "xi:include" $BLFS_XML/gnome/add/add.xml` ; do
|
---|
76 | base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
|
---|
77 | package=`grep "gnome/add/$base_xml" packages | cut -f1`
|
---|
78 | [[ -n "$package" ]] && echo $package >> gnome-full.dep.tmp
|
---|
79 | done
|
---|
80 |
|
---|
81 | tac gnome-full.dep.tmp > libs/gnome-full.dep
|
---|
82 | rm gnome-full.dep.tmp
|
---|
83 | }
|
---|
84 |
|
---|
85 | #--------------------------#
|
---|
86 | generate_kde_core() { # KDE core
|
---|
87 | #--------------------------#
|
---|
88 | local line base_xml package
|
---|
89 |
|
---|
90 | > kde-core.dep.tmp
|
---|
91 |
|
---|
92 | for line in `grep "xi:include" $BLFS_XML/kde/core/core.xml` ; do
|
---|
93 | base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
|
---|
94 | package=`grep "kde/core/$base_xml" packages | cut -f1`
|
---|
95 | [[ -n "$package" ]] && echo $package >> kde-core.dep.tmp
|
---|
96 | done
|
---|
97 |
|
---|
98 | tac kde-core.dep.tmp > libs/kde-core.dep
|
---|
99 | rm kde-core.dep.tmp
|
---|
100 | }
|
---|
101 |
|
---|
102 | #--------------------------#
|
---|
103 | generate_kde_full() { # KDE full
|
---|
104 | #--------------------------#
|
---|
105 | local line base_xml package
|
---|
106 |
|
---|
107 | echo "kde-core" > kde-full.dep.tmp
|
---|
108 |
|
---|
109 | for line in `grep "xi:include" $BLFS_XML/kde/add/add.xml` ; do
|
---|
110 | base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
|
---|
111 | package=`grep "kde/add/$base_xml" packages | cut -f1`
|
---|
112 | [[ -n "$package" ]] && echo $package >> kde-full.dep.tmp
|
---|
113 | done
|
---|
114 |
|
---|
115 | for line in `grep "xi:include" $BLFS_XML/kde/devel/devel.xml` ; do
|
---|
116 | base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
|
---|
117 | package=`grep "kde/devel/$base_xml" packages | cut -f1`
|
---|
118 | [[ -n "$package" ]] && echo $package >> kde-full.dep.tmp
|
---|
119 | done
|
---|
120 |
|
---|
121 | tac kde-full.dep.tmp > libs/kde-full.dep
|
---|
122 | rm kde-full.dep.tmp
|
---|
123 | }
|
---|
124 |
|
---|
125 | #--------------------------#
|
---|
126 | generate_kde_koffice() { # KDE full + Koffice
|
---|
127 | #--------------------------#
|
---|
128 | echo -e "koffice\nkde-full\nkde-core" > libs/kde-koffice.dep
|
---|
129 | }
|
---|
130 |
|
---|
131 | #--------------------------#
|
---|
132 | generate_alsa() { # ALSA packages
|
---|
133 | #--------------------------#
|
---|
134 | echo -e "alsa-oss\nalsa-firmware\nalsa-tools\nalsa-utils\n\
|
---|
135 | alsa-plugins\nalsa-lib" > libs/alsa.dep
|
---|
136 | }
|
---|
137 |
|
---|
138 | #--------------------------#
|
---|
139 | generate_xorg7() { # Xorg7 packages
|
---|
140 | #--------------------------#
|
---|
141 | echo -e "x-config\nx-setup\nrman\nxterm2\nxorg7-driver\nxorg7-server\nluit\n\
|
---|
142 | xorg7-font\nxorg7-data\nxorg7-app\nxbitmaps\nmesalib\nlibdrm\n\
|
---|
143 | xorg7-lib\nxorg7-util\nxorg7-proto" > libs/xorg7.dep
|
---|
144 | }
|
---|