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
|
export DH_OPTIONS
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
STATIC_BUILD_PATH=DEB_build_static
SHARED_BUILD_PATH=DEB_build_shared
CMAKE_FLAGS=-DCMAKE_INSTALL_PREFIX:PATH=/usr \
-DNIFTI_INSTALL_INCLUDE_DIR:PATH=include/nifti \
-DCMAKE_SKIP_RPATH:BOOL=ON \
-DCMAKE_C_FLAGS:STRING="$$CFLAGS" \
-DCMAKE_SHARED_LINKER_FLAGS="$$LDFLAGS -Wl,--as-needed" \
-DCMAKE_EXE_LINKER_FLAGS="$$LDFLAGS -Wl,--as-needed" \
-DUSE_FSL_CODE:BOOL=OFF \
-DBUILD_TESTING:BOOL=TRUE
%:
dh $@ --buildsystem=cmake
override_dh_auto_clean:
rm -rf $(STATIC_BUILD_PATH) $(SHARED_BUILD_PATH)
rm -rf docs/html
dh_clean
override_dh_auto_configure:
if [ ! -d $(STATIC_BUILD_PATH) ]; then mkdir $(STATIC_BUILD_PATH); fi
if [ ! -d $(SHARED_BUILD_PATH) ]; then mkdir $(SHARED_BUILD_PATH); fi
cd $(STATIC_BUILD_PATH) \
&& cmake $(CURDIR) $(CMAKE_FLAGS) -DBUILD_SHARED_LIBS:BOOL=OFF \
-DBUILD_TESTING:BOOL=ON
cd $(SHARED_BUILD_PATH) \
&& cmake $(CURDIR) $(CMAKE_FLAGS) -DBUILD_SHARED_LIBS:BOOL=ON \
-DBUILD_TESTING:BOOL=OFF
override_dh_auto_build:
cd $(STATIC_BUILD_PATH) && $(MAKE) VERBOSE=1
cd $(SHARED_BUILD_PATH) && $(MAKE) VERBOSE=1
cd docs && doxygen Doxy_nifti.txt
rm -f docs/html/jquery.js
override_dh_auto_test:
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
cd $(STATIC_BUILD_PATH) && ctest
endif
override_dh_auto_install:
cd $(SHARED_BUILD_PATH) && $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
cd $(STATIC_BUILD_PATH)/znzlib \
&& $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
cd $(STATIC_BUILD_PATH)/niftilib \
&& $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
cd $(STATIC_BUILD_PATH)/nifticdf \
&& $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
$(STATIC_BUILD_PATH)/utils/nifti_tool -help | \
python debian/makeniftitoolmanpage.py > debian/tmp/nifti_tool.1
rm $(CURDIR)/debian/tmp/usr/include/nifti/nifti_tool.h
override_dh_installchangelogs:
dh_installchangelogs -k Updates.txt
|