File: Makefile

package info (click to toggle)
ooo2dbk 2.1.0-1.1
  • links: PTS
  • area: main
  • in suites: buster, stretch
  • size: 1,816 kB
  • ctags: 62
  • sloc: xml: 1,053; python: 869; makefile: 73
file content (73 lines) | stat: -rw-r--r-- 1,950 bytes parent folder | download | duplicates (3)
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
# $Id: Makefile 22204 2005-06-03 10:25:13Z matrojette $

projectName := ooo2dbk
projectPath := $(shell pwd)
# $(notdir names...) extracts all but the directory-part of each file name in
# names.
projectDir := $(notdir ${projectPath})

version = $(shell grep VERSION VERSION | cut -d"=" -f2)

buildDir := ${projectName}-${version}
buildDirPath := /tmp/${buildDir}
buildArchivePath := /tmp/${projectName}-${version}.tar.gz

.PHONY: test clean check patch dist debian-dist debian rpm

test:
	echo "version = ${version}"

clean:
	find . "(" -name "*~" -or  -name ".#*" -or -name "*.pyc" ")" -print0 | xargs -0 rm -f
	rm -rf images

check:
	pychecker2 *.py

pkg:
	@(cd ooo ; \
	${MAKE} ; \
	find -not -name . -not -name .. \
	-not -name "*.stw" -not -name "*.zip" -print0 \
	| xargs -0 rm -rf ; \
	)

patch:
	diff -uNr ooo2dbk-orig/ ooo2dbk > distrib.patch

dist: clean
	rm -rf ${buildDirPath}
	rm -rf ${buildArchivePath}
	mkdir ${buildDirPath}
	cp -a README.txt HISTORY COPYING doc \
	__init__.py ole2img.py ooo2dbk \
	ooo2dbk.xml ooo2dbk.xsl ooo2dbk-fo.xsl \
	${buildDirPath}
	tar cvzf ${buildArchivePath} \
	--directory /tmp \
	${buildDir}

debian-dist: clean
	rm -rf ../ooo2dbk-${version} ../ooo2dbk_${version}.orig.tar.gz
	cp -a ../ooo2dbk ../ooo2dbk-${version}
	tar cvzf ../ooo2dbk_${version}.orig.tar.gz \
	--directory .. \
	--exclude ${projectDir}/CHANGES \
	--exclude .svn \
	--exclude ${projectDir}/setup.py \
	--exclude ${projectDir}/rpm \
	ooo2dbk-${version}
	rm -rf ../ooo2dbk-${version}

debian: debian-dist
	cd .. && tar xvzf ooo2dbk_${version}.orig.tar.gz && \
	cd ooo2dbk-${version} && dpkg-buildpackage -rfakeroot -uc -us

rpm: dist
	sudo cp ${buildArchivePath} /usr/src/rpm/SOURCES/
	sudo cp distrib.patch /usr/src/rpm/SOURCES/
	# -bb builds a binary package
	# (after doing the %prep, %build, and %install stages).
	sudo rpmbuild -v -bb rpm/ooo2dbk.spec
	# Lauching rpmbuild with a fakeroot
	#fakeroot rpmbuild -v -bb rpm/ooo2dbk.spec