File debian.rules of Package ogre

#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1


export DEB_BUILD_MAINT_OPTIONS   := hardening=+bindnow
# CMake doesn't use CPPFLAGS, pass them to CFLAGS/CXXFLAGS to enable the
# missing (hardening) flags. dpkg_buildflags is necessary because $(shell ..)
# doesn't use local environment variables. (bug #665324)
dpkg_buildflags = DEB_BUILD_MAINT_OPTIONS=$(DEB_BUILD_MAINT_OPTIONS) dpkg-buildflags
export DEB_CFLAGS_MAINT_APPEND   := -pipe -Wall $(shell $(dpkg_buildflags) --get CPPFLAGS)
export DEB_CXXFLAGS_MAINT_APPEND := -pipe -Wall $(shell $(dpkg_buildflags) --get CPPFLAGS)

#export DEB_LDFLAGS_MAINT_APPEND  := -Wl,-z,defs -Wl,--as-needed
# disable -Wl,--as-needed on ia64 due to bug #718047, see also #725143
ifeq ($(DEB_HOST_ARCH),ia64)
export DEB_LDFLAGS_MAINT_APPEND  := -Wl,-z,defs
else
export DEB_LDFLAGS_MAINT_APPEND  := -Wl,-z,defs -Wl,--as-needed
endif


DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)


# Use this variable to define the particular version of OGRE that we're building
OGRE_VERSION=13.4.2

OGRE_CHANGELOG = Docs/ChangeLog.md

# Directories to install with Multi-arch and versioned OGRE dir names
LIB_MULTIARCH_DIR = /usr/lib/$(DEB_HOST_MULTIARCH)
LIB_MULTIARCH_PRIVATE_DIR = /usr/lib/$(DEB_HOST_MULTIARCH)/OGRE-$(OGRE_VERSION)

%:
	dh $@ --buildsystem=cmake --parallel

override_dh_auto_configure:
	dh_auto_configure -- \
		-DOGRE_LIB_DIRECTORY="lib/$(DEB_HOST_MULTIARCH)" \
		-DOGRE_FULL_RPATH:BOOL=TRUE \
		-DOGRE_BUILD_DOCS:BOOL=TRUE \
		-DOGRE_INSTALL_DOCS:BOOL=TRUE \
		-DOGRE_BUILD_SAMPLES:BOOL=FALSE \
		-DOGRE_INSTALL_SAMPLES:BOOL=FALSE \
		-DOGRE_INSTALL_SAMPLES_SOURCE:BOOL=FALSE \
		-DOGRE_RESOURCEMANAGER_STRICT:BOOL=true \
		-DOGRE_NODELESS_POSITIONING:BOOL=OFF \
		-DOGRE_BUILD_DEPENDENCIES:BOOL=OFF \
		-DOGRE_CONFIG_THREADS=2 \
		-DOGRE_CONFIG_THREAD_PROVIDER="std" \
		-DOGRE_BUILD_COMPONENT_OVERLAY_IMGUI:BOOL=OFF \
		-DOGRE_ENABLE_PRECOMPILED_HEADERS=OFF

override_dh_auto_build-indep:
	dh_auto_build -i --

	# generate doxygen API doc
	dh_auto_build -i -- OgreDoc

override_dh_install-arch:
	# Introduced in 1.7.3-5 as an attempt at using versioned files/dirs for
	# plugins and config files (so several versions of OGRE can be installed
	# at once)
	mv debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/OGRE debian/tmp/$(LIB_MULTIARCH_PRIVATE_DIR)
	sed -i "/{libdir}/ s|{libdir}/OGRE|{libdir}/OGRE-$(OGRE_VERSION)|g" debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/*
	sed -i "/$(DEB_HOST_MULTIARCH)/ s|lib/$(DEB_HOST_MULTIARCH)/OGRE|lib/$(DEB_HOST_MULTIARCH)/OGRE-$(OGRE_VERSION)|g" debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/OGRE-$(OGRE_VERSION)/cmake/OGREConfig.cmake
	sed -i "s|lib/$(DEB_HOST_MULTIARCH)/OGRE/|lib/$(DEB_HOST_MULTIARCH)/OGRE-$(OGRE_VERSION)/|g" debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/OGRE-$(OGRE_VERSION)/cmake/OgreTargets*
	
	# multi-arch/rpath issue with lintian:
	# E: libogre-1.7.3: binary-or-shlib-defines-rpath usr/lib/x86_64-linux-gnu/OGRE/Plugin_OctreeZone.so /usr/lib/OGRE
	chrpath --replace $(LIB_MULTIARCH_PRIVATE_DIR) debian/tmp/$(LIB_MULTIARCH_PRIVATE_DIR)/Plugin_OctreeZone.so.*
	
	dh_install -a --list-missing

override_dh_install-indep:
        # remove .md5, .map and other files that we do not want installed
	find debian/tmp/usr/share/doc/OGRE/api -type f -not \( -iname '*.html' -or -iname '*.png' -or -iname '*.css' -or -iname '*.js' \) -exec rm -fv {} \;
	find debian/tmp/usr/share/doc/OGRE/ -type f -iname '*.cfg' -exec rm -fv {} \;

	dh_install -i --list-missing
	
override_dh_shlibdeps:
	LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH) dh_shlibdeps -l$(LIB_MULTIARCH_DIR) --dpkg-shlibdeps-params=--ignore-missing-info

override_dh_installchangelogs:
	dh_installchangelogs -- $(OGRE_CHANGELOG)

override_dh_strip:
	dh_strip -plibogre-$(OGRE_VERSION) --dbg-package=libogre-$(OGRE_VERSION)-dbg
	dh_strip -pogre-13.4-tools

override_dh_clean:
	dh_clean

openSUSE Build Service is sponsored by