2 # gPodder - A media aggregator and podcast client
3 # Copyright (c) 2005-2018 The gPodder Team
5 # gPodder is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # gPodder is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 ##########################################################################
23 MANPAGES
= share
/man
/man1
/gpodder
.1 share
/man
/man1
/gpo
.1
25 GPODDER_SERVICE_FILE
=share
/dbus-1
/services
/org.gpodder.service
26 GPODDER_SERVICE_FILE_IN
=$(addsuffix .in
,$(GPODDER_SERVICE_FILE
))
28 DESKTOP_FILES_IN
=$(wildcard share
/applications
/*.desktop.in
)
29 DESKTOP_FILES_IN_H
=$(patsubst %.desktop.in
,%.desktop.in.h
,$(DESKTOP_FILES_IN
))
30 DESKTOP_FILES
=$(patsubst %.desktop.in
,%.desktop
,$(DESKTOP_FILES_IN
))
32 MESSAGES
= po
/messages.pot
33 POFILES
= $(wildcard po
/*.po
)
34 LOCALEDIR
= share
/locale
35 MOFILES
= $(patsubst po
/%.po
,$(LOCALEDIR
)/%/LC_MESSAGES
/gpodder.mo
, $(POFILES
))
37 UIFILES
=$(wildcard share
/gpodder
/ui
/gtk
/*.ui
)
38 UIFILES_H
=$(subst .ui
,.ui.h
,$(UIFILES
))
39 GETTEXT_SOURCE
=$(wildcard src
/gpodder
/*.py \
40 src
/gpodder
/gtkui
/*.py \
41 src
/gpodder
/gtkui
/interface
/*.py \
42 src
/gpodder
/gtkui
/desktop
/*.py \
43 src
/gpodder
/plugins
/*.py \
44 share
/gpodder
/extensions
/*.py
)
46 GETTEXT_SOURCE
+= $(UIFILES_H
)
47 GETTEXT_SOURCE
+= $(wildcard bin
/*[^~
])
48 GETTEXT_SOURCE
+= $(DESKTOP_FILES_IN_H
)
56 PYTEST ?
= $(shell which pytest || which pytest-3
)
58 ##########################################################################
61 @cat tools
/make-help.txt
63 ##########################################################################
66 LC_ALL
=C PYTHONPATH
=src
/ $(PYTEST
) --ignore
=tests
--ignore
=src
/gpodder
/utilwin32ctypes.py
--doctest-modules src
/gpodder
/util.py src
/gpodder
/jsonconfig.py
67 LC_ALL
=C PYTHONPATH
=src
/ $(PYTEST
) tests
--ignore
=src
/gpodder
/utilwin32ctypes.py
--ignore
=src
/mygpoclient
--cov
=gpodder
69 ISORTOPTS
:= -c share src
/gpodder tools bin
/* *.py
72 pycodestyle share src
/gpodder tools bin
/* *.py
75 isort
-q
$(ISORTOPTS
) || isort
--df
$(ISORTOPTS
)
76 codespell
--quiet-level
3 --skip
"./.git,*.po,./share/applications/gpodder.desktop"
79 $(PYTHON
) setup.py sdist
81 releasetest
: unittest
$(DESKTOP_FILES
) $(POFILES
)
82 for f in
$(DESKTOP_FILES
); do desktop-file-validate
$$f || exit
1; done
83 for f in
$(POFILES
); do msgfmt
--check $$f || exit
1; done
85 $(GPODDER_SERVICE_FILE
): $(GPODDER_SERVICE_FILE_IN
)
86 sed
-e
's#__PREFIX__#$(PREFIX)#' $< >$@
88 %.desktop
: %.desktop.in
$(POFILES
)
89 sed
-e
's#__PREFIX__#$(PREFIX)#' $< >$@.tmp
90 intltool-merge
-d
-u po
$@.tmp
$@
93 %.desktop.in.h
: %.desktop.in
94 intltool-extract
--quiet
--type
=gettext
/ini
$<
96 install: messages
$(GPODDER_SERVICE_FILE
) $(DESKTOP_FILES
)
97 $(PYTHON
) setup.py
install --root
=$(DESTDIR
) --prefix=$(PREFIX
) --optimize
=1
99 install-win
: messages
$(GPODDER_SERVICE_FILE
) $(DESKTOP_FILES
)
100 $(PYTHON
) setup.py
install
102 ##########################################################################
105 LC_ALL
=C sed
-i
"s/\(__version__\s*=\s*'\).*'/\1$(VERSION)'/" src
/gpodder
/__init__.py
106 LC_ALL
=C sed
-i
"s/\(__date__\s*=\s*'\).*'/\1$(shell date "+%Y-
%m-
%d
")'/" src
/gpodder
/__init__.py
107 LC_ALL
=C sed
-i
"s/\(__copyright__\s*=.*2005-\)[0-9]*\(.*\)/\1$(shell date "+%Y
")\2/" src
/gpodder
/__init__.py
108 $(MAKE
) messages manpages
111 @echo
"Usage: make revbump VERSION=x.y.z"
113 ##########################################################################
115 manpages
: $(MANPAGES
)
117 share
/man
/man1
/gpodder
.1: src
/gpodder
/__init__.py
$(BINFILE
)
118 LC_ALL
=C
$(HELP2MAN
) --name
="$(shell $(PYTHON) setup.py --description)" -N
$(BINFILE
) >$@
120 share
/man
/man1
/gpo
.1: src
/gpodder
/__init__.py
121 sed
-i
's/^\.TH.*/.TH GPO "1" "$(shell LANG=en date "+%B %Y")" "gpodder $(shell $(PYTHON) setup.py --version)" "User Commands"/' $@
123 ##########################################################################
128 msgmerge
--previous
--silent
$@
$< --output-file
=$@
129 msgattrib
--set-obsolete
--ignore-file
=$< -o
$@
$@
130 msgattrib
--no-obsolete
-o
$@
$@
132 $(LOCALEDIR
)/%/LC_MESSAGES
/gpodder.mo
: po
/%.po
137 intltool-extract
--quiet
--type
=gettext
/glade
$<
139 $(MESSAGES
): $(GETTEXT_SOURCE
)
140 xgettext
--from-code
=utf-8
-LPython
-k_
:1 -kN_
:1 -kN_
:1,2 -kn_
:1,2 -o
$(MESSAGES
) $^
143 xgettext
--from-code
=utf-8
-LPython
-k_
:1 -kN_
:1 -kN_
:1,2 -kn_
:1,2 -o
$(MESSAGES
) $(GETTEXT_SOURCE
)
145 ##########################################################################
147 # This only works in a Git working commit, and assumes that the local Git
148 # HEAD has already been pushed to the main repository. It's mainly useful
149 # for the gPodder maintainer to quickly generate a commit link that can be
150 # posted online in bug trackers and mailing lists.
153 @echo http
://gpodder.org
/commit
/`git show-ref HEAD | head -c8`
155 ##########################################################################
158 $(PYTHON
) setup.py
clean
159 find src
/ '(' -name
'*.pyc' -o
-name
'*.pyo' ')' -exec
rm '{}' +
160 find src
/ -type d
-name
'__pycache__' -exec
rm -r
'{}' +
161 find share
/gpodder
/ui
/ -name
'*.ui.h' -exec
rm '{}' +
162 rm -f MANIFEST .coverage messages.mo po
/*.mo
163 rm -f
$(GPODDER_SERVICE_FILE
)
164 rm -f
$(DESKTOP_FILES
) $(DESKTOP_FILES_IN_H
)
165 rm -rf build
$(LOCALEDIR
)
170 ##########################################################################
172 .PHONY
: help unittest release releasetest
install manpages
clean distclean messages headlink lint revbump
174 ##########################################################################