diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..639bf7c --- /dev/null +++ b/.dockerignore @@ -0,0 +1,12 @@ +* +!vdirsyncer/*/* +!vdirsyncer/* +!.git/**/* +!.git/* +!debian/*/* +!debian/* +!scripts/*/* +!scripts/* +!setup.py +!Makefile +!README.rst diff --git a/Makefile b/Makefile index 0584fa0..d5f298d 100644 --- a/Makefile +++ b/Makefile @@ -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] diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..f599e28 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +10 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..487417a --- /dev/null +++ b/debian/control @@ -0,0 +1,20 @@ +Source: vdirsyncer-latest +Maintainer: Markus Unterwaditzer +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. diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..bf55cde --- /dev/null +++ b/debian/rules @@ -0,0 +1,7 @@ +#!/usr/bin/make -f + +%: + dh $@ --with python-virtualenv + +override_dh_virtualenv: + dh_virtualenv --python /usr/bin/python3 --preinstall requests-oauthlib diff --git a/docs/installation.rst b/docs/installation.rst index ea1b769..bb39f9d 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -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) `_ -- `Debian `_ +- `Ubuntu and Debian `_ + (packages also exist in the official repositories but may be out of date) - `GNU Guix `_ -- `Ubuntu `_ - `OS X (homebrew) `_ - `BSD (pkgsrc) `_ - `OpenBSD `_ diff --git a/scripts/dpkg.Dockerfile b/scripts/dpkg.Dockerfile new file mode 100644 index 0000000..22076d2 --- /dev/null +++ b/scripts/dpkg.Dockerfile @@ -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/ diff --git a/scripts/release-deb.sh b/scripts/release-deb.sh new file mode 100644 index 0000000..c6ec247 --- /dev/null +++ b/scripts/release-deb.sh @@ -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 diff --git a/scripts/write-dpkg-changelog.py b/scripts/write-dpkg-changelog.py new file mode 100644 index 0000000..fdf94a6 --- /dev/null +++ b/scripts/write-dpkg-changelog.py @@ -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 {} +'''.format(datetime.datetime.now().strftime('%a, %d %b %Y %H:%M:%S +0200')))