File debian.rules of Package geant4.11.0

#!/usr/bin/make -f

#export DH_VERBOSE=1
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

debname = $(shell dpkg-parsechangelog | sed -n -e 's/^Source: //p')
debversion = $(shell dpkg-parsechangelog | sed -n -e 's/^Version: //p')

g4Name = geant4
g4Version = 11.0
name = $(g4Name).$(g4Version)

buildroot = /usr/src/packages/BUILD/debian/$(name)
buildroot_examples = /usr/src/packages/BUILD/debian/$(name)-examples

_sourcedir = /usr/src/packages/SOURCES
_bindir = /usr/bin
_docdir = /usr/share/doc
_datadir = /usr/share

g4InstallRoot = /opt/$(g4Name)
g4DataPath = $(g4InstallRoot)/$(g4Name)-data
g4ConfigPath = $(g4InstallRoot)/$(g4Name)-multi_config
g4InstallPath = $(g4InstallRoot)/$(name)
g4ExamplesPath = $(g4InstallRoot)/$(name)-examples

%:
	dh $@

override_dh_auto_configure:
	find ./ -name .README* -delete
	find ./ -name .cproject* -delete
	find ./ -name .project* -delete
	find ./ -name .gitignore* -delete
	find ./ -name .doxygen* -type d -exec rm -rf {} +
	find ./ -name .doxygen* -delete
	find ./examples -name *.py -exec sed -i "1s@#!.*python.*@#!/usr/bin/python3@" {} \;
	patch -p1 < $(_sourcedir)/G4-multi.patch
	cat $(_sourcedir)/G4-LEND.patch >> cmake/Modules/G4DatasetDefinitions.cmake
	sed -i "s/OFF/ON/g" cmake/Modules/G4DatasetDefinitions.cmake
	dh_auto_configure -- \
	$(shell cat $(_sourcedir)/geant4_build_options) \
	-DGEANT4_INSTALL_DATADIR=$(g4DataPath) \
	-DCMAKE_INSTALL_PREFIX=$(g4InstallPath)

override_dh_auto_install:
	dh_auto_install -a --destdir=debian/$(name)
	#
	install -d -m 0755 $(buildroot_examples)/$(g4ExamplesPath)
	cp -r examples $(buildroot_examples)/$(g4ExamplesPath)

override_dh_shlibdeps:
	dh_shlibdeps -l$(buildroot)/$(g4InstallPath)/lib/$(DEB_HOST_MULTIARCH)

openSUSE Build Service is sponsored by