#Debian package creation
The system contains rebuildd, a front-end for pbuilder, some chroot pbuilder for i386, amd64, armhf and reprepro for debian repository system.
There is 3 repositories (unstable, testing & stable):
-
Packages from
unstable(akadaily) are the latest version from git and are build automatically every night. -
Packages from
testing(akatest) allow to set up a new package version to be tested. -
Packages from
stable(akamegusta) contains only production versions.
This workflow purpose is to avoid any manual interaction (script launch, ...) on your server and to focus on package management through Github only.
Thus, each yunohost package has three branches, matching the three repositories (unstable, testing et stable). The build server will automatically build and deploy Debian source packages and binaries into the corresponding state on Github
Commits to the unstable branch will not modify the debian/changelog file because it is automatically updated during daily builds with corresponding date and time.
Any commit that will alter a package behaviour need to be done to the unstable branch first.
TODO Add pre-commit hook to avoid errors ?
No commit can be done directly in those branches. You need to use merges (merge from unstable to testing & merge from testing to stable).
The only specific changes that occur on the repositories are version changes (modification of debian/changelog, then tag).
As a YunoHost application maintainer, you may find specific tools in the repository yunohost-debhelper
git clone https://github.com/YunoHost/yunohost-debhelper
yunohost-debhelper/setup_git_alias.shThe previous instructions will configure a new git alias named yunobump. It is global and located at ~/.gitconfig, therefore accessible through any local git repository.
- Go into the repository you wish to build
- Make sure
unstablebranch contains all modifications you wish to apply - Get the current version number:
head debian/changelog - Move to the
testingorstablebranch - Merge or cherry-pick commits you want to insert into the
unstablebranch - Add to
debian/changelogthe corresponding commits messages (or usegit-dchto do it automatically) - Tag the current branch (
testingorstable) with the next superior value for version number - Push modifications and tags into GitHub repository
- Go back to
unstablebranch - Merge changelog
- Push
unstablebranch
# You Only Clone Once
$ git clone git@github.com:YunoHost/yunohost.git
$ cd yunohost
# Be sure to be up-to-date, and don't forget to get the tags !
$ git fetch --tags
# Checkout your branch: stable or testing
$ git checkout testing
# Do your 'functional' modifications: either merge unstable in testing, or merge testing in stable
$ git pull origin unstable
# Or just
$ git merge unstable
# What is the current version number in test?
$ dpkg-parsechangelog | grep "^Version" | cut -d ' ' -f 2
# Or just
$ head debian/changelog
# Update changelog and do a proper tag (explained below)
$ git yunobump x.y.z
# Push the branch state AND the tags to the remote repository
$ git push origin --tags testing:testing
# Merge changelog modifications to the `unstable` branch
$ git checkout unstable
$ git merge testing
$ git push origin unstableTODO Tag format policy: actually $branch/$version to enable the same version into two different branches. Is it necessary?
TODO Under normal circumstances, every push to test or stable, the last commit will result in a changelog commit properly tagged. It should be possible to set a pre-push git hook that prevents from pushing unfinished work
Exceptionally, you may hotfix (for security purposes for example) stable or test packages, leading to a merge into daily branch which is not acceptable (too much new features in development).
** This MUST remain exceptional **
TODO Describe
TODO Develop a 'git yunohotfix ...' helper that commit into stable and cherry-pick right away into daily? or the opposite?
« not-YunoHost » packages (python-bottle for example) don't go through unstable repository. Once package tests are completed, they need to be manually transferred into backport repository.
So far, YunoHost global base version is 2. The current convention for the version number is 2.x.x.
The second section of the number string is incremented if a major functional change has occured: addition of a new functionality, modification of a behaviour. For now, all packages are versionned 2.1.x.
The third section of the number string is incremented if a bugfix or a minor functional change has occured. For example, you may currently find 2.1.3 or 2.1.5 packages
A fourth section is dedicated for exceptional cases like bugfixes in stable branch. In this case, we want to pass on a unique change directly into stable branch, therefore we add -x to the number string. This may result into something like this: 2.1.3-1.
A cron task defined for pbuilder user is executed every day at 01:00. The script will update the packages git repository and submodules (ssowat, moulinette, yunohost & yunohost-admin).
Once sources are up to date, the script will rebuild packages that have been updated the day.
Sources packages will then need to be created and moved into /var/www/repo.yunohost.org/daily/incomming folder.
Launch source file addition to the repository. This will automatically launch a rebuildd job (see daily repository configuration: /var/www/repo.yunohost.org/daily/conf/distribustion).
Once packages are built, they are added to the unstable repository.
You may manualy launch a package build by typing:
$ daily_build -p package_name$ build_deb /path/of/packageTODO Describe : need to bump the version to pass from test to stable
$ push-packages-test -p package_nameYou may add the -v argument to manually define the package version.
The script will get the daily sources package and define the version and changelist into the changelog. Build package will be added to the rebuildd jobs list that will pass everything to the test repository.
Attention : Version name must not contain daily otherwise the package will be added to the daily repository.
$ push-package-stable -p package_nameThe previous command only passes the package from test to stable repository, without rebuild.
- Delete a package
$ reprepro -V -b /var/www/repo.yunohost.org/repo_name/ remove megusta package_name- Add a Debian package into a repository
$ reprepro -V -b /var/www/repo.yunohost.org/repo_name/ includedeb megusta package_name.debPackages from backports repository can be quickly into Yunohost test repository.
To do so, you need to add the package name into the /var/www/repo.yunohost.org/test/conf/list file and type in the following command:
$ reprepro -V -b /var/www/repo.yunohost.org/test update megustaNow packages will be downloaded and added to test repository.