File: rules

package info (click to toggle)
sofa-framework 1.0~beta4-11
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 88,820 kB
  • ctags: 27,300
  • sloc: cpp: 151,126; ansic: 2,387; xml: 581; sh: 417; makefile: 68
file content (97 lines) | stat: -rwxr-xr-x 3,388 bytes parent folder | download
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
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
# export DH_VERBOSE=1

PACKAGE := $(shell dpkg-parsechangelog | sed -n 's/^Source: //p')
DEB_SOURCE_PACKAGE:=$(PACKAGE)

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

devpkg := libsofa1-dev
apppkg := sofa-apps
docpkg := sofa-doc

%:
	dh $@ --parallel

get-orig-source:
	. debian/get-orig-source

override_dh_auto_configure:
	qmake
	(cd applications/projects/runSofa; qmake -o Makefile runSofa.pro)

	# create a folder without object files
	cp -a $(CURDIR)/applications/tutorials $(CURDIR)/tutorials

override_dh_auto_build:
	dh_auto_build
	# Create the documentation files if debian/control does include the package definition
	if grep -q "^Package: sofa-doc$$" debian/control ; then \
	  mkdir -p $(CURDIR)/doc/doxygen ; \
	  doxygen -u Doxyfile ; \
	  doxygen ; \
	fi
	# remove zero byte files
	find $(CURDIR)/doc/doxygen/ -depth -empty | xargs rm -rf

override_dh_clean:
	rm -rf bin lib tutorials doc OBJ
	# - rm -rf extlibs/tinyxml/

	dh_clean

	# some packages might remain after clean
	find . -name "*.o" -delete
	find . -name "Makefile" -delete
	find . -name "Makefile.lib*" -delete
	find . -name "Makefile.sofa_*" -delete
	find . -name "moc_*" -delete
	find . -type d -empty -delete
	rm -rf  applications/sofa/gui/qt/PluginManager.h \
                applications/sofa/gui/qt/VisitorGUI.cpp \
                applications/sofa/gui/qt/GUI.cpp \
                applications/sofa/gui/qt/GUI.h \
                applications/sofa/gui/qt/DialogAddObject.h \
                applications/sofa/gui/qt/PluginManager.cpp \
                applications/sofa/gui/qt/BaseGenGraphForm.h \
                applications/sofa/gui/qt/VisitorGUI.h \
                applications/sofa/gui/qt/DialogAddObject.cpp \
                applications/sofa/gui/qt/BaseGenGraphForm.cpp \
                applications/projects/Modeler/lib/PluginManager.h \
                applications/projects/Modeler/lib/Modeler.cpp \
                applications/projects/Modeler/lib/DialogAddPreset.cpp \
                applications/projects/Modeler/lib/PluginManager.cpp \
                applications/projects/Modeler/lib/DialogAddPreset.h \
                applications/projects/Modeler/lib/Modeler.h \
                applications/sofa/gui/qt/UI \
                applications/projects/Modeler/lib/UI
	rm -f Sofa.tag doxygen.log


override_dh_install:
	find tutorials -name "*.kdevelop" | xargs chmod 644
	find share -type f -exec chmod 644 \{\} \;
	find share -name "*.sh" -exec chmod 755 \{\} \;
	find examples -type f -exec chmod 644 \{\} \;
	find examples -name "*.sh" -exec chmod 755 \{\} \;

	dh_install

	# try only if doxygen was called above
	if [ -d doc/doxygen/html ] ; then mv doc/doxygen/html/* $(CURDIR)/debian/$(docpkg)/usr/share/doc/sofa-doc/html ; fi

	# install some files directly into development package
	mkdir -p $(CURDIR)/debian/$(devpkg)/usr/include

	for dir in framework modules applications ; do \
	    for header in `find $$dir -name "*.h" -o -name "*.inl"` ; do \
		target=`echo $$header | sed "s?^$${dir}/??"`; \
		mkdir -p `dirname debian/$(devpkg)/usr/include/$$target`; \
		cp -a $$header debian/$(devpkg)/usr/include/$$target ; \
	    done ; \
	done

	# rename runSofa
	mkdir -p $(CURDIR)/debian/$(apppkg)/usr/lib/sofa-framework
	mv $(CURDIR)/bin/runSofa         $(CURDIR)/debian/$(apppkg)/usr/lib/sofa-framework/sofa