summary refs log tree commit diff stats
path: root/Makefile
blob: 8adae6a0bdbd35f9fc43942b714d98359487b81f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Copyright (C) 2009, 2010, 2011  Roman Zimbelmann <romanz@lavabit.com>
#
# This program 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.
#
# This program 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/>.

NAME = ranger
VERSION = $(shell grep -m 1 -o '[0-9][0-9.]\+' README)
SNAPSHOT_NAME ?= $(NAME)-$(VERSION)-$(shell git rev-parse HEAD | cut -b 1-8).tar.gz
# Find suitable python version (need python >= 2.6 or 3.1):
PYTHON ?= $(shell python -c 'import sys; sys.exit(sys.version < "2.6")' && \
	which python || which python3.2 || which python3.1 || which python3 || \
	which python2.6)
SETUPOPTS ?= '--record=install_log.txt'
DOCDIR ?= doc/pydoc
DESTDIR ?= /
PYOPTIMIZE ?= 1

CWD = $(shell pwd)

default: test compile
	@echo 'Run `make options` for a list of all options'

options: help
	@echo
	@echo 'Options:'
	@echo 'PYTHON = $(PYTHON)'
	@echo 'PYOPTIMIZE = $(PYOPTIMIZE)'
	@echo 'DOCDIR = $(DOCDIR)'

help:
	@echo 'make:          Test and compile ranger.'
	@echo 'make install:  Install $(NAME)'
	@echo 'make clean:    Remove the compiled files (*.pyc, *.pyo)'
	@echo 'make doc:      Create the pydoc documentation'
	@echo 'make cleandoc: Remove the pydoc documentation'
	@echo 'make man:      Compile the manpage with "pod2man"'
	@echo 'make manhtml:  Compile the html manpage with "pod2html"'
	@echo 'make snapshot: Create a tar.gz of the current git revision'
	@echo 'make test:     Test all testable modules of ranger'
	@echo 'make todo:     Look for TODO and XXX markers in the source code'

install:
	$(PYTHON) setup.py install $(SETUPOPTS) \
		'--root=$(DESTDIR)' --optimize=$(PYOPTIMIZE)

compile: clean
	PYTHONOPTIMIZE=$(PYOPTIMIZE) $(PYTHON) -m compileall -q ranger

clean:
	find ranger -regex .\*.py[co]\$$ -delete
	find ranger -depth -name __pycache__ -type d -exec rm -rf -- {} \;

doc: cleandoc
	mkdir -p $(DOCDIR)
	cd $(DOCDIR); \
		$(PYTHON) -c 'import pydoc, sys; \
		sys.path[0] = "$(CWD)"; \
		pydoc.writedocs("$(CWD)")'
	find . -name \*.html -exec sed -i 's|'$(CWD)'|../..|g' -- {} \;

test:
	@for FILE in $(shell grep -IHm 1 doctest -r ranger | cut -d: -f1); do \
		echo "Testing $$FILE..."; \
		PYTHONPATH=".:"$$PYTHONPATH ${PYTHON} $$FILE; \
	done

man:
	pod2man --stderr --center='ranger manual' --date='$(NAME)-$(VERSION)' \
		--release=$(shell date +%x) doc/ranger.pod doc/ranger.1

manhtml:
	pod2html doc/ranger.pod --outfile=doc/ranger.1.html

cleandoc:
	test -d $(DOCDIR) && rm -f -- $(DOCDIR)/*.html || true

snapshot:
	git archive --prefix='$(NAME)-$(VERSION)/' --format=tar HEAD | gzip > $(SNAPSHOT_NAME)

todo:
	@grep --color -Ion '\(TODO\|XXX\).*' -r ranger

.PHONY: default options compile clean doc cleandoc snapshot install man todo
7'>17 18 19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81

               






                                                                                                 
                                                       
                                    



                                                                                        



                                                                                                              
                                                                                                                  
                                                                                                                                   

                       
                                                     

                     





                                                     
                                         




                        

                                                              
        
             
      
 
                                       

   
                             

   
                    

   



               

   
                                     

   
                            

   



                                                                 
 
      

                   
                                                                          
                                                              



                                                     
                                
                                                                
# Release Guide

* Release libstrophe and libmesode if required

* Run Unit tests: `make check-unit`
* Run Functional tests - Currently disabled
* Run manual valgrind tests for new features
* Build and simple tests in Virtual machines ideally all dists including OSX and Windows (Cygwin)

* Update Inline command help (./src/command/cmd_defs.c)
* Check copyright dates in all files

* Generate HTML docs (the docgen argument only works when package status is development)
    `./profanity docgen`

* Generate manpages for profanity commands (the mangen argument only works when package status is development)
    `./profanity mangen`
  These files should be added to the docs subfolder and added to git whenever a command changes.

* Determine if libprofanitys version needs to be [increased](https://github.com/profanity-im/profanity/issues/973)
* Update plugin API docs (./apidocs/c and ./apidocs/python) need to run the `gen.sh` and commit the results to the website git repo
* Update CHANGELOG
* Update profrc.example
* Update profanity.doap (new XEPs and latest version)

## Creating artefacts
* Set the correct release version in configure.ac:

```
AC_INIT([profanity], [0.6.0], [boothj5web@gmail.com])
```

* Set the package status in configure.ac:

```
PACKAGE_STATUS="release"
```

* Add generated command manpages: `git add docs/profanity-*.1`

* Commit
* Tag (0.1.2)
* Push

* Configure to generate fresh Makefile:

```
./bootstrap.sh && ./configure
```

* Generate tarballs:

```
make dist
make dist-bzip2
make dist-xz
make dist-zip
```

* Set the package status back to dev:

```
PACKAGE_STATUS="development"
```

* Remove generated command manpages:
  `git rm docs/profanity-*.1`
  `git checkout HEAD -- docs/profanity-ox-setup.1`
  docs/profanity.1 and docs/profanity-ox-setup.1 are handwritten.

* Push

## Updating website
  * Make changes to the git repo including uploading the new artefacts at:
        https://github.com/profanity-im/profanity-im.github.io
  * Add .xz and .zip tarballs to `tarballs` directory
  * Copy `guide/latest` to `guide/newversion`
  * Update tarball location and name in index.html
  * Update checksums in index.html
  * Update profanity_version.txt
  * Take results from profanity.doap and put them into xeps.html