Skip to content

Commit 36794f3

Browse files
committed
Add Arista-specific script to build RPM.
1 parent 1da39bf commit 36794f3

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

Arista/arista_package.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
3+
# Check and install fpm if necessary.
4+
check_fpm() {
5+
fpm --help > /dev/null 2>&1 || ( echo "Installing fpm" && sudo yum install -y gcc libffi-devel ruby-devel rubygems && sudo gem install fpm )
6+
}
7+
8+
check_fpm
9+
10+
set -e
11+
echo "Creating RPMS"
12+
13+
# Cleanup old RPMS.
14+
mkdir ./RPMS > /dev/null 2>&1 || rm -rf ./RPMS/*
15+
rm ./*.rpm > /dev/null 2>&1 || true
16+
17+
# Build new RPMS.
18+
URL="https://github.com/aristanetworks/influxdb-python"
19+
while read line; do
20+
DEPENDENCIES+="--depends \"$line\" "
21+
done < ./requirements.txt
22+
FPM_ARGS="--log error --url $URL --no-python-dependencies $DEPENDENCIES"
23+
24+
eval "fpm $FPM_ARGS -s python -t rpm ../setup.py"
25+
26+
mv ./*.rpm RPMS/
27+
echo "Created" `ls RPMS`

Arista/requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
python-dateutil >= 2.0.0
2+
pytz
3+
python-requests >= 1.0.3
4+
python-six >= 1.9.0

0 commit comments

Comments
 (0)