3 ## Written 2006 by Julia Dubenskaya and Sergei Vyshenski
4 ## for the OpenXPKI project
5 ## (C) Copyright 2006 by The OpenXPKI Project
9 MAIN_DIR
=`cd ../../../.. && pwd`
10 MAIN_PORTS_DIR
="/usr/ports"
11 PORTS_DIR
="${MAIN_DIR}/openxpki/trunk/package/freebsd/${MAIN_PORTS_DIR}"
12 TARBALLS_DIR
="${PORTS_DIR}/distfiles/openxpki"
15 BSD_FILES
="bsd.openssl.mk bsd.port.mk bsd.sites.mk"
18 if test -f Makefile
; then ${MAKE} clean
20 if test -f Makefile.old
; then rm -f *.old
24 if [ -e ${PORTS_DIR}/Mk
]; then
25 if [ -d ${PORTS_DIR}/Mk
-o -h ${PORTS_DIR}/Mk
]; then
26 echo "Link or directory ${PORTS_DIR}/Mk already exists";
27 for BSD_FILE
in ${BSD_FILES}; do
28 if [ ! -f ${PORTS_DIR}/Mk
/${BSD_FILE} ]; then
29 echo "File ${BSD_FILE} is absent from ${PORTS_DIR}/Mk"
33 echo "All needed files are present in ${PORTS_DIR}/Mk";
35 echo "${PORTS_DIR}/Mk exists"
36 echo "but it is not a symbolic link or directory"
40 echo "Link directory ${PORTS_DIR}/Mk does not exist";
41 if [ ! -d ${MAIN_PORTS_DIR} ]; then
42 echo "Directory ${MAIN_PORTS_DIR}/Mk does not exist too";
43 echo "Please provide directory ${PORTS_DIR}/Mk with files:"
44 for BSD_FILE
in ${BSD_FILES}; do
49 echo "Soft link ${PORTS_DIR}/Mk will be created"
50 ln -s ${MAIN_PORTS_DIR}/Mk
${PORTS_DIR}/Mk
54 rm -rf ${TARBALLS_DIR}/*
55 rm -rf ${MAIN_DIR}/*.
tar.gz
56 rm -rf ${MAIN_DIR}/*.tgz
58 #---------------- SERVER ----------------------
60 SERVER_DIR
="openxpki/trunk/perl-modules/core/trunk"
61 TAR_SERVER_DIR
="perl_modules"
63 if ! test -d ${MAIN_DIR}/${SERVER_DIR}; then
64 echo "Error: directory ${MAIN_DIR}/${SERVER_DIR} does not exist"
68 cd ${MAIN_DIR}/${SERVER_DIR}
75 ${MV} *.gz
${TARBALLS_DIR}/
79 #---------------- CLIENTS ----------------------
81 CLIENTS_COMMON_DIR
="openxpki/trunk/clients/perl"
82 CLIENTS
="OpenXPKI-Client \
83 OpenXPKI-Client-HTML-Mason \
86 for CLIENT_NAME
in ${CLIENTS}
88 CLIENT_DIR
=${MAIN_DIR}/${CLIENTS_COMMON_DIR}/${CLIENT_NAME}
89 if test -d ${CLIENT_DIR}; then
90 echo =================================================================
91 echo fixing directory
: ${CLIENT_DIR}
92 echo =================================================================
97 ${MV} *.gz
${TARBALLS_DIR}/
102 #---------------- DEPLOYMENT----------------------
104 COMMON_DIR
="openxpki/trunk"
105 OTHER_DIRS
="deployment"
107 for DIR
in ${OTHER_DIRS}
109 cd ${MAIN_DIR}/${COMMON_DIR}/${DIR}
111 .
/configure
--distonly
113 ${MV} *.gz
${TARBALLS_DIR}/
117 #---------------- i18n ----------------------
119 COMMON_DIR
="openxpki/trunk"
122 for DIR
in ${OTHER_DIRS}
124 cd ${MAIN_DIR}/${COMMON_DIR}/${DIR}
127 ${MV} *.gz
${TARBALLS_DIR}/
131 #---------------- Makefile for port ----------------------
134 PORTS
="openxpki openxpki-client openxpki-client-html-mason openxpki-client-scep openxpki-i18n openxpki-deployment"
139 for PORT
in ${PORTS}; do
141 TARBALL_NAME
=`find . -iname ${PORT}-${MAJOR_VERSION}.*.gz | sed -e "s/\.\///"`
142 PORT_NAME
=`echo ${TARBALL_NAME} | sed -e "s/\(^.*\)-${MAJOR_VERSION}\..*\.tar\.gz/\1/"`
143 NEW_MINOR_VERSION
=`echo ${TARBALL_NAME} | sed -e "s/${PORT_NAME}-${MAJOR_VERSION}\.\(.*\)\.tar\.gz/\1/"`
144 PORT_MAKEFILE
="${PORTS_DIR}/security/${PORTS_PREFIX}${PORT}/Makefile"
145 PREV_MINOR_VERSION
=`grep "PORTVERSION=" ${PORT_MAKEFILE} | sed -e "s/PORTVERSION= ${MAJOR_VERSION}\.\(.*$\)/\1/"`
146 if [ ${NEW_MINOR_VERSION} != ${PREV_MINOR_VERSION} ]; then
147 MODIFIED_PORTS
=`expr ${MODIFIED_PORTS} + 1`
148 echo "${MODIFIED_PORTS}.Updating port ${PORTS_PREFIX}${PORT}: previous version = ${PREV_MINOR_VERSION}, new version = ${NEW_MINOR_VERSION}."
150 -e "s/\(PORTVERSION= ${MAJOR_VERSION}\.\).*$/\1${NEW_MINOR_VERSION}/" \
151 -e "s/${PORT_NAME}-${MAJOR_VERSION}\..*\.gz/${TARBALL_NAME}/" -i .bak ${PORT_MAKEFILE}
153 cd ${PORTS_DIR}/security/${PORTS_PREFIX}${PORT}/
154 make makesum PORTSDIR=${PORTS_DIR}
156 rm -rf ${TARBALLS_DIR}/${TARBALL_NAME}
160 echo Your TARBALLS have gone into directory ${TARBALLS_DIR}
161 echo "Makefile and distinfo files modified
in ${MODIFIED_PORTS} ports
in directory
${PORTS_DIR}/security
/"