1 Debian Package Building
2 =======================
3 Chris Sharp <csharp@georgialibraries.org>
4 Josh Lamos <jlamos@georgialibraries.org>
5 Andy Witter <awitter@georgialibraries.org>
6 (C) 2011-2015 Georgia Public Library Service
10 This repository is to provide examples of the way GPLS builds its own Debian
11 packages for installing on Ubuntu LTS. These methods are based on well-
12 established Debian packaging techniques (see
13 https://www.debian.org/doc/manuals/maint-guide/index.en.html) with some
14 necessary hacks to work with Evergreen, OpenSRF, and other unpackaged
17 The Package-Building Environment
18 --------------------------------
19 Running the "deb-builder-setup.sh" script will accomplish the following, but we
20 provide the manual steps in case you have a custom setup.
22 It is recommended to build packages on a test server running the same OS version as
23 your target production servers. While some packages are portable between Ubuntu
24 (or even Debian) releases, many are not. From a base Ubuntu 14.04 server
25 installation, do the following to install packaging dependencies:
28 sudo apt-get install build-essential dh-make dh-make-perl quilt apt-file
32 Then, set up the deb-building environment variables:
35 $ cat >>~/.bashrc <<EOF
36 DEBEMAIL="your.email.address@example.org"
37 DEBFULLNAME="Firstname Lastname"
38 export DEBEMAIL DEBFULLNAME
43 Setting up quilt to Handle Patches
44 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
45 The OpenSRF and Evergreen-ILS source trees require patching for the Debian
46 packaging process to work. "quilt" is a VCS-like program that handles this
47 automatically and is configured to work seamlessly with Debian packaging tools.
49 Following from the official Debian packaging documentation, we create a custom
53 d=. ; while [ ! -d $d/debian -a `readlink -e $d` != / ]; do d=$d/..; done
54 if [ -d $d/debian ] && [ -z $QUILT_PATCHES ]; then
55 # if in Debian packaging tree with unset $QUILT_PATCHES
56 QUILT_PATCHES="debian/patches"
57 QUILT_PATCH_OPTS="--reject-format=unified"
58 QUILT_DIFF_ARGS="-p ab --no-timestamps --no-index --color=auto"
59 QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index"
60 QUILT_COLORS="diff_hdr=1;32:diff_add=1;34:diff_rem=1;31:diff_hunk=1;33:diff_ctx=35:diff_cctx=33"
61 if ! [ -d $d/debian/patches ]; then mkdir $d/debian/patches; fi
65 We then add a bash alias to ~/.bashrc:
68 alias dquilt="quilt --quiltrc=${HOME}/.quiltrc-dpkg"
69 complete -F _quilt_completion $_quilt_complete_opt dquilt
74 While the number of unpackaged Perl dependencies has lessened, there remain a
75 few (and new ones are added) that still need to be installed from CPAN. Since
76 our goal in creating our Evergreen packages is to ease the entire installation
77 process, as well as to have an entirely replicable system, we pull down and
78 package particular releases of CPAN modules. As of Evergreen 2.7.4 on Ubuntu
79 14.04 LTS, the following perl modules are not available via standard Ubuntu
82 - Business::CreditCard::Object
83 - Business::OnlinePayment::PayPal
85 - Class::DBI::Frozen::301
87 Using dh-make-perl to Build CPAN Dependencies
88 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
89 The steps for building each of the CPAN dependencies are essentially the same:
91 1. Run 'dh-make-perl --requiredeps --cpan <packagename>' within the directory for each module.
92 2. Run 'dpkg-buildpackage -F' (installing any missing dependencies indicated by the script, then repeating as necessary).