| 1 | #!/usr/bin/make -f |
| 2 | include /usr/share/dpkg/pkg-info.mk |
| 3 | include /usr/share/dpkg/buildtools.mk |
| 4 | |
| 5 | # Uncomment this to turn on verbose mode. |
| 6 | #export DH_VERBOSE=1 |
| 7 | |
| 8 | # Exclude .svn directories from packages |
| 9 | export DH_ALWAYS_EXCLUDEscip-makefile . . . DH_ALWAYS_EXCLUDE.=.svn |
| 10 | |
| 11 | # Enable hardening |
| 12 | export DEB_BUILD_MAINT_OPTIONSscip-makefile . . . DEB_BUILD_MAINT_OPTIONS.=hardening=+all |
| 13 | |
| 14 | VERSIONscip-makefile . . . VERSION.=$(DEB_VERSION) |
| 15 | PREFIXscip-makefile . . . PREFIX.=/usr |
| 16 | DATADIRscip-makefile . . . DATADIR.=$(PREFIXscip-makefile . . . PREFIX.)/share/nsis |
| 17 | DOCDIRscip-makefile . . . DOCDIR.=$(PREFIXscip-makefile . . . PREFIX.)/share/doc/nsis |
| 18 | SYSCONFscip-makefile . . . SYSCONF.=/etc |
| 19 | BUILDDIRscip-makefile . . . BUILDDIR.=build |
| 20 | UNICODEscip-makefile . . . UNICODE.=yes |
| 21 | INSTDIRscip-makefile . . . INSTDIR.=$(CURDIRscip-makefile . . . CURDIR.)/debian |
| 22 | TESTDIRscip-makefile . . . TESTDIR.=$(CURDIRscip-makefile . . . CURDIR.)/$(BUILDDIRscip-makefile . . . BUILDDIR.)/test |
| 23 | |
| 24 | # Decomposition of version string |
| 25 | define SPLITscip-makefile . . . SPLIT. |
| 26 | $(if $(2),$(call SPLIT,$(subst $(firstword $(2)), ,$(1)),$(filter-out $(firstword $(2)), $(2))), $(1)) |
| 27 | endef |
| 28 | VERSION_DECOMPOSEDscip-makefile . . . VERSION_DECOMPOSED.=$(call SPLIT,$(VERSIONscip-makefile . . . VERSION.),. - + ~) |
| 29 | VER_MAJORscip-makefile . . . VER_MAJOR.=$(firstword $(VERSION_DECOMPOSEDscip-makefile . . . VERSION_DECOMPOSED.)) |
| 30 | VER_MINORscip-makefile . . . VER_MINOR.=$(word 2,$(VERSION_DECOMPOSEDscip-makefile . . . VERSION_DECOMPOSED.)) |
| 31 | VER_REVISIONscip-makefile . . . VER_REVISION.=$(shell echo $(firstword $(subst +, ,$(word 3,$(VERSION_DECOMPOSEDscip-makefile . . . VERSION_DECOMPOSED.)))) | sed 's/[^0-9]//g') |
| 32 | |
| 33 | # Variables for Win32/Win64 cross compiler |
| 34 | XGCC_W32_X86scip-makefile . . . XGCC_W32_X86. = i686-w64-mingw32-gcc |
| 35 | XGCC_W32_X86_PATHscip-makefile . . . XGCC_W32_X86_PATH. = $(abspath $(shell $(XGCC_W32_X86scip-makefile . . . XGCC_W32_X86.) -print-file-name=libkernel32.a)/../..) |
| 36 | XGCC_W32_X86_PREFIXscip-makefile . . . XGCC_W32_X86_PREFIX. = $(subst -gcc,-,$(XGCC_W32_X86scip-makefile . . . XGCC_W32_X86.)) |
| 37 | XGCC_W32_AMD64scip-makefile . . . XGCC_W32_AMD64. = x86_64-w64-mingw32-gcc |
| 38 | XGCC_W32_AMD64_PATHscip-makefile . . . XGCC_W32_AMD64_PATH. = $(abspath $(shell $(XGCC_W32_AMD64scip-makefile . . . XGCC_W32_AMD64.) -print-file-name=libkernel32.a)/../..) |
| 39 | XGCC_W32_AMD64_PREFIXscip-makefile . . . XGCC_W32_AMD64_PREFIX. = $(subst -gcc,-,$(XGCC_W32_AMD64scip-makefile . . . XGCC_W32_AMD64.)) |
| 40 | |
| 41 | |
| 42 | # Evaluate parallel build option |
| 43 | ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) |
| 44 | ifeq (,$(shell dh_listpackages -i)) |
| 45 | NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) |
| 46 | SCONSFLAGS = -j $(NUMJOBS) |
| 47 | endif |
| 48 | endif |
| 49 | |
| 50 | # Honor hardening flags |
| 51 | SCONSHOSTFLAGSscip-makefile . . . SCONSHOSTFLAGS. = APPEND_CCFLAGS="$(shell dpkg-buildflags --get CPPFLAGS) \ |
| 52 | $(shell dpkg-buildflags --get CFLAGS)" \ |
| 53 | APPEND_LINKFLAGS="$(shell dpkg-buildflags --get LDFLAGS)" |
| 54 | |
| 55 | # Propagate CCACHE_DIR environment variable |
| 56 | ifneq (,$(CCACHE_DIR)) |
| 57 | SCONSHOSTFLAGS += CC="CCACHE_DIR=\"$(CCACHE_DIR)\" $(CCscip-makefile . . . CC.)" CXX="CCACHE_DIR=\"$(CCACHE_DIR)\" $(CXXscip-makefile . . . CXX.)" |
| 58 | endif |
| 59 | |
| 60 | SCONSOPTSscip-makefile . . . SCONSOPTS. = $(SCONSFLAGS) VERSION=$(VERSIONscip-makefile . . . VERSION.) VER_MAJOR=$(VER_MAJORscip-makefile . . . VER_MAJOR.) \ |
| 61 | VER_MINOR=$(VER_MINORscip-makefile . . . VER_MINOR.) VER_REVISION=$(VER_REVISIONscip-makefile . . . VER_REVISION.) \ |
| 62 | PREFIX=$(PREFIXscip-makefile . . . PREFIX.) PREFIX_CONF=$(SYSCONFscip-makefile . . . SYSCONF.) CHMDOCS=0 \ |
| 63 | STRIP_CP=no \ |
| 64 | $(if $(findstring nostripfull,$(DEB_BUILD_OPTIONS)),STRIP_W32=no,) |
| 65 | |
| 66 | ifneq (,$(UNICODEscip-makefile . . . UNICODE.),yes) |
| 67 | SCONSOPTS += UNICODE=yes |
| 68 | BUILDTYPE := u |
| 69 | endif |
| 70 | |
| 71 | ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) |
| 72 | SCONSOPTS += DEBUG=yes |
| 73 | BUILDTYPE := $(BUILDTYPE)debug |
| 74 | else |
| 75 | BUILDTYPE := $(BUILDTYPE)release |
| 76 | endif |
| 77 | |
| 78 | ifdef XGCC_W32_X86_PATH |
| 79 | SCONSOPTS_X86scip-makefile . . . SCONSOPTS_X86. = PREFIX_PLUGINAPI_INC=$(XGCC_W32_X86_PATHscip-makefile . . . XGCC_W32_X86_PATH.)/include/ \ |
| 80 | PREFIX_PLUGINAPI_LIB=$(XGCC_W32_X86_PATHscip-makefile . . . XGCC_W32_X86_PATH.)/lib/ \ |
| 81 | XGCC_W32_PREFIX=$(XGCC_W32_X86_PREFIXscip-makefile . . . XGCC_W32_X86_PREFIX.) \ |
| 82 | TARGET_ARCH=x86 |
| 83 | endif |
| 84 | |
| 85 | ifdef XGCC_W32_AMD64_PATH |
| 86 | SCONSOPTS_AMD64scip-makefile . . . SCONSOPTS_AMD64. = PREFIX_PLUGINAPI_INC=$(XGCC_W32_AMD64_PATHscip-makefile . . . XGCC_W32_AMD64_PATH.)/include/ \ |
| 87 | PREFIX_PLUGINAPI_LIB=$(XGCC_W32_AMD64_PATHscip-makefile . . . XGCC_W32_AMD64_PATH.)/lib/ \ |
| 88 | XGCC_W32_PREFIX=$(XGCC_W32_AMD64_PREFIXscip-makefile . . . XGCC_W32_AMD64_PREFIX.) \ |
| 89 | TARGET_ARCH=amd64 |
| 90 | endif |
| 91 | |
| 92 | COMMAscip-makefile . . . COMMA. := , |
| 93 | |
| 94 | UTILS_ALLscip-makefile . . . UTILS_ALL. = 'Library/RegTool,MakeLangId,Makensisw,NSIS Menu,UIs,SubStart,VPatch/Source/GenPat,zip2exe' |
| 95 | |
| 96 | # Only build GenPat for the host system |
| 97 | IGNORE_UTILS_NSISscip-makefile . . . IGNORE_UTILS_NSIS. := $(subst $(COMMAscip-makefile . . . COMMA.)VPatch/Source/GenPat,,$(UTILS_ALLscip-makefile . . . UTILS_ALL.)) |
| 98 | |
| 99 | # Build the win32 user interfaces (UIs) and RegTool |
| 100 | IGNORE_UTILS_COMMONscip-makefile . . . IGNORE_UTILS_COMMON. := $(subst Library/RegTool$(COMMAscip-makefile . . . COMMA.),,$(UTILS_ALLscip-makefile . . . UTILS_ALL.)) |
| 101 | IGNORE_UTILS_COMMONscip-makefile . . . IGNORE_UTILS_COMMON. := $(subst $(COMMAscip-makefile . . . COMMA.)UIs,,$(IGNORE_UTILS_COMMONscip-makefile . . . IGNORE_UTILS_COMMON.)) |
| 102 | |
| 103 | SCONSOPTS_HOSTscip-makefile . . . SCONSOPTS_HOST. := $(SCONSHOSTFLAGSscip-makefile . . . SCONSHOSTFLAGS.) $(SCONSOPTSscip-makefile . . . SCONSOPTS.) \ |
| 104 | SKIPPLUGINS=all SKIPSTUBS=all \ |
| 105 | SKIPUTILS=$(IGNORE_UTILS_NSISscip-makefile . . . IGNORE_UTILS_NSIS.) SKIPDOC=COPYING |
| 106 | SCONSOPTS_COMMONscip-makefile . . . SCONSOPTS_COMMON. := $(SCONSOPTSscip-makefile . . . SCONSOPTS.) SKIPUTILS=$(IGNORE_UTILS_COMMONscip-makefile . . . IGNORE_UTILS_COMMON.) \ |
| 107 | SKIPDOC=COPYING |
| 108 | |
| 109 | INSTALL_nsisscip-makefile . . . INSTALL_nsis. = install-utils install-compiler install-conf |
| 110 | INSTALL_FLAGS_nsisscip-makefile . . . INSTALL_FLAGS_nsis. = $(SCONSOPTS_HOSTscip-makefile . . . SCONSOPTS_HOST.) |
| 111 | INSTALL_nsis-commonscip-makefile . . . INSTALL_nsis-common. = install-stubs install-plugins install-data install-utils |
| 112 | INSTALL_FLAGS_nsis-commonscip-makefile . . . INSTALL_FLAGS_nsis-common. = $(SCONSOPTS_COMMONscip-makefile . . . SCONSOPTS_COMMON.) |
| 113 | INSTALL_nsis-pluginapiscip-makefile . . . INSTALL_nsis-pluginapi. = install-pluginapi |
| 114 | INSTALL_FLAGS_nsis-pluginapiscip-makefile . . . INSTALL_FLAGS_nsis-pluginapi. = $(SCONSOPTS_COMMONscip-makefile . . . SCONSOPTS_COMMON.) |
| 115 | INSTALL_nsis-docscip-makefile . . . INSTALL_nsis-doc. = install-examples install-doc install-docs |
| 116 | INSTALL_FLAGS_nsis-docscip-makefile . . . INSTALL_FLAGS_nsis-doc. = $(SCONSOPTS_COMMONscip-makefile . . . SCONSOPTS_COMMON.) \ |
| 117 | SKIPPLUGINS=ExDLL SKIPSTUBS=all SKIPUTILS=$(IGNORE_UTILS_COMMONscip-makefile . . . IGNORE_UTILS_COMMON.) \ |
| 118 | SKIPDOC=COPYING |
| 119 | |
| 120 | # Exclude test scripts which are not appropriate for POSIX platforms. |
| 121 | IGNORE_TESTSscip-makefile . . . IGNORE_TESTS. = gfx.nsi|install-per-user.nsi|install-shared.nsi|makensis.nsi |
| 122 | |
| 123 | # Path to .nsi scripts |
| 124 | SCRIPTS_PATHscip-makefile . . . SCRIPTS_PATH. = $(DOCDIRscip-makefile . . . DOCDIR.)/Examples |
| 125 | |
| 126 | # Add contents to the given Debian package by taking |
| 127 | # INSTALL_FLAGS_<package> and INSTALL_<package> variables into account. |
| 128 | # $(1) package name, for example nsis-common |
| 129 | # $(2) additional flags for scons |
| 130 | define DO_SCONS_INSTALLscip-makefile . . . DO_SCONS_INSTALL. |
| 131 | scons $(INSTALL_FLAGS_$(1)) $(2) PREFIX_DEST="$(INSTDIRscip-makefile . . . INSTDIR.)/$(1)" $(INSTALL_$(1)) || exit 1; |
| 132 | endef |
| 133 | |
| 134 | # Add contents to the given Debian package via the path specfic target |
| 135 | # $(1) package name, for example nsis-common |
| 136 | # $(2) path specfic scons target |
| 137 | define DO_SCONS_INSTALL_EXTRAscip-makefile . . . DO_SCONS_INSTALL_EXTRA. |
| 138 | scons $(INSTALL_FLAGS_$(1)) PREFIX_DEST="$(INSTDIRscip-makefile . . . INSTDIR.)/$(1)" "$(INSTDIRscip-makefile . . . INSTDIR.)/$(1)$(2)" || exit 1; |
| 139 | endef |
| 140 | |
| 141 | # Select pretty style option depending on major version of html2text |
| 142 | HTML2TEXT_PRETTY_OPTIONscip-makefile . . . HTML2TEXT_PRETTY_OPTION. = $(shell test $$(expr \ |
| 143 | $$(dpkg-query --show --showformat '$${Version}' html2text) \ |
| 144 | : '\([^.]*\)') -gt 1 \ |
| 145 | && echo -rcfile /usr/share/doc/html2text/examples/pretty.style \ |
| 146 | || echo -style pretty) |
| 147 | |
| 148 | # Convert html to text using the pretty.style configuration |
| 149 | # $(1) html formatted input file |
| 150 | # $(2) If omitted then the resulting text is written to standard output |
| 151 | # otherwise to the provided output file |
| 152 | define HTML2TEXT_PRETTYscip-makefile . . . HTML2TEXT_PRETTY. |
| 153 | html2text -nobs \ |
| 154 | $(HTML2TEXT_PRETTY_OPTIONscip-makefile . . . HTML2TEXT_PRETTY_OPTION.) $(if $(2),-o $(2) ,)$(1) |
| 155 | endef |
| 156 | |
| 157 | # Substitute reference to License text file in Modern UI examples |
| 158 | # with source file to enable their compilation with makensis |
| 159 | define SANITIZE_MODERN_UIscip-makefile . . . SANITIZE_MODERN_UI. |
| 160 | for f in $$(find "$(1)" -type f -name '*.nsi' -print0 | xargs -0 -n 1 basename); \ |
| 161 | do \ |
| 162 | sed -i \ |
| 163 | -e "s&\$${NSISDIR}\\\\Docs\\\\Modern UI\\\\License.txt&$${f}&g" \ |
| 164 | "$(1)/$${f}"; \ |
| 165 | done |
| 166 | endef |
| 167 | |
| 168 | # Replace duplicate files with symbolic link |
| 169 | define SYMLINK_DUPLICATESscip-makefile . . . SYMLINK_DUPLICATES. |
| 170 | for f in $$(ls -1 "$(1)"); \ |
| 171 | do \ |
| 172 | cmp -s "$(1)/$${f}" "$(2)/$${f}"; \ |
| 173 | if [ $$? -eq 0 ]; \ |
| 174 | then \ |
| 175 | ln -sf "$(3)/$${f}" "$(2)/$${f}"; \ |
| 176 | echo $${f}; \ |
| 177 | fi; \ |
| 178 | done |
| 179 | endef |
| 180 | |
| 181 | %scip-makefile . . . `%`/: |
| 182 | dh "$@scip-makefile . . . `@`." |
| 183 | |
| 184 | override_dh_auto_cleanscip-makefile . . . override_dh_auto_clean/: |
| 185 | # Remove build directory instead of removing target files |
| 186 | # via Scons due to pull in of dependencies. |
| 187 | -rm -rf .sconf_temp .sconsign.dblite SCons/Tools/__pycache__ SCons/Tools/crossmingw.pyc build config.log .test $(BUILDDIRscip-makefile . . . BUILDDIR.) $(TESTDIRscip-makefile . . . TESTDIR.) |
| 188 | -rm -f Source/exehead/sconf.h Source/version.h Source/defines.h config.log |
| 189 | |
| 190 | $(scip-makefile . . . `$(BUILDDIR)/NEWS`/BUILDDIRscip-makefile . . . BUILDDIR.)/NEWSscip-makefile . . . `$(BUILDDIR)/NEWS`/: |
| 191 | scons $(SCONSOPTS_HOSTscip-makefile . . . SCONSOPTS_HOST.) Docs/src; \ |
| 192 | html2text -nobs "$(BUILDDIRscip-makefile . . . BUILDDIR.)/$(BUILDTYPE)/Docs/html/AppendixF.html" | \ |
| 193 | sed -e '0,/^\*\*\*\*\*/c\NSIS Release Notes (automatically converted from AppendixF.html)' -e 's/F\.[.0-9]* //g' -e 's/^\*\*\*\** *\([^*]*\) *\**\*\*\*/\n\1\n/g' -e '/Changelog/d' -e '/^NSIS_1.x_version_history/,/^=/c\ http://nsis.sourceforge.net/download/nsis1/' -e 's/^\(Released.*\)/ \1\n/g' | cat -s > "$@scip-makefile . . . `@`." |
| 194 | |
| 195 | # Convert DocBook to man page |
| 196 | $(scip-makefile . . . `$(BUILDDIR)/%.1`/BUILDDIRscip-makefile . . . BUILDDIR.)/%.1scip-makefile . . . `$(BUILDDIR)/%.1`/: debian/%.xmlscip-makefile . . . `debian/%.xml`/ |
| 197 | xsltproc --nonet --output $@scip-makefile . . . `@`. $<scip-makefile . . . `<`. |
| 198 | |
| 199 | override_dh_auto_build-archscip-makefile . . . override_dh_auto_build-arch/: $(scip-makefile . . . `$(BUILDDIR)/NEWS`/BUILDDIRscip-makefile . . . BUILDDIR.)/NEWSscip-makefile . . . `$(BUILDDIR)/NEWS`/ $(scip-makefile . . . `$(BUILDDIR)/GenPat.1`/BUILDDIRscip-makefile . . . BUILDDIR.)/GenPat.1scip-makefile . . . `$(BUILDDIR)/GenPat.1`/ $(scip-makefile . . . `$(BUILDDIR)/makensis.1`/BUILDDIRscip-makefile . . . BUILDDIR.)/makensis.1scip-makefile . . . `$(BUILDDIR)/makensis.1`/ |
| 200 | scons $(SCONSOPTS_HOSTscip-makefile . . . SCONSOPTS_HOST.) utils makensis |
| 201 | |
| 202 | override_dh_auto_build-indepscip-makefile . . . override_dh_auto_build-indep/: $(scip-makefile . . . `$(BUILDDIR)/NEWS`/BUILDDIRscip-makefile . . . BUILDDIR.)/NEWSscip-makefile . . . `$(BUILDDIR)/NEWS`/ |
| 203 | scons $(SCONSOPTS_HOSTscip-makefile . . . SCONSOPTS_HOST.) makensis |
| 204 | ifdef XGCC_W32_X86_PATH |
| 205 | scons $(SCONSOPTS_COMMONscip-makefile . . . SCONSOPTS_COMMON.) $(SCONSOPTS_X86scip-makefile . . . SCONSOPTS_X86.) stubs plugins utils |
| 206 | endif |
| 207 | ifdef XGCC_W32_AMD64_PATH |
| 208 | scons $(SCONSOPTS_COMMONscip-makefile . . . SCONSOPTS_COMMON.) $(SCONSOPTS_AMD64scip-makefile . . . SCONSOPTS_AMD64.) stubs plugins utils |
| 209 | endif |
| 210 | $(call HTML2TEXT_PRETTY,"Contrib/Modern UI/Readme.html","$(BUILDDIRscip-makefile . . . BUILDDIR.)/README.Modern UI") |
| 211 | $(call HTML2TEXT_PRETTY,"Contrib/Modern UI 2/Readme.html","$(BUILDDIRscip-makefile . . . BUILDDIR.)/README.Modern UI 2") |
| 212 | $(call HTML2TEXT_PRETTY,Contrib/VPatch/Readme.html,$(BUILDDIRscip-makefile . . . BUILDDIR.)/README.VPatch) |
| 213 | $(call HTML2TEXT_PRETTY,Contrib/InstallOptions/Readme.html,$(BUILDDIRscip-makefile . . . BUILDDIR.)/README.InstallOptions) |
| 214 | $(call HTML2TEXT_PRETTY,Contrib/MultiUser/Readme.html,$(BUILDDIRscip-makefile . . . BUILDDIR.)/README.MultiUser) |
| 215 | $(call HTML2TEXT_PRETTY,Contrib/nsDialogs/Readme.html,$(BUILDDIRscip-makefile . . . BUILDDIR.)/README.nsDialogs) |
| 216 | |
| 217 | override_dh_auto_test-archscip-makefile . . . override_dh_auto_test-arch/: |
| 218 | ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) |
| 219 | scons $(SCONSOPTS_HOSTscip-makefile . . . SCONSOPTS_HOST.) test-code |
| 220 | endif |
| 221 | |
| 222 | override_dh_auto_test-indepscip-makefile . . . override_dh_auto_test-indep/: |
| 223 | ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) |
| 224 | test -x "$(BUILDDIRscip-makefile . . . BUILDDIR.)/$(BUILDTYPE)/makensis/makensis" && \ |
| 225 | scons $(INSTALL_FLAGS_nsisscip-makefile . . . INSTALL_FLAGS_nsis.) PREFIX_DEST="$(TESTDIRscip-makefile . . . TESTDIR.)"\ |
| 226 | install-compiler install-conf && \ |
| 227 | scons $(INSTALL_FLAGS_nsis-docscip-makefile . . . INSTALL_FLAGS_nsis-doc.) PREFIX_DEST="$(TESTDIRscip-makefile . . . TESTDIR.)"\ |
| 228 | install-examples && \ |
| 229 | scons $(INSTALL_FLAGS_nsis-commonscip-makefile . . . INSTALL_FLAGS_nsis-common.) $(SCONSOPTS_X86scip-makefile . . . SCONSOPTS_X86.) PREFIX_DEST="$(TESTDIRscip-makefile . . . TESTDIR.)" \ |
| 230 | $(INSTALL_nsis-commonscip-makefile . . . INSTALL_nsis-common.) && \ |
| 231 | scons $(INSTALL_FLAGS_nsis-commonscip-makefile . . . INSTALL_FLAGS_nsis-common.) $(SCONSOPTS_AMD64scip-makefile . . . SCONSOPTS_AMD64.) PREFIX_DEST="$(TESTDIRscip-makefile . . . TESTDIR.)" \ |
| 232 | $(INSTALL_nsis-commonscip-makefile . . . INSTALL_nsis-common.) && \ |
| 233 | $(call SANITIZE_MODERN_UI,$(TESTDIRscip-makefile . . . TESTDIR.)$(DOCDIRscip-makefile . . . DOCDIR.)/Examples/Modern UI) && \ |
| 234 | for script_path in $(TESTDIRscip-makefile . . . TESTDIR.)$(SCRIPTS_PATHscip-makefile . . . SCRIPTS_PATH.)/*.nsi \ |
| 235 | $(TESTDIRscip-makefile . . . TESTDIR.)$(SCRIPTS_PATHscip-makefile . . . SCRIPTS_PATH.)/*/*.nsi; do \ |
| 236 | script=$${script_path#$(TESTDIRscip-makefile . . . TESTDIR.)$(SCRIPTS_PATHscip-makefile . . . SCRIPTS_PATH.)/}; \ |
| 237 | if [ "$${script%/*}" != "$${script}" ]; then \ |
| 238 | mkdir -p "$(TESTDIRscip-makefile . . . TESTDIR.)/$${script%/*}"; \ |
| 239 | fi; \ |
| 240 | case $${script} in \ |
| 241 | $(IGNORE_TESTSscip-makefile . . . IGNORE_TESTS.)) ;; \ |
| 242 | *) \ |
| 243 | if [ -f "$${script_path}" ]; then \ |
| 244 | PATH=$(TESTDIRscip-makefile . . . TESTDIR.)$(PREFIXscip-makefile . . . PREFIX.)/bin:$(PATHscip-makefile . . . PATH.) \ |
| 245 | NSISDIR=$(TESTDIRscip-makefile . . . TESTDIR.)$(DATADIRscip-makefile . . . DATADIR.) \ |
| 246 | NSISCONFDIR=$(TESTDIRscip-makefile . . . TESTDIR.)$(SYSCONFscip-makefile . . . SYSCONF.) \ |
| 247 | "$(TESTDIRscip-makefile . . . TESTDIR.)$(PREFIXscip-makefile . . . PREFIX.)/bin/makensis" \ |
| 248 | "$${script_path}" \ |
| 249 | -X"OutFile \"$(TESTDIRscip-makefile . . . TESTDIR.)/$${script%.nsi}.exe\"" \ |
| 250 | || exit 1; \ |
| 251 | fi;; \ |
| 252 | esac; \ |
| 253 | done; |
| 254 | # Fail the build if libwinpthread is needed at runtime (see #722898) |
| 255 | test `find $(TESTDIRscip-makefile . . . TESTDIR.)$(DATADIRscip-makefile . . . DATADIR.)/Plugins -iname "*.dll" -exec objdump -p {} \; | grep -E "file format|DLL Name" | grep -cim1 libwinpthread` -eq 0 |
| 256 | endif |
| 257 | |
| 258 | override_dh_auto_install-archscip-makefile . . . override_dh_auto_install-arch/: |
| 259 | $(foreach p,$(shell dh_listpackages -a),$(call DO_SCONS_INSTALL,$(p))) |
| 260 | |
| 261 | override_dh_fixperms-archscip-makefile . . . override_dh_fixperms-arch/: |
| 262 | dh_fixperms |
| 263 | find "$(INSTDIRscip-makefile . . . INSTDIR.)/nsis/$(SYSCONFscip-makefile . . . SYSCONF.)" \ |
| 264 | -type f -perm /111 -exec chmod a-x {} \; |
| 265 | |
| 266 | override_dh_auto_install-indepscip-makefile . . . override_dh_auto_install-indep/: |
| 267 | $(foreach p,$(shell dh_listpackages -i),$(call DO_SCONS_INSTALL,$(p),$(SCONSOPTS_X86scip-makefile . . . SCONSOPTS_X86.))) |
| 268 | $(foreach p,$(shell dh_listpackages -i),$(call DO_SCONS_INSTALL,$(p),$(SCONSOPTS_AMD64scip-makefile . . . SCONSOPTS_AMD64.))) |
| 269 | # Add plugin example to nsis-pluginapi package |
| 270 | $(call DO_SCONS_INSTALL_EXTRA,nsis-pluginapi,$(DOCDIRscip-makefile . . . DOCDIR.)/Examples/Plugin) |
| 271 | # Exclude any architecture dependent binaries from nsis-common |
| 272 | rm -rf "$(INSTDIRscip-makefile . . . INSTDIR.)/nsis-common$(PREFIXscip-makefile . . . PREFIX.)/bin" |
| 273 | # Clean up examples and documentation |
| 274 | # The docs file can't seem to have spaces within the file name(s) |
| 275 | dh_installdocs -pnsis-doc "$(BUILDDIRscip-makefile . . . BUILDDIR.)/README.Modern UI" \ |
| 276 | "$(BUILDDIRscip-makefile . . . BUILDDIR.)/README.Modern UI 2" |
| 277 | rm "debian/nsis-doc$(DOCDIRscip-makefile . . . DOCDIR.)/Docs/Modern UI/License.txt" |
| 278 | rm "debian/nsis-doc$(DOCDIRscip-makefile . . . DOCDIR.)/Docs/Modern UI 2/License.txt" |
| 279 | rm "debian/nsis-doc$(DOCDIRscip-makefile . . . DOCDIR.)/Docs/NSISdl/License.txt" |
| 280 | $(call SANITIZE_MODERN_UI,$(INSTDIRscip-makefile . . . INSTDIR.)/nsis-doc$(DOCDIRscip-makefile . . . DOCDIR.)/Examples/Modern UI) |
| 281 | # Replace duplicate image files with symbolic links |
| 282 | $(call SYMLINK_DUPLICATES,$(INSTDIRscip-makefile . . . INSTDIR.)/nsis-doc$(DOCDIRscip-makefile . . . DOCDIR.)/Docs/Modern UI/images,$(INSTDIRscip-makefile . . . INSTDIR.)/nsis-doc$(DOCDIRscip-makefile . . . DOCDIR.)/Docs/Modern UI 2/images,../../Modern UI/images) |
| 283 | |
| 284 | override_dh_compress-indepscip-makefile . . . override_dh_compress-indep/: |
| 285 | dh_compress -X.nlf -X.nsh -X.nsi -X.dll |
| 286 | # Adapt links to documents with those of their compressed version |
| 287 | if [ -d debian/nsis-doc$(DOCDIRscip-makefile . . . DOCDIR.) ]; then \ |
| 288 | cd debian/nsis-doc$(DOCDIRscip-makefile . . . DOCDIR.) ; \ |
| 289 | find -mindepth 2 -name \*.gz | \ |
| 290 | sed -e 's,^\.\(.\+\)\.gz$$,\1,g' -e 's, ,%20,g' | \ |
| 291 | xargs -i88 sh -c 'fgrep -rl "88\"" . | \ |
| 292 | xargs -i{} sed -i -e "s|88\"|88.gz\"|g" "{}"'; \ |
| 293 | fi |
| 294 | |
| 295 | override_dh_fixperms-indepscip-makefile . . . override_dh_fixperms-indep/: |
| 296 | dh_fixperms |
| 297 | # Remove executable flag from data files |
| 298 | find "$(INSTDIRscip-makefile . . . INSTDIR.)/nsis-common$(DATADIRscip-makefile . . . DATADIR.)" \ |
| 299 | -type f -perm /111 -exec chmod a-x {} \; |
| 300 | # Fix permissions for plugin API header and library files |
| 301 | ifdef XGCC_W32_X86_PATH |
| 302 | find "$(INSTDIRscip-makefile . . . INSTDIR.)/nsis-pluginapi$(XGCC_W32_X86_PATHscip-makefile . . . XGCC_W32_X86_PATH.)" \ |
| 303 | -type f -perm /111 -exec chmod a-x {} \; |
| 304 | endif |
| 305 | ifdef XGCC_W32_AMD64_PATH |
| 306 | find "$(INSTDIRscip-makefile . . . INSTDIR.)/nsis-pluginapi$(XGCC_W32_AMD64_PATHscip-makefile . . . XGCC_W32_AMD64_PATH.)" \ |
| 307 | -type f -perm /111 -exec chmod a-x {} \; |
| 308 | endif |