packaging: make branch configurable
if [ -z "$1" ]; then
cat <<EOF
usage:
- ./make_spec.sh PACKAGE
+ ./make_spec.sh PACKAGE [BRANCH]
EOF
exit 1
fi
@@ -17,6 +17,7 @@ COMMIT=$(git rev-parse --short HEAD)
VERSION="${VERSION%+*}+git_r${REVISION}_${COMMIT}"
NAME=$1
GITREPONAME=$(basename `git rev-parse --show-toplevel`)
+BRANCH=${2:-master}
cat <<EOF > ${NAME}.spec
#
@@ -47,7 +48,7 @@ Summary: Production-Grade Container Scheduling and Management
License: Apache-2.0
Group: System/Management
Url: https://github.com/kubic-project/salt
-Source: master.tar.gz
+Source: ${BRANCH}.tar.gz
BuildRequires: systemd-rpm-macros
Requires: salt
Requires: python-m2crypto
@@ -56,14 +57,14 @@ Requires: python-m2crypto
Salt scripts for deploying a Kubernetes cluster
%prep
-%setup -q -n %{gitrepo}-master
+%setup -q -n %{gitrepo}-${BRANCH}
%build
%install
rm -rf %{buildroot}%{_datadir}
mkdir -p %{buildroot}%{_datadir}/salt/kubernetes
-cp -R %{_builddir}/%{gitrepo}-master/* %{buildroot}%{_datadir}/salt/kubernetes/
+cp -R %{_builddir}/%{gitrepo}-${BRANCH}/* %{buildroot}%{_datadir}/salt/kubernetes/
%files
%defattr(-,root,root)
