Blame Makefile.am

Packit b040ce
ACLOCAL_AMFLAGS = -I m4
Packit b040ce
DISTCHECK_CONFIGURE_FLAGS = --enable-introspection
Packit b040ce
Packit b040ce
SUBDIRS = . po src dist tests
Packit b040ce
if WITH_GTK_DOC
Packit b040ce
SUBDIRS += docs
Packit b040ce
endif
Packit b040ce
Packit b040ce
dist_noinst_DATA = LICENSE README.md
Packit b040ce
Packit b040ce
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.sub \
Packit b040ce
    configure depcomp install-sh ltmain.sh missing py-compile compile ar-lib \
Packit b040ce
    m4/*.m4
Packit b040ce
Packit b040ce
LIBDIRS = src/.libs
Packit b040ce
PYTHONDIR = src/python
Packit b040ce
Packit b040ce
TEST_PYTHON ?= $(PYTHON)
Packit b040ce
Packit b040ce
ZANATA_PULL_ARGS = --transdir ./po/
Packit b040ce
ZANATA_PUSH_ARGS = --srcdir ./po/ --push-type source --force
Packit b040ce
Packit b040ce
TEST_DEPENDENCIES = $(shell rpm --specfile dist/libbytesize.spec --requires | cut -d' ' -f1 | grep -v ^libbytesize)
Packit b040ce
TEST_DEPENDENCIES += gmp gmp-devel
Packit b040ce
TEST_DEPENDENCIES += mpfr mpfr-devel
Packit b040ce
TEST_DEPENDENCIES += pcre pcre-devel
Packit b040ce
Packit b040ce
# If translations are present, run tests on the .po files before tarring them
Packit b040ce
# up to remove any .po files with errors. Use a weird looking loop since shell
Packit b040ce
# doesn't have a good way to test for a wildcard.
Packit b040ce
dist-hook:
Packit b040ce
	for p in $(distdir)/po/*.po ; do \
Packit b040ce
	    if [ -e "$$p" ]; then \
Packit b040ce
		PYTHONPATH=$(srcdir)/translation-canary python3 -m translation_canary.translated \
Packit b040ce
		    --release $(distdir)/po ; \
Packit b040ce
	    fi ; \
Packit b040ce
	    break ; \
Packit b040ce
	done
Packit b040ce
Packit b040ce
run-ipython: all
Packit Service 0a675f
	LD_LIBRARY_PATH=${LIBDIRS} PYTHONPATH=$(PYTHONDIR) ipython3
Packit b040ce
Packit b040ce
check-requires:
Packit b040ce
	@echo "*** Checking if the dependencies required for testing and analysis are available ***"
Packit b040ce
	@status=0 ; \
Packit b040ce
	for pkg in $(TEST_DEPENDENCIES) ; do \
Packit b040ce
		test_output="$$(rpm -q --whatprovides "$$pkg")" ; \
Packit b040ce
		if [ $$? != 0 ]; then \
Packit b040ce
			echo "$$test_output" ; \
Packit b040ce
			status=1 ; \
Packit b040ce
		fi ; \
Packit b040ce
	done ; \
Packit b040ce
	exit $$status
Packit b040ce
Packit b040ce
install-requires:
Packit b040ce
	@echo "*** Installing the dependencies required for testing and analysis ***"
Packit b040ce
	dnf install -y $(TEST_DEPENDENCIES)
Packit b040ce
Packit b040ce
test:
Packit b040ce
	$(MAKE) check
Packit b040ce
Packit b040ce
ci:
Packit b040ce
	$(MAKE) distcheck; \
Packit b040ce
	status="$$?" ; \
Packit b040ce
	find . -name 'test-suite.log' -exec cat '{}' \; ; \
Packit b040ce
	test "$$status" = "0"
Packit b040ce
Packit b040ce
po-pull:
Packit b040ce
	@which zanata >/dev/null 2>&1 || ( echo "You need to install Zanata client to download translation files"; exit 1 )
Packit b040ce
	zanata pull $(ZANATA_PULL_ARGS)
Packit b040ce
Packit b040ce
tag:
Packit b040ce
	@TAG="$(PACKAGE_VERSION)" ; \
Packit b040ce
	git tag -a -s -m "Tag as $$TAG" -f "$$TAG" && \
Packit b040ce
	echo "Tagged as $$TAG"
Packit b040ce
Packit b040ce
rpmlog:
Packit b040ce
	@cl=`grep -n %changelog dist/libbytesize.spec.in |cut -d : -f 1` ; \
Packit b040ce
	version_release=`tail --lines=+$$(($$cl + 1)) dist/libbytesize.spec.in|head -1|cut -d- -f2-3|sed 's/ //g'|sed -r 's/-[0-9]+//'` ; \
Packit b040ce
	git log --no-merges --pretty="format:- %s (%ae)" "$$version_release.." |sed -e 's/@.*)/)/' ; \
Packit b040ce
	echo
Packit b040ce
Packit b040ce
shortlog:
Packit b040ce
	git shortlog -r --no-merges --format="- %s" -w76,0,2 $$(git tag -l | grep '^[0-9]' | tail -n 1)..HEAD | sed 's/"):$"/"):\n"/g'
Packit b040ce
Packit b040ce
bumpver:
Packit b040ce
	@VERSION=`echo $(PACKAGE_VERSION)|sed -r 's/(.*)\.([0-9]+)/\1/'` ; \
Packit b040ce
	SUBVERSION=`echo $(PACKAGE_VERSION)|sed -r 's/.*\.([0-9]+)/\1/'` ; \
Packit b040ce
	NEWSUBVERSION=$$(($$SUBVERSION + 1)) ; \
Packit b040ce
	DATELINE="* `date "+%a %b %d %Y"` `git config user.name` <`git config user.email`> - $$VERSION.$$NEWSUBVERSION-1"  ; \
Packit b040ce
	cl=`grep -n %changelog dist/libbytesize.spec.in |cut -d : -f 1` ; \
Packit b040ce
	tail --lines=+$$(($$cl + 1)) dist/libbytesize.spec.in > speclog ; \
Packit b040ce
	(head -n $$cl dist/libbytesize.spec.in ; echo "$$DATELINE" ; make --quiet rpmlog 2>/dev/null ; echo ""; cat speclog) > dist/libbytesize.spec.in.new ; \
Packit b040ce
	mv dist/libbytesize.spec.in.new dist/libbytesize.spec.in ; rm -f speclog ; \
Packit b040ce
	sed -ri "s/(AC_INIT\(\[$(PACKAGE_NAME)\], \[)[0-9]+\.[0-9]+(\],.*)/\1$$VERSION.$$NEWSUBVERSION\2/" configure.ac ; \
Packit b040ce
	sed -ri "s/Version:(\\s+)[-0-9.]+/Version:\\1$$VERSION.$$NEWSUBVERSION/" dist/libbytesize.spec.in ;
Packit Service a8514a
	$(MAKE) -C po/ $(PACKAGE_NAME).pot-update
Packit b040ce
Packit b040ce
archive: po-pull
Packit b040ce
	$(MAKE) distcheck
Packit b040ce
Packit b040ce
local: all
Packit b040ce
	[ -f ./po/en_US.po ] || msginit -i ./po/$(PACKAGE_NAME).pot -o ./po/en_US.po --no-translator
Packit b040ce
	$(MAKE) dist
Packit b040ce
Packit b040ce
srpm: local
Packit b040ce
	rpmbuild -ts --nodeps $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz
Packit b040ce
	rm -f $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz
Packit b040ce
Packit b040ce
rpm: local
Packit b040ce
	rpmbuild -tb --nodeps $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz
Packit b040ce
	rm -f $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz
Packit b040ce
Packit b040ce
release: tag
Packit b040ce
	$(MAKE) archive
Packit b040ce
	$(MAKE) -C po/ $(PACKAGE_NAME).pot-update
Packit b040ce
	zanata push $(ZANATA_PUSH_ARGS)
Packit b040ce
Packit b040ce
EXTRA_DIST = config.rpath
Packit b040ce
Packit b040ce
# Include the xgettext wrapper so pot-update can be run from the source distribution
Packit b040ce
# This is needed for make distcheck.
Packit b040ce
EXTRA_DIST += $(srcdir)/translation-canary/xgettext_werror.sh