# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
# minstallp.ksh # create an installp image of ${NAME} (defined in aixinfo)
# from TEMPDIR using mkinstallp (part of bos.adt.insttools)
umask 022
TEMPDIR=$1
BASE=`pwd`
cd ${TEMPDIR}
# use the aixinfo for PKG NAME VERSION etc labels
cd ${BASE}
# mkdir -p $INFO
# mkinstallp template definitions
# copy LICENSE information
# TODO: setup template so that license acceptance is required
# TODO: add Copyright Information for display during install
cd ${TEMPDIR}
# remove files we do not want as "part" possibly
# left-over from a previous packaging
#if we are going to add extra symbolic links - do it now
# get the directory sizes in blocks
do
if [[ -d $d/${NAME} ]]
then
else
[[ -d $d ]] && set `du -s $d`
fi
# make sure the argument exists before using setting values
if [[ -d $d ]]
then
eval nm$d=/"$2"
let sz$d=$1
fi
done
cd ${TEMPDIR}/..
cat - <<EOF >>$template
Package Name: ${PKG}.${NAME}
Package VRMF: ${VERSION}.${RELEASE}
Update: N
Fileset
Fileset Name: ${PKG}.${NAME}.rte
Fileset VRMF: ${VERSION}.${RELEASE}
Fileset Description: ${descr}
USRLIBLPPFiles
EOUSRLIBLPPFiles
Bosboot required: N
License agreement acceptance required: N
Name of license agreement:
Include license files in this package: N
Requisites:
EOF
echo " USRFiles" >> $template
# USR part -- i.e. files in /usr and /opt
cd ${TEMPDIR}/..
| sed -e s#^${files}## | sed -e "/^$/d" >>$template
echo " EOUSRFiles" >> $template
then
cd ${TEMPDIR}
[[ $szetc -gt 0 ]] && find ./etc -type d | backup -if - | (cd ${INSTROOT}; restore -xqf -) >/dev/null
[[ $szvar -gt 0 ]] && find ./var -type d | backup -if - | (cd ${INSTROOT}; restore -xqf -) >/dev/null
cat - <<EOF >>$template
ROOT Part: Y
ROOTFiles
EOF
# ROOT part
cd ${TEMPDIR}/..
| sed -e s#^${files}## | sed -e "/^$/d" >>$template
else
# no ROOT parts to include
cat - <<EOF >>$template
ROOT Part: N
ROOTFiles
EOF
fi
cat - <<EOF >>$template
EOROOTFiles
Relocatable: N
EOFileset
EOF
# man pages as separate fileset
cd ${TEMPDIR}
then
# manual pages, space required calculation
szman=$1
cat - <<EOF >>$template
Fileset
Fileset Name: ${PKG}.${NAME}.man.en_US
Fileset VRMF: ${VERSION}.${RELEASE}
Fileset Description: ${descr}
USRLIBLPPFiles
EOUSRLIBLPPFiles
Bosboot required: N
License agreement acceptance required: N
Name of license agreement:
Include license files in this package: N
Requisites:
EOF
echo " USRFiles" >> $template
cd ${TEMPDIR}/..
cat - <<EOF >>$template
EOUSRFiles
ROOT Part: N
ROOTFiles
EOROOTFiles
Relocatable: N
EOFileset
EOF
fi
# use mkinstallp to create the fileset. result is in ${TEMPDIR}/tmp
# must actually sit in TEMPDIR for ROOT part processing to succeed
# also - need "empty" directories to exist, as they do not get copied
# in the inst_root part
cd ${TEMPDIR}
# create TOC
inutoc .