amoralej / centos / cbs-tools

Forked from centos/cbs-tools 4 years ago
Clone
Blob Blame History Raw
Name:           buildsys-tools
Version:        0.1
Release:        14%{?dist}
Summary:        Tools from centos-git-common git repository

License:        GPLv2
URL:            https://git.centos.org/summary/centos-git-common.git
#Source0:       %{name}-%{version}.tgz
Source0:        get_sources.sh
Source1:        return_disttag.sh
BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)

Requires:       python
Requires:       bash
Requires:       which
Requires:       git

%description

%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{_bindir}
cp %{SOURCE0} %{buildroot}%{_bindir}
cp %{SOURCE1} %{buildroot}%{_bindir}

cat >%{buildroot}%{_bindir}/get_sources <<'EOF'
#!/bin/bash
#MAJOR=`cat /etc/rpm/macros.dist | grep rhel | cut -d " " -f 2`
#git checkout c$MAJOR >> log
COMMIT=`git rev-parse HEAD`
BRANCH=`git branch -r --contains | cut -d / -f 2`
get_sources.sh -b $BRANCH >> log
EOF

chmod a+x %{buildroot}%{_bindir}/get_sources

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%{_bindir}/*


%changelog
* Mon Jul 28 2014 Thomas Oulevey <thomas.oulevey@cern.ch> - 0.1-1
- Initial version