--- /dev/null
+.travis.ubuntu.sh
\ No newline at end of file
--- /dev/null
+#! /bin/bash
+
+set -e -x
+
+make -f Makefile.repo
+make package
+
+# Build the binary package locally, use plain "rpmbuild" to make it simple.
+# "osc build" is too resource hungry (builds a complete chroot from scratch).
+# Moreover it does not work in a Docker container (it fails when trying to mount
+# /proc and /sys in the chroot).
+mkdir -p /root/rpmbuild/SOURCES
+cp package/* /root/rpmbuild/SOURCES
+rpmbuild -bb -D "fedora_version 25" -D "jobs `nproc`" package/*.spec
+
+# test the %pre/%post scripts by installing/updating/removing the built packages
+# ignore the dependencies to make the test easier, as a smoke test it's good enough
+rpm -iv --force --nodeps /root/rpmbuild/RPMS/*/*.rpm
+
+# smoke test, make sure snapper at least starts
+snapper --version
+
+rpm -Uv --force --nodeps /root/rpmbuild/RPMS/*/*.rpm
+# get the plain package names and remove all packages at once
+rpm -ev --nodeps `rpm -q --qf '%{NAME} ' -p /root/rpmbuild/RPMS/**/*.rpm`
--- /dev/null
+.travis.tumbleweed.sh
\ No newline at end of file
--- /dev/null
+#! /bin/bash
+
+set -e -x
+
+make -f Makefile.repo
+make package
+
+# Build the binary package locally, use plain "rpmbuild" to make it simple.
+# "osc build" is too resource hungry (builds a complete chroot from scratch).
+# Moreover it does not work in a Docker container (it fails when trying to mount
+# /proc and /sys in the chroot).
+cp package/* /usr/src/packages/SOURCES/
+rpmbuild -bb -D "jobs `nproc`" package/*.spec
+
+# test the %pre/%post scripts by installing/updating/removing the built packages
+# ignore the dependencies to make the test easier, as a smoke test it's good enough
+rpm -iv --force --nodeps /usr/src/packages/RPMS/*/*.rpm
+
+# smoke test, make sure snapper at least starts
+snapper --version
+
+rpm -Uv --force --nodeps /usr/src/packages/RPMS/*/*.rpm
+# get the plain package names and remove all packages at once
+rpm -ev --nodeps `rpm -q --qf '%{NAME} ' -p /usr/src/packages/RPMS/**/*.rpm`
--- /dev/null
+#! /bin/bash
+
+set -e -x
+
+make -f Makefile.repo
+
+# convert the OBS Debian files to the native Debian files
+(cd debian && rename 's/^debian\.//' debian.*)
+
+# build binary packages
+dpkg-buildpackage -j`nproc` -rfakeroot -b
+
+# install the built packages
+dpkg -i ../*.deb
+
+# smoke test, make sure snapper at least starts
+snapper --version
+
--- /dev/null
+sudo: required
+language: bash
+services:
+ - docker
+
+# define the build matrix
+env:
+ - BUILD_FLAVOR=tumbleweed
+ - BUILD_FLAVOR=leap
+ - BUILD_FLAVOR=fedora
+ - BUILD_FLAVOR=ubuntu
+ - BUILD_FLAVOR=debian
+
+before_install:
+ # use the Dockerfile.<distro> file for building the image
+ - docker build -f Dockerfile.$BUILD_FLAVOR -t snapper-devel .
+
+script:
+ # run the respective .travis.<distro>.sh script
+ - docker run -it snapper-devel ./.travis.$BUILD_FLAVOR.sh
--- /dev/null
+# Build Debian 8 image
+FROM debian:8
+
+# see https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/#/run
+RUN apt-get update && \
+ apt-get install -y --no-install-recommends \
+ acl-dev \
+ autoconf \
+ automake \
+ build-essential \
+ debhelper \
+ devscripts \
+ docbook-xsl \
+ fakeroot \
+ g++ \
+ gettext \
+ libboost-dev \
+ libboost-system-dev \
+ libboost-test-dev \
+ libboost-thread-dev \
+ libdbus-1-dev \
+ libmount-dev \
+ libpam-dev \
+ libtool \
+ libxml2-dev \
+ libz-dev \
+ locales-all \
+ xsltproc
+
+RUN mkdir -p /usr/src/app
+WORKDIR /usr/src/app
+
+COPY . /usr/src/app
--- /dev/null
+# Build Fedora 25 image
+FROM fedora:25
+
+RUN dnf -y install \
+ autoconf \
+ automake \
+ boost-devel \
+ dbus-devel \
+ docbook-style-xsl \
+ e2fsprogs-devel \
+ gcc-c++ \
+ gettext \
+ glibc-langpack-de \
+ glibc-langpack-en \
+ libacl-devel \
+ libmount-devel \
+ libtool \
+ libxml2-devel \
+ libxslt \
+ make \
+ pam-devel \
+ pkgconfig \
+ rpm-build
+
+RUN mkdir -p /usr/src/app
+WORKDIR /usr/src/app
+
+COPY . /usr/src/app
--- /dev/null
+# Build the latest openSUSE Leap (42.x) image
+FROM opensuse:leap
+
+RUN zypper --non-interactive in --no-recommends \
+ autoconf \
+ automake \
+ boost-devel \
+ dbus-1-devel \
+ docbook-xsl-stylesheets \
+ e2fsprogs-devel \
+ gcc-c++ \
+ grep \
+ libacl-devel \
+ libbtrfs-devel \
+ libmount-devel \
+ libtool \
+ libxml2-devel \
+ libxslt \
+ pam-devel \
+ rpm-build \
+ which
+
+RUN mkdir -p /usr/src/app
+WORKDIR /usr/src/app
+
+COPY . /usr/src/app
--- /dev/null
+# Build the latest openSUSE Tumbleweed image
+FROM opensuse:tumbleweed
+
+RUN zypper --non-interactive in --no-recommends \
+ autoconf \
+ automake \
+ boost-devel \
+ dbus-1-devel \
+ docbook-xsl-stylesheets \
+ e2fsprogs-devel \
+ gcc-c++ \
+ grep \
+ libacl-devel \
+ libbtrfs-devel \
+ libmount-devel \
+ libtool \
+ libxml2-devel \
+ libxslt \
+ pam-devel \
+ rpm-build \
+ which
+
+RUN mkdir -p /usr/src/app
+WORKDIR /usr/src/app
+
+COPY . /usr/src/app
--- /dev/null
+# Build Ubuntu 16.10 image
+FROM ubuntu:16.10
+
+# see https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/#/run
+RUN apt-get update && \
+ apt-get install -y --no-install-recommends \
+ acl-dev \
+ autoconf \
+ automake \
+ build-essential \
+ debhelper \
+ devscripts \
+ docbook-xsl \
+ fakeroot \
+ g++ \
+ gettext \
+ language-pack-de \
+ language-pack-en \
+ libboost-dev \
+ libboost-system-dev \
+ libboost-test-dev \
+ libboost-thread-dev \
+ libdbus-1-dev \
+ libmount-dev \
+ libpam-dev \
+ libtool \
+ libxml2-dev \
+ libz-dev \
+ xsltproc
+
+RUN mkdir -p /usr/src/app
+WORKDIR /usr/src/app
+
+COPY . /usr/src/app
xUbuntu_14.10 \
xUbuntu_15.04 \
xUbuntu_15.10 \
- xUbuntu_16.04
+ xUbuntu_16.04 \
+ xUbuntu_16.10
show-debian:
@echo "Debian flavors: $(DEBIAN_FLAVOURS)"
--- /dev/null
+# Travis CI
+
+By default Travis uses Ubuntu 14.04 LTS for building, but it is possible to run
+the build in any Linux distribution using [Docker](https://www.docker.com/).
+
+## Setup
+
+For each target distribution there is a `Dockerfile` and the respective
+`.travis.sh` script. The `Dockerfile` defines the steps needed for building
+the Docker image, the script runs the build in the specific distribution.
+
+The `.travis.yml` file defines the build matrix which runs builds for all
+configured distributions in parallel. It is defined in the `env` section,
+see more details in the [Travis documentation](
+https://docs.travis-ci.com/user/customizing-the-build#Build-Matrix).
+
+## Running the Build Locally
+
+- [Install and start Docker](https://docs.docker.com/engine/installation/linux/)
+- Run (as `root`) the same commands as in the `.travis.yml` file, that means:
+- First build the docker image locally, e.g. `docker build -f
+ Dockerfile.tumbleweed -t snapper-devel .`, the Docker image automatically
+ includes also the copy of the current Snapper sources.
+- Then run the build: `docker run -it --rm snapper-devel ./.travis.tumbleweed.sh`
+ (The `--rm` will cleanup the new Docker image layer created by the build,
+ if you want to inspect the build artifacts then remove it.)
+- If you need to debug a failure then run `bash` instead of the Travis script
+ and run the build steps manually. If you need an editor or some other tool
+ you can install them via the respective packaging tool, see the `Dockerfile`
+ for examples.
+
Snapper
=======
+[](https://travis-ci.org/openSUSE/snapper)
+
Snapper is a tool for Linux file system snapshot management. Apart from the
obvious creation and deletion of snapshots it can compare snapshots and
revert differences between them. In simple terms, this allows root and
docbook-xsl-stylesheets libxml2-devel libbtrfs-devel
```
+Alternatively you can use a [Docker](https://www.docker.com/) container,
+see [REAME.Travis.md](REAME.Travis.md) file for some hints.
+
### Building Snapper
You can download the sources and build Snapper by using these commands:
### Releasing
- Before releasing the Snapper package ensure that the changes made to the package
-are mentioned in the `package/snapper.changes` file.
+are mentioned in the `package/snapper.changes` file, update also the
+`debian/debian.changelog` file.
- Make sure the units tests still passes ([see above](#running-tests)).
+snapper (0.4.1-0) stable; urgency=low
+
+ * Updated to version 0.4.1
+
+ -- Arvin Schnell <aschnell@suse.com> Wed, 21 Dec 2016 11:26:28 +0100
+
snapper (0.3.3-0) stable; urgency=low
* Updated to version 0.3.3
# Turn on verbose mode.
export DH_VERBOSE=1
-# Set debhelper compatibility version.
-export DH_COMPAT=5
-
CFLAGS = -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0 -Wall
CFLAGS += -O2 -Wall
endif
-build: build-stamp
-build-stamp:
- dh_testdir
-
- ./configure --docdir=/usr/share/doc/packages/snapper --disable-silent-rules \
- --disable-ext4 --enable-xattrs --disable-rollback --disable-btrfs-quota
- make
-
- make check
-
- touch build-stamp
-
-clean:
- dh_testdir
- dh_testroot
- rm -f build-stamp
-
- make clean || true
-
- dh_clean
-
-install: build
- dh_testdir
- dh_testroot
- dh_clean -k
- dh_installdirs
-
- make install DESTDIR=/usr/src/packages/BUILD/debian/tmp
- install -D -m 644 data/sysconfig.snapper /usr/src/packages/BUILD/debian/tmp/etc/sysconfig/snapper
-
-# Build architecture-independent files here.
-binary-indep: build install
-
-# Build architecture-dependent files here.
-binary-arch: build install
- dh_testdir
- dh_testroot
-
- mv debian/tmp/etc/cron.hourly/suse.de-snapper debian/tmp/etc/cron.hourly/snapper
- mv debian/tmp/etc/cron.daily/suse.de-snapper debian/tmp/etc/cron.daily/snapper
+# allow parallel builds
+%:
+ dh $@ --parallel
- dh_install --sourcedir=debian/tmp
- dh_installman
- dh_installchangelogs
- dh_strip
- dh_compress
- dh_fixperms
- dh_makeshlibs
- dh_installdeb
- dh_shlibdeps
- dh_gencontrol
- dh_md5sums
- dh_builddeb
+override_dh_auto_configure:
+ dh_auto_configure -- --docdir=/usr/share/doc/packages/snapper --disable-silent-rules \
+ --disable-ext4 --enable-xattrs --disable-rollback --disable-btrfs-quota
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install
+override_dh_auto_install:
+ dh_auto_install
+ install -D -m 644 data/sysconfig.snapper $$(pwd)/debian/tmp/etc/sysconfig/snapper
-etc/cron.daily/snapper
-etc/cron.hourly/snapper
+etc/cron.daily/suse.de-snapper etc/cron.daily/snapper
+etc/cron.hourly/suse.de-snapper etc/cron.hourly/snapper
etc/dbus-1/system.d/org.opensuse.Snapper.conf
etc/logrotate.d/snapper
usr/bin/snapper