1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-12-11 20:34:18 +01:00

Remove old method to build

This commit is contained in:
Johan Andersson 2018-05-22 22:18:56 +02:00
parent 34f84db667
commit 9268ef269e
3 changed files with 4 additions and 98 deletions

View File

@ -7,14 +7,6 @@ all: svtplay-dl
VERSION = 1.9.11 VERSION = 1.9.11
LATEST_RELEASE = $(VERSION) LATEST_RELEASE = $(VERSION)
# If we build a new release, this is what it will be called:
NEW_RELEASE = $(VERSION)
RELEASE_DIR = svtplay-dl-$(NEW_RELEASE)
PREFIX ?= /usr/local
BINDIR = $(PREFIX)/bin
MANDIR = $(PREFIX)/share/man/man1
# Compress the manual if MAN_GZIP is set to y, # Compress the manual if MAN_GZIP is set to y,
ifeq ($(MAN_GZIP),y) ifeq ($(MAN_GZIP),y)
MANFILE_EXT = .gz MANFILE_EXT = .gz
@ -35,16 +27,6 @@ export PYTHONPATH=lib
# nosetests3), you can remove the -3 flag. # nosetests3), you can remove the -3 flag.
TEST_OPTS ?= -2 -3 TEST_OPTS ?= -2 -3
install: svtplay-dl $(MANFILE)
install -d $(DESTDIR)$(BINDIR)
install -d $(DESTDIR)$(MANDIR)
install -m 755 svtplay-dl $(DESTDIR)$(BINDIR)
install -m 644 $(MANFILE) $(DESTDIR)$(MANDIR)
svtplay-dl: $(PYFILES)
$(MAKE) -C lib
mv -f lib/svtplay-dl .
svtplay-dl.1: svtplay-dl.pod svtplay-dl.1: svtplay-dl.pod
rm -f $@ rm -f $@
$(POD2MAN) $< $@ $(POD2MAN) $< $@
@ -65,32 +47,13 @@ pylint:
doctest: svtplay-dl doctest: svtplay-dl
sh scripts/diff_man_help.sh sh scripts/diff_man_help.sh
$(RELEASE_DIR): clean_releasedir release:
mkdir $(RELEASE_DIR)
cd $(RELEASE_DIR) && git clone -b master ../ . && \
make $(MANFILE)
clean_releasedir:
rm -rf $(RELEASE_DIR)
release: $(RELEASE_DIR) release-test
set -e; cd $(RELEASE_DIR) && \
sed -i -re 's/^\(__version__ = \).*/\1"$(NEW_RELEASE)"/' lib/svtplay_dl/__init__.py;\
git add Makefile lib/svtplay_dl/__init__.py; \
git commit -m "New release $(NEW_RELEASE)";
(cd $(RELEASE_DIR) && git format-patch --stdout HEAD^) | git am
git tag -m "New version $(NEW_RELEASE)" \ git tag -m "New version $(NEW_RELEASE)" \
-m "$$(git log --oneline $$(git describe --tags --abbrev=0 HEAD^)..HEAD^)" \ -m "$$(git log --oneline $$(git describe --tags --abbrev=0 HEAD^)..HEAD^)" \
$(NEW_RELEASE) $(NEW_RELEASE)
make clean_releasedir
release-test: $(RELEASE_DIR)
make -C $(RELEASE_DIR) test
make -C $(RELEASE_DIR) doctest
clean: clean:
$(MAKE) -C lib clean $(MAKE) -C lib clean
rm -f svtplay-dl rm -f svtplay-dl
rm -f $(MANFILE) rm -f $(MANFILE)
rm -f .tox

View File

@ -88,17 +88,11 @@ To install it, run
:: ::
# as root: sudo python3 setup.py install
python3 setup.py install
# or the old method
make
# as root:
make install
After install After install
============= =============
:: ::
svtplay-dl [options] URL svtplay-dl [options] URL

View File

@ -1,51 +0,0 @@
PYLINT_OPTS = --reports=no -d I -d C -d R -d W0511
all: svtplay-dl
clean:
find . -name '*.pyc' -exec rm {} \;
rm -f svtplay-dl
pylint:
pylint $(PYLINT_OPTS) svtplay_dl
export PACKAGES = svtplay_dl \
svtplay_dl.fetcher \
svtplay_dl.utils \
svtplay_dl.service \
svtplay_dl.subtitle \
svtplay_dl.postprocess
export PYFILES = $(sort $(addsuffix /*.py,$(subst .,/,$(PACKAGES))))
PYTHON ?= /usr/bin/env python3
VERSION = $(shell git describe 2>/dev/null || echo $(LATEST_RELEASE)-unknown)
svtplay-dl: $(PYFILES)
@# Verify that there's no .build already \
! [ -d .build ] || { \
echo "ERROR: build already in progress? (or remove $(PWD)/.build/)"; \
exit 1; \
}; \
mkdir -p .build
@# Stage the files in .build for postprocessing
for py in $(PYFILES); do \
install -d ".build/$${py%/*}"; \
install $$py .build/$$py; \
done
# Add git version info to __version__, seen in --version
sed -i -e 's/^__version__ = "\([^"]\+\)"$$/__version__ = "$(VERSION)"/' \
.build/svtplay_dl/__init__.py
@# reset timestamps, to avoid non-determinism in zip file
find .build/ -exec touch -m -t 198001010000 {} \;
(cd .build && zip -X --quiet svtplay-dl $(PYFILES))
(cd .build && zip -X --quiet --junk-paths svtplay-dl svtplay_dl/__main__.py)
echo '#!$(PYTHON)' > svtplay-dl
cat .build/svtplay-dl.zip >> svtplay-dl
rm -rf .build
chmod a+x svtplay-dl