Blame Makefile.am

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