zenoss/zminion — pull request #2 by wplu (2014-09-02 16:05:24+00:00)
Title: initial makefile and VERSION

DEMO (after make docker-rpm):
```
~/src/europa/src/golang/src/github.com/zenoss/zminion/pkg
# plu@plu-9: ls -l zminion-0.1.0-1.x86_64.rpm
-rw-r--r-- 1 plu plu 2394486 Sep 2 11:03 zminion-0.1.0-1.x86_64.rpm
~/src/europa/src/golang/src/github.com/zenoss/zminion/pkg
# plu@plu-9: docker run -it -w /mnt/zminion -v $(pwd):/mnt/zminion zenoss/rpmbuild:centos7 rpmls *.rpm
-rwxr-xr-x /opt/zenoss/bin/zminion
```

DEMO (buildlog):
```
~/src/europa/src/golang/src/github.com/zenoss/zminion/pkg
# plu@plu-9: date; time make docker-rpm; date
Tue Sep 2 10:59:57 CDT 2014
docker run --rm -w /mnt/zminion/pkg -v /home/plu/src/europa/src/golang/src/github.com/zenoss/zminion:/mnt/zminion zenoss/rpmbuild:centos7 \
bash -c "make rpm && find /mnt/zminion -exec chown 1000:1000 {} \\;"
cd .. && make
make[1]: Entering directory `/mnt/zminion'
go get github.com/tools/godep
go install github.com/tools/godep
/gosrc/bin/godep restore
touch .Godeps_restored
/gosrc/bin/godep restore github.com/zenoss/zminion
go build -x
WORK=/tmp/go-build904862836
mkdir -p $WORK/github.com/codegangsta/cli/_obj/
mkdir -p $WORK/github.com/codegangsta/
cd /gosrc/src/github.com/codegangsta/cli
/go/pkg/tool/linux_amd64/6g -o $WORK/github.com/codegangsta/cli/_obj/_go_.6 -p github.com/codegangsta/cli -complete -D _/gosrc/src/github.com/codegangsta/cli -I $WORK ./app.go ./cli.go ./command.go ./context.go ./flag.go ./help.go
mkdir -p $WORK/github.com/zenoss/glog/_obj/
mkdir -p $WORK/github.com/zenoss/
cd /gosrc/src/github.com/zenoss/glog
/go/pkg/tool/linux_amd64/6g -o $WORK/github.com/zenoss/glog/_obj/_go_.6 -p github.com/zenoss/glog -complete -D _/gosrc/src/github.com/zenoss/glog -I $WORK ./glog.go ./glog_file.go ./glog_logstash.go
mkdir -p $WORK/github.com/zenoss/go-dockerclient/utils/_obj/
mkdir -p $WORK/github.com/zenoss/go-dockerclient/
cd /gosrc/src/github.com/zenoss/go-dockerclient/utils
/go/pkg/tool/linux_amd64/6g -o $WORK/github.com/zenoss/go-dockerclient/utils/_obj/_go_.6 -p github.com/zenoss/go-dockerclient/utils -complete -D _/gosrc/src/github.com/zenoss/go-dockerclient/utils -I $WORK ./random.go ./stdcopy.go ./uname_linux.go ./utils.go
mkdir -p $WORK/github.com/garyburd/redigo/redis/_obj/
mkdir -p $WORK/github.com/garyburd/redigo/
cd /gosrc/src/github.com/garyburd/redigo/redis
/go/pkg/tool/linux_amd64/6g -o $WORK/github.com/garyburd/redigo/redis/_obj/_go_.6 -p github.com/garyburd/redigo/redis -complete -D _/gosrc/src/github.com/garyburd/redigo/redis -I $WORK ./commandinfo.go ./conn.go ./doc.go ./log.go ./pool.go ./pubsub.go ./redis.go ./reply.go ./scan.go ./script.go
cd /gosrc/src/github.com/codegangsta/cli
/go/pkg/tool/linux_amd64/pack grcP $WORK $WORK/github.com/codegangsta/cli.a $WORK/github.com/codegangsta/cli/_obj/_go_.6
cd /gosrc/src/github.com/zenoss/glog
/go/pkg/tool/linux_amd64/pack grcP $WORK $WORK/github.com/zenoss/glog.a $WORK/github.com/zenoss/glog/_obj/_go_.6
cd /gosrc/src/github.com/garyburd/redigo/redis
/go/pkg/tool/linux_amd64/pack grcP $WORK $WORK/github.com/garyburd/redigo/redis.a $WORK/github.com/garyburd/redigo/redis/_obj/_go_.6
cd /gosrc/src/github.com/zenoss/go-dockerclient/utils
/go/pkg/tool/linux_amd64/pack grcP $WORK $WORK/github.com/zenoss/go-dockerclient/utils.a $WORK/github.com/zenoss/go-dockerclient/utils/_obj/_go_.6
mkdir -p $WORK/github.com/zenoss/go-dockerclient/engine/_obj/
cd /gosrc/src/github.com/zenoss/go-dockerclient/engine
/go/pkg/tool/linux_amd64/6g -o $WORK/github.com/zenoss/go-dockerclient/engine/_obj/_go_.6 -p github.com/zenoss/go-dockerclient/engine -complete -D _/gosrc/src/github.com/zenoss/go-dockerclient/engine -I $WORK -I /gosrc/pkg/linux_amd64 ./engine.go ./env.go ./hack.go ./http.go ./job.go ./streams.go
/go/pkg/tool/linux_amd64/pack grcP $WORK $WORK/github.com/zenoss/go-dockerclient/engine.a $WORK/github.com/zenoss/go-dockerclient/engine/_obj/_go_.6
mkdir -p $WORK/github.com/zenoss/go-dockerclient/_obj/
cd /gosrc/src/github.com/zenoss/go-dockerclient
/go/pkg/tool/linux_amd64/6g -o $WORK/github.com/zenoss/go-dockerclient/_obj/_go_.6 -p github.com/zenoss/go-dockerclient -complete -D _/gosrc/src/github.com/zenoss/go-dockerclient -I $WORK -I /gosrc/pkg/linux_amd64 ./change.go ./client.go ./container.go ./event.go ./image.go ./misc.go ./signal.go ./zevent.go
/go/pkg/tool/linux_amd64/pack grcP $WORK $WORK/github.com/zenoss/go-dockerclient.a $WORK/github.com/zenoss/go-dockerclient/_obj/_go_.6
mkdir -p $WORK/github.com/control-center/serviced/utils/_obj/
mkdir -p $WORK/github.com/control-center/serviced/
cd /gosrc/src/github.com/control-center/serviced/utils
/go/pkg/tool/linux_amd64/6g -o $WORK/github.com/control-center/serviced/utils/_obj/_go_.6 -p github.com/control-center/serviced/utils -complete -D _/gosrc/src/github.com/control-center/serviced/utils -I $WORK -I /gosrc/pkg/linux_amd64 ./cmd.go ./directory.go ./host_utils.go ./nsenter.go ./nsinit.go ./strings.go ./uuid.go
/go/pkg/tool/linux_amd64/pack grcP $WORK $WORK/github.com/control-center/serviced/utils.a $WORK/github.com/control-center/serviced/utils/_obj/_go_.6
mkdir -p $WORK/_/mnt/zminion/_obj/
cd /mnt/zminion
/go/pkg/tool/linux_amd64/6g -o $WORK/_/mnt/zminion/_obj/_go_.6 -p _/mnt/zminion -complete -D _/mnt/zminion -I $WORK -I /gosrc/pkg/linux_amd64 ./main.go
/go/pkg/tool/linux_amd64/pack grcP $WORK $WORK/_/mnt/zminion.a $WORK/_/mnt/zminion/_obj/_go_.6
cd .
/go/pkg/tool/linux_amd64/6l -o zminion -L $WORK -L /gosrc/pkg/linux_amd64 $WORK/_/mnt/zminion.a
#go install
make[1]: Leaving directory `/mnt/zminion'
cd .. && make clean
make[1]: Entering directory `/mnt/zminion'
/gosrc/bin/godep restore && go clean -r && go clean -i github.com/zenoss/zminion/... # this cleans all dependencies
warning: "github.com/zenoss/zminion/..." matched no packages
rm -f .Godeps_restored
make[1]: Leaving directory `/mnt/zminion'
make clean_files clean_dirs clean_dirs=pkgroot pkgroot
make[1]: Entering directory `/mnt/zminion/pkg'
mkdir -p pkgroot
make[1]: Leaving directory `/mnt/zminion/pkg'
cd .. && make install PREFIX=/mnt/zminion/pkg/pkgroot//opt/zenoss
make[1]: Entering directory `/mnt/zminion'
/gosrc/bin/godep restore
touch .Godeps_restored
/gosrc/bin/godep restore github.com/zenoss/zminion
go build -x
WORK=/tmp/go-build414585075
mkdir -p $WORK/github.com/codegangsta/cli/_obj/
mkdir -p $WORK/github.com/codegangsta/
cd /gosrc/src/github.com/codegangsta/cli
/go/pkg/tool/linux_amd64/6g -o $WORK/github.com/codegangsta/cli/_obj/_go_.6 -p github.com/codegangsta/cli -complete -D _/gosrc/src/github.com/codegangsta/cli -I $WORK ./app.go ./cli.go ./command.go ./context.go ./flag.go ./help.go
mkdir -p $WORK/github.com/zenoss/glog/_obj/
mkdir -p $WORK/github.com/zenoss/
cd /gosrc/src/github.com/zenoss/glog
/go/pkg/tool/linux_amd64/6g -o $WORK/github.com/zenoss/glog/_obj/_go_.6 -p github.com/zenoss/glog -complete -D _/gosrc/src/github.com/zenoss/glog -I $WORK ./glog.go ./glog_file.go ./glog_logstash.go
mkdir -p $WORK/github.com/zenoss/go-dockerclient/utils/_obj/
mkdir -p $WORK/github.com/zenoss/go-dockerclient/
cd /gosrc/src/github.com/zenoss/go-dockerclient/utils
/go/pkg/tool/linux_amd64/6g -o $WORK/github.com/zenoss/go-dockerclient/utils/_obj/_go_.6 -p github.com/zenoss/go-dockerclient/utils -complete -D _/gosrc/src/github.com/zenoss/go-dockerclient/utils -I $WORK ./random.go ./stdcopy.go ./uname_linux.go ./utils.go
mkdir -p $WORK/github.com/garyburd/redigo/redis/_obj/
mkdir -p $WORK/github.com/garyburd/redigo/
cd /gosrc/src/github.com/garyburd/redigo/redis
/go/pkg/tool/linux_amd64/6g -o $WORK/github.com/garyburd/redigo/redis/_obj/_go_.6 -p github.com/garyburd/redigo/redis -complete -D _/gosrc/src/github.com/garyburd/redigo/redis -I $WORK ./commandinfo.go ./conn.go ./doc.go ./log.go ./pool.go ./pubsub.go ./redis.go ./reply.go ./scan.go ./script.go
cd /gosrc/src/github.com/codegangsta/cli
/go/pkg/tool/linux_amd64/pack grcP $WORK $WORK/github.com/codegangsta/cli.a $WORK/github.com/codegangsta/cli/_obj/_go_.6
cd /gosrc/src/github.com/zenoss/glog
/go/pkg/tool/linux_amd64/pack grcP $WORK $WORK/github.com/zenoss/glog.a $WORK/github.com/zenoss/glog/_obj/_go_.6
cd /gosrc/src/github.com/garyburd/redigo/redis
/go/pkg/tool/linux_amd64/pack grcP $WORK $WORK/github.com/garyburd/redigo/redis.a $WORK/github.com/garyburd/redigo/redis/_obj/_go_.6
cd /gosrc/src/github.com/zenoss/go-dockerclient/utils
/go/pkg/tool/linux_amd64/pack grcP $WORK $WORK/github.com/zenoss/go-dockerclient/utils.a $WORK/github.com/zenoss/go-dockerclient/utils/_obj/_go_.6
mkdir -p $WORK/github.com/zenoss/go-dockerclient/engine/_obj/
cd /gosrc/src/github.com/zenoss/go-dockerclient/engine
/go/pkg/tool/linux_amd64/6g -o $WORK/github.com/zenoss/go-dockerclient/engine/_obj/_go_.6 -p github.com/zenoss/go-dockerclient/engine -complete -D _/gosrc/src/github.com/zenoss/go-dockerclient/engine -I $WORK -I /gosrc/pkg/linux_amd64 ./engine.go ./env.go ./hack.go ./http.go ./job.go ./streams.go
/go/pkg/tool/linux_amd64/pack grcP $WORK $WORK/github.com/zenoss/go-dockerclient/engine.a $WORK/github.com/zenoss/go-dockerclient/engine/_obj/_go_.6
mkdir -p $WORK/github.com/zenoss/go-dockerclient/_obj/
cd /gosrc/src/github.com/zenoss/go-dockerclient
/go/pkg/tool/linux_amd64/6g -o $WORK/github.com/zenoss/go-dockerclient/_obj/_go_.6 -p github.com/zenoss/go-dockerclient -complete -D _/gosrc/src/github.com/zenoss/go-dockerclient -I $WORK -I /gosrc/pkg/linux_amd64 ./change.go ./client.go ./container.go ./event.go ./image.go ./misc.go ./signal.go ./zevent.go
/go/pkg/tool/linux_amd64/pack grcP $WORK $WORK/github.com/zenoss/go-dockerclient.a $WORK/github.com/zenoss/go-dockerclient/_obj/_go_.6
mkdir -p $WORK/github.com/control-center/serviced/utils/_obj/
mkdir -p $WORK/github.com/control-center/serviced/
cd /gosrc/src/github.com/control-center/serviced/utils
/go/pkg/tool/linux_amd64/6g -o $WORK/github.com/control-center/serviced/utils/_obj/_go_.6 -p github.com/control-center/serviced/utils -complete -D _/gosrc/src/github.com/control-center/serviced/utils -I $WORK -I /gosrc/pkg/linux_amd64 ./cmd.go ./directory.go ./host_utils.go ./nsenter.go ./nsinit.go ./strings.go ./uuid.go
/go/pkg/tool/linux_amd64/pack grcP $WORK $WORK/github.com/control-center/serviced/utils.a $WORK/github.com/control-center/serviced/utils/_obj/_go_.6
mkdir -p $WORK/_/mnt/zminion/_obj/
cd /mnt/zminion
/go/pkg/tool/linux_amd64/6g -o $WORK/_/mnt/zminion/_obj/_go_.6 -p _/mnt/zminion -complete -D _/mnt/zminion -I $WORK -I /gosrc/pkg/linux_amd64 ./main.go
/go/pkg/tool/linux_amd64/pack grcP $WORK $WORK/_/mnt/zminion.a $WORK/_/mnt/zminion/_obj/_go_.6
cd .
/go/pkg/tool/linux_amd64/6l -o zminion -L $WORK -L /gosrc/pkg/linux_amd64 $WORK/_/mnt/zminion.a
#go install
mkdir -p /mnt/zminion/pkg/pkgroot//opt/zenoss/bin
install -m 755 zminion /mnt/zminion/pkg/pkgroot//opt/zenoss/bin/zminion
make[1]: Leaving directory `/mnt/zminion'
yum install -y gem ruby-devel
Loaded plugins: fastestmirror
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
Determining fastest mirrors
* base: mirror-centos.hostingswift.com
* extras: mirror.steadfast.net
* updates: mirrors.centarra.com
Resolving Dependencies
--> Running transaction check
---> Package ruby-devel.x86_64 0:2.0.0.353-20.el7 will be installed
--> Processing Dependency: ruby(x86-64) = 2.0.0.353-20.el7 for package: ruby-devel-2.0.0.353-20.el7.x86_64
--> Processing Dependency: libruby.so.2.0()(64bit) for package: ruby-devel-2.0.0.353-20.el7.x86_64
---> Package rubygems.noarch 0:2.0.14-20.el7 will be installed
--> Processing Dependency: rubygem(rdoc) >= 4.0.0 for package: rubygems-2.0.14-20.el7.noarch
--> Processing Dependency: rubygem(psych) >= 2.0.0 for package: rubygems-2.0.14-20.el7.noarch
--> Processing Dependency: rubygem(io-console) >= 0.4.2 for package: rubygems-2.0.14-20.el7.noarch
--> Running transaction check
---> Package ruby.x86_64 0:2.0.0.353-20.el7 will be installed
--> Processing Dependency: rubygem(bigdecimal) >= 1.2.0 for package: ruby-2.0.0.353-20.el7.x86_64
---> Package ruby-libs.x86_64 0:2.0.0.353-20.el7 will be installed
---> Package rubygem-io-console.x86_64 0:0.4.2-20.el7 will be installed
---> Package rubygem-psych.x86_64 0:2.0.0-20.el7 will be installed
--> Processing Dependency: libyaml-0.so.2()(64bit) for package: rubygem-psych-2.0.0-20.el7.x86_64
---> Package rubygem-rdoc.noarch 0:4.0.0-20.el7 will be installed
--> Processing Dependency: ruby(irb) = 2.0.0.353 for package: rubygem-rdoc-4.0.0-20.el7.noarch
--> Processing Dependency: rubygem(json) >= 1.7.7 for package: rubygem-rdoc-4.0.0-20.el7.noarch
--> Running transaction check
---> Package libyaml.x86_64 0:0.1.4-10.el7 will be installed
---> Package ruby-irb.noarch 0:2.0.0.353-20.el7 will be installed
---> Package rubygem-bigdecimal.x86_64 0:1.2.0-20.el7 will be installed
---> Package rubygem-json.x86_64 0:1.7.7-20.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
ruby-devel x86_64 2.0.0.353-20.el7 base 126 k
rubygems noarch 2.0.14-20.el7 base 211 k
Installing for dependencies:
libyaml x86_64 0.1.4-10.el7 base 55 k
ruby x86_64 2.0.0.353-20.el7 base 66 k
ruby-irb noarch 2.0.0.353-20.el7 base 87 k
ruby-libs x86_64 2.0.0.353-20.el7 base 2.8 M
rubygem-bigdecimal x86_64 1.2.0-20.el7 base 78 k
rubygem-io-console x86_64 0.4.2-20.el7 base 49 k
rubygem-json x86_64 1.7.7-20.el7 base 74 k
rubygem-psych x86_64 2.0.0-20.el7 base 76 k
rubygem-rdoc noarch 4.0.0-20.el7 base 317 k

Transaction Summary
================================================================================
Install 2 Packages (+9 Dependent packages)

Total download size: 3.9 M
Installed size: 13 M
Downloading packages:
--------------------------------------------------------------------------------
Total 2.3 MB/s | 3.9 MB 00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : ruby-libs-2.0.0.353-20.el7.x86_64 1/11
Installing : libyaml-0.1.4-10.el7.x86_64 2/11
Installing : rubygem-json-1.7.7-20.el7.x86_64 3/11
Installing : rubygem-psych-2.0.0-20.el7.x86_64 4/11
Installing : rubygem-bigdecimal-1.2.0-20.el7.x86_64 5/11
Installing : rubygem-io-console-0.4.2-20.el7.x86_64 6/11
Installing : rubygem-rdoc-4.0.0-20.el7.noarch 7/11
Installing : ruby-irb-2.0.0.353-20.el7.noarch 8/11
Installing : ruby-2.0.0.353-20.el7.x86_64 9/11
Installing : rubygems-2.0.14-20.el7.noarch 10/11
Installing : ruby-devel-2.0.0.353-20.el7.x86_64 11/11
Verifying : rubygems-2.0.14-20.el7.noarch 1/11
Verifying : rubygem-rdoc-4.0.0-20.el7.noarch 2/11
Verifying : ruby-irb-2.0.0.353-20.el7.noarch 3/11
Verifying : rubygem-json-1.7.7-20.el7.x86_64 4/11
Verifying : ruby-devel-2.0.0.353-20.el7.x86_64 5/11
Verifying : rubygem-psych-2.0.0-20.el7.x86_64 6/11
Verifying : libyaml-0.1.4-10.el7.x86_64 7/11
Verifying : rubygem-bigdecimal-1.2.0-20.el7.x86_64 8/11
Verifying : rubygem-io-console-0.4.2-20.el7.x86_64 9/11
Verifying : ruby-2.0.0.353-20.el7.x86_64 10/11
Verifying : ruby-libs-2.0.0.353-20.el7.x86_64 11/11

Installed:
ruby-devel.x86_64 0:2.0.0.353-20.el7 rubygems.noarch 0:2.0.14-20.el7

Dependency Installed:
libyaml.x86_64 0:0.1.4-10.el7
ruby.x86_64 0:2.0.0.353-20.el7
ruby-irb.noarch 0:2.0.0.353-20.el7
ruby-libs.x86_64 0:2.0.0.353-20.el7
rubygem-bigdecimal.x86_64 0:1.2.0-20.el7
rubygem-io-console.x86_64 0:0.4.2-20.el7
rubygem-json.x86_64 0:1.7.7-20.el7
rubygem-psych.x86_64 0:2.0.0-20.el7
rubygem-rdoc.noarch 0:4.0.0-20.el7

Complete!
gem install fpm
Successfully installed cabin-0.6.1
Successfully installed backports-3.6.0
Successfully installed arr-pm-0.0.9
Successfully installed clamp-0.6.3
Building native extensions. This could take a while...
unable to convert "\xF3" from ASCII-8BIT to UTF-8 for lib/fpm/package/pyfpm/__init__.pyc, skipping
unable to convert "\xF3" from ASCII-8BIT to UTF-8 for lib/fpm/package/pyfpm/get_metadata.pyc, skipping
Successfully installed ffi-1.9.3
Successfully installed childprocess-0.5.3
Successfully installed fpm-1.2.0
Parsing documentation for cabin-0.6.1
Installing ri documentation for cabin-0.6.1
Parsing documentation for backports-3.6.0
Installing ri documentation for backports-3.6.0
Parsing documentation for arr-pm-0.0.9
Installing ri documentation for arr-pm-0.0.9
Parsing documentation for clamp-0.6.3
Installing ri documentation for clamp-0.6.3
Parsing documentation for ffi-1.9.3
Installing ri documentation for ffi-1.9.3
Parsing documentation for childprocess-0.5.3
Installing ri documentation for childprocess-0.5.3
Parsing documentation for fpm-1.2.0
Installing ri documentation for fpm-1.2.0
7 gems installed
echo "installed dependencies"
installed dependencies
echo "creating rpm takes a few minutes"
creating rpm takes a few minutes
fpm \
-n zminion \
-v 0.1.0 \
-s dir \
-t rpm \
-a x86_64 \
-C pkgroot \
-m "Zenoss CM " \
--description "$DESCRIPTION" \
--rpm-user root \
--rpm-group root \
--license "ASL 2.0" \
--vendor "Zenoss, Inc." \
--url https://github.com/zenoss/zminion \
--category admin \
.
{:timestamp=>"2014-09-02T17:03:24.159224+0100", :message=>"no value for epoch is set, defaulting to nil", :level=>:warn}
{:timestamp=>"2014-09-02T17:03:24.178975+0100", :message=>"no value for epoch is set, defaulting to nil", :level=>:warn}
{:timestamp=>"2014-09-02T17:03:26.705814+0100", :message=>"Created package", :path=>"zminion-0.1.0-1.x86_64.rpm"}

real	3m29.621s
user	0m0.030s
sys	0m0.028s
Tue Sep 2 11:03:27 CDT 2014
~/src/europa/src/golang/src/github.com/zenoss/zminion/pkg
# plu@plu-9: ls -l zminion-0.1.0-1.x86_64.rpm
-rw-r--r-- 1 plu plu 2394486 Sep 2 11:03 zminion-0.1.0-1.x86_64.rpm
```