2013-03-23 15:43:05 +01:00
|
|
|
all: svtplay-dl
|
|
|
|
|
2015-03-21 19:05:44 +01:00
|
|
|
.PHONY: test cover doctest pylint svtplay-dl \
|
|
|
|
release clean_releasedir $(RELEASE_DIR)
|
2013-04-21 10:48:20 +02:00
|
|
|
|
2015-05-26 19:52:38 +02:00
|
|
|
# These variables describe the latest release:
|
2017-09-19 00:47:03 +02:00
|
|
|
VERSION = 1.9.6
|
2016-03-28 21:32:16 +02:00
|
|
|
LATEST_RELEASE = $(VERSION)
|
2015-05-26 19:52:38 +02:00
|
|
|
|
|
|
|
# If we build a new release, this is what it will be called:
|
2016-03-28 21:32:16 +02:00
|
|
|
NEW_RELEASE = $(VERSION)
|
2015-05-26 19:52:38 +02:00
|
|
|
RELEASE_DIR = svtplay-dl-$(NEW_RELEASE)
|
2013-03-23 15:43:05 +01:00
|
|
|
|
2013-05-27 20:32:51 +02:00
|
|
|
PREFIX ?= /usr/local
|
|
|
|
BINDIR = $(PREFIX)/bin
|
|
|
|
MANDIR = $(PREFIX)/share/man/man1
|
2013-05-27 20:28:08 +02:00
|
|
|
|
|
|
|
# Compress the manual if MAN_GZIP is set to y,
|
|
|
|
ifeq ($(MAN_GZIP),y)
|
|
|
|
MANFILE_EXT = .gz
|
|
|
|
endif
|
|
|
|
MANFILE = svtplay-dl.1$(MANFILE_EXT)
|
|
|
|
|
|
|
|
# As pod2man is a perl tool, we have to jump through some hoops
|
|
|
|
# to remove references to perl.. :-)
|
2015-05-26 19:52:38 +02:00
|
|
|
POD2MAN ?= pod2man --section 1 --utf8 \
|
|
|
|
--center "svtplay-dl manual" \
|
|
|
|
--release "svtplay-dl $(VERSION)" \
|
|
|
|
--date "$(LATEST_RELEASE_DATE)"
|
2013-05-27 20:28:08 +02:00
|
|
|
|
2014-02-02 15:10:17 +01:00
|
|
|
PYTHON ?= /usr/bin/env python
|
2013-04-21 11:26:43 +02:00
|
|
|
export PYTHONPATH=lib
|
2013-03-23 15:43:05 +01:00
|
|
|
|
2014-03-19 23:16:00 +01:00
|
|
|
# If you don't have a python3 environment (e.g. mock for py3 and
|
|
|
|
# nosetests3), you can remove the -3 flag.
|
2014-09-07 15:27:26 +02:00
|
|
|
TEST_OPTS ?= -2 -3
|
2014-03-19 23:16:00 +01:00
|
|
|
|
2013-05-27 20:28:08 +02:00
|
|
|
install: svtplay-dl $(MANFILE)
|
2013-03-23 15:43:05 +01:00
|
|
|
install -d $(DESTDIR)$(BINDIR)
|
2013-05-27 20:28:08 +02:00
|
|
|
install -d $(DESTDIR)$(MANDIR)
|
2013-03-23 15:43:05 +01:00
|
|
|
install -m 755 svtplay-dl $(DESTDIR)$(BINDIR)
|
2015-02-01 16:09:57 +01:00
|
|
|
install -m 644 $(MANFILE) $(DESTDIR)$(MANDIR)
|
2013-03-23 15:43:05 +01:00
|
|
|
|
2013-04-21 14:08:41 +02:00
|
|
|
svtplay-dl: $(PYFILES)
|
|
|
|
$(MAKE) -C lib
|
2017-09-25 22:52:47 +02:00
|
|
|
mv -f lib/svtplay-dl .
|
2013-03-23 17:07:36 +01:00
|
|
|
|
2013-05-27 20:28:08 +02:00
|
|
|
svtplay-dl.1: svtplay-dl.pod
|
|
|
|
rm -f $@
|
|
|
|
$(POD2MAN) $< $@
|
|
|
|
|
|
|
|
svtplay-dl.1.gz: svtplay-dl.1
|
|
|
|
rm -f $@
|
|
|
|
gzip -9 svtplay-dl.1
|
|
|
|
|
2013-03-23 17:07:36 +01:00
|
|
|
test:
|
2015-10-25 16:04:07 +01:00
|
|
|
sh scripts/run-tests.sh $(TEST_OPTS)
|
2013-03-23 17:25:07 +01:00
|
|
|
|
2013-04-21 10:48:20 +02:00
|
|
|
cover:
|
2015-10-25 16:04:07 +01:00
|
|
|
sh scripts/run-tests.sh -C
|
2013-04-21 10:48:20 +02:00
|
|
|
|
2013-03-23 17:25:07 +01:00
|
|
|
pylint:
|
2014-12-26 02:11:19 +01:00
|
|
|
$(MAKE) -C lib pylint
|
2013-05-27 20:28:08 +02:00
|
|
|
|
2015-03-22 18:00:25 +01:00
|
|
|
doctest: svtplay-dl
|
|
|
|
sh scripts/diff_man_help.sh
|
|
|
|
|
2015-03-21 19:05:44 +01:00
|
|
|
$(RELEASE_DIR): clean_releasedir
|
2015-05-26 19:52:38 +02:00
|
|
|
mkdir $(RELEASE_DIR)
|
|
|
|
cd $(RELEASE_DIR) && git clone -b master ../ . && \
|
2016-01-10 21:34:54 +01:00
|
|
|
make $(MANFILE)
|
2015-03-21 19:05:44 +01:00
|
|
|
|
|
|
|
clean_releasedir:
|
|
|
|
rm -rf $(RELEASE_DIR)
|
|
|
|
|
|
|
|
release: $(RELEASE_DIR) release-test
|
2015-03-24 23:54:03 +01:00
|
|
|
set -e; cd $(RELEASE_DIR) && \
|
2016-05-05 14:01:03 +02:00
|
|
|
sed -i -re 's/^\(__version__ = \).*/\1"$(NEW_RELEASE)"/' lib/svtplay_dl/__init__.py;\
|
2016-01-10 21:34:54 +01:00
|
|
|
git add Makefile lib/svtplay_dl/__init__.py; \
|
2016-01-10 21:12:45 +01:00
|
|
|
git commit -m "New release $(NEW_RELEASE)";
|
2015-03-21 19:05:44 +01:00
|
|
|
(cd $(RELEASE_DIR) && git format-patch --stdout HEAD^) | git am
|
|
|
|
|
2015-05-26 19:52:38 +02:00
|
|
|
git tag -m "New version $(NEW_RELEASE)" \
|
2015-10-08 23:25:05 +02:00
|
|
|
-m "$$(git log --oneline $$(git describe --tags --abbrev=0 HEAD^)..HEAD^)" \
|
2015-05-26 19:52:38 +02:00
|
|
|
$(NEW_RELEASE)
|
2015-03-21 19:05:44 +01:00
|
|
|
|
|
|
|
make clean_releasedir
|
|
|
|
|
|
|
|
release-test: $(RELEASE_DIR)
|
|
|
|
make -C $(RELEASE_DIR) test
|
|
|
|
make -C $(RELEASE_DIR) doctest
|
|
|
|
|
2013-05-27 20:28:08 +02:00
|
|
|
clean:
|
|
|
|
$(MAKE) -C lib clean
|
|
|
|
rm -f svtplay-dl
|
|
|
|
rm -f $(MANFILE)
|