Full revamp of debian/rules so it is easier to understand and maintain.

parent 0e629829
usr/share/openscenegraph/examples
examples/* usr/share/openscenegraph/examples
#!/usr/bin/make -f
# # Sample debian/rules that uses debhelper.
# # GNU copyright 1997 to 1999 by Joey Hess.
# #
# # Build comments:
# # About 3.2 GB is needed on disc.
# # orig sources are created by
# # mkdir openscenegraph-xxx.orig
# # cd openscenegraph-xxx.orig
# # unzip OpenSceneGraph-xxx.zip
# # mv OpenSceneGraph-xxx OpenSceneGraph
# # cd ..
# # cp -a openscenegraph-xxx.orig openscenegraph-xxx
# # cd openscenegraph-xxx
# # cp -a ../openscenegraph-yyy/debian .
#
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
#export DH_OPTIONS=-v
......@@ -28,37 +14,10 @@ CFLAGS += $(CPPFLAGS)
CXXFLAGS += $(CPPFLAGS)
%:
dh $@
dh $@ --buildsystem cmake --parallel
# Use override_dh_* targets to customize this.
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
# Default to g++
CXX ?= g++
# Detect parallel builds.
ifneq (,$(findstring parallel,$(DEB_BUILD_OPTIONS)))
PARALLEL_JOBS = $(shell echo $(DEB_BUILD_OPTIONS) | \
sed -e 's/.*parallel=\([0-9]\+\).*/\1/')
PARALLEL_OPTIONS = -j$(PARALLEL_JOBS)
endif
define SETAFFINITY
grep 'sched_setaffinity.*cpusetsize' /usr/include/sched.h > /dev/null || export COMPILE_USING_TWO_PARAM_sched_setaffinity=-DCOMPILE_USING_TWO_PARAM_sched_setaffinity ;
endef
ifeq (hppa,$(DEB_BUILD_ARCH))
ARCH_C_FLAGS=-mlong-calls
ARCH_CXX_FLAGS=${ARCH_C_FLAGS}
endif
CFLAGS := ${CFLAGS} ${ARCH_C_FLAGS}
CXXFLAGS := ${CXXFLAGS} ${ARCH_CXX_FLAGS}
......@@ -70,19 +29,19 @@ ifeq (armhf, $(findstring $(DEB_HOST_ARCH), armhf))
ARM_FP_SUFFIX := hf
endif
ARM_DEFINES=-D OSG_GL1_AVAILABLE:BOOL=OFF \
-D OSG_GL2_AVAILABLE:BOOL=OFF \
-D OSG_GL3_AVAILABLE:BOOL=OFF \
-D OSG_GLES1_AVAILABLE:BOOL=OFF \
-D OSG_GLES2_AVAILABLE:BOOL=ON \
-D OSG_GL_DISPLAYLISTS_AVAILABLE:BOOL=OFF \
-D OSG_GL_MATRICES_AVAILABLE:BOOL=OFF \
-D OSG_GL_VERTEX_FUNCS_AVAILABLE:BOOL=OFF \
-D OSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE:BOOL=OFF \
-D OSG_GL_FIXED_FUNCTION_AVAILABLE:BOOL=OFF \
-D OSG_CPP_EXCEPTIONS_AVAILABLE:BOOL=OFF \
-D OPENGL_gl_LIBRARY:STRING=/usr/lib/arm-linux-gnueabi$(ARM_FP_SUFFIX)/libGLESv2.so \
-D OPENGL_egl_LIBRARY:STRING=/usr/lib/arm-linux-gnueabi$(ARM_FP_SUFFIX)/libEGL.so
ARM_DEFINES=-DOSG_GL1_AVAILABLE:BOOL=OFF \
-DOSG_GL2_AVAILABLE:BOOL=OFF \
-DOSG_GL3_AVAILABLE:BOOL=OFF \
-DOSG_GLES1_AVAILABLE:BOOL=OFF \
-DOSG_GLES2_AVAILABLE:BOOL=ON \
-DOSG_GL_DISPLAYLISTS_AVAILABLE:BOOL=OFF \
-DOSG_GL_MATRICES_AVAILABLE:BOOL=OFF \
-DOSG_GL_VERTEX_FUNCS_AVAILABLE:BOOL=OFF \
-DOSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE:BOOL=OFF \
-DOSG_GL_FIXED_FUNCTION_AVAILABLE:BOOL=OFF \
-DOSG_CPP_EXCEPTIONS_AVAILABLE:BOOL=OFF \
-DOPENGL_gl_LIBRARY:STRING=/usr/lib/arm-linux-gnueabi$(ARM_FP_SUFFIX)/libGLESv2.so \
-DOPENGL_egl_LIBRARY:STRING=/usr/lib/arm-linux-gnueabi$(ARM_FP_SUFFIX)/libEGL.so
endif
#
......@@ -191,7 +150,7 @@ get-orig-source:
dh_testdir
wget --directory-prefix=.. https://github.com/openscenegraph/OpenSceneGraph/archive/$(TARBALL_NAME)
clean:
override_dh_clean:
dh_testdir
dh_testroot
......@@ -383,87 +342,33 @@ MANEXAMPLES = \
osgtransferfunction.1 \
osgtransformfeedback.1
install-arch: build-arch
dh_testdir
dh_testroot
# Before installation so the binaries still have rpath set.
for man in ${MANAPPLICATIONS} ; do rm -f $$man ; help2man -N --version-string="$(VERSION)" -S OpenSceneGraph $(CURDIR)/build/osg/bin/$${man%.1} > $$man ; done
# Add here commands to install the package into debian/tmp
mkdir -p $(CURDIR)/debian/tmp/usr
$(MAKE) -C build/osg DESTDIR=$(CURDIR)/debian/tmp install
-mv $(CURDIR)/debian/tmp/usr/share/OpenSceneGraph/bin/* $(CURDIR)/debian/tmp/usr/bin
for man in ${MANEXAMPLES} ; do rm -f $$man ; ln -s debian/osgexamples.1 $$man ; done
# Build architecture-independent files here.
binary-indep: install-indep
dh_installdocs -i
dh_installchangelogs -i
override_dh_install-indep:
dh_install -i -XCMakeLists.txt
dh_lintian -i
dh_compress -i
dh_fixperms -i
dh_installdeb -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
install-indep: build-indep
mkdir -p debian/tmp/usr/share/openscenegraph/
cp -r examples debian/tmp/usr/share/openscenegraph
# Build architecture-dependent files here.
binary-arch: install-arch
dh_install -a
dh_installdocs -a
dh_installchangelogs -a
dh_installexamples -a
override_dh_installman:
# Provably better done with --builddirectory= in the general options
# than specifying DEFAULT_BUILD_DIRECTORY. From the sources I can see
# that always starts with "obj-"
for man in ${MANAPPLICATIONS} ; do rm -f $$man ; help2man -N --version-string="$(VERSION)" -S OpenSceneGraph obj-*/bin/$${man%.1} > $$man ; done
for man in ${MANEXAMPLES} ; do rm -f $$man ; ln -s debian/osgexamples.1 $$man ; done
dh_installman -p openscenegraph-3.4 ${MANPAGES}
dh_lintian -a
dh_link -a
dh_compress -a
dh_fixperms -a
dh_strip -a
dh_makeshlibs -a
dh_shlibdeps -a
dh_installdeb -a
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
binary: binary-indep binary-arch
build: build-indep build-arch
build-indep: doc-stamp
doc-stamp:
override_dh_auto_build-indep:
mkdir -p html
doxygen debian/Doxyfile-openscenegraph
# Use Debian's jquery.js
rm html/openscenegraph/jquery.js
find html -name "*.html" -print0 | xargs -0 perl -i -pe 's|src="jquery.js"|src="/usr/share/javascript/jquery/jquery.js"|'
touch doc-stamp
build-arch: build-stamp
build-stamp:
dh_testdir
# Dynamic
mkdir -p build/osg; cd build/osg ; ${SETAFFINITY} cmake --debug-output \
-D OPENTHREADS_SOVERSION:STRING=${OPENTHREADS_SOVERSION} \
-D OPENSCENEGRAPH_SOVERSION:STRING=${OPENSCENEGRAPH_SOVERSION} \
-D CMAKE_INSTALL_PREFIX:PATH=/usr \
-D BUILD_OSG_EXAMPLES:BOOL=ON \
-D LIB_POSTFIX="/${DEB_HOST_MULTIARCH}" \
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
-D CMAKE_RELWITHDEBINFO_POSTFIX="" \
-D OSG_USE_LOCAL_LUA_SOURCE:BOOL=OFF \
${ARM_DEFINES} \
../..
${MAKE} ${PARALLEL_OPTIONS} VERBOSE=1 -C build/osg
touch build-stamp
.PHONY: build build-indep build-arch clean binary-indep binary-arch binary install-indep \
install-arch get-orig-source
override_dh_auto_configure:
dh_auto_configure -- --debug-output \
-DOPENTHREADS_SOVERSION:STRING=${OPENTHREADS_SOVERSION} \
-DOPENSCENEGRAPH_SOVERSION:STRING=${OPENSCENEGRAPH_SOVERSION} \
-DCMAKE_INSTALL_PREFIX:PATH=/usr \
-DBUILD_OSG_EXAMPLES:BOOL=ON \
-DLIB_POSTFIX="/${DEB_HOST_MULTIARCH}" \
-DCMAKE_RELWITHDEBINFO_POSTFIX="" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DOSG_USE_LOCAL_LUA_SOURCE:BOOL=OFF \
${ARM_DEFINES}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment