-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathpackage.sh
More file actions
executable file
·33 lines (27 loc) · 978 Bytes
/
package.sh
File metadata and controls
executable file
·33 lines (27 loc) · 978 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
if [[ "x$RIVESCRIPT_DOCKER_BUILD" == "x" ]]; then
echo This script should only be run from the Docker environment.
exit 1
fi
if [[ ! -f "./python-rivescript.spec" ]]; then
cd ..
if [[ ! -f "./python-rivescript.spec" ]]; then
echo Could not find the python-rivescript.spec; are you in the right folder?
exit 1
fi
fi
# RiveScript module version
VERSION=$(grep -e '__version__' rivescript/__init__.py | head -n 1 | cut -d "'" -f 2)
# Make sure the rpm spec always has this version too.
perl -pi -e "s/^%global version .+?$/%global version ${VERSION}/g" python-rivescript.spec
# Build the tarball and copy everything into the rpmbuild root.
python setup.py sdist
cp dist/*.tar.gz ${HOME}/rpm/
cp python-rivescript.spec ${HOME}/rpm/
echo $(ls -hal dist)
cd ${HOME}/rpm
echo $(ls -hal)
rpmbuild -bb python-rivescript.spec
echo $(ls -hal)
sudo find . -name '*.rpm' -exec cp {} /mnt/export \;
sudo chown 1000:1000 /mnt/export/*.rpm