ubuntu-defaults-builder-0.49/0000775000000000000000000000000012146654515013122 5ustar ubuntu-defaults-builder-0.49/test/0000775000000000000000000000000012146654515014101 5ustar ubuntu-defaults-builder-0.49/test/run0000775000000000000000000004454012030313710014617 0ustar #!/usr/bin/python3 import unittest import subprocess import tempfile import shutil import os from glob import glob import json class T(unittest.TestCase): def setUp(self): '''Call ubuntu-defaults-template to build a test project. This will build defaults-test (self.pkgdir) in self.workdir (a temporary directory), and leave the files untouched. Call self.enable_example() to enable the example content of a customization file, or change the files manually. ''' self.srcdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) self.workdir = tempfile.mkdtemp() os.environ['UBUNTU_DEFAULTS_TEMPLATE_DIR'] = os.path.join(self.srcdir, 'template') builder = subprocess.Popen([os.path.join(self.srcdir, 'bin', 'ubuntu-defaults-template'), '--quiet', 'defaults-test'], cwd=self.workdir) builder.communicate() self.assertEqual(builder.returncode, 0) self.pkgdir = os.path.join(self.workdir, 'defaults-test') self.assertTrue(os.path.isdir(self.pkgdir)) def tearDown(self): shutil.rmtree(self.workdir) def build(self, expect_fail=False): '''Build the defaults package and run lintian check. Return the result of dpkg -I. After running this, self.debdir contains the unpacked .deb. ''' env = os.environ.copy() env['PATH'] = os.path.join(self.srcdir, 'bin') + ':' + env.get('PATH', '') env['DH_AUTOSCRIPTDIR'] = os.path.join(self.srcdir, 'debhelper-scripts') dpkg = subprocess.Popen(['dpkg-buildpackage', '-us', '-uc', '-d'], cwd=self.pkgdir, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=env) out = dpkg.communicate()[0].decode() if expect_fail: self.assertNotEqual(dpkg.returncode, 0, 'dpkg-buildpackage unexpectedly succeeded:\n' + out) return else: self.assertEqual(dpkg.returncode, 0, 'dpkg-buildpackage failed:\n' + out) changes = glob(os.path.join(self.workdir, '*defaults-test_*.changes')) self.assertEqual(len(changes), 1) changes = changes[0] (code, lintian) = subprocess.getstatusoutput('lintian ' + changes) # filter out warnings we don't care about for line in lintian.splitlines(): if 'unknown-section metapackages' in line or \ 'desktop-command-not-in-package' in line or \ 'empty-binary-package' in line: continue self.fail('lintian errors:\n' + lintian) self.assertEqual(code, 0, 'lintian failed') deb = glob(os.path.join(self.workdir, '*defaults-test_*.deb')) self.assertEqual(len(deb), 1) deb = deb[0] self.debdir = os.path.join(self.workdir, 'deb') subprocess.check_call(['dpkg', '-x', deb, self.debdir], cwd=self.workdir) return subprocess.check_output(['dpkg', '-I', deb], cwd=self.workdir).decode() def enable_example(self, file): file = os.path.join(self.pkgdir, file) lines = [] line = '' with open(file) as f: for line in f: if line.startswith('# Example:'): break for line in f: assert line.startswith('# ') lines.append(line[2:]) with open(file, 'w') as f: for line in lines: f.write(line) def set_file(self, file, contents): with open(os.path.join(self.pkgdir, file), 'w') as f: f.write(contents) def rename_package(self, name): '''Change the built package name''' for file in ['debian/control', 'debian/changelog']: with open(os.path.join(self.pkgdir, file)) as f: contents = f.read() contents = contents.replace('defaults-test', name) with open(os.path.join(self.pkgdir, file), 'w') as f: f.write(contents) def test_template(self): '''Pure template without any customizations.''' control = self.build() files = subprocess.check_output(['find', '-type', 'f', '!', '-path', './usr/share/doc/defaults-test*'], cwd=self.debdir).decode() self.assertTrue(files == '', 'unexpected files in package:\n' + files) self.assertTrue('Package: defaults-test' in control) self.assertFalse('Depends:' in control) self.assertFalse('Recommends:' in control) def test_empty(self): '''Empty defaults package with no example files''' # only keep the Debianization for f in os.listdir(self.pkgdir): if f != 'debian': path = os.path.join(self.pkgdir, f) if os.path.isdir(path): shutil.rmtree(path) else: os.unlink(path) control = self.build() self.assertTrue('Package: defaults-test' in control) self.assertFalse('Depends:' in control) self.assertFalse('Recommends:' in control) def test_dependencies(self): '''depends.txt, recommends.txt''' self.enable_example('depends.txt') self.enable_example('recommends.txt') control = self.build() self.assertTrue('Depends: manpages-de\n' in control, control) self.assertTrue('Recommends: fortunes-de\n' in control) def test_desktop_background(self): '''desktop/background.jpg''' test_jpg = os.path.join('test', 'test.jpg') shutil.copy(test_jpg, os.path.join(self.pkgdir, 'desktop', 'background.jpg')) self.build() with open(os.path.join(self.debdir, 'usr/share/backgrounds/defaults-test.jpg'), 'rb') as dest: with open(test_jpg, 'rb') as src: self.assertEqual(src.read(), dest.read()) with open(os.path.join(self.debdir, 'usr/share/glib-2.0/schemas/defaults-test.gschema.override')) as f: self.assertTrue('usr/share/backgrounds/defaults-test.jpg' in f.read()) def test_desktop_files(self): '''desktop/*.desktop''' path = os.path.join(self.pkgdir, 'desktop', 'googlemail.desktop') os.rename(path + '.example', path) self.build() with open(os.path.join(self.debdir, 'usr/share/applications/googlemail.desktop')) as f: self.assertTrue('http://googlemail.com' in f.read()) def test_desktop_default_session(self): '''desktop/default-session.txt''' self.enable_example('desktop/default-session.txt') self.build() with open(os.path.join(self.debdir, 'usr/share/defaults-test/default-session.txt')) as f: self.assertEqual(f.read(), 'ubuntu-2d') def test_default_applications(self): '''desktop/default-applications.txt''' self.enable_example('desktop/default-applications.txt') control = self.build() # check default applications settings with open(os.path.join(self.debdir, 'usr/share/applications/defaults.list')) as f: contents = f.read() self.assertTrue("[Default Applications]" in contents, 'has correct header') self.assertTrue("application/ogg=banshee.desktop" in contents, 'has overriden default applications') self.assertTrue("x-scheme-handler/mailto=thunderbird.desktop" in contents, 'has overriden default application') self.assertTrue("x-foo/bar=toto.desktop" in contents, 'have non exiting custom mimetype') self.assertTrue(contents.count("application/ogg") == 1, 'have only one occurence by overriden mimetype') self.assertTrue(contents.count("\n") > 3, 'have not only overriden values') def test_unity(self): '''unity/launchers.txt''' self.enable_example('unity/launchers.txt') control = self.build() # check Unity gsettings with open(os.path.join(self.debdir, 'usr/share/glib-2.0/schemas/defaults-test.gschema.override')) as f: contents = f.read() self.assertTrue("favorites=[" in contents, 'has correct array formatting') self.assertTrue("'application://firefox.desktop'," in contents, 'has standard launchers: ' + contents) self.assertTrue("'application://gnome-sudoku.desktop'," in contents, 'has custom launchers:' + contents) self.assertTrue("'application://sol.desktop'" in contents, 'has custom launchers:' + contents) # picks up the extra dependency self.assertTrue('aisleriot' in control, control) def test_unity_clear(self): '''unity/launchers.txt with @clear''' with open(os.path.join(self.pkgdir, 'unity', 'launchers.txt'), 'w') as f: f.write('@clear\ngnome-sudoku\nyelp'); self.build() # check Unity gsettings with open(os.path.join(self.debdir, 'usr/share/glib-2.0/schemas/defaults-test.gschema.override')) as f: contents = f.read() self.assertTrue("favorites=[" in contents, 'has correct array formatting') self.assertFalse('firefox.desktop' in contents, 'does not have standard launchers: ' + contents) self.assertTrue("'application://gnome-sudoku.desktop'," in contents, 'has custom launchers:' + contents) self.assertTrue("'application://yelp.desktop'" in contents, 'has custom launchers:' + contents) self.assertFalse('clear' in contents, 'does not have @clear control command') def test_multimedia(self): '''multimedia/radiostations.txt''' self.enable_example('multimedia/radiostations.txt') with open(os.path.join(self.pkgdir, 'multimedia', 'radiostations.txt'), 'a') as f: f.write('invalid;line\n'); self.build() with open(os.path.join(self.debdir, 'usr/share/rhythmbox/plugins/iradio/iradio-initial.xspf')) as f: contents = f.read() self.assertTrue('Paradise' in contents) self.assertTrue('SWR3' in contents) self.assertFalse('invalid' in contents) self.assertTrue('&channel' in contents) self.assertNotEqual(glob(os.path.join(self.debdir, 'usr/share/banshee/stations/*.xspf')), []) def test_webbrowser(self): '''webbrowser/''' self.enable_example('webbrowser/startpage.txt') self.enable_example('webbrowser/searchengine.txt') self.enable_example('webbrowser/bookmarks-toolbar.txt') self.enable_example('webbrowser/bookmarks-menu.txt') self.build() with open(glob(os.path.join(self.debdir, 'usr/lib/firefox*/distribution/distribution.ini'))[0]) as f: contents = f.read() rel = subprocess.check_output(['lsb_release', '-sr']).decode().strip() self.assertTrue('http://www.ubuntuforums.org?release=' + rel in contents) self.assertFalse('${' in contents) self.assertTrue('"Wikipedia (de)"' in contents) self.assertTrue('www.zeit.de' in contents) self.assertTrue('www.ubuntu.de' in contents) self.assertTrue('heise.de' in contents) def test_i18n(self): '''i18n/''' self.enable_example('i18n/language.txt') self.enable_example('i18n/langpacks.txt') self.enable_example('i18n/keyboard.txt') self.build() with open(os.path.join(self.debdir, 'usr/share/defaults-test/language.txt')) as f: self.assertEqual(f.read(), 'de\n') with open(os.path.join(self.debdir, 'usr/share/defaults-test/langpacks.txt')) as f: self.assertEqual(f.read(), 'de complete\nes\nzh-hans') with open(os.path.join(self.debdir, 'usr/share/defaults-test/keyboard.txt')) as f: self.assertEqual(f.read(), 'de_nodeadkeys') def test_i18n_keyboard_no_variant(self): '''i18n/keyboard.txt without variant''' with open(os.path.join(self.pkgdir, 'i18n', 'keyboard.txt'), 'w') as f: f.write('de\n'); self.build() with open(os.path.join(self.debdir, 'usr/share/defaults-test/keyboard.txt')) as f: self.assertEqual(f.read(), 'de') def test_i18n_keyboard_invalid_fields(self): '''i18n/keyboard.txt with invalid number of fields''' with open(os.path.join(self.pkgdir, 'i18n', 'keyboard.txt'), 'w') as f: f.write('de nodeadkeys foo\n'); self.build(expect_fail=True) def test_i18n_keyboard_invalid_layout(self): '''i18n/keyboard.txt with invalid layout''' with open(os.path.join(self.pkgdir, 'i18n', 'keyboard.txt'), 'w') as f: f.write('yy\n'); self.build(expect_fail=True) def test_i18n_keyboard_invalid_variant(self): '''i18n/keyboard.txt with invalid variant''' with open(os.path.join(self.pkgdir, 'i18n', 'keyboard.txt'), 'w') as f: f.write('de dvorak-classic\n'); self.build(expect_fail=True) def test_macros(self): '''macros''' # this gets copied verbatim, so abuse this for some more complicated # test cases with open(os.path.join(self.pkgdir, 'i18n', 'language.txt'), 'w') as f: f.write('-${distro_release_name}-$-${distro_release_number}-${distro_release_name}'); self.build() rel = subprocess.check_output(['lsb_release', '-sr']).decode().strip() relname = subprocess.check_output(['lsb_release', '-sc']).decode().strip() with open(glob(os.path.join(self.debdir, 'usr/share/defaults-test/language.txt'))[0]) as f: self.assertEqual(f.read(), '-%s-$-%s-%s\n' % (relname, rel, relname)) with open(os.path.join(self.pkgdir, 'webbrowser', 'startpage.txt'), 'w') as f: f.write('http://${unknown}.start.com\n'); self.build(expect_fail=True) def test_icons(self): '''icons/''' test_jpg = os.path.join('test', 'test.jpg') shutil.copy(test_jpg, os.path.join(self.pkgdir, 'icons', '48x48', 'apps', 'myapp.jpg')) self.build() self.assertEqual(os.listdir(os.path.join(self.debdir, 'usr/share/icons/hicolor')), ['48x48']) with open(os.path.join(self.debdir, 'usr/share/icons/hicolor/48x48/apps/myapp.jpg'), 'rb') as dest: with open(test_jpg, 'rb') as src: self.assertEqual(src.read(), dest.read()) self.assertFalse(os.path.exists(os.path.join(self.debdir, 'usr/share/icons/hicolor/README'))) def test_ubiquity_slideshow(self): '''ubiquity-slideshow/''' slides_path = os.path.join(self.pkgdir, 'ubiquity-slideshow', 'slides') os.makedirs(os.path.join(slides_path, 'C', 'screenshots')) test_jpg = os.path.join('test', 'test.jpg') shutil.copy(test_jpg, os.path.join(slides_path, 'C', 'screenshots', 'welcome.jpg')) test_slide = open(os.path.join(slides_path, 'C', 'welcome.html'), 'w') test_slide.close() self.build() install_dir = os.path.join(self.debdir, 'usr/share/ubiquity-slideshow/slides/extra') self.assertEqual(sorted(os.listdir(install_dir)), ['C', 'directory.jsonp']) self.assertEqual(sorted(os.listdir(os.path.join(install_dir, 'C'))), ['screenshots', 'welcome.html']) self.assertEqual(os.listdir(os.path.join(install_dir, 'C', 'screenshots')), ['welcome.jpg']) self.assertFalse(os.path.exists( os.path.join(install_dir, 'README'))) directory = {} with open(os.path.join(install_dir, 'directory.jsonp'), 'r') as f: f_jsonp = f.read() f_json = f_jsonp[f_jsonp.index('(')+1 : f_jsonp.rindex(')')] directory = json.loads(f_json) self.assertEqual(directory['C']['slides'], ['welcome.html']) self.assertEqual(directory['C']['media'], ['screenshots/welcome.jpg']) def test_hooks(self): '''hooks/''' with open(os.path.join(self.pkgdir, 'hooks', 'chroot'), 'w') as f: f.write('#!/bin/sh -e\ntouch /tmp/pwned\n') self.build() self.assertTrue(os.access(os.path.join(self.debdir, 'usr/share/defaults-test/hooks/chroot'), os.X_OK)) def test_ubuntu_restrictions_allowed(self): '''Some settings are allowed in ubuntu-* package''' self.rename_package('ubuntu-defaults-test') self.enable_example('depends.txt') self.enable_example('recommends.txt') self.enable_example('webbrowser/bookmarks-menu.txt') self.enable_example('i18n/language.txt') self.enable_example('i18n/langpacks.txt') self.enable_example('i18n/keyboard.txt') self.build() def test_ubuntu_restrictions_session(self): '''Default session must not be changed for an ubuntu-* package''' self.rename_package('ubuntu-defaults-test') self.enable_example('desktop/default-session.txt') self.build(expect_fail=True) def test_ubuntu_restrictions_background(self): '''Background must not be changed for an ubuntu-* package''' self.rename_package('ubuntu-defaults-test') test_jpg = os.path.join('test', 'test.jpg') shutil.copy(test_jpg, os.path.join(self.pkgdir, 'desktop', 'background.jpg')) self.build(expect_fail=True) def test_ubuntu_restrictions_disable(self): '''Disable ubuntu-* restrictions''' self.rename_package('ubuntu-defaults-test') self.enable_example('desktop/default-session.txt') rules_path = os.path.join(self.pkgdir, 'debian', 'rules') with open(rules_path) as f: rules = f.read() rules = rules.replace('dh_ubuntu_defaults', 'dh_ubuntu_defaults --disable-restrictions') with open(rules_path, 'w') as f: f.write(rules) self.build(expect_fail=False) with open(os.path.join(self.debdir, 'usr/share/ubuntu-defaults-test/default-session.txt')) as f: self.assertEqual(f.read(), 'ubuntu-2d') def test_image_syntax(self): '''syntax check of ubuntu-defaults-image''' self.assertEqual(subprocess.call(['sh', '-n', 'bin/ubuntu-defaults-image']), 0) def test_image_ppa_spec(self): '''ubuntu-defaults-image fails early on invalid PPA spec''' for spec in ['~user/foo', 'user', 'user foo']: img = subprocess.Popen(['bin/ubuntu-defaults-image', '--ppa', spec], stderr=subprocess.PIPE) err = img.communicate()[1].decode() self.assertNotEqual(img.returncode, 0) self.assertTrue('Invalid PPA' in err) unittest.main() ubuntu-defaults-builder-0.49/test/test.jpg0000664000000000000000000000067511575673500015572 0ustar JFIFHHC  }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz?o?P'p p |io~'4|9Ygß5 >?ƺ?  x74xcÚVhmckkubuntu-defaults-builder-0.49/test/make-example0000775000000000000000000000406711730655624016404 0ustar #!/bin/sh # Generate an example source package from the template, by uncommenting all # examples. # # Author: Martin Pitt # Copyright: (C) 2011 Canonical Ltd. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . set -e top_srcdir=$(dirname $(dirname $(readlink -f $0))) # support running from source tree if [ -e "$top_srcdir/template/depends.txt" ]; then export UBUNTU_DEFAULTS_TEMPLATE_DIR="$top_srcdir/template" export DH_AUTOSCRIPTDIR="$top_srcdir/debhelper-scripts" "$top_srcdir"/bin/ubuntu-defaults-template defaults-builder-test else ubuntu-defaults-template defaults-builder-test fi cd defaults-builder-test # uncomment all examples find -name '*.txt' | xargs sed -i '/^# Example:/,$ { /^# Example/d; s/^# // }' # install example desktop files for f in `find desktop -name '*.example'`; do mv $f ${f%.example} echo `basename ${f%.desktop.example}` >> unity/launchers.txt done # stick in background and icon if [ -e "$top_srcdir/test/test.jpg" ]; then cp "$top_srcdir/test/test.jpg" desktop/background.jpg cp "$top_srcdir/test/test.jpg" icons/scalable/apps/myapp.jpg else cp "$(dirname $(readlink -f $0))/test.jpg" desktop/background.jpg cp "$(dirname $(readlink -f $0))/test.jpg" icons/scalable/apps/myapp.jpg fi # add an example chroot hook echo 'echo "Running defaults-builder-test chroot hook"' >> hooks/chroot echo 'touch /chroot_hook_was_run' >> hooks/chroot # build package PATH="$top_srcdir/bin:$PATH" dpkg-buildpackage -d -us -uc ubuntu-defaults-builder-0.49/man/0000775000000000000000000000000012146654515013675 5ustar ubuntu-defaults-builder-0.49/man/ubuntu-defaults-template.10000664000000000000000000001011211730656011020701 0ustar .TH ubuntu\-defaults\-template 1 "June 22, 2011" "Martin Pitt" .SH NAME ubuntu\-defaults\-template \- create skeleton defaults customization package .SH SYNOPSIS .B ubuntu\-defaults\-template [ .B \-\-quiet ] .I packagename .SH DESCRIPTION The ubuntu\-defaults\-builder project allows you to easily create a "default settings" package for Ubuntu and then build a customized image with it. The main purpose for this is to provide a standard and safe way to create localized Ubuntu images, or OEM custom projects. The .B ubuntu\-defaults\-template script will generate a source package with the customizable settings (e. g. .I desktop/background.jpg and .I webbrowser/bookmarks-menu.txt\fR). When built and installed, it will take the necessary actions to modify the system-wide defaults for desktops, programs, etc. The first step is to call .B ubuntu\-defaults\-template with the target package name as an argument, for example "ubuntu-defaults-french" or "mockbuntu-default-settings". This will create a source package with the given name in the current directory, with a set of (disabled) example configuration files, and a standard .B debian/ packaging (using mostly .B dh_ubuntu_defaults\fR). Then you customize the individual configuration files like .B webbrowser/bookmarks-menu.txt or .B unity/launchers.txt to your needs, and then run .BR dpkg-buildpackage (1) to build the source and binary packages. Once you install the generated .deb, new users will from then on use the new default settings. After you have done this, you can build installation images using .BR ubuntu\-defaults\-image (1). .SH CONFIGURATION At present you can change the following defaults: .IP \(bu 2 .B Desktop background image (desktop/background.jpg) .IP \(bu 2 .B Additional .desktop files (desktop/*.desktop, particularly useful to provide launchers for web applications) .IP \(bu 2 .B Default desktop session in login managers (desktop/default-session.txt) Supports LightDM and GDM right now. .IP \(bu 2 .B Default applications (desktop/default-applications.txt) .IP \(bu 2 .B Webbrowser start page (webbrowser/startpage.txt) .IP \(bu 2 .B Additional Webbrowser bookmarks in the Menu and in the Toolbar (webbrowser/bookmarks-menu.txt and webbrowser/bookmarks-toolbar.txt) .IP \(bu 2 .B Webbrowser default search engine (webbrowser/searchengine.txt) .IP \(bu 2 .B Radio stations in Rhythmbox and Banshee (multimedia/radiostations.txt) .IP \(bu 2 .B Additional launchers in Unity and Unity 2d (unity/launchers.txt). .IP \(bu 2 .B Internationalization support (i18n/language.txt, i18n/langpacks.txt, i18n/keyboard.txt) .IP \(bu 2 .B Additional icons (icons/, *.jpg, *.png, or *.svg, in the directory hierarchy given in .B /usr/share/icons/hicolor/\fR) .IP \(bu 2 .B Extra packages (depends.txt and recommends.txt) .P Except for desktop/background.jpg, all configuration files are simple text files with one entry per line. Lines which start with '#' are ignored and can be used for comments. Each configuration file has comments which document the format and give some example entries. .SH MACROS All configuration files can contain macro variables which will be expanded when building the defaults package. At present, these variables are known: .IP \(bu 2 .B ${distro_release_number} The release number of the Ubuntu release the package is built on. E. g. "11.04". .IP \(bu 2 .B ${distro_release_name} The release code name of the Ubuntu release the package is built on. E. g. "lucid". .P Unknown variables will abort the package build, to avoid unexpected results. .SH EXAMPLE You can run the /usr/share/doc/ubuntu-defaults-builder/examples/make-example to build an "defaults-builder-test" defaults package in the current directory, which will exercise all possible customizations by uncommenting the examples from the configuration files. .SH "SEE ALSO" .BR dh_ubuntu_defaults (1), .BR ubuntu\-defaults\-image (1) /usr/share/doc/ubuntu-defaults-builder/examples/make-example https://wiki.ubuntu.com/DesktopTeam/Specs/Oneiric/LocalizedCDImageTools .SH AUTHOR .B ubuntu\-defaults\-builder is developed by Martin Pitt . ubuntu-defaults-builder-0.49/man/ubuntu-defaults-image.10000664000000000000000000001127211730655701020165 0ustar .TH ubuntu\-defaults\-image 1 "July 22, 2011" "Martin Pitt" .SH NAME ubuntu\-defaults\-image \- create installation image from default settings package .SH SYNOPSIS .B ubuntu\-defaults\-image [ .I options ] .B \-\-ppa .I lpusername/ppaname .B \-\-locale fr_FR .B ubuntu\-defaults\-image [ .I options ] .B \-\-package /path/to/myproject-defaults_0.1_all.deb .SH DESCRIPTION The ubuntu\-defaults\-builder project allows you to easily create a "default settings" package for Ubuntu and then build a customized image with it. The main purpose for this is to provide a standard and safe way to create localized Ubuntu images, or OEM custom projects. Please see .BR ubuntu\-defaults\-template(1) for how to create a "default settings" package with the customizations. With such a package, you can build installation images. If you are planning to actually publish these images, you need to have the defaults package in an archive, either the Ubuntu archive itself or a personal package archive (PPA). That way you can provide updates for it post-release, and support upgrades to newer Ubuntu releases properly. In this case you need to specify a package name with .B \-\-package or a locale with .B \-\-locale which will then assume that the canonical defaults package name for locale .I ll_CC is .B ubuntu\-defaults\-\fIll\fB\-\fIcc\fR. If the specified defaults package is not in Ubuntu, but in a PPA, you can add the PPA to the image with the .B \-\-ppa option. While developing the defaults package and doing test image builds, you can also specify the full path to the .deb with .B \-\-package projectdir/myproject-defaults_0.1_all.deb\fR. This avoids having to upload the defaults package to a PPA for each test iteration. Note that running this program will need a lot of disk space, an order of 3 GB. It will create a lot of temporary files and a cache directory in the current directory you are running this in, so please change to an empty scratch directory. .SH OPTIONS .TP .B \-\-package \fIpackage name or path Install this default settings package. Can be a simple name (in which case the package needs to be .B apt\-get\fR'able) or path to a local .deb package for testing. .TP .B \-\-locale \fIll_CC Defaults packages for localized Ubuntu images should be named .B ubuntu\-defaults\-\fIll\fB\-\fIcc\fR. This option will install the corresponding defaults package for the given locale. .TP .B \-\-ppa \fI lp_username/ppa_name Enable an additional personal package archive (PPA) on the image. This is usually the archive providing the defaults package. Example: "joe/myproject-defaults". .TP .B \-\-arch \fIarchitecture Specify the architecture of the image build, e. g. "i386" or "amd64". If not given, it builds for the host system architecture. .TP .B \-\-release \fIrelease Specify the Ubuntu release code name on which image build is based on, e. g. "oneiric". If not given, it builds for the host system release. .TP .B \-\-components \fIcomponent\fR[,\fIcomponent...\fR] Specify the archive components which are enabled during image build. If not given, this uses "main,restricted", which is how standard Ubuntu images are built. However, if your defaults package is in universe, or has dependencies to universe packages, you need to use "main,restricted,universe". .TP .B \-\-keep\-apt Do not remove apt indexes from live system (\fB/var/lib/apt/lists/*_Packages\fR). This will significantly enlarge the resulting ISO image, but will make package related operations work without an initial .B apt-get update run. .TP .B \-\-help Print a summary of the options. .SH EXAMPLES As mentioned above, change to an empty scratch directory on a drive with at least 3 GB of free space. For a first test, you can call .RS 4 .B /usr/share/doc/ubuntu-defaults-builder/examples/make-example .RE to build an "defaults-builder-test" package with all the template example settings enabled. (Please see .BR ubuntu\-defaults\-template (1) for details). To build an iso out of this, run .RS 4 .B ubuntu-defaults-image --package ./defaults-builder-test_0.1_all.deb --components main,restricted,universe .RE You need to enable universe as the defaults-builder-test has extra dependencies on some universe packages like "manpages-de". For building a localized Ubuntu image for Chinese/China (i. e. with the "ubuntu-defaults-zh-cn" package), you use .RS 4 ubuntu-defaults-image --locale zh_CN --components main,restricted,universe .RE As ubuntu-defaults-zh-cn is in the Ubuntu archive, you don't need to specify a \-\-ppa. .SH "SEE ALSO" .BR ubuntu\-defaults\-template (1), .BR live\-build (7) https://wiki.ubuntu.com/DesktopTeam/Specs/Oneiric/LocalizedCDImageTools .SH AUTHOR .B ubuntu\-defaults\-builder is developed by Martin Pitt . ubuntu-defaults-builder-0.49/template/0000775000000000000000000000000012146654515014735 5ustar ubuntu-defaults-builder-0.49/template/multimedia/0000775000000000000000000000000012146654515017067 5ustar ubuntu-defaults-builder-0.49/template/multimedia/radiostations.txt0000664000000000000000000000046311606312713022505 0ustar # List of radio stations in Rhythmbox and Banshee # # Format: arbitrarily many lines with # URL; Genre; Name # # Example: # http://www.radioparadise.com/musiclinks/rp_128.m3u; Eclectic Rock; Radio Paradise # http://www.swr3.de/wraps/musik/webradio/aplayer/stream_extern.php?format=mp3e&channel=0; Pop; SWR3 ubuntu-defaults-builder-0.49/template/i18n/0000775000000000000000000000000012146654515015514 5ustar ubuntu-defaults-builder-0.49/template/i18n/keyboard.txt0000664000000000000000000000061111606312523020041 0ustar # Default keyboard layout for installer images built with this defaults # package. Note that the defaults package itself does not configure the # layout, this only gets effective for image builds. # # Format: single line with # layout # or # layout variant # # Check /usr/share/X11/xkb/rules/xorg.lst for the complete list of available # layouts and variants. # # Example: # de nodeadkeys ubuntu-defaults-builder-0.49/template/i18n/language.txt0000664000000000000000000000062611622457353020043 0ustar # Default language for installer images built with this defaults package. # Note that the defaults package itself does not configure the locale, this # only gets effective for image builds. # # Format: single line with language code (or ll_CC for the languages like zh # which have two major codes like zh_CN or zh_TW). See /isolinux/langlist on a # Ubuntu live CD for the complete list. # # Example: # de ubuntu-defaults-builder-0.49/template/i18n/langpacks.txt0000664000000000000000000000140011612024576020206 0ustar # Language support included on built installer images. The user can still # select a different language than the ones included here, the language packs # and support packages will then be downloaded from the network. # Note that this does not affect package dependencies, only image builds, as # the set of support packages depends on the installed applications. # # Format: arbitrarily many lines, one language code per line. If the second # column is "complete", all additional support packages like LibreOffice help, # input methods, dictionaries etc. will be installed in addition; otherwise # only the language packs with the translations will be installed. Note that # complete language support takes a lot of CD space. # # Example: # de complete # es # zh-hans ubuntu-defaults-builder-0.49/template/depends.txt0000664000000000000000000000143711611260256017114 0ustar # These packages will become dependencies of the generated defaults package, i. # e. will be installed by default on a customized image. Requirements for # official Ubuntu customization packages: # - They should not conflict to a default installation package, or add # applications for a purpose which the default installation already has an # application for. For example, don't add thunderbird or pidgin when we already # have evolution or empathy # - They should preferably be in main. If they are not, consider writing a MIR, # or add a justification to a comment in depends.txt or the changelog. # Depending on universe packages will be a valid reason to reject an # ubuntu-defaults package. # # Format: arbitrarily many lines, one package name per line # # Example: # manpages-de ubuntu-defaults-builder-0.49/template/recommends.txt0000664000000000000000000000154711606312442017627 0ustar # These packages will become recommends of the generated defaults package, i. # e. will be installed by default on a customized image, but can be removed by # the user without removing the defaults package. Requirements for # official Ubuntu customization packages: # # - They should not conflict to a default installation package, or add # applications for a purpose which the default installation already has an # application for. For example, don't add thunderbird or pidgin when we already # have evolution or empathy # - They should preferably be in main. If they are not, consider writing a MIR, # or add a justification to a comment in depends.txt or the changelog. # Depending on universe packages will be a valid reason to reject an # ubuntu-defaults package. # # Format: arbitrarily many lines, one package name per line # # Example: # fortunes-de ubuntu-defaults-builder-0.49/template/unity/0000775000000000000000000000000012146654515016105 5ustar ubuntu-defaults-builder-0.49/template/unity/launchers.txt0000664000000000000000000000066011611031547020622 0ustar # List of .desktop file names (without extension) with additional default launchers # # Format: arbitrarily many lines, one .desktop name (without extension) per line # An optional second word on the line specifies the package name which # provides this desktop file; this will be added to the defaults package's # dependencies, just like if it were added to "depends.txt". # # Example: # gnome-sudoku # simple-scan # sol aisleriot ubuntu-defaults-builder-0.49/template/desktop/0000775000000000000000000000000012146654515016406 5ustar ubuntu-defaults-builder-0.49/template/desktop/background.jpg0000664000000000000000000000000011574407026021212 0ustar ubuntu-defaults-builder-0.49/template/desktop/default-applications.txt0000664000000000000000000000072111727353224023254 0ustar # The following default association will either replace or be appended # to the existing applications system default for a given MIME type. # desktop files have to be provided without any extension. # # NotUbuntu: This may not be changed for Ubuntu localized images, only for # derivatives and OEM projects. # # Format: arbitrarily many lines with # MIMEtype desktopfile # # Example: # application/ogg banshee # x-scheme-handler/mailto thunderbird # x-foo/bar toto ubuntu-defaults-builder-0.49/template/desktop/default-session.txt0000664000000000000000000000052211727353305022250 0ustar # Set the default desktop session for login managers. Right now lightdm and # gdm are supported. # # NotUbuntu: This may not be changed for Ubuntu localized images, only for # derivatives and OEM projects. # # Format: Single line with a session name. This must correspond to # /usr/share/xsessions/.desktop # # Example: # ubuntu-2d ubuntu-defaults-builder-0.49/template/desktop/googlemail.desktop.example0000664000000000000000000000035511611023774023546 0ustar [Desktop Entry] # Example .desktop file for a web launcher Version=1.0 Name=Google Mail Comment=http://googlemail.com Exec=/usr/bin/xdg-open http://googlemail.com Type=Application Icon=applications-mail Categories=GNOME;GTK;Application; ubuntu-defaults-builder-0.49/template/ubiquity-slideshow/0000775000000000000000000000000012146654515020607 5ustar ubuntu-defaults-builder-0.49/template/ubiquity-slideshow/slides/0000775000000000000000000000000012146654515022072 5ustar ubuntu-defaults-builder-0.49/template/ubiquity-slideshow/README0000664000000000000000000000037012023301050021440 0ustar You can place custom slides and screenshots for any locale in slides/$LOCALE and slides/$LOCALE/screenshots. Note that screenshots in slides/C will appear for all slideshows, while screenshots for any other locale will only appear for that locale. ubuntu-defaults-builder-0.49/template/icons/0000775000000000000000000000000012146654515016050 5ustar ubuntu-defaults-builder-0.49/template/icons/48x48/0000775000000000000000000000000012146654515016647 5ustar ubuntu-defaults-builder-0.49/template/icons/48x48/apps/0000775000000000000000000000000012146654515017612 5ustar ubuntu-defaults-builder-0.49/template/icons/README0000664000000000000000000000020211611331310016677 0ustar You can place additional jpg, png, or svg icons here, but only into directories which already exist in /usr/share/icons/hicolor/. ubuntu-defaults-builder-0.49/template/icons/scalable/0000775000000000000000000000000012146654515017616 5ustar ubuntu-defaults-builder-0.49/template/icons/scalable/apps/0000775000000000000000000000000012146654515020561 5ustar ubuntu-defaults-builder-0.49/template/icons/scalable/status/0000775000000000000000000000000012146654515021141 5ustar ubuntu-defaults-builder-0.49/template/hooks/0000775000000000000000000000000012146654515016060 5ustar ubuntu-defaults-builder-0.49/template/hooks/chroot0000775000000000000000000000034511612007512017270 0ustar #!/bin/sh set -e # Hook for building live images # # This script is run in the built chroot after all packages are installed, # before it is packed into a squashfs. This is where you can apply extra tweaks # to the live system. ubuntu-defaults-builder-0.49/template/debian/0000775000000000000000000000000012266033412016145 5ustar ubuntu-defaults-builder-0.49/template/debian/copyright0000664000000000000000000000105711726402260020104 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: #PKGNAME# Upstream-Contact: #MAINTAINER# Files: * Copyright: Portions Copyright (C) 2011 Canonical Ltd. License: GPL-3+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. . The full text of the GPL is distributed as in /usr/share/common-licenses/GPL-3 on Debian systems. ubuntu-defaults-builder-0.49/template/debian/changelog0000664000000000000000000000013011574452730020022 0ustar #PKGNAME# (0.1) UNRELEASED; urgency=low * Initial release. -- #MAINTAINER# #DATE# ubuntu-defaults-builder-0.49/template/debian/rules0000775000000000000000000000012611574420760017233 0ustar #!/usr/bin/make -f %: dh "$@" override_dh_install: dh_install dh_ubuntu_defaults ubuntu-defaults-builder-0.49/template/debian/control0000664000000000000000000000074312266033412017554 0ustar Source: #PKGNAME# Section: metapackages Priority: optional Maintainer: #MAINTAINER# Build-Depends: debhelper (>= 7.0.50~), ubuntu-defaults-builder Standards-Version: 3.9.5 Package: #PKGNAME# Architecture: all Depends: ${misc:Depends}, ${ubuntudefaults:Depends} Recommends: ${ubuntudefaults:Recommends} Provides: ubuntu-default-settings Conflicts: ubuntu-default-settings Description: Default settings for Ubuntu customizations This package contains customized default settings. ubuntu-defaults-builder-0.49/template/debian/compat0000664000000000000000000000000211574420246017351 0ustar 7 ubuntu-defaults-builder-0.49/template/webbrowser/0000775000000000000000000000000012146654515017116 5ustar ubuntu-defaults-builder-0.49/template/webbrowser/startpage.txt0000664000000000000000000000045611606316741021652 0ustar # The following URL will become the web browser start page. # For now only Firefox is supported. # # Format: single line with an URL. Using the ${distro_release_number} # or ${distro_release_name} macros is often useful here. # # Example: # http://www.ubuntuforums.org?release=${distro_release_number} ubuntu-defaults-builder-0.49/template/webbrowser/searchengine.txt0000664000000000000000000000042611727353445022316 0ustar # The search engine that will be selected by default. # For now only Firefox is supported. # # NotUbuntu: This may not be changed for Ubuntu localized images, only for # derivatives and OEM projects. # # Format: single line with search engine name # # Example: # Wikipedia (de) ubuntu-defaults-builder-0.49/template/webbrowser/bookmarks-menu.txt0000664000000000000000000000043311606312711022576 0ustar # The following bookmarks will be appended to the default bookmark folders in the menu # For now only Firefox is supported. # # Format: arbitrarily many lines with # URL Name # # Example: # http://www.ubuntu.de Deutsches Ubuntu-Forum # http://www.heise.de heise Computer-Nachrichten ubuntu-defaults-builder-0.49/template/webbrowser/bookmarks-toolbar.txt0000664000000000000000000000035411606312732023301 0ustar # The following bookmarks will be appended to the default bookmark folders in the toolbar # For now only Firefox is supported. # # Format: arbitrarily many lines with # URL Name # # Example: # http://www.zeit.de Die Zeit Nachrichten ubuntu-defaults-builder-0.49/debhelper-scripts/0000775000000000000000000000000012146654515016541 5ustar ubuntu-defaults-builder-0.49/debhelper-scripts/postrm-ubuntu-defaults-divert0000664000000000000000000000024111576623145024426 0ustar if [ "$1" = remove -o "$1" = abort-install -o "$1" = disappear ]; then dpkg-divert --package PACKAGE --rename --divert FILE.ubuntu-defaults --remove FILE fi ubuntu-defaults-builder-0.49/debhelper-scripts/postinst-ubuntu-defaults-desktop-session0000664000000000000000000000071611645217763026633 0ustar if [ "$1" = configure ] && [ -z "$2" ] && [ -r /usr/share/PACKAGE/default-session.txt ]; then session=$(cat /usr/share/PACKAGE/default-session.txt) # LightDM if [ -x /usr/lib/lightdm/lightdm-set-defaults ] ; then /usr/lib/lightdm/lightdm-set-defaults --session $session || true fi # gdm if [ ! -e /etc/gdm/custom.conf ]; then mkdir -p /etc/gdm/ cat < /etc/gdm/custom.conf [daemon] DefaultSession=$session EOF fi fi ubuntu-defaults-builder-0.49/debhelper-scripts/preinst-ubuntu-defaults-divert0000664000000000000000000000020511576622624024567 0ustar if [ "$1" = install -o "$1" = upgrade ]; then dpkg-divert --package PACKAGE --rename --divert FILE.ubuntu-defaults --add FILE fi ubuntu-defaults-builder-0.49/debhelper-scripts/postinst-ubuntu2d-launchers0000664000000000000000000000042311611260416024063 0ustar # not covered by usual gconf trigger if [ "$1" = "configure" ]; then mkdir -p /var/lib/gconf/ubuntu-2d.default update-gconf-defaults --source /usr/share/gconf/ubuntu-2d/default \ --destination /var/lib/gconf/ubuntu-2d.default --no-signal fi ubuntu-defaults-builder-0.49/bin/0000775000000000000000000000000012146654515013672 5ustar ubuntu-defaults-builder-0.49/bin/ubuntu-defaults-image0000775000000000000000000002106012146653121020016 0ustar #! /bin/sh # Build an image based on an Ubuntu flavour plus a defaults package. # # Authors: Colin Watson # Martin Pitt # Copyright: (C) 2011 Canonical Ltd. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . set -e LOCALE= PACKAGE= ARCH= COMPONENTS= MIRROR= SECURITY_MIRROR= PPA= FLAVOUR=ubuntu SUITE=$(lsb_release -sc) KEEP_APT_OPT= DELETE_APT_LISTS="rm -vf /var/lib/apt/lists/*_*" if which dpkg-architecture >/dev/null 2>&1; then ARCH="$(dpkg-architecture -qDEB_HOST_ARCH)" fi help () { cat >&2 </dev/null; then echo "Invalid fingerprint returned by Launchpad: $FINGERPRINT" >&2 exit 1 fi # chop off enclosing quotes FINGERPRINT=${FINGERPRINT%'"'} FINGERPRINT=${FINGERPRINT#'"'} # fetch GPG key gpg --no-default-keyring --primary-keyring config/archives/ubuntu-defaults.key --keyserver keyserver.ubuntu.com --recv-key "$FINGERPRINT" # add PPA apt source local DEB_PPA="deb http://ppa.launchpad.net/$PPA/ubuntu $SUITE main" echo "$DEB_PPA" > config/archives/ubuntu-defaults.list } eval set -- "$(getopt -o '' -l help,locale:,keep-apt,keep-apt-components:,package:,arch:,release:,components:,mirror:,security-mirror:,ppa: -- "$@")" || { help; exit 1; } while :; do case $1 in --help) help exit 0 ;; --locale) LOCALE="$2" shift 2 ;; --package) PACKAGE="$2" shift 2 ;; --arch) ARCH="$2" shift 2 ;; --release) SUITE="$2" shift 2 ;; --components) COMPONENTS="$(echo "$2" | sed 's/,/ /g' | tr -s ' ')" shift 2 ;; --mirror) MIRROR="$2" shift 2 ;; --security-mirror) SECURITY_MIRROR="$2" shift 2 ;; --ppa) PPA="$2" if ! expr match "$PPA" '^[.[:alnum:]-]\+/[[:alnum:]-]\+$' >/dev/null; then echo "Invalid PPA specification, must be lp_username/ppaname" >&2 exit 1 fi shift 2 ;; --keep-apt) KEEP_APT_OPT="$1" DELETE_APT_LISTS="rm -vf /var/lib/apt/lists/*_Translation-*" shift ;; --keep-apt-components) KEEP_APT_OPT="$1" components="$(echo "$2" | sed 's/,/ /g')" DELETE_APT_LISTS="rm -vf /var/lib/apt/lists/*_Translation-* rm -vf /var/lib/apt/lists/*_main_* rm -vf /var/lib/apt/lists/*_restricted_* rm -vf /var/lib/apt/lists/*_universe_* rm -vf /var/lib/apt/lists/*_multiverse_*" for comp in $components; do case $comp in main|restricted|universe|multiverse) DELETE_APT_LISTS=$(echo "$DELETE_APT_LISTS" | grep -v $comp) ;; *) echo "ERROR: unknown component $comp" exit 1 ;; esac done shift 2 ;; --) shift break ;; *) help exit 1 ;; esac done if ([ -z "$LOCALE" ] && [ -z "$PACKAGE" ]) || [ -z "$ARCH" ]; then help exit 1 fi if ([ -n "$MIRROR" ] || [ -n "$SECURITY_MIRROR" ]) && [ -n "$KEEP_APT_OPT" ]; then echo "ERROR: $KEEP_APT_OPT cannot currently be used along with --mirror or --security-mirror" >&2 exit 1 fi if [ "$LOCALE" ] && [ -z "$PACKAGE" ]; then PACKAGE="ubuntu-defaults-$(echo "$LOCALE" | tr '_A-Z' '-a-z')" fi if [ "$(id -u)" = 0 ]; then SUDO=env else SUDO=sudo fi # Make sure all our dependencies (which are Recommends of our package) are # installed. This is a bit dubious long-term, but seems to be needed to # make autobuilds reliable. case $ARCH in *amd64|*i386) $SUDO apt-get -y install syslinux-themes-ubuntu syslinux-themes-ubuntu-$SUITE gfxboot-theme-ubuntu memtest86+ syslinux || exit 1 ;; esac $SUDO apt-get -y install genisoimage rm -rf auto mkdir -p auto for f in config build clean; do ln -s "/usr/share/livecd-rootfs/live-build/auto/$f" auto/ done $SUDO lb clean rm -f .stage/config SUITE="$SUITE" PROJECT="$FLAVOUR" ARCH="$ARCH" LB_ARCHITECTURES="$ARCH" \ LB_MIRROR_BOOTSTRAP="$MIRROR" LB_MIRROR_CHROOT_SECURITY="$SECURITY_MIRROR" \ IMAGEFORMAT=squashfs BINARYFORMAT=iso-hybrid lb config if [ "$COMPONENTS" ]; then sed -i "s/^\\(LB_PARENT_ARCHIVE_AREAS=\\).*/\\1\"$COMPONENTS\"/" \ config/bootstrap fi sed -i "s/^\\(LB_SYSLINUX_THEME=\\).*/\\1\"ubuntu-$SUITE\"/" config/binary if [ "${PACKAGE%.deb}" = "$PACKAGE" ]; then # package name, apt-get'able echo "$PACKAGE" >> config/package-lists/ubuntu-defaults.list.chroot_install else # local deb cp "$PACKAGE" config/packages.chroot/ fi if [ -n "$PPA" ]; then add_ppa fi PACKAGENAME=${PACKAGE%%_*} PACKAGENAME=${PACKAGENAME##*/} # install language support hook (try the one from the source tree first) HOOK=$(dirname $(readlink -f $0))/../lib/language-support-hook if ! [ -e "$HOOK" ]; then HOOK=/usr/share/ubuntu-defaults-builder/language-support-hook fi sed "s/#DEFAULTS_PACKAGE#/$PACKAGENAME/" < "$HOOK" > config/hooks/00_language-support.chroot # work around live-build failure with lzma initramfs (Debian #637979) sed -i 's/^LB_INITRAMFS_COMPRESSION="lzma"/LB_INITRAMFS_COMPRESSION="gzip"/' config/common # run hooks from defaults package cat < config/hooks/10_ubuntu-defaults.chroot #!/bin/sh set -e HOOK=/usr/share/$PACKAGENAME/hooks/chroot if [ -x \$HOOK ]; then \$HOOK fi EOF # clean up files that we do not need cat < config/hooks/90_cleanup.chroot #!/bin/sh set -e echo "$0: Removing unnecessary files..." rm -vf /var/cache/apt/*cache.bin $DELETE_APT_LISTS rm -vrf /tmp/* EOF # rename kernel and initrd to what syslinux expects cat < config/hooks/rename-kernel.binary #!/bin/sh -e if [ ! -e binary/casper/initrd.lz ]; then echo "\$0: Renaming initramfs to initrd.lz..." zcat binary/casper/initrd.img-* | lzma -c > binary/casper/initrd.lz rm binary/casper/initrd.img-* fi if [ ! -e binary/casper/vmlinuz ]; then echo "\$0: Renaming kernel to vmlinuz..." # This will go wrong if there's ever more than one vmlinuz-* after # excluding *.efi.signed. We can deal with that if and when it arises. for x in binary/casper/vmlinuz-*; do case \$x in *.efi.signed) ;; *) mv \$x binary/casper/vmlinuz if [ -e "\$x.efi.signed" ]; then mv \$x.efi.signed binary/casper/vmlinuz.efi fi ;; esac done fi EOF # set default language cat < config/hooks/default-language.binary #!/bin/sh -e LOC=chroot/usr/share/$PACKAGENAME/language.txt if [ -e "\$LOC" ]; then echo "\$0: \$LOC exists, setting gfxboot default language..." cp "\$LOC" binary/isolinux/lang echo >> binary/isolinux/lang else echo "\$0: \$LOC does not exist, not setting gfxboot default language" fi EOF DISPLAY= $SUDO PROJECT="$FLAVOUR" ARCH="$ARCH" lb build ubuntu-defaults-builder-0.49/bin/dh_ubuntu_defaults0000775000000000000000000004674612146653753017530 0ustar #!/usr/bin/perl -w use strict; # Author: Martin Pitt # Copyright: (C) 2011 Canonical Ltd. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . =head1 NAME dh_ubuntu_defaults - build defaults customization package =cut use strict; use Debian::Debhelper::Dh_Lib; use Errno; use File::Path; use File::Copy; use File::Find; use File::Spec; use JSON; =head1 SYNOPSIS B [S>] =head1 DESCRIPTION ubuntu-defaults-builder allows you to easily create a "default settings" package for Ubuntu. The B script will generate a source package with the customizable settings (e. g. desktop/background.jpg and webbrowser/bookmarks-menu.txt). When built and installed, it will take the necessary actions to modify the system-wide defaults for desktops, programs, etc. The main purpose for this is to provide a standard and safe way to create localized Ubuntu images, or OEM custom projects. B is a debhelper program which implements the main logic of these defaults packages by converting the simple configuration files from the defaults source package into the configuration file format used by the target applications and desktop environments, and adding the corresponding maintainer script code like file diversions. It is usually not necessary to know about or deal with this program manually. The intended mode of operation is to call B to create a skeleton source package (which will call B), and then customize the example configuration files. =cut # initialize global %macros hash my %macros = (); my @extra_depends = (); my $template_dir = $ENV{'UBUNTU_DEFAULTS_TEMPLATE_DIR'} || '/usr/share/ubuntu-defaults-builder/template/'; sub init_macros { $macros{'distro_release_number'} = `lsb_release -sr` or die "cannot run lsb_release: $!"; chomp $macros{'distro_release_number'}; $macros{'distro_release_name'} = `lsb_release -sc` or die "cannot run lsb_release: $!"; chomp $macros{'distro_release_name'}; } # return an array of lines from given file, with comments sorted out and macros # replaced sub lines { my ($fname) = @_; my @lines = (); if (not open F, $fname) { return @lines if ($!{ENOENT}); # missing files are OK die "cannot open $fname: $!"; } while () { s/#.*$//; s/^\s*//; s/\s*$//; next unless $_; # substitute macros while (/\${(\w+)}/) { my $var = $1; error "unknown macro: $var" unless exists $macros{$var}; s/\${$var}/$macros{$var}/g; } push @lines, $_; } close F; return @lines; } # abort if customization is not allowed for this package; e. g. mere ubuntu # localizations (package name starts with "ubuntu-") must not change the # desktop behaviour too much sub check_allowed { my $package = shift; my $file = shift; return if $dh{DISABLE_RESTRICTIONS}; return unless $package =~ /^ubuntu-/; # check if our template (NOT the package's file) has a "NotUbuntu:" tag; # special-case background here as this is not a text file if ($file ne 'desktop/background.jpg' && -e "$template_dir/$file") { open F, "$template_dir/$file" or die "cannot open template file $template_dir/$file: $!"; read F, $_, 1000; close F; if ((index $_, 'NotUbuntu:') < 0) { return; # can be changed } } # if we do not have a template for that file, assume that it cannot be # changed error "error: $file must not be changed for Ubuntu localizations (packages starting with \"ubuntu-\")"; } # process depends.txt and recommends.txt sub dependencies { my $package = shift; my @depends = lines('depends.txt'); my @recommends = lines('recommends.txt'); check_allowed($package, 'depends.txt') if @depends; check_allowed($package, 'recommends.txt') if @recommends; push @extra_depends, @depends; addsubstvar($package, 'ubuntudefaults:Depends', join(', ', @extra_depends)); addsubstvar($package, 'ubuntudefaults:Recommends', join(', ', @recommends)); } # process desktop/background.jpg sub desktop_background { my $package = shift; my $tmp = tmpdir($package); return unless -s 'desktop/background.jpg'; check_allowed($package, 'desktop/background.jpg'); mkpath("$tmp/usr/share/backgrounds"); copy('desktop/background.jpg', "$tmp/usr/share/backgrounds/$package.jpg"); mkpath("$tmp/usr/share/glib-2.0/schemas/"); open F, '>>', "$tmp/usr/share/glib-2.0/schemas/$package.gschema.override" or die "Cannot create gschema override: $!"; print F "[org.gnome.desktop.background] picture-uri='file:///usr/share/backgrounds/$package.jpg' "; close F; # set the same in gconf as well, for older GNOME and gsettings-data-convert mkpath("$tmp/usr/share/gconf/defaults/"); open F, '>>', "$tmp/usr/share/gconf/defaults/zz_$package" or die "Cannot create gconf override: $!"; print F "/desktop/gnome/background/picture_filename \"/usr/share/backgrounds/$package.jpg\"\n"; close F; } # process desktop/*.desktop sub desktop_files { my $package = shift; my $tmp = tmpdir($package); my @files = ; return unless @files; mkpath("$tmp/usr/share/applications"); foreach (@files) { check_allowed($package, $_); File::Copy::copy $_, "$tmp/usr/share/applications/"; } } # process desktop/default-applications.txt sub desktop_default_applications { my $package = shift; my $tmp = tmpdir($package); my @lines = lines('desktop/default-applications.txt'); return unless @lines; check_allowed($package, 'desktop/default-applications.txt'); my @defaults = (); my @modified_mimetypes = (); # get new defaults for (@lines) { my @fields = split; if ($#fields != 1) { warning "Invalid line in desktop/default-applications.txt, expected 2 fields separated by whitespace: $_"; next; } push @defaults, "$fields[0]=$fields[1].desktop"; push @modified_mimetypes, $fields[0]; } # read and print defaults while ignoring overridden default apps open F, '/usr/share/applications/defaults.list' or die "cannot open default application list file: $!"; mkpath("$tmp/usr/share/applications"); open my $newf, '>', "$tmp/usr/share/applications/defaults.list"; SEARCH: while () { my($line) = $_; my($found); foreach my $mimetype (@modified_mimetypes) { next SEARCH if ($line =~ m/\Q$mimetype\E/); } print $newf $line; } close F; # append custom defaults print $newf join "\n", @defaults; close $newf; autoscript $package, 'preinst', 'preinst-ubuntu-defaults-divert', "s/PACKAGE/$package/g; s_FILE_/usr/share/applications/defaults.list_g"; autoscript $package, 'postrm', 'postrm-ubuntu-defaults-divert', "s/PACKAGE/$package/g; s_FILE_/usr/share/applications/defaults.list_g"; } # process desktop/default-session.txt sub desktop_default_session { my $package = shift; my $tmp = tmpdir($package); my @lines = lines('desktop/default-session.txt'); return unless @lines; check_allowed($package, 'desktop/default-session.txt'); if ($#lines > 0) { warning 'Extra lines in webbrowser/startpage.txt, ignoring'; } mkpath("$tmp/usr/share/$package/"); open my $f, '>', "$tmp/usr/share/$package/default-session.txt"; print $f $lines[0]; close $f; autoscript $package, 'postinst', 'postinst-ubuntu-defaults-desktop-session', "s/PACKAGE/$package/g;"; } # unity/launchers.txt sub unity_launchers { my $package = shift; my $tmp = tmpdir($package); my @lines = lines('unity/launchers.txt'); return unless @lines; check_allowed($package, 'unity/launchers.txt'); # get current default launcher list for Unity my @defaults = (); unless (grep { $_ eq '@clear' } @lines) { open F, '/usr/share/glib-2.0/schemas/com.canonical.Unity.gschema.xml' or die "cannot open Unity gschema: $!"; read F, $_, 10000; close F; my ($v) = /\s*\s*\[(.*?)\]\s*<\/default>/s; $v =~ s/'//g; $v =~ s/\s+//g; @defaults = split /,/, $v; } else { @lines = grep { $_ ne '@clear' } @lines; } # append custom defaults for (@lines) { my @fields = split; if ($#fields > 1) { warning "Invalid line in unity/launchers.txt, expected at most 2 fields separated by whitespace: $_"; next; } push @defaults, "application://$fields[0].desktop"; if ($fields[1]) { push @extra_depends, $fields[1]; } } # Unity uses gsettings, write schema my $v = join(', ', map("'$_'", @defaults)); mkpath("$tmp/usr/share/glib-2.0/schemas/"); open F, '>>', "$tmp/usr/share/glib-2.0/schemas/$package.gschema.override" or die "Cannot create gschema override: $!"; print F "[com.canonical.Unity.Launcher] favorites=[$v] "; close F; # Unity 2D still uses gconf $v = join(',', @defaults); mkpath("$tmp/usr/share/gconf/ubuntu-2d/default/"); open F, '>>', "$tmp/usr/share/gconf/ubuntu-2d/default/zz_$package" or die "Cannot create gconf override: $!"; print F "/desktop/unity-2d/launcher/favorites [$v]\n"; close F; autoscript $package, 'postinst', 'postinst-ubuntu2d-launchers'; } # multimedia/radiostations.txt sub radio_stations { my $package = shift; my $tmp = tmpdir($package); my @lines = lines('multimedia/radiostations.txt'); return unless @lines; check_allowed($package, 'multimedia/radiostations.txt'); # for Rhythmbox mkpath("$tmp/usr/share/rhythmbox/plugins/iradio"); open F, '>', "$tmp/usr/share/rhythmbox/plugins/iradio/iradio-initial.xspf" or die "Cannot create iradio-initial.xspf: $!"; print F ' '; foreach (@lines) { my @fields = split ';'; map $_ =~ s/^\s+//, @fields; map $_ =~ s/\s+$//, @fields; map $_ =~ s/\&/\&/, @fields; map $_ =~ s//>/, @fields; if ($#fields != 2) { warning "Invalid line in multimedia/radiostations.txt, expected 3 fields separated by ';': $_"; next; } print F " $fields[2] $fields[0] $fields[1] "; } print F ' '; close F; autoscript $package, 'preinst', 'preinst-ubuntu-defaults-divert', "s/PACKAGE/$package/g; s_FILE_/usr/share/rhythmbox/plugins/iradio/iradio-initial.xspf_g"; autoscript $package, 'postrm', 'postrm-ubuntu-defaults-divert', "s/PACKAGE/$package/g; s_FILE_/usr/share/rhythmbox/plugins/iradio/iradio-initial.xspf_g"; # for Banshee mkpath "$tmp/usr/share/banshee/stations"; symlink "/usr/share/rhythmbox/plugins/iradio/iradio-initial.xspf", "$tmp/usr/share/banshee/stations/$package.xspf"; } sub write_bookmarks { my $file = $_[0]; my @lines = @{$_[1]}; my $count = 1; foreach (@lines) { my ($url, $name) = split /\s+/, $_, 2; print $file "item.$count.title=$name item.$count.link=$url "; ++$count; } } # webbrowser/* sub webbrowser { my $package = shift; my $tmp = tmpdir($package); my $startpage; my @lines = lines('webbrowser/startpage.txt'); if (@lines) { check_allowed($package, 'webbrowser/startpage.txt'); if ($#lines > 0) { warning 'Extra lines in webbrowser/startpage.txt, ignoring'; } $startpage = $lines[0]; } my $searchengine; @lines = lines('webbrowser/searchengine.txt'); if (@lines) { check_allowed($package, 'webbrowser/searchengine.txt'); if ($#lines > 0) { warning 'Extra lines in webbrowser/searchengine.txt, ignoring'; } $searchengine = $lines[0]; } my @bookmarks_toolbar = lines('webbrowser/bookmarks-toolbar.txt'); my @bookmarks_menu = lines('webbrowser/bookmarks-menu.txt'); check_allowed($package, 'webbrowser/bookmarks-toolbar.txt') if @bookmarks_toolbar; check_allowed($package, 'webbrowser/bookmarks-menu.txt') if @bookmarks_menu; return if (!$startpage && !$searchengine && !@bookmarks_toolbar && !@bookmarks_menu); mkpath("$tmp/usr/lib/firefox/distribution/"); open my $ini, '>', "$tmp/usr/lib/firefox/distribution/distribution.ini"; print $ini '[Global] id=canonical version=1.0 about=Mozilla Firefox for Ubuntu [Preferences] app.distributor = "canonical" app.distributor.channel = "ubuntu" app.partner.ubuntu = "ubuntu" '; # startpage if ($startpage) { print $ini "browser.startup.homepage=\"$startpage\" browser.startup.homepage_reset=\"$startpage\" extensions.ubufox\@ubuntu.com.custom_homepage=\"$startpage\" "; } # default search engine if ($searchengine) { print $ini "browser.search.defaultenginename=\"$searchengine\"\n"; } # bookmarks print $ini "\n[BookmarksToolbar]\n"; write_bookmarks($ini, \@bookmarks_toolbar); print $ini "\n[BookmarksMenu]\n"; write_bookmarks($ini, \@bookmarks_menu); close $ini; autoscript $package, 'preinst', 'preinst-ubuntu-defaults-divert', "s/PACKAGE/$package/g; s_FILE_/usr/lib/firefox/distribution/distribution.ini_g"; autoscript $package, 'postrm', 'postrm-ubuntu-defaults-divert', "s/PACKAGE/$package/g; s_FILE_/usr/lib/firefox/distribution/distribution.ini_g"; } # i18n/* sub i18n { my $package = shift; my $tmp = tmpdir($package); my @lines = lines('i18n/language.txt'); if ($#lines > 0) { warning 'Extra lines in i18n/language.txt, ignoring'; } if (@lines) { check_allowed($package, 'i18n/language.txt'); mkpath("$tmp/usr/share/$package/"); open my $f, '>', "$tmp/usr/share/$package/language.txt"; print $f $lines[0], "\n"; close $f; } @lines = lines('i18n/langpacks.txt'); if (@lines) { check_allowed($package, 'i18n/langpacks.txt'); mkpath("$tmp/usr/share/$package/"); open my $f, '>', "$tmp/usr/share/$package/langpacks.txt"; print $f join "\n", @lines; close $f; } } sub check_valid_keyboard { my $layout = shift; my $variant = undef; $variant = $_[0] if @_; open my $f, '/usr/share/X11/xkb/rules/xorg.lst' or die "cannot open /usr/share/X11/xkb/rules/xorg.lst: $!"; # skip until the layout section while (<$f>) { last if /^! layout/; } # check validity of layout my $valid_layout = 0; while (<$f>) { if (/^!/) { unless (/^! variant/) { error 'internal error: expected variant section after layout section'; } last; } if (/^\s*$layout\s/) { $valid_layout = 1; } } error "Invalid layout '$layout' in i18n/keyboard.txt; check /usr/share/X11/xkb/rules/xorg.lst for valid ones" unless $valid_layout; # check validity of variant return unless $variant; my $valid_variant = 0; while (<$f>) { last if /^!/; if (/^\s*$variant\s+$layout:/) { $valid_variant = 1; last; } } error "Invalid variant '$variant' in i18n/keyboard.txt; check /usr/share/X11/xkb/rules/xorg.lst for valid ones" unless $valid_variant; close $f; } # i18n/keyboard.txt sub keyboard { my $package = shift; my $tmp = tmpdir($package); my @lines = lines('i18n/keyboard.txt'); if ($#lines > 0) { warning 'Extra lines in i18n/keyboard.txt, ignoring'; } return unless @lines; check_allowed($package, 'i18n/keyboard.txt'); my @fields = split /\s+/, $lines[0]; if ($#fields < 0 || $#fields > 1) { error 'Invalid format of i18n/keyboard.txt: Expecting 1 or 2 fields'; } check_valid_keyboard @fields; mkpath("$tmp/usr/share/$package/"); open my $f, '>', "$tmp/usr/share/$package/keyboard.txt"; if ($#fields == 0) { print $f $lines[0]; } else { print $f "$fields[0]_$fields[1]"; } close $f; } # icons/ sub icons { my $package = shift; my $cwd = File::Spec->rel2abs('.'); my $tmp = File::Spec->rel2abs(tmpdir($package)); my $iter = sub { return if -l $_ or -d $_; # Skip directories and symlinks return unless /\.(jpg|jpeg|png|svg)$/; my $name = $_; # See if we were asked to exclude this file. foreach my $f (@{$dh{EXCLUDE}}) { return if ($File::Find::name =~ m/\Q$f\E/); } doit "install -D -m 644 '$_' '$tmp/usr/share/icons/hicolor/$File::Find::name'"; }; chdir 'icons' || return; File::Find::find $iter, '.'; chdir $cwd; } # ubiquity-slideshow/ sub ubiquity_slideshow { my $package = shift; my $tmp = File::Spec->rel2abs(tmpdir($package)); my $tmp_extra_slides_dir = "$tmp/usr/share/ubiquity-slideshow/slides/extra"; my $add_locale = sub { my $locale_name = shift; my @slides = (); my @media = (); my $add_locale_file = sub { my $file = $_; return unless -f $file; return if $file =~ m/^\./; doit "install -D -m 644 '$file' '$tmp_extra_slides_dir/$locale_name/$File::Find::name'"; if ($File::Find::dir eq '.') { # This file is a slide push(\@slides, $file); } else { # This file is something else (we assume it's a media file) my $file_path = $File::Find::name; # Slideshow expects relative path without preceding './' $file_path = substr($file_path, 2); push(\@media, $file_path); } }; File::Find::find($add_locale_file, '.'); my %locale_data = (); $locale_data{slides} = \@slides; $locale_data{media} = \@media; return %locale_data; }; my $cwd = File::Spec->rel2abs('.'); chdir "ubiquity-slideshow" || return; my %directory_data; opendir(my $locales_dh, "slides") || return; my @locales = grep { !/^\./ } readdir($locales_dh); closedir $locales_dh; foreach my $locale (@locales) { my $locale_dir = "slides/$locale"; next unless -d $locale_dir; next if $locale =~ m/^\./; my $cwd = File::Spec->rel2abs('.'); chdir $locale_dir || next; my %locale_data = &$add_locale($locale); chdir $cwd; if (%locale_data) { $directory_data{$locale} = \%locale_data; } } if (%directory_data) { my $directory_json = to_json(\%directory_data); mkpath($tmp_extra_slides_dir); open F, '>', "$tmp_extra_slides_dir/directory.jsonp"; print F "ubiquitySlideshowDirectoryCb($directory_json);"; close F; } chdir $cwd; } # hooks sub hooks { my $package = shift; my $tmp = tmpdir($package); if (-x 'hooks/chroot') { # only install it if it is not just the example file my @lines = lines('hooks/chroot'); if ($#lines > 0 || $lines[0] ne 'set -e') { check_allowed($package, 'hooks/chroot'); doit "install -D -m 755 hooks/chroot '$tmp/usr/share/$package/hooks/chroot'"; } } } init(options => { "disable-restrictions" => \$dh{DISABLE_RESTRICTIONS}, }); init_macros(); foreach my $package (@{$dh{DOPACKAGES}}) { desktop_background($package); desktop_files($package); desktop_default_applications($package); desktop_default_session($package); unity_launchers($package); radio_stations($package); webbrowser($package); i18n($package); keyboard($package); icons($package); ubiquity_slideshow($package); hooks($package); dependencies($package); } =head1 SEE ALSO L, L =head1 AUTHOR Martin Pitt Copyright (C) 2011 Canonical Ltd., licensed under the GNU GPL v3 or later. =cut ubuntu-defaults-builder-0.49/bin/ubuntu-defaults-template0000775000000000000000000000333611600330411020541 0ustar #!/bin/sh # Generate a skeleton defaults source package from a template. # # Author: Martin Pitt # Copyright: (C) 2011 Canonical Ltd. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . set -e help() { echo "Usage: $0 Example: $0 ubuntu-defaults-germany" >&2 } if [ "$1" = "--help" -o "$1" = "-h" ]; then help exit 0 fi if [ "$1" = "--quiet" -o "$1" = "-q" ]; then QUIET=1 shift fi if [ -z "$1" -o -n "$2" ]; then help exit 1 fi if [ -e "$1" ]; then echo "Error: Target $1 already exists" >&1 exit 1 fi cp -r ${UBUNTU_DEFAULTS_TEMPLATE_DIR:-"/usr/share/ubuntu-defaults-builder/template"} "$1" PKGNAME=${1##*/} MAINTAINER="${DEBFULLNAME:-$(getent passwd `id -un`|cut -d: -f5|cut -f1 -d,)}" MAINTAINER="$MAINTAINER <${DEBEMAIL:-${EMAIL:-$USER@$(hostname -f)}}>" DATE=`date -R` find "$1" -type f | xargs sed -i "s/#PKGNAME#/$PKGNAME/g; s/#MAINTAINER#/$MAINTAINER/g; s/#DATE#/$DATE/g" if [ -z "$QUIET" ]; then echo "Successfully created $1 source package." echo "Now do 'cd $1' and customize the files. All *.txt files have documentation and examples in comments." fi ubuntu-defaults-builder-0.49/COPYING0000664000000000000000000010451311574407636014165 0ustar GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . ubuntu-defaults-builder-0.49/Makefile0000664000000000000000000000155111612045126014551 0ustar default: check: test/run -v install: install -d $(DESTDIR)/usr/bin $(DESTDIR)/usr/share/ubuntu-defaults-builder $(DESTDIR)/usr/share/debhelper/autoscripts/ $(DESTDIR)/usr/share/doc/ubuntu-defaults-builder/examples $(DESTDIR)/usr/share/man/man1 install -m 755 bin/* $(DESTDIR)/usr/bin/ install -m 644 debhelper-scripts/* $(DESTDIR)/usr/share/debhelper/autoscripts/ cp -r template $(DESTDIR)/usr/share/ubuntu-defaults-builder/ cp -r lib/* $(DESTDIR)/usr/share/ubuntu-defaults-builder/ install -m 755 test/make-example $(DESTDIR)/usr/share/doc/ubuntu-defaults-builder/examples/ install -m 644 test/test.jpg $(DESTDIR)/usr/share/doc/ubuntu-defaults-builder/examples/ install -m 644 man/*.1 $(DESTDIR)/usr/share/man/man1/ pod2man -c Debhelper bin/dh_ubuntu_defaults $(DESTDIR)/usr/share/man/man1/dh_ubuntu_defaults.1 .PHONY: check install default clean distclean ubuntu-defaults-builder-0.49/debian/0000775000000000000000000000000012266033451014335 5ustar ubuntu-defaults-builder-0.49/debian/copyright0000664000000000000000000000111411726402226016265 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: ubuntu-defaults-builder Upstream-Contact:: Martin Pitt Files: * Copyright: Copyright (C) 2011 Canonical Ltd. License: GPL-3+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. . The full text of the GPL is distributed as in /usr/share/common-licenses/GPL-3 on Debian systems. ubuntu-defaults-builder-0.49/debian/changelog0000664000000000000000000004705312266033451016220 0ustar ubuntu-defaults-builder (0.49) trusty; urgency=medium * debian/control, emplate/debian/control: Bump Standards-Version to 3.9.5. -- Sebastien Bacher Thu, 16 Jan 2014 20:46:28 +0100 ubuntu-defaults-builder (0.48) saucy; urgency=low * /bin/dh_ubuntu_defaults: Remove quotes from Firefox bookmarks titles. (LP: #1171811) -- Mantas Kriaučiūnas Tue, 21 May 2013 13:21:17 +0200 ubuntu-defaults-builder (0.47.1) raring; urgency=low * debian/control, template/debian/control: Bump Standards-Version to 3.9.4. -- Dmitrijs Ledkovs Tue, 02 Apr 2013 13:39:54 +0100 ubuntu-defaults-builder (0.47) raring; urgency=low [ Nobuto MURATA ] * Write the PPA apt line to just one file to avoid apt duplicate sources.list entries warning. (LP: #1072115) -- Barry Warsaw Tue, 11 Dec 2012 16:11:09 -0500 ubuntu-defaults-builder (0.46) raring; urgency=low * Move the signed kernel to binary/casper/vmlinuz.efi, to fit within 8.3 restrictions for isolinux. -- Colin Watson Mon, 12 Nov 2012 15:39:39 +0000 ubuntu-defaults-builder (0.45) quantal-proposed; urgency=low * lib/language-support-hook: langpacks.txt's last line is not usually terminated with a CR. Always append a CR to it after cat'ing, to ensure that the read loop sees the last line. This fixes the ignoring of languages in i18n/langpacks.txt. (LP: #1070523) -- Martin Pitt Fri, 26 Oct 2012 08:22:11 +0200 ubuntu-defaults-builder (0.44) quantal; urgency=low * Revert binary/casper/vmlinuz to the unsigned kernel, and put the signed kernel in binary/casper/vmlinuz.efi.signed instead (LP: #1067659). -- Colin Watson Wed, 17 Oct 2012 11:50:23 +0100 ubuntu-defaults-builder (0.43) quantal; urgency=low * bin/ubuntu-defaults-image: Since *.efi.signed images are bootable on BIOS systems too, prefer them over the unsigned versions if they exist. -- Colin Watson Thu, 11 Oct 2012 02:14:52 +0100 ubuntu-defaults-builder (0.42) quantal; urgency=low * bin/ubuntu-defaults-image: Don't fail to rename the kernel to vmlinuz if a *.efi.signed image is present. -- Colin Watson Thu, 11 Oct 2012 01:47:11 +0100 ubuntu-defaults-builder (0.41) quantal; urgency=low * bin/dh_ubuntu_defaults: Add application:// prefix to custom launchers, as current Unity does. Update test_unity() in test/run accordingly. -- Martin Pitt Tue, 25 Sep 2012 13:41:44 +0200 ubuntu-defaults-builder (0.40) quantal; urgency=low * bin/ubuntu-defaults-image: Install syslinux-themes-ubuntu-$SUITE, to ensure the theme for the target release is available, and to fail early if it is not. Thanks Nobuto MURATA! (LP: #1053021) -- Martin Pitt Thu, 20 Sep 2012 08:20:21 +0200 ubuntu-defaults-builder (0.39) quantal; urgency=low * bin/ubuntu-defaults-image: Add --mirror/--security-mirror option for faster local building. These do _not_ set the mirror in the target apt (as of now). Thanks Nobuto MURATA! (LP: #998271) -- Martin Pitt Thu, 20 Sep 2012 06:09:11 +0200 ubuntu-defaults-builder (0.38) quantal; urgency=low * bin/ubuntu-defaults-image: Pass LB_ARCHITECTURES as well, to fix --arch. Thanks Nobuto MURATA for the patch! (LP: #1016121) -- Martin Pitt Mon, 17 Sep 2012 16:34:08 +0200 ubuntu-defaults-builder (0.37) quantal; urgency=low * lib/language-support-hook: Fix handling of "complete" lines. Thanks Alkis Georgopoulos! (LP: #1048207) -- Martin Pitt Mon, 10 Sep 2012 09:47:21 +0200 ubuntu-defaults-builder (0.36) quantal; urgency=low * bin/ubuntu-defaults-image: Allow dots in lp_username. Thanks Alkis Georgopoulos! (LP: #1048171) -- Martin Pitt Mon, 10 Sep 2012 08:07:58 +0200 ubuntu-defaults-builder (0.35) quantal; urgency=low [ Dylan McCall ] * Adding ubiquity-slideshow customization. (LP: #1035806). [ Dmitrijs Ledkovs ] * Specify source format "3.0 (native)" * Set DEBFULLNAME & DEBEMAIL for the test runner no avoid lintian errors. * test_ubiquity_slideshow: sort os.listdir before comparison -- Dmitrijs Ledkovs Wed, 29 Aug 2012 09:05:16 +0100 ubuntu-defaults-builder (0.34) quantal; urgency=low * Revert misguided path changes in local binary hooks. -- Colin Watson Fri, 24 Aug 2012 08:45:55 +0100 ubuntu-defaults-builder (0.33) quantal; urgency=low * bin/ubuntu-defaults-image: Clean up unnecessarily complicated installation of local hooks. -- Colin Watson Thu, 23 Aug 2012 10:13:02 +0100 ubuntu-defaults-builder (0.32) quantal; urgency=low * bin/ubuntu-defaults-image: Adjust for live-build interface changes. -- Colin Watson Wed, 22 Aug 2012 13:29:25 +0100 ubuntu-defaults-builder (0.31) precise-proposed; urgency=low * bin/ubuntu-defaults-image: Add some logging to hooks. * lib/language-support-hook: Do not remove language support packages for requested languages. Some language support packages are needed by several languages (most notably poppler-data), so we must not remove those, otherwise we will also remove reverse dependencies. E. g. ubuntu-defaults-zh-cn depends on poppler-data, which we removed before as poppler-data is _also_ a support package for -pt and -en. (LP: #988836) -- Martin Pitt Thu, 26 Apr 2012 15:35:02 +0200 ubuntu-defaults-builder (0.30) precise; urgency=low * bin/dh_ubuntu_defaults: Add (undocumented) --disable-restrictions option. (LP: #971994) -- Martin Pitt Tue, 03 Apr 2012 09:28:22 +0200 ubuntu-defaults-builder (0.29) precise; urgency=low * bin/dh_ubuntu_defaults: Fix unintentional closure binding of $tmp in icons ("Variable "$tmp" will not stay shared"), which resulted in icons only being considered for the first package. * bin/dh_ubuntu_defaults: Consider *.jpeg files as icons (previously typoed as *.jepg). -- Colin Watson Mon, 02 Apr 2012 15:29:50 +0100 ubuntu-defaults-builder (0.28) precise; urgency=low * bin/ubuntu-defaults-image: Add --keep-apt-components option, so that projects can choose to compromise between e. g. keeping the apt indexes for main to keep apport etc. working, and dropping for universe to reduce image size. (LP: #958573) -- Martin Pitt Fri, 23 Mar 2012 11:44:27 +0100 ubuntu-defaults-builder (0.27) precise; urgency=low * test/make-example: Call the package "defaults-builder-test", with the recent "restrict Ubuntu customizations" change we can't call the package "ubuntu-defaults-test" any more. (LP: #957044) * bin/ubuntu-defaults-image: With --keep-apt, remove the translations. They take a lot of space, and most apt operations will work fine without them. (LP: #956894) * bin/dh_ubuntu_defaults: Update distribution.ini path to where Firefox puts the file these days. (LP: #956899) -- Martin Pitt Fri, 16 Mar 2012 17:04:14 +0100 ubuntu-defaults-builder (0.26) precise; urgency=low * bin/dh_ubuntu_defaults: Update to current Rhythmbox' radio plugin data location. Update test case accordingly. Thanks Paolo Sammicheli! (LP: #955473) -- Martin Pitt Thu, 15 Mar 2012 07:53:54 +0100 ubuntu-defaults-builder (0.25) precise; urgency=low * bin/ubuntu-defaults-image: Fix getopt call for new --keep-apt, thanks Paolo Sammicheli! (LP: #954501) -- Martin Pitt Wed, 14 Mar 2012 07:35:56 +0100 ubuntu-defaults-builder (0.24) precise; urgency=low * debian/copyright, template/debian/copyright: Update to copyright format 1.0. * debian/control, template/debian/control: Bump Standards-Version to 3.9.3. * Drop support for webbrowser/offline-startpage.txt, as this is not actually configurable in Firefox, and we do not support other browsers at the moment. (LP: #950097) * bin/ubuntu-defaults-image: Explicitly set LB_SYSLINUX_THEME, to not rely on live-build's static default (which is "ubuntu-oneiric" right now). (LP: #910859) * bin/ubuntu-defaults-image, man/ubuntu-defaults-image.1: Add --keep-apt option to not clean up /var/lib/apt/lists/*_Packages from the live system. This will significantly enlarge the resulting ISO image, but will make package related operations work without an initial "apt-get update" run. (LP: #942180) * template/desktop/default-{session,applications}.txt, template/webbrowser/searchengine.txt: Add comments that these files may not be changed for Ubuntu localizations, only for derivatives and OEM projects. * test/run: Change package name to "defaults-test", as with "ubuntu-defaults-test" we are going to fail for some customizations. * bin/dh_ubuntu_defaults: Check if template file has a "NotUbuntu:" tag, and if so, disallow changing defaults if the package name starts with "ubuntu-". (LP: #881371) -- Martin Pitt Mon, 12 Mar 2012 15:03:23 +0100 ubuntu-defaults-builder (0.23) oneiric; urgency=low * debhelper-scripts/postinst-ubuntu-defaults-desktop-session: Use /usr/lib/lightdm/lightdm-set-defaults to also change the default session if /etc/lightdm/lightdm.conf already exists (which is the case in oneiric final). (LP: #869546) -- Martin Pitt Wed, 12 Oct 2011 07:16:37 +0200 ubuntu-defaults-builder (0.22) oneiric; urgency=low * bin/dh_ubuntu_defaults: Firefox now provides a non-versioned path for distribution.ini, use that. This avoids breaking the defaults packages with every major Firefox release. -- Martin Pitt Tue, 27 Sep 2011 13:03:40 +0200 ubuntu-defaults-builder (0.21) oneiric; urgency=low * template/debian/copyright: Rename Name to Upstream-Name and Maintainer to Upstream-Contact, to match the current DEP-5 specification which lintian now checks. -- Colin Watson Wed, 14 Sep 2011 03:21:18 +0100 ubuntu-defaults-builder (0.20) oneiric; urgency=low * bin/ubuntu-defaults-image: Make sure all our dependencies (which are Recommends of our package) are installed. This is a bit dubious long-term, but seems to be needed to make autobuilds reliable. -- Colin Watson Wed, 14 Sep 2011 02:08:12 +0100 ubuntu-defaults-builder (0.19) oneiric; urgency=low * debian/control: Recommend genisoimage and syslinux (for isohybrid) too, since ubuntu-defaults-image builds a hybrid ISO image by default. -- Colin Watson Thu, 01 Sep 2011 17:05:01 +0100 ubuntu-defaults-builder (0.18) oneiric; urgency=low * debian/control: Recommend memtest86+, since live-build copies it from the build system by default (and we want it to). -- Colin Watson Wed, 31 Aug 2011 15:14:39 +0100 ubuntu-defaults-builder (0.17) oneiric; urgency=low * bin/ubuntu-defaults-image: Set SUDO=env if running as root, so that variable assignments after $SUDO are parsed in a regular way. -- Colin Watson Wed, 31 Aug 2011 13:18:27 +0100 ubuntu-defaults-builder (0.16) oneiric; urgency=low * bin/ubuntu-defaults-image: Don't use sudo if we're already running as root. -- Colin Watson Wed, 31 Aug 2011 10:11:52 +0100 ubuntu-defaults-builder (0.15) oneiric; urgency=low * lib/language-support-hook: Ensure that cat'ing langpacks.txt ends with a newline, so that the read command does not miss the last line. Fixes image building for zh_CN to actually get full language support. -- Martin Pitt Mon, 29 Aug 2011 17:24:27 +0200 ubuntu-defaults-builder (0.14) oneiric; urgency=low * bin/ubuntu-defaults-image: Fix variable quoting in hook for setting default language, and ensure that the language ends with a newline. * bin/dh_ubuntu_defaults: Ensure that language.txt ends in a newline, so that we can remove above hack once the Chinese defaults package is rebuilt. Update test cases accordingly. * bin/ubuntu-defaults-image: Remove apt indexes and package caches, similar to livecd.sh. * bin/ubuntu-defaults-image: Prefix our chroot hooks with numbers, so that they sort in a more logical order, and also run before all_chroot_pyc-purge.sh. This ensures that the latter also removes *.pyc files which were generated due to calling Python packages in other hooks. -- Martin Pitt Mon, 29 Aug 2011 15:52:59 +0200 ubuntu-defaults-builder (0.13) oneiric; urgency=low * bin/dh_ubuntu_defaults: Don't put garbage into the binary package if icons/ does not exist. * bin/dh_ubuntu_defaults: Move to /usr/lib/firefox-7.0/. -- Martin Pitt Sat, 20 Aug 2011 17:21:54 +0200 ubuntu-defaults-builder (0.12) oneiric; urgency=low * debian/control: Add recommends to gfxboot-theme-ubuntu and syslinux-themes-ubuntu. * bin/ubuntu-defaults-image: Rename kernel and initrd in /casper/ to what syslinux expects. Leave LB_INITRAMFS_COMPRESSION as "gzip" and re-compress initramfs to lzma in a local hook to work around Debian #637979. * Rename template/i18n/locale.txt to template/i18n/language.txt and update documentation and test cases. This sets the pre-selected language in gfxboot, not a full locale. * bin/ubuntu-defaults-image: Set default language in the image's /isolinux/lang file. -- Martin Pitt Tue, 16 Aug 2011 14:28:39 +0200 ubuntu-defaults-builder (0.11) oneiric; urgency=low * Implement support for setting the default desktop session in LightDM and gdm. -- Martin Pitt Thu, 11 Aug 2011 16:46:53 +0200 ubuntu-defaults-builder (0.10) oneiric; urgency=low * Add default applications support: - bin/dh_ubuntu_defaults and template/desktop/default-applications.txt for the logic and the default override file - corresponding test is in test/run - man/ubuntu-defaults-template.1 for documenting the functionality - add desktop-file-utils build-dep and dep to retrieve the system defaults -- Didier Roche Fri, 22 Jul 2011 16:11:00 +0200 ubuntu-defaults-builder (0.9) oneiric; urgency=low [ Colin Watson ] * bin/ubuntu-defaults-image: Add first cut at an image building tool. [ Martin Pitt ] * Implement support for installing desktop/*.desktop. Particularly useful for creating web launchers. * test/make-example: Install example desktop files. * man/ubuntu-defaults-template.1, template/unity/launchers.txt: Remove documentation for @clear. It's not supposed to be used for Loco images. * template/depends.txt, test/run: Drop texlive-lang-german example, it's quite big. * debhelper-scripts/postinst-ubuntu2d-launchers: Ensure that ubuntu-2d target directory exists, which might not be the case during bootstrapping. * bin/dh_ubuntu_defaults: Move to /usr/lib/firefox-6.0. * Implement support for installing additional icons in icons/. * bin/ubuntu-defaults-image: Only accept "lp_username/ppaname" syntax for --ppa, and fix the case of not specifying a PPA. * debian/control: Add missing unity-common dependency. Needed to get default launchers. * bin/ubuntu-defaults-image: Implement GPG key retrieval for PPAs. * bin/ubuntu-defaults-image: Allow --package to specify a local .deb instead of an apt-get'able package name. * bin/ubuntu-defaults-image: Use gzip compression for now, as the debian syslinux themes only get along with that. * Implement support for running a hook script during live image building (hook/chroot in the template). * bin/ubuntu-defaults-image: Unset $DISPLAY, to avoid the host X session getting very upset and crash when some packages like brltty in the building chroot get configured. * template/i18n/langpacks.txt: Introduce a second field "complete" which will determine if we'll only install language packs or the full suite of support packages for that language. Update documentation. * lib/language-support-hook, bin/ubuntu-defaults-image: Implement hook to remove unwanted and add requested language support, as per the default packages' i18n/langpacks.txt. * bin/ubuntu-defaults-image: Add --release option, default to current host release. * test/run: Check that ubuntu-defaults-image passes 'sh -n' coarse syntax test. * test/run: Check thaht ubuntu-defaults-image fails early on invalid PPA names. * man/ubuntu-defaults-template.1: Some clarifications and typo fix. * Add man/ubuntu-defaults-image.1: manpage for ubuntu-defaults-image. -- Martin Pitt Fri, 22 Jul 2011 10:32:46 +0200 ubuntu-defaults-builder (0.8) oneiric; urgency=low * debian/control: Add lsb-release as build dependency as well, for the test suite. -- Martin Pitt Mon, 11 Jul 2011 10:02:35 +0200 ubuntu-defaults-builder (0.7) oneiric; urgency=low * Rename firefox/ to webbrowser/ in the template, as eventually this should also apply to Chromium and other browsers. * Implement support for i18n/keyboard.txt, including checking that the layout and variant is valid (in /usr/share/X11/xkb/rules/xorg.lst). Add xkb-data dependency for this. * template/: Update documentation to more clearly point out that the "Format:" bit is not part of the format. * Implement support for webbrowser/offline-startpage.txt. * Implement support for "@clear" command in unity/launchers.txt to replace default launchers instead of being appended to them. * Implement support for macros in templates, and provide ${distro_release_number} and ${distro_release_name}. Add lsb-release dependency for this. * Implement support for specifying a package name in unity/launchers.txt as the second field. This will be added to the dependencies, just like in depends.txt. -- Martin Pitt Mon, 11 Jul 2011 09:49:00 +0200 ubuntu-defaults-builder (0.6) oneiric; urgency=low * Implement support for i18n/langpacks.txt and i18n/locale.txt. -- Martin Pitt Tue, 28 Jun 2011 10:39:39 +0100 ubuntu-defaults-builder (0.5) oneiric; urgency=low * Provide a banshee symlink for the initial radio stations. This requires Banshee >= 2.1.0-1ubuntu3. -- Martin Pitt Fri, 24 Jun 2011 15:44:41 +0200 ubuntu-defaults-builder (0.4) oneiric; urgency=low * debian/control: Add lintian and unity-common build dependencies. Third time is the charm! -- Martin Pitt Thu, 23 Jun 2011 10:05:35 +0200 ubuntu-defaults-builder (0.3) oneiric; urgency=low * debian/rules: Run tests with NO_PKG_MANGLE, to avoid test failures/FTBFS on the buildds. -- Martin Pitt Wed, 22 Jun 2011 17:59:59 +0200 ubuntu-defaults-builder (0.2) oneiric; urgency=low * bin/dh_ubuntu_defaults: Fix license in POD. * debian/control: Add missing python3 build dependency (for the test suite). * bin/dh_ubuntu_defaults: Add actual POD documentation. * Makefile: Build and install dh_ubuntu_defaults manpage from POD. * Add man/ubuntu-defaults-template.1, install it in Makefile. -- Martin Pitt Wed, 22 Jun 2011 17:04:15 +0200 ubuntu-defaults-builder (0.1) oneiric; urgency=low * Initial release, still incomplete. See blueprint for details: https://blueprints.launchpad.net/ubuntu/+spec/desktop-o-cd-localization -- Martin Pitt Tue, 21 Jun 2011 13:08:06 +0200 ubuntu-defaults-builder-0.49/debian/rules0000775000000000000000000000025512023301050015377 0ustar #!/usr/bin/make -f %: dh "$@" override_dh_auto_test: DEBFULLNAME="Ubuntu Developers" \ DEBEMAIL="ubuntu-devel-discuss@lists.ubuntu.com" \ NO_PKG_MANGLE=1 dh_auto_test ubuntu-defaults-builder-0.49/debian/source/0000775000000000000000000000000012146654515015644 5ustar ubuntu-defaults-builder-0.49/debian/source/format0000664000000000000000000000001512023301050017024 0ustar 3.0 (native) ubuntu-defaults-builder-0.49/debian/control0000664000000000000000000000335212266033407015744 0ustar Source: ubuntu-defaults-builder Section: devel Priority: optional Maintainer: Ubuntu Developers Build-Depends: debhelper (>= 7.0.50~), python3, unity-common, xkb-data, lsb-release, lintian, desktop-file-utils, libjson-perl, Standards-Version: 3.9.5 Package: ubuntu-defaults-builder Architecture: all Depends: ${misc:Depends}, ${perl:Depends}, libjson-perl, dpkg-dev, xkb-data, debhelper (>= 7.0.50~), lsb-release, unity-common, livecd-rootfs (>= 2.75), desktop-file-utils, Recommends: syslinux-themes-ubuntu, gfxboot-theme-ubuntu, memtest86+, genisoimage, syslinux, Description: create Ubuntu customization packages This tool allows you to create a "default settings" package for Ubuntu. The "ubuntu-defaults-template" script will generate a source package with the customizable settings (e. g. desktop/background.jpg and webbrowser/bookmarks-menu.txt). When built and installed, it will take the necessary actions to modify the system-wide defaults for desktops, programs, etc. . The main purpose for this is to provide a standard and safe way to create localized Ubuntu images, or OEM custom projects. . You can customize the following settings: . * Web browser start page, default search engine, and bookmarks (supports Firefox right now) * Unity/Unity 2D launchers * Desktop background (for GNOME right now) * Default desktop session in LightDM/gdm * Default radio stations in Rhythmbox and Banshee * Extra dependencies (Depends: and Recommends:), i. e. packages that are installed by default on the customized image * Internationalization (default locale, keyboard layout, language support) (only for built images, not configured by the defaults package itself) ubuntu-defaults-builder-0.49/debian/compat0000664000000000000000000000000211600035205015521 0ustar 7 ubuntu-defaults-builder-0.49/lib/0000775000000000000000000000000012146654515013670 5ustar ubuntu-defaults-builder-0.49/lib/language-support-hook0000775000000000000000000000450412042425536020046 0ustar #!/bin/sh set -e #uncomment this to just do a test run without actually installing/removing packages #TEST='echo WOULD RUN:' REQUESTED_LANGUAGES=/usr/share/#DEFAULTS_PACKAGE#/langpacks.txt INSTALLED_LANGUAGES=/root/installed_languages NOREMOVE_PACKAGES=/root/noremove_packages echo 'P: Configuring language support...' if [ ! -e "$REQUESTED_LANGUAGES" ]; then echo "P: No $REQUESTED_LANGUAGES file, skipping" exit 0 fi # determine installed languages trap "rm -f $INSTALLED_LANGUAGES $NOREMOVE_PACKAGES" 0 HUP INT ABRT FPE PIPE TERM dpkg -l 'language-pack-*'|perl -ne 'if (/^ii\s+.*language-pack-((?:zh-)?[a-z]+)\s/) { print "$1\n" }' | sort -u > $INSTALLED_LANGUAGES remove=`join -j 1 -v 1 $INSTALLED_LANGUAGES $REQUESTED_LANGUAGES` installed=`xargs < $INSTALLED_LANGUAGES` requested=`sed "s/ complete//" < "$REQUESTED_LANGUAGES" | xargs` # determine installed packages for requested languages for lang in $requested; do check-language-support --show-installed -l $lang | xargs -n1 >> $NOREMOVE_PACKAGES done echo "requested: $requested" echo "installed: $installed" echo -n 'to remove: ' echo "$remove" | xargs # removal for lang in $remove; do pkgs=`check-language-support --show-installed -l $lang | xargs -n1` # above list might contain packages which are also needed by the languages # we want to install/keep (e. g. poppler-data is needed by many languages), # so filter those out pkgs=`echo "$pkgs" | join -j1 -v1 - $NOREMOVE_PACKAGES | xargs` echo "P: Removing packages for language $lang: $pkgs" $TEST apt-get -y -q purge $pkgs done # install # note that we iterate through all requested languages, instead of just # computing the delta between requested and installed; this will catch # languages which are already installed, but without complete support # $REQUESTED_LANGUAGES's last line is not usually terminated with a CR, so # append one to ensure that "read" sees that. (cat "$REQUESTED_LANGUAGES"; echo) | while read lang complete; do [ -n "$lang" ] || continue pkgs=`check-language-support -l $lang` if [ "$complete" != "complete" ]; then pkgs=`echo "$pkgs" | xargs -n1 | grep ^language-pack-` || true fi if [ -n "$pkgs" ]; then echo "P: Installing packages for language $lang: $pkgs" $TEST apt-get -y -q install $pkgs fi done echo 'P: Language support configuration done.'