-
Notifications
You must be signed in to change notification settings - Fork 130
/
Makefile.am
128 lines (108 loc) · 4.44 KB
/
Makefile.am
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#
# 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_10.0 \
Debian_11.0 \
Debian_12.0 \
Debian_Unstable
UBUNTU_FLAVOURS = \
xUbuntu_18.04 \
xUbuntu_18.10 \
xUbuntu_19.04 \
xUbuntu_19.10 \
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
RASPBIAN_FLAVOURS = \
Raspbian_10 \
Raspbian_11 \
Raspbian_12
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/