]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
Unify SUSE and Debian build
authorStefan Hundhammer <shundhammer@suse.de>
Wed, 13 Apr 2016 14:55:18 +0000 (16:55 +0200)
committerStefan Hundhammer <shundhammer@suse.de>
Thu, 13 Oct 2016 13:11:39 +0000 (15:11 +0200)
18 files changed:
.gitignore
Makefile.am
Makefile.ci
Rakefile
configure.ac
debian/debian.changelog [new file with mode: 0644]
debian/debian.control [new file with mode: 0644]
debian/debian.libpam-snapper.install [new file with mode: 0644]
debian/debian.libpam-snapper.manpages [new file with mode: 0644]
debian/debian.libsnapper-dev.install [new file with mode: 0644]
debian/debian.libsnapper.install [new file with mode: 0644]
debian/debian.rules [new file with mode: 0644]
debian/debian.snapper-zypp-plugin.install [new file with mode: 0644]
debian/debian.snapper-zypp-plugin.manpages [new file with mode: 0644]
debian/debian.snapper.install [new file with mode: 0644]
debian/debian.snapper.manpages [new file with mode: 0644]
debian/snapper.dsc.in [new file with mode: 0644]
package/.gitignore

index aaf6c3aa2e8a4c09f7958f882171fbe4feed0abb..d222ed9deb6b087c4f57168ecc26e6b10b903503 100644 (file)
@@ -12,7 +12,7 @@ install-sh
 libtool
 ltmain.sh
 missing
-/obs-package-from-git
+obs-package-from-git
 stamp-h1
 py-compile
 test-driver
index 00a799afbb011a4b8809dc65d8b5f59c7821640f..11c8f8336296efcb7db78133ba4c04d8faaa4289 100644 (file)
@@ -13,7 +13,48 @@ EXTRA_DIST = $(doc_DATA) VERSION LIBVERSION
 
 snapper-$(VERSION).tar.bz2: dist-bzip2
 
-package: snapper-$(VERSION).tar.bz2
+DEBIAN_FLAVOURS =      \
+    Debian_7.0         \
+    Debian_8.0         \
+    xUbuntu_14.04      \
+    xUbuntu_14.10      \
+    xUbuntu_15.04      \
+    xUbuntu_15.10      \
+    xUbuntu_16.04
+
+show-debian:
+       @echo "Debian flavors: $(DEBIAN_FLAVOURS)"
+
+package-clean:
        rm -f package/snapper-*.tar.bz2
+       rm -f package/debian.*
+       rm -f package/*.dsc
+
+# Create all the files necessary for building the package with OBS:
+#
+# - Clean up the package/ directory
+# - create a new tarball (via the depencency)
+# - copy the content of the debian/ directory
+# - generate a master .dsc file with the "Files:" line for the tarball
+#   with its md5sum, file size in bytes, and name
+# - copy that .dsc master file for each flavor of Debian to be supported
+# - remove the .dsc master file and the .dsc.in file
+# - move the new tarball to the package/ directory
+#
+# Unfortunately, using variables for the md5sum and the file size didn't work out
+# (not even with the GNU make ':=' syntax): They cannot be assigned in the 'actions'
+# part of a rule, only outside rules.
+#
+# The debian/snapper.dsc file is generated by autoconf (see configure.ac) from
+# debian/snapper.dsc.in with @VERSION@ expanded with the content of
+# $toplevel/VERSION.
+#
+# $< is the first depencency of the rule, i.e. snapper-$(VERSION).tar.gz in this case.
+#
+package: snapper-$(VERSION).tar.bz2 package-clean
+       cp debian/* package/
+       echo "$(shell md5sum $< | sed -e 's/\s.*//') $(shell wc -c $<)" >>package/snapper.dsc
+       for DEB in $(DEBIAN_FLAVOURS); do cp -v package/snapper.dsc package/snapper-$${DEB}.dsc; done
+       rm package/snapper.dsc*
        mv snapper-$(VERSION).tar.bz2 package/
 
index a3d7b81a27cd1939506bc3da2dde8cbecdfcf42a..231c0da5eb4319700152498ceffe6067aaebbfe6 100644 (file)
@@ -3,15 +3,18 @@
 # Usage in Jenkins:
 # make -f Makefile.ci package
 
-.PHONY: package
+.PHONY: package always_out_of_date
+
 package: obs-package-from-git
        ./$^ \
-               -P YaST:Head -p snapper \
+               -P filesystems:snapper -p snapper \
                -o .obsdir \
                -c 'make -f Makefile.repo && make package'
 
 # A script that is shared with other projects and should be always refreshed
 URL=https://raw.githubusercontent.com/openSUSE/obs-package-from-git/master/obs-package-from-git
+
 .PHONY: always_out_of_date
+
 obs-package-from-git: always_out_of_date
        wget -O $@ $(URL) && chmod +x $@
index 83341ad87be535aaade7c00b4020737632722587..595579e592124e599df07fb1df80e794a7541ed0 100644 (file)
--- a/Rakefile
+++ b/Rakefile
@@ -15,6 +15,11 @@ Packaging.configuration do |conf|
   conf.package_name.sub!(/-.*/, "") # strip branch name
   conf.package_dir    = ".obsdir" # Makefile.ci puts it there
   conf.skip_license_check << /.*/
+
+  conf.obs_api = "https://api.opensuse.org/"
+  conf.obs_project = "filesystems:snapper"
+  conf.obs_target = "openSUSE_Factory"
+  conf.obs_sr_project = "openSUSE_Factory"
 end
 
 desc 'Pretend to run the test suite'
index 50093f0f536c30ca24b4568c1df1ce9b69886490..33ce6eb33214950d3f4cc595ad6249627d3c2803 100644 (file)
@@ -183,4 +183,5 @@ AC_OUTPUT(
        testsuite-real/Makefile
        testsuite-cmp/Makefile
        package/snapper.spec:snapper.spec.in
+        debian/snapper.dsc:debian/snapper.dsc.in
 )
diff --git a/debian/debian.changelog b/debian/debian.changelog
new file mode 100644 (file)
index 0000000..87081cb
--- /dev/null
@@ -0,0 +1,131 @@
+snapper (0.3.3-0) stable; urgency=low
+
+  * Updated to version 0.3.3
+
+ -- Arvin Schnell <aschnell@suse.com>  Tue,  2 Aug 2016 13:42:22 +0200
+
+snapper (0.2.8-0) stable; urgency=low
+
+  * Updated to version 0.2.8
+
+ -- Arvin Schnell <aschnell@suse.com>  Thu, 27 Aug 2015 12:01:05 +0200
+
+snapper (0.2.6-0) stable; urgency=low
+
+  * Updated to version 0.2.6
+
+ -- Arvin Schnell <aschnell@suse.de>  Tue, 24 Feb 2015 10:58:53 +0100
+
+snapper (0.2.5-0) stable; urgency=low
+
+  * Updated to version 0.2.5
+
+ -- Arvin Schnell <aschnell@suse.de>  Mon, 19 Jan 2015 16:05:14 +0100
+
+snapper (0.2.4-0) stable; urgency=low
+
+  * Updated to version 0.2.4
+
+ -- Arvin Schnell <aschnell@suse.de>  Mon, 15 Sep 2014 11:56:42 +0200
+
+snapper (0.2.3-0) stable; urgency=low
+
+  * Updated to version 0.2.3
+
+ -- Arvin Schnell <aschnell@suse.de>  Tue, 24 Jun 2014 11:22:40 +0200
+
+snapper (0.2.2-0) stable; urgency=low
+
+  * Updated to version 0.2.2
+
+ -- Arvin Schnell <aschnell@suse.de>  Wed, 16 Apr 2014 12:54:13 +0200
+
+snapper (0.2.0-0) stable; urgency=low
+
+  * Updated to version 0.2.0
+
+ -- Arvin Schnell <aschnell@suse.de>  Wed, 29 Jan 2014 16:56:45 +0100
+
+snapper (0.1.8-0) stable; urgency=low
+
+  * Updated to version 0.1.8
+
+ -- Arvin Schnell <aschnell@suse.de>  Tue,  3 Dec 2013 10:48:50 +0100
+
+snapper (0.1.7-0) stable; urgency=low
+
+  * Updated to version 0.1.7
+
+ -- Arvin Schnell <aschnell@suse.de>  Tue,  8 Oct 2013 13:43:52 +0200
+
+snapper (0.1.6-0) stable; urgency=low
+
+  * Updated to version 0.1.6
+
+ -- Arvin Schnell <aschnell@suse.de>  Fri,  6 Sep 2013 17:05:05 +0200
+
+snapper (0.1.5-0) stable; urgency=low
+
+  * Updated to version 0.1.5
+
+ -- Arvin Schnell <aschnell@suse.de>  Fri, 12 Jul 2013 10:53:14 +0200
+
+snapper (0.1.4-0) stable; urgency=low
+
+  * Updated to version 0.1.4
+
+ -- Arvin Schnell <aschnell@suse.de>  Fri, 24 May 2013 09:51:11 +0200
+
+snapper (0.1.3-0) stable; urgency=low
+
+  * Updated to version 0.1.3
+
+ -- Arvin Schnell <aschnell@suse.de>  Thu, 15 Apr 2013 16:29:34 +0200
+
+snapper (0.1.2-0) stable; urgency=low
+
+  * Updated to version 0.1.2
+
+ -- Arvin Schnell <aschnell@suse.de>  Mon, 11 Feb 2013 15:04:51 +0100
+
+snapper (0.1.1-0) stable; urgency=low
+
+  * Updated to version 0.1.1
+
+ -- Arvin Schnell <aschnell@suse.de>  Mon, 12 Nov 2012 16:42:06 +0100
+
+snapper (0.1.0-0) stable; urgency=low
+
+  * Updated to version 0.1.0
+
+ -- Arvin Schnell <aschnell@suse.de>  Mon, 15 Oct 2012 11:08:32 +0100
+
+snapper (0.0.14-0) stable; urgency=low
+
+  * Updated to version 0.0.14
+
+ -- Arvin Schnell <aschnell@suse.de>  Wed, 22 Aug 2012 18:49:42 +0100
+
+snapper (0.0.13-0) stable; urgency=low
+
+  * Updated to version 0.0.13
+
+ -- Arvin Schnell <aschnell@suse.de>  Thu, 26 Jul 2012 15:06:12 +0100
+
+snapper (0.0.12-0) stable; urgency=low
+
+  * Updated to version 0.0.12
+
+ -- Arvin Schnell <aschnell@suse.de>  Tue, 24 Jul 2012 15:07:31 +0100
+
+snapper (0.0.11-0) stable; urgency=low
+
+  * Updated to version 0.0.11
+
+ -- Arvin Schnell <aschnell@suse.de>  Thu, 14 Jun 2012 11:14:21 +0100
+
+snapper (0.0.10-0) stable; urgency=low
+
+  * Initial Debian package
+
+ -- Arvin Schnell <aschnell@suse.de>  Tue, 19 Mar 2012 15:57:09 +0100
diff --git a/debian/debian.control b/debian/debian.control
new file mode 100644 (file)
index 0000000..f94618f
--- /dev/null
@@ -0,0 +1,45 @@
+Source: snapper
+Priority: optional
+Section: admin
+Maintainer: Arvin Schnell <aschnell@suse.com>
+Build-Depends: debhelper (>= 4.1.16), g++, libboost-dev, libboost-thread-dev, libboost-system-dev, libboost-test-dev, libxml2-dev, libz-dev, libdbus-1-dev, libpam-dev, xsltproc, docbook-xsl
+Homepage: http://en.opensuse.org/Portal:Snapper
+
+Package: snapper
+Priority: optional
+Section: admin
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: snapper
+ This package contains snapper, a tool for filesystem snapshot management.
+
+Package: libsnapper
+Priority: optional
+Section: libs
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: snapper
+ This package contains libsnapper, a library for filesystem snapshot management.
+
+Package: libsnapper-dev
+Priority: optional
+Section: libdevel
+Architecture: any
+Description: snapper
+ This package contains header files and documentation for developing with
+ libsnapper.
+
+Package: snapper-zypp-plugin
+Priority: optional
+Section: admin
+Architecture: any
+Description: snapper
+ This package contains a plugin for zypp that makes filesystem snapshots with
+ snapper during commits.
+
+Package: libpam-snapper
+Priority: optional
+Section: admin
+Architecture: any
+Description: pam_snapper
+ A PAM module for calling snapper during user login and logout.
diff --git a/debian/debian.libpam-snapper.install b/debian/debian.libpam-snapper.install
new file mode 100644 (file)
index 0000000..e8957e2
--- /dev/null
@@ -0,0 +1 @@
+lib/security/pam_snapper.so
diff --git a/debian/debian.libpam-snapper.manpages b/debian/debian.libpam-snapper.manpages
new file mode 100644 (file)
index 0000000..4773f27
--- /dev/null
@@ -0,0 +1 @@
+debian/tmp/usr/share/man/man8/pam_snapper.8
diff --git a/debian/debian.libsnapper-dev.install b/debian/debian.libsnapper-dev.install
new file mode 100644 (file)
index 0000000..c217fe9
--- /dev/null
@@ -0,0 +1,3 @@
+usr/include/snapper
+usr/lib/libsnapper.la
+usr/lib/libsnapper.so
diff --git a/debian/debian.libsnapper.install b/debian/debian.libsnapper.install
new file mode 100644 (file)
index 0000000..52e3700
--- /dev/null
@@ -0,0 +1,6 @@
+etc/snapper/config-templates
+etc/snapper/configs
+etc/snapper/filters
+etc/sysconfig/snapper
+usr/lib/libsnapper.so.*
+usr/share/doc/packages/snapper
diff --git a/debian/debian.rules b/debian/debian.rules
new file mode 100644 (file)
index 0000000..cf15d01
--- /dev/null
@@ -0,0 +1,71 @@
+#!/usr/bin/make -f
+
+# 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
+else
+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
+
+       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
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install
diff --git a/debian/debian.snapper-zypp-plugin.install b/debian/debian.snapper-zypp-plugin.install
new file mode 100644 (file)
index 0000000..2d29694
--- /dev/null
@@ -0,0 +1,2 @@
+usr/lib/zypp/plugins/commit/snapper.py
+etc/snapper/zypp-plugin.conf
diff --git a/debian/debian.snapper-zypp-plugin.manpages b/debian/debian.snapper-zypp-plugin.manpages
new file mode 100644 (file)
index 0000000..018b2a5
--- /dev/null
@@ -0,0 +1,2 @@
+debian/tmp/usr/share/man/man8/snapper-zypp-plugin.8
+debian/tmp/usr/share/man/man5/snapper-zypp-plugin.conf.5
diff --git a/debian/debian.snapper.install b/debian/debian.snapper.install
new file mode 100644 (file)
index 0000000..f957310
--- /dev/null
@@ -0,0 +1,8 @@
+etc/cron.daily/snapper
+etc/cron.hourly/snapper
+etc/dbus-1/system.d/org.opensuse.Snapper.conf
+etc/logrotate.d/snapper
+usr/bin/snapper
+usr/sbin/snapperd
+usr/share/dbus-1/system-services/org.opensuse.Snapper.service
+usr/share/locale/*/LC_MESSAGES/snapper.mo
diff --git a/debian/debian.snapper.manpages b/debian/debian.snapper.manpages
new file mode 100644 (file)
index 0000000..03a75bc
--- /dev/null
@@ -0,0 +1,3 @@
+debian/tmp/usr/share/man/man8/snapper.8
+debian/tmp/usr/share/man/man8/snapperd.8
+debian/tmp/usr/share/man/man5/snapper-configs.5
diff --git a/debian/snapper.dsc.in b/debian/snapper.dsc.in
new file mode 100644 (file)
index 0000000..0ffc23c
--- /dev/null
@@ -0,0 +1,13 @@
+Format: 1.0
+Source: snapper
+Version: @VERSION@
+Binary: snapper
+Maintainer: Arvin Schnell <aschnell@suse.com>
+Architecture: any
+Build-Depends: debhelper (>= 4.1.16), acl-dev, g++, libboost-dev, libboost-thread-dev, libboost-system-dev, libboost-test-dev, libxml2-dev, libz-dev, libdbus-1-dev, libpam-dev, xsltproc, docbook-xsl, locales-all
+#
+# The 'Files' line is generated during 'make debian-package':
+# Files:
+#  423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz
+#        md5sum                     size   filename
+Files:
index c29f158b9ad05b7e6132ed8b66e87e9420549771..31ba2f3cc902b57e8249381f97a27e131f6e5ab5 100644 (file)
@@ -1,2 +1,4 @@
 snapper-*.tar.bz2
 snapper.spec
+debian.*
+*.dsc