Skip to content

Commit

Permalink
Merge pull request #102 from mackerelio/v2-package
Browse files Browse the repository at this point in the history
v2 packages
  • Loading branch information
Songmu committed Jun 2, 2017
2 parents d29ffc4 + 2536c65 commit 5922caf
Show file tree
Hide file tree
Showing 15 changed files with 116 additions and 6 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ script:
after_script:
- make cover
before_deploy:
- make rpm deb
- go get github.com/motemen/gobump/cmd/gobump
- go get github.com/mackerelio/golib/cmd/mackerel-github-release
deploy:
Expand Down
23 changes: 19 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ BIN = mkr
VERSION = 0.16.0
CURRENT_REVISION = $(shell git rev-parse --short HEAD)

all: clean cross lint gofmt test
all: clean cross lint gofmt test rpm deb

test: testdeps
go test -v ./...
Expand All @@ -27,17 +27,32 @@ cross: deps
cp -p $(PWD)/snapshot/darwin_amd64/mkr $(PWD)/snapshot/mkr_darwin_amd64
cp -p $(PWD)/snapshot/darwin_386/mkr $(PWD)/snapshot/mkr_darwin_386

rpm:
rpm: rpm-v1 rpm-v2

rpm-v1:
GOOS=linux GOARCH=386 make build
rpmbuild --define "_builddir `pwd`" --define "_version ${VERSION}" --define "buildarch noarch" -bb packaging/rpm/mkr.spec
GOOS=linux GOARCH=amd64 make build
rpmbuild --define "_builddir `pwd`" --define "_version ${VERSION}" --define "buildarch x86_64" -bb packaging/rpm/mkr.spec

deb:
rpm-v2:
GOOS=linux GOARCH=amd64 make build
rpmbuild --define "_builddir `pwd`" --define "_version ${VERSION}" \
--define "buildarch x86_64" --define "dist .el7.centos" \
-bb packaging/rpm/mkr-v2.spec

deb: deb-v1 deb-v2

deb-v1:
GOOS=linux GOARCH=386 make build
cp $(BIN) packaging/deb/debian/$(BIN).bin
cd packaging/deb && debuild --no-tgz-check -rfakeroot -uc -us

deb-v2:
GOOS=linux GOARCH=amd64 make build
cp $(BIN) packaging/deb-v2/debian/$(BIN).bin
cd packaging/deb-v2 && debuild --no-tgz-check -rfakeroot -uc -us

deps:
go get -d -v .

Expand Down Expand Up @@ -69,4 +84,4 @@ clean:
cover: testdeps
goveralls

.PHONY: test build cross lint gofmt deps testdeps clean deb rpm release cover
.PHONY: test build cross lint gofmt deps testdeps clean deb deb-v1 deb-v2 rpm rpm-v1 rpm-v2 release cover
2 changes: 2 additions & 0 deletions packaging/deb-v2/debian/README.Debian
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mkr for Debian
-------------------------
6 changes: 6 additions & 0 deletions packaging/deb-v2/debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
mkr (0.16.0-1.v2) stable; urgency=low

* Add services subcommand (by yuuki)
<https://github.com/mackerelio/mkr/pull/97>

-- mackerel <mackerel-developers@hatena.ne.jp> Tue, 09 May 2017 05:58:38 +0000
1 change: 1 addition & 0 deletions packaging/deb-v2/debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9
13 changes: 13 additions & 0 deletions packaging/deb-v2/debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Source: mkr
Maintainer: Mackerel Developers <mackerel-developers@hatena.ne.jp>
Section: admin
Priority: extra
Build-Depends: debhelper (>= 9)
Standards-Version: 3.9.4
Homepage: https://mackerel.io

Package: mkr
Architecture: amd64
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: macekrel.io api client tool
api client tool for makerel.io
11 changes: 11 additions & 0 deletions packaging/deb-v2/debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Copyright:

<Copyright (C) 2015 Hatena>

License:

Apache-2.0

The Debian packaging is:

Copyright (C) 2015 Hatena <developers@mackerel.io>
12 changes: 12 additions & 0 deletions packaging/deb-v2/debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/make -f
# -*- makefile -*-

%:
dh $@

package=mkr

override_dh_auto_install:
dh_auto_install
install -d -m 755 debian/${package}/usr/bin/
install -m 655 debian/${package}.bin debian/${package}/usr/bin/${package}
1 change: 1 addition & 0 deletions packaging/deb-v2/debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (quilt)
1 change: 1 addition & 0 deletions packaging/deb-v2/debian/source/include-binaries
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
debian/mkr.bin
1 change: 1 addition & 0 deletions packaging/deb/debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (quilt)
1 change: 1 addition & 0 deletions packaging/deb/debian/source/include-binaries
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
debian/mkr.bin
Binary file added packaging/mkr_0.16.0.orig.tar.gz
Binary file not shown.
40 changes: 40 additions & 0 deletions packaging/rpm/mkr-v2.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Name: mkr
Version: %{_version}
Release: 1%{?dist}
License: ASL 2.0
Summary: macekrel.io api client tool
URL: https://mackerel.io
Group: Application/System
Packager: Hatena
BuildArch: %{buildarch}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root

%description
macekrel.io api client tool

%prep

%build

%install
rm -rf %{buildroot}

install -d -m 755 %{buildroot}/%{_bindir}
install -m 655 %{_builddir}/%{name} %{buildroot}/%{_bindir}

%clean
rm -f %{buildroot}%{_bindir}/%{name}

%pre

%post

%preun

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

%changelog
* Tue May 09 2017 <mackerel-developers@hatena.ne.jp> - 0.16.0-1
- Add services subcommand (by yuuki)
9 changes: 8 additions & 1 deletion script/create-release-pullrequest
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ use strict;
use warnings;
use utf8;

use File::Copy qw/move/;
use Mackerel::ReleaseUtils qw/create_release_pull_request/;

create_release_pull_request 'mkr';
create_release_pull_request 'mkr' => sub {
my ($current_version, $next_version, $releases) = @_;

move
"packaging/mkr_$current_version.orig.tar.gz",
"packaging/mkr_$next_version.orig.tar.gz";
};

0 comments on commit 5922caf

Please sign in to comment.