Check-in [294977292d]
Overview
Comment:Release building updates
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:294977292d7bba4436e671dbe3bd824356609aff
User & Date: rkeene on 2016-02-03 07:11:51
Other Links: manifest | tags
Context
2016-02-03
08:03
Chrome extension cleanups check-in: 482f4fa828 user: rkeene tags: trunk
07:11
Release building updates check-in: 294977292d user: rkeene tags: trunk
07:08
Add header files for pcsclite check-in: b4f1d32aff user: rkeene tags: trunk
Changes

Modified build/make-release from [37e5d36a75] to [9bc2bb2091].

     1      1   #! /bin/bash
     2      2   
     3         -PATH="${PATH}:/sbin:/usr/sbin:/usr/local/sbin"
            3  +PATH="${HOME}/root/cross-compilers:${PATH}:/sbin:/usr/sbin:/usr/local/sbin"
     4      4   export PATH
     5      5   
     6      6   VERSION="$1"
     7      7   
     8      8   if [ -z "${VERSION}" ]; then
     9      9   	echo 'Usage: make-release <cackey_version>' >&2
    10     10   	exit 1
    11     11   fi
    12     12   
    13         -for dir in ../../archive/ ../archive/; do
           13  +for dir in ../../archive/ ../archive/ ..; do
    14     14   	CACKEY_TARBALL="$(readlink -f "${dir}/cackey-${VERSION}.tar.gz")"
    15     15   
    16     16   	if [ -f "${CACKEY_TARBALL}" ]; then
    17     17   		break
    18     18   	fi
    19     19   done
           20  +
           21  +if [ ! -f "${CACKEY_TARBALL}" ]; then
           22  +	echo "Tarball not found" >&2
           23  +
           24  +	exit 1
           25  +fi
    20     26   
    21     27   # Create RPM, SRPM, and Slackware package
    22     28   ## Create RPM/SRPM
    23         -mkdir -p ~/rpmbuild/SPECS ~/rpmbuild/SOURCES
           29  +(
           30  +	eval "$(setup-cc x86_64-redhat5-linux)"
    24     31   
    25         -cp "${CACKEY_TARBALL}" ~/rpmbuild/SOURCES/ || exit 1
    26         -tar -xOf "${CACKEY_TARBALL}" cackey-${VERSION}/cackey.spec > ~/rpmbuild/SPECS/cackey-${VERSION}.spec || exit 1
           32  +	mkdir -p ~/rpmbuild/SPECS ~/rpmbuild/SOURCES
    27     33   
    28         -rpmbuild -ba ~/rpmbuild/SPECS/cackey-${VERSION}.spec || exit 1
           34  +	cp "${CACKEY_TARBALL}" ~/rpmbuild/SOURCES/ || exit 1
           35  +	tar -xOf "${CACKEY_TARBALL}" cackey-${VERSION}/cackey.spec > ~/rpmbuild/SPECS/cackey-${VERSION}.spec || exit 1
           36  +
           37  +	rpmbuild --target x86_64-redhat5-linux -ba ~/rpmbuild/SPECS/cackey-${VERSION}.spec || exit 1
           38  +)
           39  +
           40  +(
           41  +	eval "$(setup-cc x86_64-redhat5-linux 32)"
           42  +	rpmbuild --target i386-redhat5-linux -ba ~/rpmbuild/SPECS/cackey-${VERSION}.spec || exit 1
           43  +)
    29     44   
    30     45   # Create Debian package from RPM
    31     46   mkdir -p ~/rpmbuild/DEB
    32     47   "$(dirname "$0")/rpm2deb" ~/rpmbuild/RPMS/i386/cackey-${VERSION}-1.i386.rpm ~/rpmbuild/DEB/cackey_${VERSION}-1_i386.deb
           48  +"$(dirname "$0")/rpm2deb" ~/rpmbuild/RPMS/x86_64/cackey-${VERSION}-1.x86_64.rpm ~/rpmbuild/DEB/cackey_${VERSION}-1_amd64.deb
    33     49   
    34         -## Create Slackware package
           50  +# Create Slackware package
    35     51   mkdir -p ~/rpmbuild/TGZ
    36     52   
    37     53   WORKDIR="${TMPDIR:-/tmp}/cackey-build-$$${RANDOM}${RANDOM}${RANDOM}"
    38     54   WORKDIRINSTROOT="${WORKDIR}/root"
    39     55   export WORKDIR WORKDIRINSTROOT
    40     56   
    41     57   mkdir -p "${WORKDIR}" "${WORKDIRINSTROOT}"
    42     58   cd "${WORKDIR}" || exit 1
    43     59   
    44     60   tar -xf "${CACKEY_TARBALL}"
    45     61   
    46     62   cd "cackey-${VERSION}" || exit 1
    47     63   
    48         -./configure --prefix=/usr
           64  +case "$(uname -m)" in
           65  +	x86_64)
           66  +		ARCH=x86_64
           67  +		LIBDIR=/usr/lib64
           68  +		;;
           69  +	i?86)
           70  +		ARCH=i486
           71  +		LIBDIR=/usr/lib
           72  +		;;
           73  +	*)
           74  +		echo "Unknown ARCH" >&2
           75  +
           76  +		exit 1
           77  +		;;
           78  +esac
           79  +
           80  +./configure --prefix=/usr --libdir=${LIBDIR}
    49     81   make
    50     82   make install DESTDIR="${WORKDIRINSTROOT}"
    51     83   
    52     84   mkdir "${WORKDIRINSTROOT}/install"
    53     85   cat << __EOF__ > "${WORKDIRINSTROOT}/install/slack-desc"
    54     86   cackey: Goverment Smartcard PKCS#11 Provider
    55     87   cackey:
................................................................................
    64     96   cackey:
    65     97   __EOF__
    66     98   cat << __EOF__ > "${WORKDIRINSTROOT}/install/slack-required"
    67     99   pcsc-lite
    68    100   __EOF__
    69    101   
    70    102   cd "${WORKDIRINSTROOT}" || exit 1
    71         -makepkg -l y -c n "${WORKDIR}/cackey-${VERSION}-i486-1.tgz"
    72         -gzip -dc "${WORKDIR}/cackey-${VERSION}-i486-1.tgz" | tardy -User root -Group root | gzip -9 > "${WORKDIR}/cackey-${VERSION}-i486-1.tgz.new"
    73         -mv "${WORKDIR}/cackey-${VERSION}-i486-1.tgz.new" "${WORKDIR}/cackey-${VERSION}-i486-1.tgz"
    74         -cp "${WORKDIR}/cackey-${VERSION}-i486-1.tgz" ~/rpmbuild/TGZ
          103  +makepkg -l y -c n "${WORKDIR}/cackey-${VERSION}-${ARCH}-1.tgz"
          104  +gzip -dc "${WORKDIR}/cackey-${VERSION}-${ARCH}-1.tgz" | tardy -User root -Group root | gzip -9 > "${WORKDIR}/cackey-${VERSION}-${ARCH}-1.tgz.new"
          105  +mv "${WORKDIR}/cackey-${VERSION}-${ARCH}-1.tgz.new" "${WORKDIR}/cackey-${VERSION}-${ARCH}-1.tgz"
          106  +cp "${WORKDIR}/cackey-${VERSION}-${ARCH}-1.tgz" ~/rpmbuild/TGZ
    75    107   
    76    108   # Cleanup
    77    109   rm -rf "${WORKDIR}"