forked from rhinstaller/anaconda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
208 lines (177 loc) · 7.81 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# Makefile.am for anaconda
#
# Copyright (C) 2009 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Author: David Cantrell <[email protected]>
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = data docs dracut po pyanaconda scripts tests widgets utils
EXTRA_DIST = config.rpath COPYING .coveragerc
# Include the xgettext wrapper so pot-update can be run from the source distribution
# This is needed for make distcheck.
EXTRA_DIST += $(srcdir)/translation-canary/xgettext_werror.sh
MAINTAINERCLEANFILES = Makefile.in config.guess config.h.in config.sub \
depcomp install-sh ltmain.sh missing ABOUT-NLS \
INSTALL aclocal.m4 configure *.pyc py-compile \
m4/* config.rpath po/Makefile.in.in po/Rules-quot \
test-driver
CLEANFILES = *~
dist_noinst_DATA = $(PACKAGE_NAME).spec
dist_sbin_SCRIPTS = anaconda.py
install-exec-hook:
cd $(DESTDIR)$(sbindir) && mv anaconda.py anaconda
uninstall-hook:
-cd $(DESTDIR)$(sbindir) && rm -f anaconda
ARCHIVE_TAG = $(PACKAGE_NAME)-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)
ZANATA_PULL_ARGS = --transdir $(srcdir)/po/
ZANATA_PUSH_ARGS = --srcdir $(srcdir)/po/ --push-type source --force
RC_RELEASE ?= $(shell date -u +0.1.%Y%m%d%H%M%S)
MOCKCHROOT ?= fedora-rawhide-$(shell uname -m)
COVERAGE ?= coverage3
USER_SITE_PACKAGES ?= $(shell $(PYTHON) -m site --user-site)
ROOT_SITE_PACKAGES ?= $(shell sudo $(PYTHON) -m site --user-site)
# Run tests on the translations before tarring them up
dist-hook:
PYTHONPATH=$(srcdir)/translation-canary python3 -m translation_canary.translated --release $(distdir)
tag:
@git tag -s -a -m "Tag as $(ARCHIVE_TAG)" $(ARCHIVE_TAG)
@echo "Tagged as $(ARCHIVE_TAG)"
po-pull:
rpm -q zanata-python-client &>/dev/null || ( echo "need to run: dnf install zanata-python-client"; exit 1 )
zanata pull $(ZANATA_PULL_ARGS)
po-empty:
for lingua in $$(grep -v '^#' $(srcdir)/po/LINGUAS) ; do \
[ -f $(srcdir)/po/$$lingua.po ] || \
msginit -i $(srcdir)/po/$(PACKAGE_NAME).pot -o $(srcdir)/po/$$lingua.po --no-translator || \
exit 1 ; \
done
# Try to fetch the real .po files, but if that fails use the empty ones
po-fallback:
$(MAKE) po-pull || $(MAKE) po-empty
scratch: po-fallback
$(MAKE) ARCHIVE_TAG=HEAD dist
git checkout -- $(srcdir)/po/$(PACKAGE_NAME).pot
scratch-bumpver: po-empty
@opts="-S -n $(PACKAGE_NAME) -v $(PACKAGE_VERSION) -r $(PACKAGE_RELEASE) -b $(PACKAGE_BUGREPORT) --newrelease $(RC_RELEASE)" ; \
if [ ! -z "$(IGNORE)" ]; then \
opts="$${opts} -i $(IGNORE)" ; \
fi ; \
if [ ! -z "$(MAP)" ]; then \
opts="$${opts} -m $(MAP)" ; \
fi ; \
if [ ! -z "$(BZDEBUG)" ]; then \
opts="$${opts} -d" ; \
fi ; \
( cd $(srcdir) && scripts/makebumpver --skip-zanata $${opts} ) || exit 1 ; \
$(MAKE) -C po $(PACKAGE_NAME).pot-update
release:
$(MAKE) dist && $(MAKE) tag && git checkout -- $(srcdir)/po/$(PACKAGE_NAME).pot
rc-release: scratch-bumpver scratch
mock -r $(MOCKCHROOT) --scrub all || exit 1
mock -r $(MOCKCHROOT) --buildsrpm --spec ./$(PACKAGE_NAME).spec --sources . --resultdir $(PWD) || exit 1
mock -r $(MOCKCHROOT) --rebuild *src.rpm --resultdir $(PWD) || exit 1
bumpver: po-pull
@opts="-n $(PACKAGE_NAME) -v $(PACKAGE_VERSION) -r $(PACKAGE_RELEASE) -b $(PACKAGE_BUGREPORT)" ; \
if [ ! -z "$(IGNORE)" ]; then \
opts="$${opts} -i $(IGNORE)" ; \
fi ; \
if [ ! -z "$(MAP)" ]; then \
opts="$${opts} -m $(MAP)" ; \
fi ; \
if [ ! -z "$(BZDEBUG)" ]; then \
opts="$${opts} -d" ; \
fi ; \
if [ ! -z "$(SKIP_ACKS)" ]; then \
opts="$${opts} -s" ; \
fi ; \
( cd $(srcdir) && scripts/makebumpver $${opts} ) || exit 1 ; \
$(MAKE) -C po $(PACKAGE_NAME).pot-update && \
zanata push $(ZANATA_PUSH_ARGS)
# Install all packages specified as BuildRequires in the Anaconda specfile
# -> installs packages needed to build Anaconda
# don't try to install s390utils-devel on non-s390 arches
install-buildrequires:
srcdir="$(srcdir)" && \
: $${srcdir:=.} && \
pkglist="$$(grep ^BuildRequires: $${srcdir}/anaconda.spec.in | cut -d ' ' -f 2)" && \
if ! [[ $$(uname -m) =~ s390x? ]]; then \
pkglist=$$(echo "$$pkglist" | grep -v s390utils) ; \
fi ; \
dnf install $$pkglist gettext-devel libtool
# Install all packages specified as Requires in the Anaconda specfile
# -> installs packages needed to run Anaconda and the Anaconda unit tests
# Filter out the %{name} entries required by -devel
install-requires:
srcdir="$(srcdir)" && \
: $${srcdir:=.} && \
dnf install $$(grep ^Requires: $${srcdir}/anaconda.spec.in | grep -v %{name} | cut -d ' ' -f 2 | grep -v ^anaconda)
# Install all packages required for running the tests
install-test-requires: install-buildrequires install-requires
dnf install bzip2 cppcheck gnome-icon-theme gnome-icon-theme-symbolic \
lorax mock parallel rpm-ostree virt-install pykickstart spin-kickstarts \
python3-rpmfluff python3-mock python3-pocketlint python3-nose-testconfig \
python3-sphinx_rtd_theme libvirt-python3 python3-lxml python3-dogtail
# Generate an updates.img based on the changed files since the release
# was tagged. Updates are copied to ./updates-img and then the image is
# created. By default, the updates subdirectory is removed after the
# image is made, but if you want to keep it around, run:
# make updates.img KEEP=y
updates:
@opts="-c" ; \
keep="$$(echo $(KEEP) | cut -c1 | tr [a-z] [A-Z])" ; \
if [ "$${keep}" = "Y" ]; then \
opts="$${opts} -k" ; \
fi ; \
( cd $(srcdir) && scripts/makeupdates $${opts} -b '$(abs_builddir)' )
# GUI TESTING
runglade:
ANACONDA_DATA=$(srcdir)/data \
ANACONDA_WIDGETS_OVERRIDES=$(srcdir)/widgets/python \
ANACONDA_WIDGETS_DATA=$(srcdir)/widgets/data \
ANACONDA_INSTALL_CLASSES=$(srcdir)/pyanaconda/installclasses \
PYTHONPATH=$(srcdir):$(builddir)/pyanaconda/isys/.libs:$(srcdir)/widgets/python/:$(builddir)/widgets/src/.libs/ \
LD_LIBRARY_PATH=$(builddir)/widgets/src/.libs \
UIPATH=$(srcdir)/pyanaconda/ui/gui/ \
GI_TYPELIB_PATH=$(builddir)/widgets/src/ \
GLADE_CATALOG_SEARCH_PATH=$(srcdir)/widgets/glade \
GLADE_MODULE_SEARCH_PATH=$(builddir)/widgets/src/.libs \
glade ${GLADE_FILE}
ci: rc-release
@rm -f tests/test-suite.log.*
@mkdir -p $(USER_SITE_PACKAGES)
@cp $(abs_builddir)/tests/usercustomize.py $(USER_SITE_PACKAGES)
@sudo mkdir -p $(ROOT_SITE_PACKAGES)
@sudo cp $(abs_builddir)/tests/usercustomize.py $(ROOT_SITE_PACKAGES)
$(MAKE) -C utils/dd
$(MAKE) TMPDIR=/var/tmp COVERAGE_PROCESS_START=$(abs_builddir)/.coveragerc \
TEST_SUITE_LOG=test-suite.log.$$$$ check
@tail -n 1 tests/gettext_tests/*.log > tests/gettext_tests/gettext_tests.log
@sudo $(MAKE) TMPDIR=/var/tmp COVERAGE_PROCESS_START=$(abs_builddir)/.coveragerc \
TEST_SUITE_LOG=test-suite.log.$$$$ TESTS=nosetests_root.sh check
@mkdir -p repo
@mv *rpm repo
@createrepo -p repo
@sudo $(MAKE) TMPDIR=/var/tmp COVERAGE_PROCESS_START=$(abs_builddir)/.coveragerc \
TEST_SUITE_LOG=test-suite.log.$$$$ TESTS=install/run_install_test.sh \
TEST_ANACONDA_REPO=file://$(abs_builddir)/repo/ check
@cat tests/test-suite.log.* > tests/test-suite.log
@rm -f tests/test-suite.log.*
@rm -f $(USER_SITE_PACKAGES)/usercustomize.py
@sudo rm -f $(ROOT_SITE_PACKAGES)/usercustomize.py
$(MAKE) coverage-report
coverage-report:
$(COVERAGE) combine tests/.coverage.*
$(COVERAGE) report --omit "tests/*" > tests/coverage-report.log
@cat tests/coverage-report.log