Commit 3cf333d8e9aac0d81a250adf47525b5775d737a8
1 parent
753f710f
Start implementing pkg check
Showing
5 changed files
with
123 additions
and
6 deletions
.gitignore
Makefile.am
| ... | ... | @@ -94,7 +94,7 @@ help: |
| 94 | 94 | pkg: |
| 95 | 95 | @case `uname -s` in \ |
| 96 | 96 | Darwin*) \ |
| 97 | - echo "Darwin supported"; \ | |
| 97 | + echo "Build Mac OS X installation image"; \ | |
| 98 | 98 | dev/pkgbuild-macosx.sh $(PACKAGE_VERSION); \ |
| 99 | 99 | ;; \ |
| 100 | 100 | Linux*) \ |
| ... | ... | @@ -118,7 +118,8 @@ pkg: |
| 118 | 118 | pkgcheck: |
| 119 | 119 | @case `uname -s` in \ |
| 120 | 120 | Darwin*) \ |
| 121 | - echo "Darwin supported"; \ | |
| 121 | + echo "Check Mac OS X installation image"; \ | |
| 122 | + dev/pkgcheck-macosx.sh $(PACKAGE_VERSION); \ | |
| 122 | 123 | ;; \ |
| 123 | 124 | Linux*) \ |
| 124 | 125 | if type lsb_release >/dev/null 2>&1; then \ | ... | ... |
dev/pkgbuild-macosx.sh
dev/pkgcheck-macosx.sh
0 → 100755
| 1 | +#!/bin/bash -f | |
| 2 | +# ========================================================================== | |
| 3 | +# ctools Mac OS X package validation | |
| 4 | +# | |
| 5 | +# Copyright (C) 2017 Juergen Knoedlseder | |
| 6 | +# | |
| 7 | +# This program is free software: you can redistribute it and/or modify | |
| 8 | +# it under the terms of the GNU General Public License as published by | |
| 9 | +# the Free Software Foundation, either version 3 of the License, or | |
| 10 | +# (at your option) any later version. | |
| 11 | +# | |
| 12 | +# This program is distributed in the hope that it will be useful, | |
| 13 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 14 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 15 | +# GNU General Public License for more details. | |
| 16 | +# | |
| 17 | +# You should have received a copy of the GNU General Public License | |
| 18 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. | |
| 19 | +# | |
| 20 | +# ========================================================================== | |
| 21 | + | |
| 22 | +# ============================================= # | |
| 23 | +# Get ctools/GammaLib version from command line # | |
| 24 | +# ============================================= # | |
| 25 | +if [ $# -ne 1 ] ; then | |
| 26 | + echo "Please specify ctools/GammaLib version in the form x.y.z" | |
| 27 | + exit 1 | |
| 28 | +fi | |
| 29 | +VERSION=$1 | |
| 30 | + | |
| 31 | + | |
| 32 | +# =============================== # | |
| 33 | +# Set software component versions # | |
| 34 | +# =============================== # | |
| 35 | +#CFITSIO=cfitsio3410 | |
| 36 | +#NCURSES=ncurses-6.0 | |
| 37 | +#READLINE=readline-7.0 | |
| 38 | +#GAMMALIB=gammalib-$VERSION | |
| 39 | +CTOOLS=ctools-$VERSION | |
| 40 | + | |
| 41 | + | |
| 42 | +# ============== # | |
| 43 | +# Set parameters # | |
| 44 | +# ============== # | |
| 45 | +WRKDIR=$PWD/pkg_check | |
| 46 | +PKGDIR=$PWD/pkg_build | |
| 47 | + | |
| 48 | + | |
| 49 | +#INSTALLDIR=$WRKDIR/install | |
| 50 | +#SRCDIR=$WRKDIR/src | |
| 51 | +#PKGDIR=$WRKDIR/pkg | |
| 52 | +#PRODDIR=$WRKDIR/prod | |
| 53 | +#PLISTFILE=$PKGDIR/$CTOOLS-components.plist | |
| 54 | +#DISTFILE=$PRODDIR/$CTOOLS.dist | |
| 55 | +DMGFILE=$PKGDIR/$CTOOLS-macosx10.7.dmg | |
| 56 | + | |
| 57 | + | |
| 58 | +# ====================== # | |
| 59 | +# Clean package creation # | |
| 60 | +# ====================== # | |
| 61 | +umount $WRKDIR | |
| 62 | +rm -rf $WRKDIR | |
| 63 | + | |
| 64 | + | |
| 65 | +# ============================= # | |
| 66 | +# Create package directory tree # | |
| 67 | +# ============================= # | |
| 68 | +mkdir -p $WRKDIR | |
| 69 | + | |
| 70 | + | |
| 71 | +# ================================= # | |
| 72 | +# Create Mac OS X RAM disk (488 MB) # | |
| 73 | +# ================================= # | |
| 74 | +DEVICE=$(hdiutil attach ram://1000000 -nomount) | |
| 75 | +diskutil erasevolume HFS+ 'ctools-test' $DEVICE | |
| 76 | +umount -f /Volumes/ctools-test | |
| 77 | +#sudo diskutil enableOwnership $DEVICE # You must be root for this command | |
| 78 | +mount -t hfs $DEVICE $WRKDIR | |
| 79 | + | |
| 80 | + | |
| 81 | +# =============== # | |
| 82 | +# Install package # | |
| 83 | +# =============== # | |
| 84 | +echo $DMGFILE | |
| 85 | +hdiutil attach $DMGFILE | |
| 86 | +sudo installer -pkg /Volumes/$CTOOLS/$CTOOLS.pkg -target $WRKDIR # You must be root for this command | |
| 87 | +hdiutil detach /Volumes/$CTOOLS | |
| 88 | + | |
| 89 | + | |
| 90 | +# ================= # | |
| 91 | +# Configure package # | |
| 92 | +# ================= # | |
| 93 | +env | |
| 94 | +export GAMMALIB=$WRKDIR/usr/local/gamma | |
| 95 | +source $GAMMALIB/bin/gammalib-init.sh | |
| 96 | +export CTOOLS=$WRKDIR/usr/local/gamma | |
| 97 | +source $CTOOLS/bin/ctools-init.sh | |
| 98 | +echo | |
| 99 | +echo | |
| 100 | +env | |
| 101 | + | |
| 102 | + | |
| 103 | +# ============ # | |
| 104 | +# Test package # | |
| 105 | +# ============ # | |
| 106 | +python -c 'import gammalib; gammalib.test()' | |
| 107 | +python -c 'import ctools; ctools.test()' | |
| 108 | + | |
| 109 | + | |
| 110 | +# =============== # | |
| 111 | +# Detach RAM disk # | |
| 112 | +# =============== # | |
| 113 | +#hdiutil detach $WRKDIR | |
| 114 | + | ... | ... |
src/ctools-setup.in
| ... | ... | @@ -26,8 +26,9 @@ fi |
| 26 | 26 | # |
| 27 | 27 | # Set parameters |
| 28 | 28 | # ============== |
| 29 | -prefix="@prefix@" | |
| 30 | -exec_prefix="@exec_prefix@" | |
| 29 | +#prefix="@prefix@" | |
| 30 | +prefix=$CTOOLS | |
| 31 | +#exec_prefix="@exec_prefix@" | |
| 31 | 32 | ctools_bin="@bindir@" |
| 32 | 33 | ctools_lib="@libdir@" |
| 33 | 34 | uname_system=`uname` | ... | ... |