Home | History | Annotate | Line # | Download | only in build
      1       1.1     lukem #! /bin/sh
      2   1.1.1.4      tron # $OpenLDAP$
      3       1.1     lukem ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
      4       1.1     lukem ##
      5  1.1.1.10  christos ## Copyright 1998-2024 The OpenLDAP Foundation.
      6       1.1     lukem ## All rights reserved.
      7       1.1     lukem ##
      8       1.1     lukem ## Redistribution and use in source and binary forms, with or without
      9       1.1     lukem ## modification, are permitted only as authorized by the OpenLDAP
     10       1.1     lukem ## Public License.
     11       1.1     lukem ##
     12       1.1     lukem ## A copy of this license is available in the file LICENSE in the
     13       1.1     lukem ## top-level directory of the distribution or, alternatively, at
     14       1.1     lukem ## <http://www.OpenLDAP.org/license.html>.
     15       1.1     lukem #
     16       1.1     lukem # Make a release
     17       1.1     lukem #
     18       1.1     lukem 
     19       1.1     lukem #
     20       1.1     lukem # This script MUST NOT add files to the export nor modify
     21   1.1.1.4      tron # any file in the export, exceptions:
     22   1.1.1.4      tron #	make guide.html
     23       1.1     lukem #
     24       1.1     lukem 
     25       1.1     lukem set -e 		# exit immediately if any errors occur
     26       1.1     lukem 
     27       1.1     lukem if test $# != 3 ; then
     28   1.1.1.4      tron 	echo 'usage: mkrelease REPO RELNAME TAG'
     29       1.1     lukem 	exit 1
     30       1.1     lukem fi
     31       1.1     lukem 
     32   1.1.1.4      tron REPO=$1
     33   1.1.1.4      tron shift
     34       1.1     lukem RELNAME=openldap-$1
     35       1.1     lukem shift
     36   1.1.1.4      tron TAG=$1
     37       1.1     lukem shift
     38       1.1     lukem 
     39   1.1.1.5  christos #Linux
     40   1.1.1.5  christos #SHA="sha1sum"
     41   1.1.1.5  christos #MD="md5sum"
     42   1.1.1.5  christos #BSD
     43   1.1.1.5  christos #SHA="sha1"
     44   1.1.1.5  christos #MD="md5"
     45   1.1.1.5  christos #OpenSSL
     46   1.1.1.9  christos #SHA="openssl sha1"
     47   1.1.1.9  christos SHA3="openssl sha3-512"
     48   1.1.1.9  christos #MD="openssl md5"
     49   1.1.1.5  christos 
     50       1.1     lukem if test -e $RELNAME ; then
     51       1.1     lukem 	echo "error: $RELNAME exists"
     52       1.1     lukem 	exit 1
     53       1.1     lukem fi
     54       1.1     lukem 
     55       1.1     lukem echo Release: $RELNAME
     56   1.1.1.4      tron echo Tag: $TAG
     57       1.1     lukem 
     58   1.1.1.4      tron git archive --format=tar --prefix="${RELNAME}/" --remote="${REPO}" "$TAG" |  tar xvf -
     59       1.1     lukem 
     60       1.1     lukem if test ! -d $RELNAME ; then
     61       1.1     lukem 	echo "error: $RELNAME doesn't exists"
     62       1.1     lukem 	exit 1
     63       1.1     lukem fi
     64       1.1     lukem 
     65       1.1     lukem if test -e $RELNAME/doc/guide/admin/guide.sdf ; then
     66       1.1     lukem 	echo "build guide..."
     67       1.1     lukem 	( cd $RELNAME/doc/guide/admin ; make guide.html )
     68       1.1     lukem else
     69       1.1     lukem 	echo "No guide"
     70       1.1     lukem fi
     71       1.1     lukem 
     72       1.1     lukem if test -e $RELNAME/libraries/liblunicode/ucdata/uctable.h ; then
     73       1.1     lukem 	echo "touching uctable.h..."
     74       1.1     lukem 	touch $RELNAME/libraries/liblunicode/ucdata/uctable.h
     75       1.1     lukem fi
     76       1.1     lukem 
     77       1.1     lukem if test ! -e $RELNAME/build/version.sh ; then
     78       1.1     lukem 	echo "No build version"
     79       1.1     lukem 	OL_STRING="something"
     80       1.1     lukem else
     81       1.1     lukem 	eval `$RELNAME/build/version.sh`
     82       1.1     lukem fi
     83       1.1     lukem 
     84       1.1     lukem echo "Rolling up $OL_STRING ..."
     85       1.1     lukem 
     86       1.1     lukem 
     87       1.1     lukem tar cf $RELNAME.tar $RELNAME
     88       1.1     lukem gzip -9 -c $RELNAME.tar > $RELNAME.tgz
     89   1.1.1.9  christos #${MD} $RELNAME.tgz > $RELNAME.md5
     90   1.1.1.9  christos #${SHA} $RELNAME.tgz > $RELNAME.sha1
     91   1.1.1.9  christos ${SHA3} $RELNAME.tgz > $RELNAME.sha3-512
     92       1.1     lukem rm -f $RELNAME.tar
     93       1.1     lukem 
     94       1.1     lukem ls -l $RELNAME.*
     95       1.1     lukem 
     96       1.1     lukem echo "Made $OL_STRING as $RELNAME.tgz"
     97