Initial import from FreeBSD RELENG_4:
[dragonfly.git] / release / scripts / print-cdrom-packages.sh
1 #!/bin/sh
2 #
3 # Author:       Jordan Hubbard
4 # Date:         Mon Jul 10 01:18:20 2000
5 # Version:      $FreeBSD: src/release/scripts/print-cdrom-packages.sh,v 1.1.2.27 2003/03/19 16:56:52 obrien Exp $
6 #
7 # MAINTAINER:   re
8 #
9 # This script prints out the list of "minimum required packages" for
10 # a given CDROM number, that numer currently referring to the 4 CD
11 # "official set" published by BSDi.  If there is no minimum package
12 # set for the given CDROM, or none is known, the script will exit
13 # with an error code of 1.  At some point, this script should be extended
14 # to at least cope with other official CD distributions, like non-US ones.
15 #
16 # usage: print-cdrom-packages.sh cdrom-number
17 #
18 # example: ./print-cdrom-packages.sh 1
19 # will print the minimal package set for the first cdrom (what's generally
20 # referred to as the installation boot CD).
21 #
22 # This information is codified in script form so that some definitive
23 # reference for the package set info exists rather than having it
24 # be left up to everybody's best guess.  It's currently hard-coded directly
25 # into the script but may, at some point, switch to a more sophisticated
26 # data-extraction technique from the ports collection.  For now, add your
27 # packages to the appropriate CDROM_SET_<n> variable as /usr/ports/<your-entry>
28 # so that the package name and dependency list for each can be at least be
29 # obtained in an automated fashion.
30
31 # The following are required if you obtained your packages from one of the
32 # package building clusters or otherwise had these defined when the packages
33 # were built.
34 export BATCH=t
35 export PACKAGE_BUILDING=t
36
37 # Don't pick up installed packages from the host
38 export LOCALBASE=/nonexistentlocal
39 export X11BASE=/nonexistentx
40 export PKG_DBDIR=/nonexistentdb
41
42 if [ "X${PKG_ARCH}" = "X" ]; then
43 export PKG_ARCH=`uname -m`
44 fi
45
46 # usage: extract-names cd# [portsdir]
47 extract-names()
48 {
49         portsdir=${2-/usr/ports}
50         _FOO=`eval echo \\${CDROM_SET_$1}`
51         if [ "${_FOO}" ]; then
52                 TMPNAME="/tmp/_extract_names$$"
53                 rm -f ${TMPNAME}
54                 for i in ${_FOO}; do
55                         ( cd $portsdir/$i && PORTSDIR=$portsdir make package-name package-depends ) >> ${TMPNAME};
56                 done
57                 if [ -s "${TMPNAME}" ]; then
58                         sed -e 's/:.*$//' < ${TMPNAME} | sort -u
59                 fi
60                 rm -f ${TMPNAME}
61         else
62                 exit 1
63         fi
64 }
65
66
67 ## Start of set for CDROM #1
68 # This is the set required by sysinstall.
69 CDROM_SET_1=""
70 if [ "X${PKG_ARCH}" = "Xalpha" ]; then
71 CDROM_SET_1="${CDROM_SET_1} emulators/osf1_base"
72 elif [ "X${PKG_ARCH}" = "Xi386" ]; then
73 CDROM_SET_1="${CDROM_SET_1} emulators/linux_base"
74 fi
75 CDROM_SET_1="${CDROM_SET_1} net/pcnfsd"
76 CDROM_SET_1="${CDROM_SET_1} net/rsync"
77 CDROM_SET_1="${CDROM_SET_1} x11-fonts/XFree86-4-font100dpi"
78 CDROM_SET_1="${CDROM_SET_1} x11-fonts/XFree86-4-font75dpi"
79 CDROM_SET_1="${CDROM_SET_1} x11-fonts/XFree86-4-fontCyrillic"
80 CDROM_SET_1="${CDROM_SET_1} x11-fonts/XFree86-4-fontDefaultBitmaps"
81 CDROM_SET_1="${CDROM_SET_1} x11-fonts/XFree86-4-fontEncodings"
82 CDROM_SET_1="${CDROM_SET_1} x11-fonts/XFree86-4-fontScalable"
83 CDROM_SET_1="${CDROM_SET_1} x11-servers/XFree86-4-FontServer"
84 CDROM_SET_1="${CDROM_SET_1} x11-servers/XFree86-4-NestServer"
85 CDROM_SET_1="${CDROM_SET_1} x11-servers/XFree86-4-PrintServer"
86 CDROM_SET_1="${CDROM_SET_1} x11-servers/XFree86-4-Server"
87 CDROM_SET_1="${CDROM_SET_1} x11-servers/XFree86-4-VirtualFramebufferServer"
88 CDROM_SET_1="${CDROM_SET_1} x11-wm/afterstep"
89 CDROM_SET_1="${CDROM_SET_1} x11-wm/enlightenment"
90 CDROM_SET_1="${CDROM_SET_1} x11-wm/fvwm2"
91 CDROM_SET_1="${CDROM_SET_1} x11-wm/sawfish"
92 CDROM_SET_1="${CDROM_SET_1} x11-wm/windowmaker"
93 CDROM_SET_1="${CDROM_SET_1} x11/XFree86-4"
94 CDROM_SET_1="${CDROM_SET_1} x11/XFree86-4-clients"
95 CDROM_SET_1="${CDROM_SET_1} x11/XFree86-4-documents"
96 CDROM_SET_1="${CDROM_SET_1} x11/XFree86-4-libraries"
97 CDROM_SET_1="${CDROM_SET_1} x11/XFree86-4-manuals"
98 CDROM_SET_1="${CDROM_SET_1} x11/gnome2"
99 CDROM_SET_1="${CDROM_SET_1} x11/kde3"
100 CDROM_SET_1="${CDROM_SET_1} www/links"
101
102 # This is the set of "people really want these" packages.  Please add to
103 # this list.
104 CDROM_SET_1="${CDROM_SET_1} astro/xearth"
105 CDROM_SET_1="${CDROM_SET_1} editors/emacs21"
106 CDROM_SET_1="${CDROM_SET_1} editors/vim-lite"
107 CDROM_SET_1="${CDROM_SET_1} editors/vim"
108 CDROM_SET_1="${CDROM_SET_1} emulators/mtools"
109 CDROM_SET_1="${CDROM_SET_1} ftp/ncftp"
110 CDROM_SET_1="${CDROM_SET_1} graphics/xpdf"
111 CDROM_SET_1="${CDROM_SET_1} graphics/xv"
112 CDROM_SET_1="${CDROM_SET_1} irc/xchat"
113 CDROM_SET_1="${CDROM_SET_1} mail/exim"
114 CDROM_SET_1="${CDROM_SET_1} mail/fetchmail"
115 CDROM_SET_1="${CDROM_SET_1} mail/mutt"
116 CDROM_SET_1="${CDROM_SET_1} mail/pine4"
117 CDROM_SET_1="${CDROM_SET_1} mail/popd"
118 CDROM_SET_1="${CDROM_SET_1} mail/xfmail"
119 CDROM_SET_1="${CDROM_SET_1} misc/screen"
120 CDROM_SET_1="${CDROM_SET_1} net/cvsup"
121 CDROM_SET_1="${CDROM_SET_1} net/samba"
122 CDROM_SET_1="${CDROM_SET_1} news/slrn"
123 CDROM_SET_1="${CDROM_SET_1} news/tin"
124 CDROM_SET_1="${CDROM_SET_1} print/a2ps-letter"
125 if [ "X${PKG_ARCH}" = "Xalpha" ]; then
126 CDROM_SET_1="${CDROM_SET_1} print/acroread4"
127 fi
128 if [ "X${PKG_ARCH}" = "Xi386" ]; then
129 CDROM_SET_1="${CDROM_SET_1} print/acroread5"
130 fi
131 CDROM_SET_1="${CDROM_SET_1} print/apsfilter"
132 CDROM_SET_1="${CDROM_SET_1} print/ghostscript-gnu-nox11"
133 CDROM_SET_1="${CDROM_SET_1} print/ghostview"
134 CDROM_SET_1="${CDROM_SET_1} print/gv"
135 CDROM_SET_1="${CDROM_SET_1} print/psutils-letter"
136 CDROM_SET_1="${CDROM_SET_1} security/sudo"
137 CDROM_SET_1="${CDROM_SET_1} shells/bash2"
138 CDROM_SET_1="${CDROM_SET_1} shells/pdksh"
139 CDROM_SET_1="${CDROM_SET_1} shells/zsh"
140 CDROM_SET_1="${CDROM_SET_1} sysutils/portupgrade"
141 CDROM_SET_1="${CDROM_SET_1} www/lynx"
142 CDROM_SET_1="${CDROM_SET_1} www/mozilla"
143 CDROM_SET_1="${CDROM_SET_1} www/netscape-remote"
144 CDROM_SET_1="${CDROM_SET_1} www/netscape-wrapper"
145 CDROM_SET_1="${CDROM_SET_1} www/netscape48-communicator"
146 CDROM_SET_1="${CDROM_SET_1} www/netscape48-navigator"
147 CDROM_SET_1="${CDROM_SET_1} www/opera"
148 CDROM_SET_1="${CDROM_SET_1} x11/rxvt"
149
150 # VERY common build dependencies
151 CDROM_SET_1="${CDROM_SET_1} archivers/unzip"
152 CDROM_SET_1="${CDROM_SET_1} devel/gmake"
153 CDROM_SET_1="${CDROM_SET_1} graphics/png"
154 if [ "X${PKG_ARCH}" = "Xi386" ]; then
155 CDROM_SET_1="${CDROM_SET_1} misc/compat22"
156 fi
157 if [ "X${PKG_ARCH}" = "Xi386" -o "X${PKG_ARCH}" = "Xalpha" ]; then
158 CDROM_SET_1="${CDROM_SET_1} misc/compat3x"
159 CDROM_SET_1="${CDROM_SET_1} misc/compat4x"
160 fi
161
162 ## End of set for CDROM #1
163
164 ## Start of set for CDROM #2
165 ## Live file system, CVS repositories, and commerical software demos
166 ## typically live on this disc.  Users do not expect to find packages
167 ## here.
168 ## End of set for CDROM #2
169
170 ## Start of set for CDROM #3
171 CDROM_SET_3="${CDROM_SET_3} editors/xemacs21"
172 CDROM_SET_3="${CDROM_SET_3} graphics/gimp1"
173 CDROM_SET_3="${CDROM_SET_3} lang/gnat"
174 CDROM_SET_3="${CDROM_SET_3} net/cvsup-without-gui"
175 CDROM_SET_3="${CDROM_SET_3} print/teTeX"
176 CDROM_SET_3="${CDROM_SET_3} textproc/docproj-jadetex"
177
178 ## End of set for CDROM #3
179
180 ## Start of set for CDROM #4
181 ## End of set for CDROM #4
182
183
184 ## Start of set that should not be included on any CDROM.
185 ## This should not contain packages that are already marked BROKEN or
186 ## RESTRICTED, it is only for packages that sysinstall(8) has trouble
187 ## with.
188 NO_CDROM_SET=""
189 NO_CDROM_SET="${NO_CDROM_SET} net/cvsupit"
190
191 # Start of actual script.
192 if [ $# -lt 1 ]; then
193         echo "usage: $0 cdrom-number [portsdir]"
194         exit 2
195 fi
196 if [ ${1} = 0 ]; then
197         echo $NO_CDROM_SET
198 else
199         extract-names $*
200 fi
201 exit 0