Thu, 27 Mar 2008 11:52:35 +0100 <thp@perli.net>
[gpodder.git] / Makefile
bloba8725ca87edc59a5a0721ce751360bf15a675adc
2 # gPodder - A media aggregator and podcast client
3 # Copyright (C) 2005-2007 Thomas Perl <thp at perli.net>
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 ##########################################################################
22 BINFILE=bin/gpodder
23 GLADEFILE=data/gpodder.glade
24 GLADEGETTEXT=$(GLADEFILE).h
25 MESSAGESPOT=data/messages.pot
26 GUIFILE=src/gpodder/gui.py
27 LOGO_22=data/icons/22/gpodder.png
28 LOGO_24=data/icons/24/gpodder.png
29 MANPAGE=doc/man/gpodder.1
30 GPODDERVERSION=`cat $(BINFILE) |grep ^__version__.*=|cut -d\" -f2`
32 ROSETTA_FILES=$(MESSAGESPOT) data/po/*.po
33 ROSETTA_ARCHIVE=gpodder-rosetta-upload.tar.gz
35 CHANGELOG=ChangeLog
36 CHANGELOG_TMP=.ChangeLog.tmp
37 CHANGELOG_EDT=.ChangeLog.edit
38 CHANGELOG_BKP=.ChangeLog.backup
39 EMAIL ?= $$USER@`hostname -f`
41 DESTDIR ?= /
42 PREFIX ?= /usr
44 # default editor of user has not set "EDITOR" env variable
45 EDITOR ?= vim
47 ##########################################################################
49 all: help
51 help:
52 @echo 'make test run gpodder in local directory'
53 @echo 'make cl make new changelog entry (1)'
54 @echo 'make ci format a commit message from the changelog'
55 @echo 'make release create source tarball in "dist/"'
56 @echo 'make releasetest run some tests before the release'
57 @echo 'make install install gpodder into "$(PREFIX)"'
58 @echo 'make uninstall uninstall gpodder from "$(PREFIX)"'
59 @echo 'make generators generate manpage, run tepache and resize logo'
60 @echo 'make messages rebuild messages.pot from new source'
61 @echo 'make rosetta-upload generate a tarball of all translation files'
62 @echo 'make clean remove generated+temp+*.pyc files'
63 @echo 'make distclean do a "make clean" + remove "dist/"'
64 @echo ''
65 @echo '(1) Please set environment variable "EMAIL" to your e-mail address'
67 ##########################################################################
69 cl:
70 cp $(CHANGELOG) $(CHANGELOG_BKP)
71 (echo "`date -R` <$(EMAIL)>" ; svn status | sed -f doc/dev/svncl.sed | sort ; echo ""; cat $(CHANGELOG)) >$(CHANGELOG_EDT)
72 cp $(CHANGELOG_EDT) $(CHANGELOG)
73 $(EDITOR) $(CHANGELOG)
74 diff -q $(CHANGELOG) $(CHANGELOG_EDT) && mv $(CHANGELOG_BKP) $(CHANGELOG) || true
75 rm -f $(CHANGELOG_BKP) $(CHANGELOG_EDT)
78 ci:
79 (svn diff ChangeLog | egrep '^[+]([^+].+|)$$' | sed -e 's/^[+]//')>commit_message
80 @echo 'to commit, enter "svn ci -F commit_message'
82 ##########################################################################
84 test:
85 @# set xterm title to know what this window does ;)
86 @echo -ne '\033]0;gPodder console (make test)\007'
87 $(BINFILE) --local --verbose
89 deb:
90 debuild
92 release: distclean
93 python setup.py sdist
95 releasetest:
96 if grep -q '^__version__.*=.*+svn' $(BINFILE); then echo "Version is still '+svn'."; exit 1; fi
97 desktop-file-validate data/gpodder.desktop
99 install: generators
100 python setup.py install --root=$(DESTDIR) --prefix=$(PREFIX)
102 update-icons:
103 gtk-update-icon-cache -f -i $(PREFIX)/share/icons/hicolor/
105 uninstall:
106 @echo "##########################################################################"
107 @echo "# MAKE UNINSTALL STILL NOT READY FOR PRIME TIME, WILL DO MY BEST TO #"
108 @echo "# REMOVE FILES INSTALLED BY GPODDER. WATCH INSTALL PROCESS AND REMOVE #"
109 @echo "# THE REST OF THE PACKAGES MANUALLY TO COMPLETELY REMOVE GPODDER. #"
110 @echo "##########################################################################"
111 rm -rf $(PREFIX)/share/gpodder $(PREFIX)/share/pixmaps/gpodder* $(PREFIX)/share/applications/gpodder.desktop $(PREFIX)/share/man/man1/gpodder.1 $(PREFIX)/bin/gpodder $(PREFIX)/lib/python?.?/site-packages/gpodder/ $(PREFIX)/share/locale/*/LC_MESSAGES/gpodder.mo
113 ##########################################################################
115 generators: $(MANPAGE) gen_graphics
116 make -C data/po update
118 messages: gen_gettext
120 $(MANPAGE): $(BINFILE)
121 help2man --name="A Media aggregator and Podcast catcher" -N $(BINFILE) >$(MANPAGE)
123 gen_gettext: $(MESSAGESPOT)
124 make -C data/po generators
125 make -C data/po update
127 gen_graphics:
128 convert -bordercolor Transparent -border 1x1 $(LOGO_22) $(LOGO_24)
130 $(GLADEGETTEXT): $(GLADEFILE)
131 intltool-extract --type=gettext/glade $(GLADEFILE)
133 $(MESSAGESPOT): src/gpodder/*.py $(GLADEGETTEXT) $(BINFILE)
134 xgettext -k_ -kN_ -o $(MESSAGESPOT) src/gpodder/*.py $(GLADEGETTEXT) $(BINFILE)
135 sed -i'~' -e 's/SOME DESCRIPTIVE TITLE/gPodder translation template/g' -e 's/YEAR THE PACKAGE'"'"'S COPYRIGHT HOLDER/2006 Thomas Perl/g' -e 's/FIRST AUTHOR <EMAIL@ADDRESS>, YEAR/Thomas Perl <thp@perli.net>, 2006/g' -e 's/PACKAGE VERSION/gPodder '$(GPODDERVERSION)'/g' -e 's/PACKAGE/gPodder/g' $(MESSAGESPOT)
137 rosetta-upload: $(ROSETTA_ARCHIVE)
138 @echo 'You can now upload the archive to launchpad.net: ' $(ROSETTA_ARCHIVE)
140 $(ROSETTA_ARCHIVE):
141 tar czvf $(ROSETTA_ARCHIVE) $(ROSETTA_FILES)
143 ##########################################################################
145 clean:
146 python setup.py clean
147 rm -f src/gpodder/*.pyc src/gpodder/*.bak MANIFEST PKG-INFO data/gpodder.gladep{,.bak} data/gpodder.glade.bak $(GLADEGETTEXT) data/messages.pot~ data/gpodder-??x??.png $(ROSETTA_ARCHIVE)
148 rm -rf build
149 make -C data/po clean
151 debclean:
152 fakeroot debian/rules clean
154 distclean: clean
155 rm -rf dist
157 ##########################################################################
159 .PHONY: all cl ci test release releasetest install update-icons generators gen_manpage gen_graphics clean distclean messages help
161 ##########################################################################