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
|
---|
38 |
|
---|
39 | # Dump packages list
|
---|
40 | sort packages.tmp >> 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 | tac gnome-core.dep.tmp > libs/gnome-core.dep
|
---|
62 | rm gnome-core.dep.tmp
|
---|
63 | }
|
---|
64 |
|
---|
65 | #--------------------------#
|
---|
66 | generate_gnome_full() { # GNOME full
|
---|
67 | #--------------------------#
|
---|
68 | local line base_xml package
|
---|
69 |
|
---|
70 | echo "gnome-core" > gnome-full.dep.tmp
|
---|
71 |
|
---|
72 | for line in `grep "xi:include" $BLFS_XML/gnome/add/add.xml` ; do
|
---|
73 | base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
|
---|
74 | package=`grep "gnome/add/$base_xml" packages | cut -f1`
|
---|
75 | [[ -n "$package" ]] && echo $package >> gnome-full.dep.tmp
|
---|
76 | done
|
---|
77 |
|
---|
78 | tac gnome-full.dep.tmp > libs/gnome-full.dep
|
---|
79 | rm gnome-full.dep.tmp
|
---|
80 | }
|
---|
81 |
|
---|
82 | #--------------------------#
|
---|
83 | generate_kde_core() { # KDE core
|
---|
84 | #--------------------------#
|
---|
85 | local line base_xml package
|
---|
86 |
|
---|
87 | > kde-core.dep.tmp
|
---|
88 |
|
---|
89 | for line in `grep "xi:include" $BLFS_XML/kde/core/core.xml` ; do
|
---|
90 | base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
|
---|
91 | package=`grep "kde/core/$base_xml" packages | cut -f1`
|
---|
92 | [[ -n "$package" ]] && echo $package >> kde-core.dep.tmp
|
---|
93 | done
|
---|
94 |
|
---|
95 | tac kde-core.dep.tmp > libs/kde-core.dep
|
---|
96 | rm kde-core.dep.tmp
|
---|
97 | }
|
---|
98 |
|
---|
99 | #--------------------------#
|
---|
100 | generate_kde_full() { # KDE full
|
---|
101 | #--------------------------#
|
---|
102 | local line base_xml package
|
---|
103 |
|
---|
104 | echo "kde-core" > kde-full.dep.tmp
|
---|
105 |
|
---|
106 | for line in `grep "xi:include" $BLFS_XML/kde/add/add.xml` ; do
|
---|
107 | base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
|
---|
108 | package=`grep "kde/add/$base_xml" packages | cut -f1`
|
---|
109 | [[ -n "$package" ]] && echo $package >> kde-full.dep.tmp
|
---|
110 | done
|
---|
111 |
|
---|
112 | for line in `grep "xi:include" $BLFS_XML/kde/devel/devel.xml` ; do
|
---|
113 | base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
|
---|
114 | package=`grep "kde/devel/$base_xml" packages | cut -f1`
|
---|
115 | [[ -n "$package" ]] && echo $package >> kde-full.dep.tmp
|
---|
116 | done
|
---|
117 |
|
---|
118 | tac kde-full.dep.tmp > libs/kde-full.dep
|
---|
119 | rm kde-full.dep.tmp
|
---|
120 | }
|
---|
121 |
|
---|
122 | #--------------------------#
|
---|
123 | generate_kde_koffice() { # KDE full + Koffice
|
---|
124 | #--------------------------#
|
---|
125 | echo -e "koffice\nkde-full\nkde-core" > libs/kde-koffice.dep
|
---|
126 | }
|
---|
127 |
|
---|
128 | #--------------------------#
|
---|
129 | generate_alsa() { # ALSA packages
|
---|
130 | #--------------------------#
|
---|
131 | echo -e "alsa-oss\nalsa-firmware\nalsa-tools\nalsa-utils\n \
|
---|
132 | alsa-plugins\nalsa-lib" > libs/alsa.dep
|
---|
133 | }
|
---|
134 |
|
---|
135 | #--------------------------#
|
---|
136 | generate_xorg7() { # Xorg7 packages
|
---|
137 | #--------------------------#
|
---|
138 | echo -e "x-config\nx-setup\nrman\nxterm2\nxorg7-driver\nxorg7-server\nluit\n \
|
---|
139 | xorg7-font\nxorg7-data\nxorg7-app\nxbitmaps\nmesalib\nlibdrm\n \
|
---|
140 | xorg7-lib\nxorg7-util\nxorg7-proto" > libs/xorg7.dep
|
---|
141 | }
|
---|