#!/usr/bin/make -f # -*- makefile -*- # Uncomment this to turn on verbose mode. export DH_VERBOSE=1 DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk SOVERSION=1.5 BALL_INSTALL_PATH=build PYTHON_VERSION=$(shell py3versions -d) PYTHON_SITE_PATH=/lib/python3/dist-packages export DEB_BUILD_MAINT_OPTIONS = hardening=+all %: dh $@ --buildsystem=cmake --builddirectory=build --with python3 override_dh_auto_configure: mkdir -p build cd build && LDFLAGS="$(LDFLAGS)" CXXFLAGS="$(CXXFLAGS)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" \ cmake .. -DCMAKE_SOURCE_DIR=$(CURDIR) -DCMAKE_INSTALL_PREFIX=./usr \ -DBALL_PATH=/usr -DBALL_DATA_PATH=/usr/share/BALL-$(SOVERSION)/data \ -DCMAKE_VERBOSE_MAKEFILE=ON # Set BALL_DATA_PATH so that test scripts find it export BALL_DATA_PATH=$(CURDIR)/data # Make sure HOME exists (for Directory_test) export HOME=/tmp # The testsuite issues several failures # Run it, but ignore the return code for now. override_dh_auto_test: ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) dh_auto_test --no-parallel -- || true endif # Different tests are failing in different runs #The following tests FAILED: # 86 - Composite_test4 (Failed) # 87 - Composite_test5 (Failed) #Errors while running CTest #The following tests FAILED: # 112 - Fragment_test (Failed) # 113 - Chain_test (Failed) #Errors while running CTest override_dh_auto_build-arch: ## Fix upstream issue of missing UI files # uic-qt4 source/VIEW/DIALOGS/assignBondOrderConfigurationDialog.ui > include/BALL/VIEW/UIC/ui_assignBondOrderConfigurationDialog.h # uic-qt4 source/VIEW/DIALOGS/assignBondOrderResultsDialog.ui > include/BALL/VIEW/UIC/ui_assignBondOrderResultsDialog.h # uic-qt4 source/VIEW/DIALOGS/atomOverview.ui > include/BALL/VIEW/UIC/ui_atomOverview.h ## ... ## Uhmmm, seems we need to do this for all UI files mentioned in ## source/VIEW/DIALOGS/sources.cmake ## but I really hope some cmake expert might be able to find a clue ## how to trigger cmake to do it as intended by upstream. ## Somehow the code ## ADD_BALL_UIFILES("VIEW/DIALOGS" "${UI_LIST}") ## needs to be called before the build code below can be started make -C build BALL VIEW BALLView build_tests install override_dh_auto_build-indep: make -C build doc doc_tutorial install override_dh_auto_clean: [ -d source ] && cd source ; \ if [ -f Makefile ] ; \ then \ make clean ; \ cd PYTHON/EXTENSIONS; \ make clean; \ rm -rf ../lib/Linux*; \ rm -rf ../doc/doxygen/latex/*; \ rm -f $(CURDIR)/source/config.status 2>/dev/null; \ fi rm -f data/BALLView/translations/BALLView.de_DE.qm rm -f data/BALLView/translations/BALLView.zh_TW.qm rm -f doc/TUTORIAL/*.aux rm -rf $(BALL_INSTALL_PATH) find . -name "*.o" | xargs -r rm find . -type l | xargs -r rm find doc/TUTORIAL/ -name "tutorial.*" | egrep -v ".(tex|bib)$$" |xargs -r rm rm -f include/BALL/BALL.doc # find . -name "*.doc" -delete # Remove self-create UI header file rm -f include/BALL/VIEW/UIC/ui_assignBondOrderConfigurationDialog.h \ include/BALL/VIEW/UIC/ui_assignBondOrderResultsDialog.h \ include/BALL/VIEW/UIC/ui_atomOverview.h override_dh_auto_install-arch: mkdir -p debian/libball$(SOVERSION)/usr/lib \ debian/libball$(SOVERSION)-data/usr/share/BALL-$(SOVERSION) \ debian/libballview$(SOVERSION)/usr/lib \ debian/python3-ball/usr/share/BALL-$(SOVERSION) \ debian/python3-ball/usr/$(PYTHON_SITE_PATH) \ debian/ballview/usr/lib/ballview/ mkdir -p debian/ballview/usr/share/BALL-$(SOVERSION)/data/graphics cp -r $(BALL_INSTALL_PATH)/usr/share/BALL/BALLView/* debian/ballview/usr/share/doc/ballview/ cp $(BALL_INSTALL_PATH)/usr/bin/BALLView debian/ballview/usr/lib/ballview/ cp -a debian/bin/* debian/ballview/usr/bin find $(BALL_INSTALL_PATH)/usr/lib/ -name libBALL*.so.* | xargs -r cp --target-directory debian/libball$(SOVERSION)/usr/lib/ find $(BALL_INSTALL_PATH)/usr/lib/ -name libVIEW*.so.* | xargs -r cp --target-directory debian/libballview$(SOVERSION)/usr/lib/ # debian needs the logo in the ballview - package, not in the libball cp $(BALL_INSTALL_PATH)/usr/share/BALL/graphics/ballview*.xpm debian/ballview/usr/share/pixmaps/ cp -r $(BALL_INSTALL_PATH)/usr/share/doc/BALL/EXAMPLES/PYTHON debian/python3-ball/usr/share/BALL-$(SOVERSION) cp -a source/PYTHON/EXTENSIONS/* debian/python3-ball/usr/$(PYTHON_SITE_PATH) # cp $(BALL_INSTALL_PATH)/usr/lib/BALLCore.so debian/python-ball/usr/$(PYTHON_SITE_PATH) # -dev packages are arch dependent mkdir -p debian/libball$(SOVERSION)-dev/usr/lib \ debian/libballview$(SOVERSION)-dev/usr/include/BALL \ debian/libballview$(SOVERSION)-dev/usr/lib \ debian/libball$(SOVERSION)-dev/usr/include # move the cmake configuration files to their final location cp -R $(BALL_INSTALL_PATH)/usr/lib/cmake/ debian/libball$(SOVERSION)-dev/usr/lib cp -r $(BALL_INSTALL_PATH)/usr/include/BALL debian/libball$(SOVERSION)-dev/usr/include cp -r $(BALL_INSTALL_PATH)/usr/include/BALL/VIEW debian/libballview$(SOVERSION)-dev/usr/include/BALL # get rid of the VIEW includes in libball-dev rm -rf debian/libball$(SOVERSION)-dev/usr/include/BALL/VIEW # eliminating chrpath settings chmod 755 debian/ballview/usr/lib/ballview/BALLView chrpath -d debian/ballview/usr/lib/ballview/BALLView find debian -name "*.so" | xargs -r chrpath -d override_dh_auto_install-indep: mkdir -p debian/libball$(SOVERSION)-doc/usr/share/doc/libball$(SOVERSION)/html \ debian/libball$(SOVERSION)-data/usr/share/BALL-$(SOVERSION)/doc \ debian/libball$(SOVERSION)-doc/usr/share/doc/libball$(SOVERSION)/html/BALL cp $(BALL_INSTALL_PATH)/usr/share/doc/BALL/TUTORIAL/tutorial.pdf debian/libball$(SOVERSION)-doc/usr/share/doc/libball$(SOVERSION)/ # cp -r $(BALL_INSTALL_PATH)/usr/share/BALL/doc/classes debian/libball$(SOVERSION)-data/usr/share/BALL-$(SOVERSION)/doc # cp -r $(BALL_INSTALL_PATH)/usr/share/BALL/doc/internal debian/libball$(SOVERSION)-data/usr/share/BALL-$(SOVERSION)/doc # we need the BALLView documentation in the data path as well... sorry for that cp -r $(BALL_INSTALL_PATH)/usr/share/doc/BALL/EXAMPLES/PYTHON/BALLView debian/libball$(SOVERSION)-data/usr/share/BALL-$(SOVERSION)/doc cp -r $(BALL_INSTALL_PATH)/usr/share/doc/BALL/html/* debian/libball$(SOVERSION)-doc/usr/share/doc/libball$(SOVERSION)/html/BALL cp -r $(BALL_INSTALL_PATH)/usr/share/BALL/* debian/libball$(SOVERSION)-data/usr/share/BALL-$(SOVERSION) override_dh_installdocs: dh_installdocs find debian/*/usr/share -type d -empty -delete find debian/*/usr/share -name jquery.js -delete find debian/*/usr/share -name license.txt -delete override_dh_install: dh_install dh_sip3 if [ -d debian/python3-ball ] ; then \ find debian/python3-ball/usr/lib/python*/dist-packages/ -name BALLPyMacros.h -delete ; \ find debian/python3-ball -name CMakeLists.txt -delete ; \ fi