* setup-packaging-environment, setup.py, debian/copyright, debian/control:

- Add a new script, setup-packaging-environment.
This commit is contained in:
Siegfried-Angel Gevatter Pujals 2009-10-25 16:17:10 +01:00
parent ea9ee6d0a7
commit 574d21c916
5 changed files with 196 additions and 4 deletions

2
debian/changelog vendored
View File

@ -17,6 +17,8 @@ ubuntu-dev-tools (0.82) UNRELEASED; urgency=low
* pbuilder-dist, ubuntutools/misc.py: * pbuilder-dist, ubuntutools/misc.py:
- Move the functions used to determine the hosts architecture and - Move the functions used to determine the hosts architecture and
distribution to the ubuntutools.misc module. distribution to the ubuntutools.misc module.
* setup-packaging-environment, setup.py, debian/copyright, debian/control:
- Add a new script, setup-packaging-environment.
[ Luca Falavigna ] [ Luca Falavigna ]
* ubuntutools/requestsync/lp.py: explicitly import exceptions for * ubuntutools/requestsync/lp.py: explicitly import exceptions for

2
debian/control vendored
View File

@ -57,6 +57,8 @@ Description: useful tools for Ubuntu developers
- requestsync - files a sync request with Debian changelog and ratione. - requestsync - files a sync request with Debian changelog and ratione.
- reverse-build-depends - find the reverse build dependencies that a package - reverse-build-depends - find the reverse build dependencies that a package
has. has.
- setup-packaging-environment - assistant to get an Ubuntu installation
ready for packaging work.
- submittodebian - automatically send your changes to Debian as a bug report. - submittodebian - automatically send your changes to Debian as a bug report.
- suspicious-source - outputs a list of files which are not common source - suspicious-source - outputs a list of files which are not common source
files. files.

8
debian/copyright vendored
View File

@ -64,8 +64,8 @@ License v2 can be found in `/usr/share/common-licenses/GPL-2'.
dch-repeat, get-branches, get-build-deps, manage-credentials, massfile, dch-repeat, get-branches, get-build-deps, manage-credentials, massfile,
mk-sbuild-lv, ppaput, pull-debian-debdiff, pull-debian-source, pull-lp-source, mk-sbuild-lv, ppaput, pull-debian-debdiff, pull-debian-source, pull-lp-source,
pull-revu-source, suspicious-source and what-patch are licensed under the GNU pull-revu-source, setup-packaging-environment, suspicious-source and what-patch
General Public License, version 3: are licensed under the GNU General Public License, version 3:
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -82,5 +82,5 @@ License v3 can be found in `/usr/share/common-licenses/GPL-3'.
The following of the scripts can be used, at your option, regarding any The following of the scripts can be used, at your option, regarding any
later version of the previously specified license: 404main, dch-repeat, dgetlp, later version of the previously specified license: 404main, dch-repeat, dgetlp,
get-build-deps, manage-credentials, mk-sbuild-lv, pull-debian-debdiff, get-build-deps, manage-credentials, mk-sbuild-lv, pull-debian-debdiff,
pull-debian-source, pull-lp-source, reverse-build-depends, suspicious-source, pull-debian-source, pull-lp-source, reverse-build-depends,
what-patch. setup-packaging-environment, suspicious-source, what-patch.

187
setup-packaging-environment Executable file
View File

@ -0,0 +1,187 @@
#! /bin/sh
#
# Copyright (C) 2009 Siegfried-A. Gevatter <rainct@ubuntu.com>
#
# ##################################################################
#
# 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; version 3 or later.
#
# 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.
#
# See file /usr/share/common-licenses/GPL for more details.
#
# ##################################################################
#
# This assistants's aim is to make it more straightforward for new
# contributors to get their Ubuntu installation ready for packaging work.
separator1() {
echo '------------------------------------------------------'
echo
}
separator2() {
echo '======================================================'
echo
}
await_response() {
echo
echo -n "Press enter when you're ready to continue... "
read line # Wait for a key press
echo
}
# ##################################################################
if [ "$(lsb_release -is)" != "Ubuntu" ]
then
echo "Error: This script has been created for Ubuntu, but you are "
echo "running «$(lsb_release -is)». Aborting."
exit 1
fi
echo "Welcome to the Ubuntu Packaging Environment setup!"
separator1
echo "This assistant will help you setting up your computer with everything"
echo "necessary for getting started with Ubuntu development."
await_response
separator2
echo "Enabling the main, restricted, universe and multiverse components..."
separator1
echo "Further steps will require packages from the «main» and «universe»"
echo "components. It's advisable for «restricted» and «multiverse» to also"
echo "be enabled, so that your apt cache knows about all official Ubuntu"
echo "packages."
echo
echo "This is the list of repositories enabled on your system:"
cat /etc/apt/sources.list /etc/apt/sources.list.d/*.list | \
grep '^[ ]*deb[ ]' | while read line
do
echo " - $line"
done
echo
echo "Please check that the list above contains all four components from"
echo "Ubuntu's official repositories, and enable any missing component"
echo "(eg., using System -> Administration -> Software Sources). Do this"
echo "now."
await_response
separator2
echo "Installing recommended packages..."
separator1
echo "In order to do packaging work, you'll need a minimal set of packages."
echo "Those, together with other packages which, though optional, have proven"
echo "to be useful, will now be installed."
echo
sudo aptitude install ubuntu-dev-tools devscripts debhelper cdbs patchutils pbuilder build-essential
separator2
echo "Enabling the source repository"
separator1
echo "In order to do packaging work comfortably, you'll want to have"
echo "information about all of Ubuntu's source packages in your apt"
echo "cache. This will make it possible for you to:"
echo " - Check information about them without the need to go online."
echo " - Download the latest version of a source package with a single command."
echo
echo "This is the list of source repositories enabled on your system:"
cat /etc/apt/sources.list /etc/apt/sources.list.d/*.list | \
grep '^[ ]*deb-src[ ]' | while read line
do
echo " - $line"
done
echo
echo "Please check that the list above contains all four components, from"
echo "Ubuntu's official repositories and for the current development version"
echo "(important: even if you're using a stable Ubuntu release, the deb-src"
echo "line needs to be for the latest, in-development, Ubuntu version)".
echo
echo "Enable any missing component (eg., by editing your /etc/apt/sources.list"
echo "file). Do this now."
await_response
separator2
echo "Defining the DEBEMAIL and DEBFULLNAME environment variables"
separator1
echo "Most packaging tools make use of the DEBEMAIL and DEBFULLNAME"
echo "environment variables to know who you are."
echo
skip_step=false
if [ -n "$DEBFULLNAME" -a -n "$DEBEMAIL" ]
then
echo "This variables currently have the following value on your system:"
echo "Full name (and comment): $DEBFULLNAME"
echo "Valid e-mail address: $DEBEMAIL"
echo
echo -n "Is this information correct? [yn] "
while read line
do
if [ "$line" = "y" ]
then
skip_step=true
break
fi
if [ "$line" = "n" ]
then
break
fi
echo -n "Please write on of «y» or «n»: "
done
echo
fi
show_gpg_info() {
if [ -n "gpg --list-secret-keys 2>/dev/null" ]
then
echo
echo "Note: Write your name and e-mail exactly like in your GPG key."
echo "For reference, here are your GPG identities:"
gpg --list-secret-keys | grep uid | cut -c4- | sed 's/^[ ]*//;' | \
while read line
do
echo " - $line"
done
fi
}
if [ "$skip_step" = false -a "$(basename $SHELL)" != "bash" ]
then
echo "Please export the DEBEMAIL and DEBFULLNAME variables in your"
echo "shell's configuration file."
show_gpg_info
skip_step=true
await_response
fi
if [ "$skip_step" = false ]
then
echo
echo "Please indicate your name and e-mail address. This information will"
echo "be added to your ~/.bashrc."
show_gpg_info
echo
echo -n "Full name (and comment): "
read line
echo "export DEBFULLNAME=\"$(echo $line | sed 's/^[ ]*//;s/[ ]*$//')\"" >> ~/.bashrc
echo -n "Valid e-mail address: "
read line
echo "export DEBEMAIL=\"$(echo $line | sed 's/^[ ]*//;s/[ ]*$//')\"" >> ~/.bashrc
echo
fi
separator2
echo "Thank you!"
separator1
echo "If you've followed all instructions carefully, your system does now"
echo "have the basic tools and configurations recommended for Ubuntu"
echo "development."
echo
echo "Some resources which may be useful during your path are:"
echo " - The Ubuntu Packaging Guide: http://wiki.ubuntu.com/PackagingGuide"
echo " - The Ubuntu Developers IRC channel: #ubuntu-motu on irc.freenode.net"
echo
echo "May the source be with you!"

View File

@ -38,6 +38,7 @@ setup(name='ubuntu-dev-tools',
'pull-revu-source', 'pull-revu-source',
'requestsync', 'requestsync',
'reverse-build-depends', 'reverse-build-depends',
'setup-packaging-environment',
'submittodebian', 'submittodebian',
'suspicious-source', 'suspicious-source',
'ubuntu-iso', 'ubuntu-iso',