forked from vigneras/sequencer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
114 lines (91 loc) · 4.41 KB
/
Makefile
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# -*- coding: utf-8 -*-
###############################################################################
# Copyright (C) Bull S.A.S (2010, 2011)
# Contributor: Pierre Vignéras <[email protected]>
# 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, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
###############################################################################
current_makefile := $(lastword $(MAKEFILE_LIST))
# TODO: Here, you list all the files and directories you want to include
# with your release. When a directory is specified, all its content is
# taken into account recursively.
files := conf bin lib doc setup.py MANIFEST.in README COPYING HOWTO
man_files_core := sequencer.dgmdb.1 sequencer.1 sequencer.graphrules.1 sequencer.knowntypes.1 sequencer.depmake.1 sequencer.seqmake.1 sequencer.seqmake.5 sequencer.seqexec.1 sequencer.seqexec.5 sequencer.chain.1
man_alias := graphrules.1 knowntypes.1 depmake.1 seqmake.1 seqmake.5 seqexec.1 seqexec.5 chain.1 dgmdb.1
man_files := $(man_files_core) $(man_alias)
name := sequencer
version := $(shell grep '^version=.*' ./VERSION|sed 's/^version=//g')
lastcommit := $(shell git log --pretty=format:'%H %aN %aE %ci' -1)
pkg_dir := $(name)-$(version)
tarall := $(pkg_dir).tar.gz
package_name := $(pkg_dir)-$(release)
tmpdir := $(shell mktemp -d)
# Default target: erase only produced files.
clean:
rm -f *~ archives/$(tarall) archives/$(tarall)
# Use this target to get information gathered by this Makefile.
# 'make config'
config:
@echo "name: $(name)"
@echo "pkg_dir: $(pkg_dir)"
@echo "tarall: $(tarall)"
@echo "tmpdir: $(tmpdir)"
@echo "version: $(version)"
@echo "tag: $(tagname)"
@echo "INFO: config OK"
@echo "tarall: $(tarall)"
# Copy required source files to a temporary directory. This directory
# will be tarred. The tar file will then be used by the rpmbuild
# command.
mkdir: config
mkdir -p archives
mkdir -p $(tmpdir)/$(pkg_dir)
copy: mkdir doc
cp -r $(files) $(tmpdir)/$(pkg_dir)
# Create the ChangeLog file and add changelog entries to the RPM .spec file.
log: copy
git --no-pager log --format="%ai %aN %n%n%x09* %s%d%n" > $(tmpdir)/$(pkg_dir)/doc/ChangeLog
version: copy
@echo "# The content of this file is generated by the packaging" > $(tmpdir)/$(pkg_dir)/lib/$(name)/.metainfo
@echo "# process (either setup.py or Makefile)" >> $(tmpdir)/$(pkg_dir)/lib/$(name)/.metainfo
@echo "# Do not change it manually." >> $(tmpdir)/$(pkg_dir)/lib/$(name)/.metainfo
@echo "$(name).version = $(version)" >> $(tmpdir)/$(pkg_dir)/lib/$(name)/.metainfo
@echo "$(name).lastcommit = $(lastcommit)" >> $(tmpdir)/$(pkg_dir)/lib/$(name)/.metainfo
man: copy
@for i in $(man_files);do \
gzip -c doc/man/$$i > $(tmpdir)/$(pkg_dir)/doc/man/$$i.gz; \
done
pdfman:
@echo pdf man pages are generated in /tmp
@for i in $(man_files_core);do \
groff -Tps -man doc/$$i |ps2pdf - /tmp/$$i.pdf ; \
done
tar: version man
tar --exclude-vcs --exclude '*~' --exclude '#*#' -C $(tmpdir) --owner=root --group=root -cvzf archives/$(tarall) $(pkg_dir)
@echo "INFO: tar OK"
test:
@echo "*****************************************************************************"
@echo "*****************************************************************************"
@echo "*** Test requires some configuration to work! Please see the README file. ***"
@echo "*****************************************************************************"
@echo "*****************************************************************************"
@nosetests
coverage:
@nosetests --with-coverage --cover-html --cover-html-dir=unpackaged/tests-report/ --cover-package=$(name)
pylint:
@PYTHONPATH=${PYTHONPATH}:lib pylint -i y -r n -f colorized --rcfile=unpackaged/pylint.rc $(name) bin/$(name)
sloc:
@sloccount --wide lib tests bin
tag: test
@unpackaged/tools/autotag VERSION
release: tag
@unpackaged/tools/ask4release .