mirror of
https://github.com/openSUSE/snapper.git
synced 2026-02-05 15:46:00 +01:00
127 lines
4.4 KiB
Makefile
127 lines
4.4 KiB
Makefile
#
|
|
# Makefile.am for snapper
|
|
#
|
|
|
|
SUBDIRS = snapper dbus server client scripts pam data doc po examples \
|
|
testsuite testsuite-real testsuite-cmp stomp zypp-plugin
|
|
|
|
AUTOMAKE_OPTIONS = foreign dist-xz no-dist-gzip
|
|
|
|
doc_DATA = AUTHORS COPYING
|
|
|
|
EXTRA_DIST = $(doc_DATA) VERSION LIBVERSION
|
|
|
|
snapper-$(VERSION).tar.xz: dist-xz
|
|
|
|
DEBIAN_FLAVOURS = \
|
|
Debian_11.0 \
|
|
Debian_12.0 \
|
|
Debian_13.0 \
|
|
Debian_Unstable
|
|
|
|
UBUNTU_FLAVOURS = \
|
|
xUbuntu_20.04 \
|
|
xUbuntu_20.10 \
|
|
xUbuntu_21.04 \
|
|
xUbuntu_21.10 \
|
|
xUbuntu_22.04 \
|
|
xUbuntu_22.10 \
|
|
xUbuntu_23.04 \
|
|
xUbuntu_23.10 \
|
|
xUbuntu_24.04 \
|
|
xUbuntu_24.10 \
|
|
xUbuntu_25.04 \
|
|
xUbuntu_25.10
|
|
|
|
RASPBIAN_FLAVOURS = \
|
|
Raspbian_11 \
|
|
Raspbian_12 \
|
|
Raspbian_13
|
|
|
|
show-debian:
|
|
@echo "Debian flavors: $(DEBIAN_FLAVOURS)"
|
|
|
|
show-ubuntu:
|
|
@echo "Ubuntu flavors: $(UBUNTU_FLAVOURS)"
|
|
|
|
show-raspbian:
|
|
@echo "Raspbian flavors: $(RASPBIAN_FLAVOURS)"
|
|
|
|
package-clean:
|
|
rm -f package/snapper-*.tar.xz
|
|
rm -f package/debian.*
|
|
rm -f package/*.dsc*
|
|
|
|
if ENABLE_COVERAGE
|
|
# Run `make coverage` after all the tests have been run.
|
|
# See also make -f Makefile.repo coveralls
|
|
COVERAGE_INFO = coverage/coverage.info
|
|
.PHONY: coverage
|
|
coverage:
|
|
mkdir -p $(dir $(COVERAGE_INFO))
|
|
lcov --capture --no-external --exclude '*/testsuite*/*' --output-file $(COVERAGE_INFO) --directory . --quiet
|
|
lcov --list $(COVERAGE_INFO)
|
|
genhtml --output-directory coverage --legend --title "Snapper code coverage" -q $(COVERAGE_INFO)
|
|
|
|
clean-local:
|
|
find -name '*.gcda' -o -name '*.gcno' | xargs rm
|
|
endif
|
|
|
|
# Create all the files necessary for building the package with OBS:
|
|
#
|
|
# - Clean up the package/ directory
|
|
# - create a new tarball (via the dependency)
|
|
# - copy the content of the debian/ directory
|
|
# - for both Debian, Ubuntu and Raspbian, generate a master .dsc.in from file with the
|
|
# "Files:" line for the tarball with its md5sum, file size in bytes, and name
|
|
# - copy that .dsc.in master file for each flavor of Debian, Ubuntu or Raspbian to be supported
|
|
# - remove the .dsc.in master file and the .dsc.in.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 .dsc files are generated from a .dsc.in file for each Debian, Ubuntu and Raspbian,
|
|
# which in turn are generated by configure/autoconf from .dsc.in.in files (see
|
|
# configure.ac) where @VERSION@ is expanded with the content of the toplevel
|
|
# VERSION file.
|
|
#
|
|
# $< is the first dependency of the rule, i.e. snapper-$(VERSION).tar.gz in this case.
|
|
|
|
# Build a reproducible tarball:
|
|
# - set the file time stamps according to the latest commit
|
|
# - sort the files (in a locale independent way, use the NULL separator to
|
|
# correctly process also the file names containing a new line)
|
|
# Note: tar >= 1.28 supports "--sort=name" option, unfortunately
|
|
# Leap 42.3 and SLES12-SP3 contain version 1.27.1
|
|
# - use the GNU format (the default POSIX format contains some time stamps)
|
|
# - set the owner and group to "root"
|
|
# - set the fixed modification time
|
|
|
|
# shared tar options
|
|
EXTRA_TAR_OPTIONS = --format=gnu --owner=root --group=root \
|
|
--mtime='$(shell git show -s --format=%ci)' --null --files-from -
|
|
|
|
# redefine the standard automake "tar" command
|
|
am__tar=find "$$tardir" -type f -print0 | LC_ALL=C sort -z | \
|
|
tar -c -f - $(EXTRA_TAR_OPTIONS)
|
|
|
|
package: snapper-$(VERSION).tar.xz package-clean
|
|
find dists/debian -not -name '*.in' -not -name '.*' -type f -print0 | \
|
|
LC_ALL=C sort -z | \
|
|
tar -c -f package/debian.tar --transform='s|dists/||' --show-transformed \
|
|
$(EXTRA_TAR_OPTIONS)
|
|
## use -n option to exclude the original file time stamps to have a reproducible tarball
|
|
gzip -n package/debian.tar
|
|
cp dists/debian/*.dsc.in package/
|
|
echo "$(shell md5sum $< | sed -e 's/\s.*//') $(shell wc -c $<)" >> package/snapper-Debian.dsc.in
|
|
echo "$(shell md5sum $< | sed -e 's/\s.*//') $(shell wc -c $<)" >> package/snapper-xUbuntu.dsc.in
|
|
echo "$(shell md5sum $< | sed -e 's/\s.*//') $(shell wc -c $<)" >> package/snapper-Raspbian.dsc.in
|
|
for FLAV in $(DEBIAN_FLAVOURS); do cp -v package/snapper-Debian.dsc.in package/snapper-$${FLAV}.dsc; done
|
|
for FLAV in $(UBUNTU_FLAVOURS); do cp -v package/snapper-xUbuntu.dsc.in package/snapper-$${FLAV}.dsc; done
|
|
for FLAV in $(RASPBIAN_FLAVOURS); do cp -v package/snapper-Raspbian.dsc.in package/snapper-$${FLAV}.dsc; done
|
|
rm package/snapper*.dsc.in*
|
|
mv snapper-$(VERSION).tar.xz package/
|
|
|