root/tags/release2_2/Makefile

Revision 642, 3.1 kB (checked in by schwa, 2 years ago)
Adapted stylesheet path.
  • Property svn:mime-type set to text/x-makefile
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
Line 
1 # Copyright (C) 2003-2006, Stefan Schwarzer
2 # All rights reserved.
3 #
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are
6 # met:
7 #
8 # - Redistributions of source code must retain the above copyright
9 #   notice, this list of conditions and the following disclaimer.
10 #
11 # - Redistributions in binary form must reproduce the above copyright
12 #   notice, this list of conditions and the following disclaimer in the
13 #   documentation and/or other materials provided with the distribution.
14 #
15 # - Neither the name of the above author nor the names of the
16 #   contributors to the software may be used to endorse or promote
17 #   products derived from this software without specific prior written
18 #   permission.
19 #
20 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR
24 # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27 # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28 # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
32 # $Id$
33
34
35 SHELL=/bin/sh
36 PROJECT_DIR=/home/schwa/sd/python/ftputil
37 DOC_FILES=README.html ftputil.html ftputil_ru.html
38 STYLESHEET_PATH=default.css
39 WWW_DIR=${HOME}/www
40 SED=sed -i'' -r -e
41
42 .PHONY: dist extdist test docs clean register patch
43 .SUFFIXES: .txt .html
44
45 test:
46         for file in `ls _test_*.py`; \
47         do \
48                 python $$file ; \
49         done
50
51
52 ftputil_ru.html: ftputil_ru_utf8.txt
53         rst2html.py --stylesheet-path=${STYLESHEET_PATH} --embed-stylesheet \
54                 --input-encoding=utf-8 $< $@
55
56 .txt.html:
57         rst2html.py --stylesheet-path=${STYLESHEET_PATH} --embed-stylesheet $< $@
58
59 patch:
60         @echo "Patching files"
61         ${SED} "s/^__version__ = '.*'/__version__ = \'`cat VERSION`\'/" \
62                 ftputil_version.py
63         ${SED} "s/^:Version:   .*/:Version:   `cat VERSION`/" ftputil.txt
64         ${SED} "s/^:Date:      .*/:Date:      `date +"%Y-%m-%d"`/" ftputil.txt
65         #TODO add rules for Russian translation
66         ${SED} "s/^Version: .*/Version: `cat VERSION`/" PKG-INFO
67         ${SED} "s/(\/wiki\/Download\/ftputil-).*(\.tar\.gz)/\1`cat VERSION`\2/" \
68                 PKG-INFO
69
70 docs: ${DOC_FILES} README.txt ftputil.txt ftputil_ru_utf8.txt
71
72 dist: clean patch docs
73         python setup.py sdist
74
75 localcopy:
76         @echo "Copying archive and documentation to local webspace"
77         cp -p dist/ftputil-`cat VERSION`.tar.gz ${WWW_DIR}/download
78         cp -p ftputil.html ${WWW_DIR}/python
79         touch ${WWW_DIR}/python/python_software.tmpl
80
81 register:
82         @echo "Registering new version with PyPI"
83         python setup.py register
84
85 extdist: test dist localcopy register
86
87 clean:
88         rm -f ${DOC_FILES}
89 # use absolute path to ensure we delete the right directory
90         rm -rf ${PROJECT_DIR}/build
91
Note: See TracBrowser for help on using the browser.