Debian packaging (#664)

This commit is contained in:
Markus Unterwaditzer 2017-08-30 21:57:38 +02:00 committed by GitHub
parent 1da0bd1cdd
commit 131b3d257d
9 changed files with 109 additions and 3 deletions

12
.dockerignore Normal file
View file

@ -0,0 +1,12 @@
*
!vdirsyncer/*/*
!vdirsyncer/*
!.git/**/*
!.git/*
!debian/*/*
!debian/*
!scripts/*/*
!scripts/*
!setup.py
!Makefile
!README.rst

View file

@ -106,6 +106,13 @@ linkcheck:
release:
python setup.py sdist bdist_wheel upload
release-deb:
sh scripts/release-deb.sh debian jessie
sh scripts/release-deb.sh debian stretch
sh scripts/release-deb.sh ubuntu trusty
sh scripts/release-deb.sh ubuntu xenial
sh scripts/release-deb.sh ubuntu zesty
install-dev:
pip install -e .
[ "$(ETESYNC_TESTS)" = "false" ] || pip install -e .[etesync]

1
debian/compat vendored Normal file
View file

@ -0,0 +1 @@
10

20
debian/control vendored Normal file
View file

@ -0,0 +1,20 @@
Source: vdirsyncer-latest
Maintainer: Markus Unterwaditzer <markus-debianpkg@unterwaditzer.net>
Section: utils
Priority: extra
Build-Depends: debhelper (>= 9), python3-all, dh-virtualenv (>= 0.8)
Standards-Version: 4.0.0
Homepage: https://github.com/pimutils/vdirsyncer
Package: vdirsyncer-latest
Architecture: any
Pre-Depends: dpkg (>= 1.16.1), python3, ${misc:Pre-Depends}
Depends: ${misc:Depends}, ${python3:Depends}
Suggests: python3-requests-oauthlib
Description: Synchronize calendars and contacts
Vdirsyncer synchronizes your calendars and addressbooks between two storages.
The most popular purpose is to synchronize a CalDAV/CardDAV server with a local
folder or file. The local data can then be accessed via a variety of programs,
none of which have to know or worry about syncing to a server.
.
It aims to be for CalDAV and CardDAV what OfflineIMAP is for IMAP.

7
debian/rules vendored Executable file
View file

@ -0,0 +1,7 @@
#!/usr/bin/make -f
%:
dh $@ --with python-virtualenv
override_dh_virtualenv:
dh_virtualenv --python /usr/bin/python3 --preinstall requests-oauthlib

View file

@ -7,12 +7,13 @@ Installation
OS/distro packages
------------------
The following packages are user-contributed. They may or may not be up-to-date:
The following packages are user-contributed and were up-to-date at the time of
writing:
- `ArchLinux (AUR) <https://aur.archlinux.org/packages/vdirsyncer>`_
- `Debian <https://packages.debian.org/sid/vdirsyncer>`_
- `Ubuntu and Debian <https://packagecloud.io/pimutils/vdirsyncer/install>`_
(packages also exist in the official repositories but may be out of date)
- `GNU Guix <https://www.gnu.org/software/guix/package-list.html#vdirsyncer>`_
- `Ubuntu <http://packages.ubuntu.com/search?keywords=vdirsyncer>`_
- `OS X (homebrew) <http://braumeister.org/formula/vdirsyncer>`_
- `BSD (pkgsrc) <http://pkgsrc.se/time/py-vdirsyncer>`_
- `OpenBSD <http://ports.su/productivity/vdirsyncer>`_

33
scripts/dpkg.Dockerfile Normal file
View file

@ -0,0 +1,33 @@
ARG distro
ARG distrover
FROM $distro:$distrover
ARG distro
ARG distrover
RUN apt-get update
RUN apt-get install -y software-properties-common
RUN if [ "$distrover" = "trusty" ]; then \
add-apt-repository -y ppa:spotify-jyrki/dh-virtualenv; \
fi
RUN if [ "$distro" = "debian" ]; then \
echo "deb http://deb.debian.org/debian ${distrover}-backports main" > /etc/apt/sources.list.d/backports.list; \
fi
RUN apt-get update
RUN apt-get install -y build-essential fakeroot debhelper git
RUN apt-get install -y python3-all python3-pip
RUN apt-get install -t${distrover}-backports -y dh-virtualenv
RUN pip3 install virtualenv
RUN python3 -m virtualenv /vdirsyncer/env/
COPY . /vdirsyncer/vdirsyncer/
WORKDIR /vdirsyncer/vdirsyncer/
RUN . /vdirsyncer/env/bin/activate; make install-dev
RUN /vdirsyncer/env/bin/python scripts/write-dpkg-changelog.py > debian/changelog
RUN . /vdirsyncer/env/bin/activate; dpkg-buildpackage -us -uc
RUN mkdir /vdirsyncer/pkgs/
RUN mv /vdirsyncer/*.deb /vdirsyncer/pkgs/

14
scripts/release-deb.sh Normal file
View file

@ -0,0 +1,14 @@
#!/bin/sh
set -xe
distro=$1
distrover=$2
name=vdirsyncer-$distro-$distrover:latest
docker build \
--build-arg distro=$distro \
--build-arg distrover=$distrover \
-t $name \
-f scripts/dpkg.Dockerfile .
rm -f dist/pkgs/*.deb
docker run $name tar -c -C /vdirsyncer pkgs | tar x -C dist/
package_cloud push pimutils/vdirsyncer/$distro/$distrover --skip-errors dist/pkgs/*.deb

View file

@ -0,0 +1,11 @@
import pkg_resources
import datetime
version = pkg_resources.get_distribution('vdirsyncer').version
version = version.replace('.dev', '~')
print('vdirsyncer-latest ({}) unstable; urgency=medium'.format(version))
print('''
* Dummy changelog
-- Markus Unterwaditzer <markus-debianpkg@unterwaditzer.net> {}
'''.format(datetime.datetime.now().strftime('%a, %d %b %Y %H:%M:%S +0200')))