Helper tool for building Debian packages
It is a wrong way to building Debian packages, but I'm so used to it
- The best way to build your package's is in a clean chroot environment
-
Install the required packages
apt-get install coreutils bash debootstrap
-
Setting up a chroot (example for debian jessie)
CHROOTDIR="/storage/jessie-chroot_amd64"; LC="ru_RU.UTF-8"; mkdir -p "${CHROOTDIR}" && \ debootstrap --arch=amd64 --variant=minbase --include=locales,apt-utils,dialog,findutils,file,sed,gawk,bzip2 \ jessie "${CHROOTDIR}" http://mirror.mephi.ru/debian/ && \ echo "LANG="${LC}"" > "${CHROOTDIR}"/etc/default/locale && \ sed -i 's/# "${LC}" UTF-8/"${LC}" UTF-8/' "${CHROOTDIR}"/etc/locale.gen && \ chroot "${CHROOTDIR}" /bin/bash -c "su - -c \"locale-gen\"";
-
Creating a new directory for the package
mkdir "${CHROOTDIR}"/package_name;
-
This helper script should be is in the same directory as the config files
cp build_package.sh "${CHROOTDIR}"/package_name;
-
Create package configurations files
cd "${CHROOTDIR}"/package_name;
Run, and then follow the instructions
./build_package.sh -a
-
Edit configuration files using text editor
-
The main configuration file is
build_config.sh
Configuration file options
APP_PCKG_MAINTAINER
The package's maintainer name and email address
APP_DEB_PCKG
list of packages to build
APP_SRC_ARCH
APP_SRC_DIR
APP_VERSION
The version number of a package
APP_REQ_PCKGAV
APP_CFG_OPTS
APP_CFLAGS
APP_HOMEPAGE
The URL of the web site for this package -
Package configuration files is
build_config_packagename.sh
Configuration file options
APP_DEB_PCKG_packagename_DESCRIPTION
APP_DEB_PCKG_packagename_ARCH
ArchitectureAPP_DEB_PCKG_packagename_DEPENDS
-
Enter the chroot environment to begin building
chroot "${CHROOTDIR}";
-
Building Debian package
cd package_name
./build_package.sh