Commit 738940a2acfdcff966b485eb55ae45f7cf50f340
1 parent
cdb1d9df
Exists in
master
and in
5 other branches
Refactoring windows package builder.
Showing
1 changed file
with
59 additions
and
14 deletions
Show diff stats
win/pack.sh
| @@ -166,6 +166,14 @@ buildLibrary() | @@ -166,6 +166,14 @@ buildLibrary() | ||
| 166 | failed "Can't install ${1}" | 166 | failed "Can't install ${1}" |
| 167 | fi | 167 | fi |
| 168 | 168 | ||
| 169 | + for NSI in $(find ./win -name '*.nsi') | ||
| 170 | + do | ||
| 171 | + cp "${NSI}" "${WORKDIR}/build/${ARCH}" | ||
| 172 | + if [ "$?" != "0" ]; then | ||
| 173 | + failed "Can't copy ${NSI}" | ||
| 174 | + fi | ||
| 175 | + done | ||
| 176 | + | ||
| 169 | done | 177 | done |
| 170 | 178 | ||
| 171 | } | 179 | } |
| @@ -243,12 +251,14 @@ buildApplication() | @@ -243,12 +251,14 @@ buildApplication() | ||
| 243 | failed "Can't install ${1}" | 251 | failed "Can't install ${1}" |
| 244 | fi | 252 | fi |
| 245 | 253 | ||
| 246 | - if [ -e ./win/${1}.nsi ]; then | ||
| 247 | - cp "./win/${1}.nsi" "${WORKDIR}/build/${ARCH}" | 254 | + |
| 255 | + for NSI in $(find ./win -name '*.nsi') | ||
| 256 | + do | ||
| 257 | + cp "${NSI}" "${WORKDIR}/build/${ARCH}" | ||
| 248 | if [ "$?" != "0" ]; then | 258 | if [ "$?" != "0" ]; then |
| 249 | - failed "Can't copy ${1}.nsi" | 259 | + failed "Can't copy ${NSI}" |
| 250 | fi | 260 | fi |
| 251 | - fi | 261 | + done |
| 252 | 262 | ||
| 253 | if [ -e ./win/makeruntime.sh ]; then | 263 | if [ -e ./win/makeruntime.sh ]; then |
| 254 | cp "./win/makeruntime.sh" "${WORKDIR}/build/${ARCH}/${1}-makeruntime.sh" | 264 | cp "./win/makeruntime.sh" "${WORKDIR}/build/${ARCH}/${1}-makeruntime.sh" |
| @@ -330,19 +340,47 @@ makeInstaller() | @@ -330,19 +340,47 @@ makeInstaller() | ||
| 330 | for ARCH in ${TARGET_ARCHS} | 340 | for ARCH in ${TARGET_ARCHS} |
| 331 | do | 341 | do |
| 332 | 342 | ||
| 333 | - echo -e "\e]2;Creating installer for ${ARCH}\a" | ||
| 334 | - echo "Creating installer for ${ARCH}" | 343 | + echo -e "\e]2;Creating installers for ${ARCH}\a" |
| 344 | + echo "Creating installers for ${ARCH}" | ||
| 335 | 345 | ||
| 336 | cd ${WORKDIR}/build/${ARCH} | 346 | cd ${WORKDIR}/build/${ARCH} |
| 337 | 347 | ||
| 338 | - echo makensis ${NSIS_ARGS} ./pw3270.nsi | ||
| 339 | - /bin/bash | 348 | + TARCH=${ARCH} |
| 349 | + if [ "${TARCH}" == "x86_32" ]; then | ||
| 350 | + TARCH="i686" | ||
| 351 | + fi | ||
| 352 | + | ||
| 353 | + for NSI in *.nsi | ||
| 354 | + do | ||
| 355 | + makensis ${NSIS_ARGS} ${NSI} | ||
| 356 | + if [ "$?" != "0" ]; then | ||
| 357 | + failed "Error building ${NSI}" | ||
| 358 | + fi | ||
| 340 | 359 | ||
| 360 | + echo "TARCH="[${TARCH}]" ARCH=[${ARCH}]" | ||
| 361 | + ls -l *-[0-9]*-${TARCH}.exe | ||
| 341 | 362 | ||
| 342 | - mv -f *.exe ${PROJECTDIR} | ||
| 343 | - if [ "$?" != "0" ]; then | ||
| 344 | - failed "Can't copy installer to ${PROJECTDIR}" | ||
| 345 | - fi | 363 | + if [ -d ~/public_html ]; then |
| 364 | + mkdir -p ~/public_html/win/${PROJECT_NAME}/${ARCH} | ||
| 365 | + cp -v *-[0-9]*-${TARCH}.exe ~/public_html/win/${PROJECT_NAME}/${ARCH} | ||
| 366 | + if [ "$?" != "0" ]; then | ||
| 367 | + failed "Can't copy binary to ~/public_html/win/${PROJECT_NAME}/${ARCH}" | ||
| 368 | + fi | ||
| 369 | + fi | ||
| 370 | + | ||
| 371 | + if [ "${PUBLISH}" == "1" ] && [ ! -z ${WIN_PACKAGE_SERVER} ]; then | ||
| 372 | + scp *-[0-9]*-${TARCH}.exe ${WIN_PACKAGE_SERVER}/${PROJECT_NAME}/${ARCH} | ||
| 373 | + if [ "$?" != "0" ]; then | ||
| 374 | + failed "Can't publish to ${WIN_PACKAGE_SERVER}/${PROJECT_NAME}/${ARCH}" | ||
| 375 | + fi | ||
| 376 | + fi | ||
| 377 | + | ||
| 378 | + mv -f *-[0-9]*-${TARCH}.exe ${PROJECTDIR} | ||
| 379 | + if [ "$?" != "0" ]; then | ||
| 380 | + failed "Can't move installer to ${PROJECTDIR}" | ||
| 381 | + fi | ||
| 382 | + | ||
| 383 | + done | ||
| 346 | 384 | ||
| 347 | done | 385 | done |
| 348 | 386 | ||
| @@ -375,8 +413,8 @@ do | @@ -375,8 +413,8 @@ do | ||
| 375 | 413 | ||
| 376 | ;; | 414 | ;; |
| 377 | 415 | ||
| 378 | - CONFIG) | ||
| 379 | - . ${value} | 416 | + PATH) |
| 417 | + PROJECTDIR=$(readlink -f ${value}) | ||
| 380 | ;; | 418 | ;; |
| 381 | 419 | ||
| 382 | 420 | ||
| @@ -409,6 +447,13 @@ do | @@ -409,6 +447,13 @@ do | ||
| 409 | done | 447 | done |
| 410 | 448 | ||
| 411 | # | 449 | # |
| 450 | +# Load customizations | ||
| 451 | +# | ||
| 452 | +if [ -e ${PROJECTDIR}/pw3270.win32.build.conf ]; then | ||
| 453 | + . ${PROJECTDIR}/pw3270.win32.build.conf | ||
| 454 | +fi | ||
| 455 | + | ||
| 456 | +# | ||
| 412 | # Download sources | 457 | # Download sources |
| 413 | # | 458 | # |
| 414 | for src in ${CORE_LIBRARIES} | 459 | for src in ${CORE_LIBRARIES} |