-%define tag RELEASE.2017-08-05T00-00-53Z
+%define tag RELEASE.2017-09-29T19-16-56Z
%define subver %(echo %{tag} | sed -e 's/[^0-9]//g')
-# git fetch https://github.com/minio/minio.git refs/tags/RELEASE.2017-08-05T00-00-53Z
-# git rev-list -n 1 FETCH_HEAD
-%define commitid aeafe668d8b6d25caac671d59e2b0f0473ce35d0
+%define commitid 60cc6184d253efee4a3120683517028342229e21
Summary: Object Storage Server
Name: minio
Version: 0.0.%{subver}
License: Apache v2.0
Group: Development/Building
Source0: https://github.com/minio/minio/archive/%{tag}.tar.gz
-# Source0-md5: 10711530ef4f690ce6a306e91aefc9ee
+# Source0-md5: 9d7e6e8b0060405f0b019355eaa16743
URL: https://www.minio.io/
BuildRequires: golang >= 1.7
ExclusiveArch: %{ix86} %{x8664} %{arm}
%define import_path github.com/minio/minio
%description
-Minio is an object storage server released under Apache License v2.0.
-It API compatible with Amazon S3 cloud storage service.
+Minio is an open source object storage server with Amazon S3
+compatible API.
%prep
%setup -qc
--- /dev/null
+#!/bin/sh
+set -e
+
+repo_url="https://github.com/minio/minio.git"
+specfile=minio.spec
+
+# Work in package dir
+dir=$(dirname "$0")
+cd "$dir"
+
+if [ "$1" ]; then
+ version=$1
+else
+ # fetch version from pldnotifdy
+ version=$(pldnotify.py $specfile | awk '/Found an update/{print $NF}')
+fi
+
+tag=RELEASE.${version#RELEASE.}
+
+# grab git hash
+git fetch "$repo_url" refs/tags/$tag
+# save this under some local ref, so repeated calls don't have to fetch everything
+git update-ref refs/keep-around/FETCH_HEAD FETCH_HEAD
+
+commitid=$(git rev-list -n 1 FETCH_HEAD)
+
+echo "Updating $specfile: tag: $tag; commitid: $commitid"
+sed -i -re "
+ s/^[#%](define[ \t]+tag[ \t]+)[0-9]+\$/%\1$tag/
+ s/^[#%](define[ \t]+commitid[ \t]+)[0-9a-fg]+\$/%\1$commitid/
+" $specfile
+../builder -ncs -5 $specfile