-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating all files to match latest internal working versions staged for
initial product launch. Adding missing licensing info to all files.
- Loading branch information
1 parent
2c190e4
commit d998839
Showing
34 changed files
with
1,005 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
VERSION_FILE=./VERSION | ||
pkgver=$(shell cat $(VERSION_FILE)) | ||
version = $(firstword $(subst -, ,$(pkgver))) | ||
release = $(lastword $(subst -, ,$(pkgver))) | ||
|
||
default: clean ; | ||
|
||
deb: | ||
./bin/make_deb.sh $(version) $(release) | ||
|
||
rpm: | ||
./bin/make_rpm.sh $(version) $(release) | ||
|
||
clean: | ||
$(shell rm -rf ec2-instance-connect*) | ||
$(shell rm -rf ./rpmbuild/SOURCES) | ||
$(shell rm -rf ./deb-src) | ||
$(shell rm -rf ./srpm_results) | ||
$(shell rm -rf ./rpm_results) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.1-10 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"). You | ||
# may not use this file except in compliance with the License. A copy of | ||
# the License is located at | ||
# | ||
# http://aws.amazon.com/apache2.0/ | ||
# | ||
# or in the "license" file accompanying this file. This file 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. | ||
|
||
# Reads authorized keys blob $3 and prints verified, unexpired keys | ||
# Openssl to use provided as $1 | ||
# Signer public key file path provided as $2 | ||
|
||
# XXX: This script builds a local 3.0 (native) package for testing purposes. | ||
# Any actual patches should be developed and submitted using apt-source and Quilt. | ||
|
||
# Note: this will only work on a system with dpkg build tools installed (ie, Debian & its derivatives) | ||
# It is also strongly recommended you install devtools (dch, etc) to assist with package building | ||
# You are *REQUIRED* to have debhelper and devscripts installed! | ||
|
||
if [ $# -ne 2 ] ; then | ||
echo "Usage: make_deb.sh [version] [release]" | ||
echo " ie, make_deb.sh [1.1] [1]" | ||
exit 1 | ||
fi | ||
|
||
md5 () { | ||
/bin/echo -n "${val}" | /usr/bin/md5sum | /bin/sed 's/\s.*$//' | ||
} | ||
|
||
sha1 () { | ||
/bin/echo -n "${val}" | /usr/bin/sha1sum | /bin/sed 's/\s.*$//' | ||
} | ||
|
||
sha256 () { | ||
/bin/echo -n "${val}" | /usr/bin/sha256sum | /bin/sed 's/\s.*$//' | ||
} | ||
|
||
TOPDIR=$(dirname "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )") | ||
|
||
version=$1 | ||
release=$2 | ||
pkgdir="${TOPDIR}/ec2-instance-connect-${version}-${release}" | ||
|
||
# Copy source files | ||
mkdir $pkgdir | ||
mkdir -p $pkgdir/ec2-instance-connect | ||
cp $TOPDIR/src/bin/* $pkgdir/ec2-instance-connect/ | ||
# Dump /bin, /usr/bin, etc from binary paths names since we want to use $PATH on Ubuntu/etc | ||
sed -i "s%/usr/bin/%%g" $pkgdir/ec2-instance-connect/* | ||
sed -i "s%^/bin/%%g" $pkgdir/ec2-instance-connect/* | ||
sed -i "s%\([^\#][^\!]\)/bin/%\1%g" $pkgdir/ec2-instance-connect/* | ||
# Copy ec2-instance-connect service file | ||
cp -r $TOPDIR/src/deb_systemd/ec2-instance-connect.service $pkgdir/ | ||
|
||
mkdir $pkgdir/debian | ||
cp -r $TOPDIR/debian/* $pkgdir/debian/ | ||
sed -i "s/\!VERSION\!/${version}-${release}/" $pkgdir/debian/control | ||
|
||
# Do the actual packaging | ||
return_dir=$(pwd) | ||
cd $pkgdir | ||
debuild | ||
|
||
# Clean up | ||
cd $return_dir | ||
rm -rf $pkgdir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"). You | ||
# may not use this file except in compliance with the License. A copy of | ||
# the License is located at | ||
# | ||
# http://aws.amazon.com/apache2.0/ | ||
# | ||
# or in the "license" file accompanying this file. This file 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. | ||
|
||
# Reads authorized keys blob $3 and prints verified, unexpired keys | ||
# Openssl to use provided as $1 | ||
# Signer public key file path provided as $2 | ||
|
||
# Note: this will only work on a system with rpm build tools installed (ie, RHEL & its derivatives) | ||
|
||
if [ $# -ne 2 ] ; then | ||
echo "Usage: make_rpm.sh [version] [release]" | ||
echo " ie, make_rpm.sh [1.1] [1]" | ||
exit 1 | ||
fi | ||
|
||
TOPDIR=$(dirname "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )") | ||
BUILDDIR=$TOPDIR/rpmbuild | ||
mkdir -p $BUILDDIR | ||
|
||
version=$1 | ||
release=$2 | ||
|
||
mkdir -p $BUILDDIR/{BUILD,RPMS,SOURCES,SPECS,SRPMS,ec2-instance-connect-${version},tmp} | ||
mkdir -p $BUILDDIR/ec2-instance-connect-$version/opt/aws/bin | ||
cp $TOPDIR/rpmsrc/SPECS/generic.spec $BUILDDIR/SPECS/ec2-instance-connect.spec | ||
cp $TOPDIR/src/bin/* $BUILDDIR/ec2-instance-connect-$version/opt/aws/bin/ | ||
cp $TOPDIR/rpmsrc/.rpmmacros $BUILDDIR/ | ||
|
||
/bin/sed -i "s%^ca_path=/etc/ssl/certs$%ca_path=/etc/ssl/certs/ca-bundle.crt%" $BUILDDIR/ec2-instance-connect-$version/opt/aws/bin/eic_curl_authorized_keys | ||
|
||
# Trick rpmbuild into thinking this is homedir to read .rpmmacros | ||
REALHOME=$HOME | ||
export HOME=$BUILDDIR | ||
|
||
function cleanup { | ||
export HOME=$REALHOME | ||
rm -rf $BUILDDIR/${BUILD,SOURCES,tmp} | ||
rm -rf $BUILDDIR/BUILDROOT # In case we got far enough for this to exist | ||
rm -rf $BUILDDIR/ec2-instance-connect-$version | ||
} | ||
trap cleanup EXIT | ||
|
||
cp $TOPDIR/src/rpm_systemd/ec2-instance-connect.service $BUILDDIR/SOURCES/ | ||
ls $BUILDDIR/SOURCES | ||
|
||
cd $BUILDDIR # Will ensure some paths are set correctly in rpmbuild | ||
|
||
# Compress the scripts | ||
tar -czf $BUILDDIR/SOURCES/ec2-instance-connect-$version.tar.gz ec2-instance-connect-$version/ | ||
|
||
# Fill in the placeholders | ||
sed -i "s/\!VERSION\!/${version}/" $BUILDDIR/SPECS/ec2-instance-connect.spec | ||
sed -i "s/\!RELEASE\!/${release}/" $BUILDDIR/SPECS/ec2-instance-connect.spec | ||
|
||
# Build the package | ||
rpmbuild -ba -bs $BUILDDIR/SPECS/ec2-instance-connect.spec | ||
|
||
cp $BUILDDIR/RPMS/noarch/ec2-instance-connect-$version-$release.noarch.rpm $TOPDIR/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.