Additions:
%%(php)
%%(php)
%%(php)
Additions:
- update the pbuilder distribution (like ##aptitude safe-upgrade## in your system):
- build source package, do not include GIT structure and sign it:
- let pbuilder build binary package in the distribution of your choice with ##build## option:
- the Deb and Changes files should be now saved in ##/var/cache/pbuilder/squueze-i386/result/## folder! Just test them with Lintian and sign them if everything is ok.
- build source package, do not include GIT structure and sign it:
- let pbuilder build binary package in the distribution of your choice with ##build## option:
- the Deb and Changes files should be now saved in ##/var/cache/pbuilder/squueze-i386/result/## folder! Just test them with Lintian and sign them if everything is ok.
Deletions:
2) build source package, do not include GIT structure and sign it:
3) let pbuilder build binary package in the distribution of your choice with ##build## option:
%%(bash)
%%
4) the Deb and Changes files should be now saved in ##/var/cache/pbuilder/squueze-i386/result/## folder! Just test them with Lintian and sign them if everything is ok.
Additions:
=====Script=====
To first initialize the Squeeze distribution, simply use ##create## option:
Ok, now log into the new distribution with ##login## option:
$ pbuilder-squeeze-i386 login
Building the build Environment
-> extracting base tarball [/var/cache/pbuilder/squeeze-i386-base.tgz]
-> creating local configuration
-> copying local configuration
-> Installing apt-lines
-> mounting /proc filesystem
-> mounting /dev/pts filesystem
-> policy-rc.d already exists
Obtaining the cached apt archive contents
-> entering the shell
File extracted to: /var/cache/pbuilder/build//10794
cat /etc/debian_version
squeeze/sid
exit
-> removing directory /var/cache/pbuilder/build//10794 and its subdirectories
Everything you will do in this chrooted environment won't be saved to keep a system as sane as possible, without packages that wouldn't be present on a fresh install. You will then be sure that if your package builds correctly with pbuilder, it will do the same on "real" environments.
=====Everyday usage=====
Now that everything is set, here is the method I use to build new versions of packages:
1) update the pbuilder distribution (like ##aptitude safe-upgrade## in your system):
$ pbuilder-squeeze-i386 update
W: /home/ludo/.pbuilderrc does not exist
-> Logging to /var/cache/pbuilder/.lastlog
Upgrading for distribution squeeze
Building the build Environment
-> extracting base tarball [/var/cache/pbuilder/squeeze-i386-base.tgz]
-> creating local configuration
-> copying local configuration
-> Installing apt-lines
-> mounting /proc filesystem
-> mounting /dev/pts filesystem
-> policy-rc.d already exists
Refreshing the base.tgz
-> upgrading packages
Get:1 http://ftp.nc.debian.org squeeze Release.gpg [835B]
Ign http://ftp.nc.debian.org/debian/ squeeze/main Translation-en
Get:2 http://ftp.nc.debian.org squeeze Release [89.9kB]
Get:3 http://ftp.nc.debian.org squeeze/main i386 Packages/DiffIndex [2038B]
Hit http://ftp.debian.org squeeze Release.gpg
Ign http://ftp.debian.org/debian/ squeeze/main Translation-en
Hit http://ftp.debian.org squeeze Release
Get:4 http://ftp.debian.org squeeze/main i386 Packages/DiffIndex [2038B]
Fetched 94.8kB in 3s (29.4kB/s)
Reading package lists...
dpkg: warning: ignoring request to remove lilo which isn't installed.
Obtaining the cached apt archive contents
Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists...
Building dependency tree...
Reading state information...
apt is already the newest version.
aptitude is already the newest version.
build-essential is already the newest version.
dpkg-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
-> removing directory /var/cache/pbuilder/build//10951 and its subdirectories
2) build source package, do not include GIT structure and sign it:
$ cd packagexx_version
$ debuild -S -sa -i.git -I.git
3) let pbuilder build binary package in the distribution of your choice with ##build## option:
%%(bash)
$ cd ..
$ pbuilder-squeeze-i386 build packagexx_version.dsc
%%
4) the Deb and Changes files should be now saved in ##/var/cache/pbuilder/squueze-i386/result/## folder! Just test them with Lintian and sign them if everything is ok.
$ cd /var/cache/pbuilder/squueze-i386/result/
$ lintian -iv packagexx_version_i386.changes
$ debsign -S packagexx_version_i386.changes
%%
To first initialize the Squeeze distribution, simply use ##create## option:
Ok, now log into the new distribution with ##login## option:
$ pbuilder-squeeze-i386 login
Building the build Environment
-> extracting base tarball [/var/cache/pbuilder/squeeze-i386-base.tgz]
-> creating local configuration
-> copying local configuration
-> Installing apt-lines
-> mounting /proc filesystem
-> mounting /dev/pts filesystem
-> policy-rc.d already exists
Obtaining the cached apt archive contents
-> entering the shell
File extracted to: /var/cache/pbuilder/build//10794
cat /etc/debian_version
squeeze/sid
exit
-> removing directory /var/cache/pbuilder/build//10794 and its subdirectories
Everything you will do in this chrooted environment won't be saved to keep a system as sane as possible, without packages that wouldn't be present on a fresh install. You will then be sure that if your package builds correctly with pbuilder, it will do the same on "real" environments.
=====Everyday usage=====
Now that everything is set, here is the method I use to build new versions of packages:
1) update the pbuilder distribution (like ##aptitude safe-upgrade## in your system):
$ pbuilder-squeeze-i386 update
W: /home/ludo/.pbuilderrc does not exist
-> Logging to /var/cache/pbuilder/.lastlog
Upgrading for distribution squeeze
Building the build Environment
-> extracting base tarball [/var/cache/pbuilder/squeeze-i386-base.tgz]
-> creating local configuration
-> copying local configuration
-> Installing apt-lines
-> mounting /proc filesystem
-> mounting /dev/pts filesystem
-> policy-rc.d already exists
Refreshing the base.tgz
-> upgrading packages
Get:1 http://ftp.nc.debian.org squeeze Release.gpg [835B]
Ign http://ftp.nc.debian.org/debian/ squeeze/main Translation-en
Get:2 http://ftp.nc.debian.org squeeze Release [89.9kB]
Get:3 http://ftp.nc.debian.org squeeze/main i386 Packages/DiffIndex [2038B]
Hit http://ftp.debian.org squeeze Release.gpg
Ign http://ftp.debian.org/debian/ squeeze/main Translation-en
Hit http://ftp.debian.org squeeze Release
Get:4 http://ftp.debian.org squeeze/main i386 Packages/DiffIndex [2038B]
Fetched 94.8kB in 3s (29.4kB/s)
Reading package lists...
dpkg: warning: ignoring request to remove lilo which isn't installed.
Obtaining the cached apt archive contents
Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists...
Building dependency tree...
Reading state information...
apt is already the newest version.
aptitude is already the newest version.
build-essential is already the newest version.
dpkg-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
-> removing directory /var/cache/pbuilder/build//10951 and its subdirectories
2) build source package, do not include GIT structure and sign it:
$ cd packagexx_version
$ debuild -S -sa -i.git -I.git
3) let pbuilder build binary package in the distribution of your choice with ##build## option:
%%(bash)
$ cd ..
$ pbuilder-squeeze-i386 build packagexx_version.dsc
%%
4) the Deb and Changes files should be now saved in ##/var/cache/pbuilder/squueze-i386/result/## folder! Just test them with Lintian and sign them if everything is ok.
$ cd /var/cache/pbuilder/squueze-i386/result/
$ lintian -iv packagexx_version_i386.changes
$ debsign -S packagexx_version_i386.changes
%%
Deletions:
To initialize the Squeeze dist, simply type:
=====Further reading=====
Todo
Additions:
[...grab some RSS news while pbuilder does it's job...]
update-alternatives: using /usr/bin/aptitude-curses to provide /usr/bin/aptitude (aptitude) in auto mode.
Copying back the cached apt archive contents
-> new cache content libxapian22_1.2.3-2_i386.deb added
-> new cache content libept1_1.0.3+b1_i386.deb added
-> new cache content libsigc++-2.0-0c2a_2.2.4.2-1_i386.deb added
-> new cache content libcwidget3_0.5.16-3_i386.deb added
-> new cache content aptitude_0.6.3-3.1_i386.deb added
-> new cache content libsqlite3-0_3.7.2-1_i386.deb added
-> new cache content libncursesw5_5.7+20100313-3_i386.deb added
-> new cache content libboost-iostreams1.42.0_1.42.0-4_i386.deb added
-> unmounting dev/pts filesystem
-> unmounting proc filesystem
-> creating base tarball [/var/cache/pbuilder/squeeze-i386-base.tgz]
-> cleaning the build env
-> removing directory /var/cache/pbuilder/build//8564 and its subdirectories
=====Debug=====
Pbuilder reads your configuration in the ##.pbuilderrc## file. Here we can specify a hook script that will allow you to log into the chrooted environment if a package build fails.
$ pico ~/.pbuilderrc
# https://wiki.ubuntu.com/PbuilderHowto
HOOKDIR="/var/cache/pbuilder/hook.d"
Then create the script ##/var/cache/pbuilder/hook.d/C10shell##
# pico /var/cache/pbuilder/hook.d/C10shell
#!/bin/sh
# invoke shell if build fails.
apt-get install -y --force-yes vim less bash mc
cd /tmp/buildd/*/debian/..
/bin/bash < /dev/tty > /dev/tty 2> /dev/tty
Note that pbuilder can install the packages you like just before you login (line 3), just add the one you want.
update-alternatives: using /usr/bin/aptitude-curses to provide /usr/bin/aptitude (aptitude) in auto mode.
Copying back the cached apt archive contents
-> new cache content libxapian22_1.2.3-2_i386.deb added
-> new cache content libept1_1.0.3+b1_i386.deb added
-> new cache content libsigc++-2.0-0c2a_2.2.4.2-1_i386.deb added
-> new cache content libcwidget3_0.5.16-3_i386.deb added
-> new cache content aptitude_0.6.3-3.1_i386.deb added
-> new cache content libsqlite3-0_3.7.2-1_i386.deb added
-> new cache content libncursesw5_5.7+20100313-3_i386.deb added
-> new cache content libboost-iostreams1.42.0_1.42.0-4_i386.deb added
-> unmounting dev/pts filesystem
-> unmounting proc filesystem
-> creating base tarball [/var/cache/pbuilder/squeeze-i386-base.tgz]
-> cleaning the build env
-> removing directory /var/cache/pbuilder/build//8564 and its subdirectories
=====Debug=====
Pbuilder reads your configuration in the ##.pbuilderrc## file. Here we can specify a hook script that will allow you to log into the chrooted environment if a package build fails.
$ pico ~/.pbuilderrc
# https://wiki.ubuntu.com/PbuilderHowto
HOOKDIR="/var/cache/pbuilder/hook.d"
Then create the script ##/var/cache/pbuilder/hook.d/C10shell##
# pico /var/cache/pbuilder/hook.d/C10shell
#!/bin/sh
# invoke shell if build fails.
apt-get install -y --force-yes vim less bash mc
cd /tmp/buildd/*/debian/..
/bin/bash < /dev/tty > /dev/tty 2> /dev/tty
Note that pbuilder can install the packages you like just before you login (line 3), just add the one you want.
Deletions:
~/.pbuilderrc
(...)
Additions:
=====Install packages=====
$ aptitude update
# aptitude install pbuilder
=====Environment=====
===Path===
$ mkdir ~/bin
$ pico ~/.profile
===Sudoers===
The script will use the ##sudo## command to have access to such directories like ##/var/cache/pbuilder##, so please verify that you are declared at the end of the sudoer's file:
# visudo
your_login ALL=(ALL) NOPASSWD: ALL
===PBuilderRC===
~/.pbuilderrc
=====Scripts=====
$ pico ~/bin/pbuilder-dist-arch.sh
$ chmod +x ~/bin/pbuilder-dist-arch.sh
$ ln -s pbuilder-dist-arch.sh pbuilder-lenny-i386
$ ln -s pbuilder-dist-arch.sh pbuilder-squeeze-i386
=====Play with your dists=====
$ pbuilder-squeeze-i386 create
ludo@ludo-vbox:~$ pbuilder-squeeze-i386 create
W: /home/ludo/.pbuilderrc does not exist
-> Logging to /var/cache/pbuilder/.lastlog
Distribution is squeeze.
Building the build environment
-> running cdebootstrap
/usr/bin/cdebootstrap
P: Retrieving Release
P: Retrieving Release.gpg
P: Validating Release
I: Good signature from "Debian Archive Automatic Signing Key (5.0/lenny) <ftpmaster@debian.org>"
P: Parsing Release
P: Retrieving Packages.gz
(...)
=====Further reading=====
$ aptitude update
# aptitude install pbuilder
=====Environment=====
===Path===
$ mkdir ~/bin
$ pico ~/.profile
===Sudoers===
The script will use the ##sudo## command to have access to such directories like ##/var/cache/pbuilder##, so please verify that you are declared at the end of the sudoer's file:
# visudo
your_login ALL=(ALL) NOPASSWD: ALL
===PBuilderRC===
~/.pbuilderrc
=====Scripts=====
$ pico ~/bin/pbuilder-dist-arch.sh
$ chmod +x ~/bin/pbuilder-dist-arch.sh
$ ln -s pbuilder-dist-arch.sh pbuilder-lenny-i386
$ ln -s pbuilder-dist-arch.sh pbuilder-squeeze-i386
=====Play with your dists=====
$ pbuilder-squeeze-i386 create
ludo@ludo-vbox:~$ pbuilder-squeeze-i386 create
W: /home/ludo/.pbuilderrc does not exist
-> Logging to /var/cache/pbuilder/.lastlog
Distribution is squeeze.
Building the build environment
-> running cdebootstrap
/usr/bin/cdebootstrap
P: Retrieving Release
P: Retrieving Release.gpg
P: Validating Release
I: Good signature from "Debian Archive Automatic Signing Key (5.0/lenny) <ftpmaster@debian.org>"
P: Parsing Release
P: Retrieving Packages.gz
(...)
=====Further reading=====
Deletions:
aptitude update
sudo aptitude install pbuilder
====Environment====
mkdir ~/bin
pico ~/.profile
====Scripts====
pico ~/bin/pbuilder-dist-arch.sh
chmod +x ~/bin/pbuilder-dist-arch.sh
ln -s pbuilder-dist-arch.sh pbuilder-lenny-i386
ln -s pbuilder-dist-arch.sh pbuilder-squeeze-i386
====Play with your dists====
pbuilder-squeeze-i386 create
====Further reading====
Additions:
If you changed your ##.profile## file or if the ##$HOME/bin## directory was not created, you'll have to logout and login again to reload your environment variables.