]> code.delx.au - monosys/blob - scripts/custom-ubuntu-desktop
34d1acd77893235ba8190892bd34338bcacf26eb
[monosys] / scripts / custom-ubuntu-desktop
1 #!/bin/bash -e
2
3 RELEASE='12.04'
4 PACKAGE_NAME="ubuntu-desktop-custom"
5 PACKAGE_VERSION="1.0.$(date +%Y-%m-%d.%H-%M)"
6
7 DEPENDS='
8 aptitude
9 atop
10 build-essential
11 colordiff
12 cryptsetup
13 curl
14 dconf-tools
15 dvdbackup
16 elinks
17 equivs
18 exiftags
19 fdupes
20 git
21 gnome-session-fallback
22 gpick
23 gstreamer-tools
24 gvfs-bin
25 hyphen-en-us
26 imagemagick
27 keepassx
28 kid3-qt
29 language-pack-en
30 language-pack-gnome-en
31 libav-tools
32 libreoffice
33 lightdm-gtk-greeter
34 lvm2
35 mercurial
36 mplayer
37 mythes-en-au
38 mythes-en-us
39 netcat-openbsd
40 netcat6
41 python-lxml
42 rdesktop
43 renameutils
44 screen
45 screenruler
46 sqlite3
47 sshfs
48 subversion
49 unrar
50 vim
51 xdotool
52 xsel
53 xtightvncviewer
54 xz-utils
55 zip
56 '
57
58 EXCLUDE='
59 activity-log-manager-control-center
60 app-install-data-partner
61 apport-gtk
62 branding-ubuntu
63 checkbox-qt
64 deja-dup
65 empathy
66 example-content
67 gnome-session
68 gnome-session-canberra
69 gwibber
70 ibus
71 ibus-gtk3
72 ibus-pinyin
73 ibus-pinyin-db-android
74 ibus-table
75 in-switch
76 kerneloops-daemon
77 landscape-client-ui-install
78 launchpad-integration
79 nautilus-sendto
80 nautilus-share
81 rhythmbox
82 rhythmbox-plugin-magnatune
83 rhythmbox-ubuntuone
84 software-center
85 software-properties-gtk
86 telepathy-idle
87 thunderbird
88 thunderbird-gnome-support
89 transmission-gtk
90 ubuntu-sounds
91 ubuntuone-client-gnome
92 ubuntuone-installer
93 unity
94 unity-2d
95 unity-greeter
96 whoopsie
97 xul-ext-ubufox
98 '
99
100
101 ####################
102 # Preflight checks #
103 ####################
104
105 if [ "$(lsb_release -r | cut -d ':' -f 2 | tr -d ' ')" != "$RELEASE" ]; then
106 echo "Sorry, at the moment this script only supports Ubuntu $RELEASE"
107 exit 1
108 fi
109
110 if ! grep -q universe /etc/apt/sources.list /etc/apt/sources.list.d/*.list; then
111 echo "You must enable universe in your apt sources.list"
112 exit 1
113 fi
114
115 if ! grep -q multiverse /etc/apt/sources.list /etc/apt/sources.list.d/*.list; then
116 echo "You must enable multiverse in your apt sources.list"
117 exit 1
118 fi
119
120 if ! which equivs-build > /dev/null; then
121 sudo apt-get install equivs
122 fi
123
124
125
126 ##########################
127 # Build the control file #
128 ##########################
129
130 CONTROLFILE="$(tempfile)"
131 echo "-- Writing control file to $CONTROLFILE"
132
133 cat > "$CONTROLFILE" <<EOT
134 Package: $PACKAGE_NAME
135 Section: metapackages
136 Priority: optional
137 Standards-Version: 3.9.2
138 Conflicts: ubuntu-desktop
139 Replaces: ubuntu-desktop
140
141 Version: $PACKAGE_VERSION
142 Description: Customised Ubuntu desktop system
143 Similar to ubuntu-desktop, but with some additions and removals.
144 EOT
145
146 function get_line {
147 line="$(apt-cache show ubuntu-desktop | grep "$1:")"
148 for pkg in $EXCLUDE; do
149 line="$(echo "$line" | sed -e "s/$pkg, //" -e "s/, $pkg\$//")"
150 done
151 echo -n "$line"
152 }
153
154 (
155 echo
156
157 get_line 'Depends'
158 echo ", $(echo $DEPENDS | sed 's/ /, /g')"
159
160 get_line 'Recommends'
161 echo
162 ) >> "$CONTROLFILE"
163
164
165 ##################
166 # Build the .deb #
167 ##################
168
169 echo "-- Building .deb in working directory"
170 equivs-build "$CONTROLFILE"
171 rm -f "$CONTROLFILE"
172
173
174 #############
175 # Go go go! #
176 #############
177
178 echo "-- Go go go!"
179 sudo aptitude install $DEPENDS
180 sudo dpkg -i "${PACKAGE_NAME}_${PACKAGE_VERSION}_all.deb"
181 sudo aptitude purge $EXCLUDE
182