2005-11-21 19:21:25 +01:00
|
|
|
#
|
2007-08-29 20:30:26 +02:00
|
|
|
# gPodder - A media aggregator and podcast client
|
2018-01-28 19:39:53 +01:00
|
|
|
# Copyright (c) 2005-2018 The gPodder Team
|
2007-08-29 20:30:26 +02:00
|
|
|
#
|
|
|
|
# gPodder is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# gPodder 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 General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
2005-11-21 19:21:25 +01:00
|
|
|
#
|
|
|
|
|
|
|
|
##########################################################################
|
|
|
|
|
2012-02-23 20:38:55 +01:00
|
|
|
BINFILE = bin/gpodder
|
2018-02-21 22:06:11 +01:00
|
|
|
MANPAGES = share/man/man1/gpodder.1 share/man/man1/gpo.1
|
2009-09-13 23:37:23 +02:00
|
|
|
|
2012-02-23 20:38:55 +01:00
|
|
|
GPODDER_SERVICE_FILE=share/dbus-1/services/org.gpodder.service
|
2010-01-08 01:58:15 +01:00
|
|
|
GPODDER_SERVICE_FILE_IN=$(addsuffix .in,$(GPODDER_SERVICE_FILE))
|
|
|
|
|
2014-09-27 15:01:06 +02:00
|
|
|
DESKTOP_FILES_IN=$(wildcard share/applications/*.desktop.in)
|
|
|
|
DESKTOP_FILES_IN_H=$(patsubst %.desktop.in,%.desktop.in.h,$(DESKTOP_FILES_IN))
|
|
|
|
DESKTOP_FILES=$(patsubst %.desktop.in,%.desktop,$(DESKTOP_FILES_IN))
|
2011-04-11 20:06:06 +02:00
|
|
|
|
2012-02-25 15:38:15 +01:00
|
|
|
MESSAGES = po/messages.pot
|
|
|
|
POFILES = $(wildcard po/*.po)
|
|
|
|
LOCALEDIR = share/locale
|
|
|
|
MOFILES = $(patsubst po/%.po,$(LOCALEDIR)/%/LC_MESSAGES/gpodder.mo, $(POFILES))
|
|
|
|
|
|
|
|
UIFILES=$(wildcard share/gpodder/ui/gtk/*.ui)
|
|
|
|
UIFILES_H=$(subst .ui,.ui.h,$(UIFILES))
|
|
|
|
GETTEXT_SOURCE=$(wildcard src/gpodder/*.py \
|
|
|
|
src/gpodder/gtkui/*.py \
|
|
|
|
src/gpodder/gtkui/interface/*.py \
|
|
|
|
src/gpodder/gtkui/desktop/*.py \
|
|
|
|
src/gpodder/plugins/*.py \
|
|
|
|
share/gpodder/extensions/*.py)
|
|
|
|
|
|
|
|
GETTEXT_SOURCE += $(UIFILES_H)
|
2020-04-03 18:41:49 +02:00
|
|
|
GETTEXT_SOURCE += $(wildcard bin/*[^~])
|
2014-09-27 15:01:06 +02:00
|
|
|
GETTEXT_SOURCE += $(DESKTOP_FILES_IN_H)
|
2012-02-25 15:38:15 +01:00
|
|
|
|
2006-04-13 12:10:33 +02:00
|
|
|
DESTDIR ?= /
|
2007-03-17 13:58:49 +01:00
|
|
|
PREFIX ?= /usr
|
2006-04-13 12:10:33 +02:00
|
|
|
|
2016-11-21 23:32:50 +01:00
|
|
|
PYTHON ?= python3
|
2012-02-23 20:38:55 +01:00
|
|
|
HELP2MAN ?= help2man
|
2010-02-13 02:52:25 +01:00
|
|
|
|
2021-01-14 21:45:58 +01:00
|
|
|
PYTEST ?= $(shell which pytest || which pytest-3)
|
|
|
|
|
2005-11-21 19:21:25 +01:00
|
|
|
##########################################################################
|
|
|
|
|
2006-04-08 08:50:20 +02:00
|
|
|
help:
|
2012-02-23 20:38:55 +01:00
|
|
|
@cat tools/make-help.txt
|
2006-07-30 15:17:27 +02:00
|
|
|
|
|
|
|
##########################################################################
|
|
|
|
|
2009-02-25 14:23:03 +01:00
|
|
|
unittest:
|
2021-01-14 21:45:58 +01:00
|
|
|
LC_ALL=C PYTHONPATH=src/ $(PYTEST) --ignore=tests --ignore=src/gpodder/utilwin32ctypes.py --doctest-modules src/gpodder/util.py src/gpodder/jsonconfig.py
|
|
|
|
LC_ALL=C PYTHONPATH=src/ $(PYTEST) tests --ignore=src/gpodder/utilwin32ctypes.py --ignore=src/mygpoclient --cov=gpodder
|
2008-04-06 02:19:03 +02:00
|
|
|
|
2021-03-28 12:46:12 +02:00
|
|
|
ISORTOPTS := -c share src/gpodder tools bin/* *.py
|
2018-02-10 14:09:56 +01:00
|
|
|
lint:
|
2018-07-28 14:29:42 +02:00
|
|
|
pycodestyle share src/gpodder tools bin/* *.py
|
2021-03-28 12:46:12 +02:00
|
|
|
isort -q $(ISORTOPTS) || isort --df $(ISORTOPTS)
|
2018-02-10 14:09:56 +01:00
|
|
|
|
|
|
|
|
2007-03-07 15:53:05 +01:00
|
|
|
release: distclean
|
2010-02-13 02:52:25 +01:00
|
|
|
$(PYTHON) setup.py sdist
|
2005-11-21 19:21:25 +01:00
|
|
|
|
2014-09-27 15:01:06 +02:00
|
|
|
releasetest: unittest $(DESKTOP_FILES) $(POFILES)
|
2015-12-01 21:49:03 +01:00
|
|
|
for f in $(DESKTOP_FILES); do desktop-file-validate $$f; done
|
2016-02-03 20:21:46 +01:00
|
|
|
for f in $(POFILES); do msgfmt --check $$f; done
|
2008-01-22 10:28:09 +01:00
|
|
|
|
2010-01-08 01:58:15 +01:00
|
|
|
$(GPODDER_SERVICE_FILE): $(GPODDER_SERVICE_FILE_IN)
|
|
|
|
sed -e 's#__PREFIX__#$(PREFIX)#' $< >$@
|
|
|
|
|
2014-09-27 15:01:06 +02:00
|
|
|
%.desktop: %.desktop.in $(POFILES)
|
|
|
|
sed -e 's#__PREFIX__#$(PREFIX)#' $< >$@.tmp
|
|
|
|
intltool-merge -d -u po $@.tmp $@
|
|
|
|
rm -f $@.tmp
|
2011-04-11 20:06:06 +02:00
|
|
|
|
2014-09-27 15:01:06 +02:00
|
|
|
%.desktop.in.h: %.desktop.in
|
2011-04-11 20:06:06 +02:00
|
|
|
intltool-extract --quiet --type=gettext/ini $<
|
|
|
|
|
2014-09-27 15:01:06 +02:00
|
|
|
install: messages $(GPODDER_SERVICE_FILE) $(DESKTOP_FILES)
|
2013-03-11 15:31:17 +01:00
|
|
|
$(PYTHON) setup.py install --root=$(DESTDIR) --prefix=$(PREFIX) --optimize=1
|
2007-03-27 19:56:59 +02:00
|
|
|
|
2018-05-02 10:58:18 +02:00
|
|
|
install-win: messages $(GPODDER_SERVICE_FILE) $(DESKTOP_FILES)
|
|
|
|
$(PYTHON) setup.py install
|
|
|
|
|
2005-11-21 19:21:25 +01:00
|
|
|
##########################################################################
|
2018-02-21 22:06:11 +01:00
|
|
|
ifdef VERSION
|
|
|
|
revbump:
|
|
|
|
LC_ALL=C sed -i "s/\(__version__\s*=\s*'\).*'/\1$(VERSION)'/" src/gpodder/__init__.py
|
|
|
|
LC_ALL=C sed -i "s/\(__date__\s*=\s*'\).*'/\1$(shell date "+%Y-%m-%d")'/" src/gpodder/__init__.py
|
|
|
|
LC_ALL=C sed -i "s/\(__copyright__\s*=.*2005-\)[0-9]*\(.*\)/\1$(shell date "+%Y")\2/" src/gpodder/__init__.py
|
2018-06-10 12:10:50 +02:00
|
|
|
$(MAKE) messages manpages
|
2018-02-21 22:06:11 +01:00
|
|
|
else
|
|
|
|
revbump:
|
|
|
|
@echo "Usage: make revbump VERSION=x.y.z"
|
|
|
|
endif
|
|
|
|
##########################################################################
|
|
|
|
|
|
|
|
manpages: $(MANPAGES)
|
2005-11-21 19:21:25 +01:00
|
|
|
|
2018-02-21 22:06:11 +01:00
|
|
|
share/man/man1/gpodder.1: src/gpodder/__init__.py $(BINFILE)
|
|
|
|
LC_ALL=C $(HELP2MAN) --name="$(shell $(PYTHON) setup.py --description)" -N $(BINFILE) >$@
|
2005-11-21 19:21:25 +01:00
|
|
|
|
2018-02-21 22:06:11 +01:00
|
|
|
share/man/man1/gpo.1: src/gpodder/__init__.py
|
|
|
|
sed -i 's/^\.TH.*/.TH GPO "1" "$(shell LANG=en date "+%B %Y")" "gpodder $(shell $(PYTHON) setup.py --version)" "User Commands"/' $@
|
2008-04-06 02:19:03 +02:00
|
|
|
|
2010-01-08 01:41:58 +01:00
|
|
|
##########################################################################
|
2006-03-31 15:00:54 +02:00
|
|
|
|
2012-02-25 15:38:15 +01:00
|
|
|
messages: $(MOFILES)
|
|
|
|
|
|
|
|
%.po: $(MESSAGES)
|
2019-09-11 21:56:35 +02:00
|
|
|
msgmerge --previous --silent $@ $< --output-file=$@
|
2016-02-03 20:06:33 +01:00
|
|
|
msgattrib --set-obsolete --ignore-file=$< -o $@ $@
|
|
|
|
msgattrib --no-obsolete -o $@ $@
|
2012-02-25 15:38:15 +01:00
|
|
|
|
|
|
|
$(LOCALEDIR)/%/LC_MESSAGES/gpodder.mo: po/%.po
|
|
|
|
@mkdir -p $(@D)
|
|
|
|
msgfmt $< -o $@
|
2006-03-31 15:00:54 +02:00
|
|
|
|
2012-02-25 15:38:15 +01:00
|
|
|
%.ui.h: %.ui
|
|
|
|
intltool-extract --quiet --type=gettext/glade $<
|
2006-03-31 15:00:54 +02:00
|
|
|
|
2012-02-25 15:38:15 +01:00
|
|
|
$(MESSAGES): $(GETTEXT_SOURCE)
|
2014-07-26 18:07:21 +02:00
|
|
|
xgettext --from-code=utf-8 -LPython -k_:1 -kN_:1 -kN_:1,2 -kn_:1,2 -o $(MESSAGES) $^
|
2007-06-21 16:15:37 +02:00
|
|
|
|
2018-12-22 15:01:00 +01:00
|
|
|
messages-force:
|
|
|
|
xgettext --from-code=utf-8 -LPython -k_:1 -kN_:1 -kN_:1,2 -kn_:1,2 -o $(MESSAGES) $(GETTEXT_SOURCE)
|
|
|
|
|
|
|
|
|
2010-01-08 01:41:58 +01:00
|
|
|
##########################################################################
|
2007-06-21 16:15:37 +02:00
|
|
|
|
2010-07-02 21:44:34 +02:00
|
|
|
# This only works in a Git working commit, and assumes that the local Git
|
|
|
|
# HEAD has already been pushed to the main repository. It's mainly useful
|
|
|
|
# for the gPodder maintainer to quickly generate a commit link that can be
|
|
|
|
# posted online in bug trackers and mailing lists.
|
|
|
|
|
|
|
|
headlink:
|
|
|
|
@echo http://gpodder.org/commit/`git show-ref HEAD | head -c8`
|
|
|
|
|
|
|
|
##########################################################################
|
|
|
|
|
2005-11-21 19:21:25 +01:00
|
|
|
clean:
|
2010-02-13 02:52:25 +01:00
|
|
|
$(PYTHON) setup.py clean
|
2012-02-23 20:38:55 +01:00
|
|
|
find src/ '(' -name '*.pyc' -o -name '*.pyo' ')' -exec rm '{}' +
|
|
|
|
find src/ -type d -name '__pycache__' -exec rm -r '{}' +
|
|
|
|
find share/gpodder/ui/ -name '*.ui.h' -exec rm '{}' +
|
2013-09-29 21:29:30 +02:00
|
|
|
rm -f MANIFEST .coverage messages.mo po/*.mo
|
2012-02-23 20:38:55 +01:00
|
|
|
rm -f $(GPODDER_SERVICE_FILE)
|
2014-09-27 15:01:06 +02:00
|
|
|
rm -f $(DESKTOP_FILES) $(DESKTOP_FILES_IN_H)
|
2012-02-25 15:38:15 +01:00
|
|
|
rm -rf build $(LOCALEDIR)
|
2006-04-05 17:00:31 +02:00
|
|
|
|
2005-11-21 19:21:25 +01:00
|
|
|
distclean: clean
|
|
|
|
rm -rf dist
|
2010-01-08 01:41:58 +01:00
|
|
|
|
2005-11-21 19:21:25 +01:00
|
|
|
##########################################################################
|
|
|
|
|
2018-02-21 22:06:11 +01:00
|
|
|
.PHONY: help unittest release releasetest install manpages clean distclean messages headlink lint revbump
|
2005-11-21 19:21:25 +01:00
|
|
|
|
|
|
|
##########################################################################
|
|
|
|
|
|
|
|
|