Web inteface: nicer system error page, and introduced a bug (OK, a photo of a bug :-)
[openxpki.git] / trunk / package / freebsd / update-port.sh
blobcf642812494de74e4f2c270c8fbb48097f032711
1 #!/bin/sh
2 ##
3 ## Written 2006 by Julia Dubenskaya
4 ## for the OpenXPKI project
5 ## (C) Copyright 2006 by The OpenXPKI Project
7 set -e
9 myPWD=`pwd`
10 PKGNAME_PREFIX="p5-"
11 MAJOR_VERSION="0.9"
12 PORT_PATH="/usr/ports/security"
13 DISTS_PATH="/usr/ports/distfiles/openxpki"
14 PORT_NAME_SHORT=$1
15 PORT_NAME_SHORT=`echo ${PORT_NAME_SHORT} | sed -e "s/^${PKGNAME_PREFIX}//"`
16 PORT_NAME=${PKGNAME_PREFIX}${PORT_NAME_SHORT}
17 TMP=${HOME}/tmp/${PORT_NAME_SHORT}
19 if [ ! -d ${myPWD}/${PORT_PATH}/${PORT_NAME} ]; then
20 echo -e "Usage: update-port.sh PORT_NAME. \nPossible values of PORT_NAME:\n$(cd ${myPWD}/${PORT_PATH}/ && ls | grep ${PKGNAME_PREFIX})"
21 exit 1
24 if [ -d ${TMP} ]; then
25 rm -rf ${TMP}
28 cd ${myPWD}/${DISTS_PATH}/
29 TARBALL_NAME=`find . -iname ${PORT_NAME_SHORT}-${MAJOR_VERSION}.*\.gz | sed -e "s/\.\///"`
30 if [ ${TARBALL_NAME} ]; then
31 echo "New tarball is " ${TARBALL_NAME}
32 else
33 echo "No new tarball for the port ${PORT_NAME} was found in"
34 echo "${myPWD}/${DISTS_PATH}/"
35 echo "Port was not updated."
36 exit 1
39 echo "========================================================="
40 echo "Building pkg-plist"
41 echo "========================================================="
42 cp ${myPWD}/build-plist.sh ${myPWD}/${PORT_PATH}/${PORT_NAME}/
43 cd ${myPWD}/${PORT_PATH}/${PORT_NAME}/
45 ./build-plist.sh
46 rm ${myPWD}/${PORT_PATH}/${PORT_NAME}/build-plist.sh
48 mv pkg-plist pkg-plist.0
49 mv Makefile Makefile.bak
51 ${myPWD}/get-final-plist.pl ${PORT_NAME_SHORT}
52 echo "pwd = " $(pwd)
53 export NOCLEANDEPENDS="yes"
54 make clean
55 rm Makefile.bak
56 rm pkg-plist.0
58 if [ -d ${TMP} ]; then
59 rm -rf ${TMP}