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