diff --git a/Makefile b/Makefile index 810f221..109ebb5 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ NAME = procfile-util +EMAIL = procfile-util@josediazgonzalez.com MAINTAINER = josegonzalez +MAINTAINER_NAME = Jose Diaz-Gonzalez REPOSITORY = go-procfile-util HARDWARE = $(shell uname -m) VERSION ?= 0.0.2 @@ -14,6 +16,8 @@ endef build: @$(MAKE) build/darwin/$(NAME) @$(MAKE) build/linux/$(NAME) + @$(MAKE) build/deb/$(NAME)_$(VERSION)_amd64.deb + @$(MAKE) build/rpm/$(NAME)-$(VERSION)-1.x86_64.rpm @$(MAKE) docker-image build/darwin/$(NAME): @@ -22,55 +26,58 @@ build/darwin/$(NAME): build/linux/$(NAME): mkdir -p build/linux && CGO_ENABLED=0 GOOS=linux go build -a -ldflags "-X main.Version=$(VERSION)" -o build/linux/$(NAME) -clean: - rm -rf build - -circleci: - docker version - rm -f ~/.gitconfig - -deps: - go get -u github.com/progrium/gh-release/... - dep ensure -vendor-only - -docker-image: - docker build -q -f Dockerfile.build -t $(IMAGE_NAME):$(BUILD_TAG) . - -release: build - rm -rf release && mkdir release - tar -zcf release/$(NAME)_$(VERSION)_linux_$(HARDWARE).tgz -C build/linux $(NAME) - tar -zcf release/$(NAME)_$(VERSION)_darwin_$(HARDWARE).tgz -C build/darwin $(NAME) - @$(MAKE) release/$(NAME)_$(VERSION)_amd64.deb - @$(MAKE) release/$(NAME)-$(VERSION)-1.x86_64.rpm - gh-release create $(MAINTAINER)/$(REPOSITORY) $(VERSION) $(shell git rev-parse --abbrev-ref HEAD) - -release/$(NAME)_$(VERSION)_amd64.deb: build/linux/$(NAME) - fpm \ +build/deb/$(NAME)_$(VERSION)_amd64.deb: build/linux/$(NAME) + mkdir -p build/deb && fpm \ --architecture amd64 \ --category utils \ --description "$$DESCRIPTION" \ --input-type dir \ --license 'MIT License' \ - --maintainer "Jose Diaz-Gonzalez " \ + --maintainer "$(MAINTAINER_NAME) <$(EMAIL)>" \ --name procfile-util \ --output-type deb \ - --package release/$(NAME)_$(VERSION)_amd64.deb \ + --package build/deb/$(NAME)_$(VERSION)_amd64.deb \ --url "https://github.com/$(MAINTAINER)/$(REPOSITORY)" \ --version $(VERSION) \ build/linux/$(NAME)=/usr/local/bin/$(NAME) -release/$(NAME)-$(VERSION)-1.x86_64.rpm: build/linux/$(NAME) - fpm \ +build/rpm/$(NAME)-$(VERSION)-1.x86_64.rpm: build/linux/$(NAME) + sudo apt install rpm -y + mkdir -p build/rpm && fpm \ --architecture x86_64 \ --category utils \ --description "$$DESCRIPTION" \ --input-type dir \ --license 'MIT License' \ - --maintainer "Jose Diaz-Gonzalez " \ + --maintainer "$(MAINTAINER_NAME) <$(EMAIL)>" \ --name procfile-util \ --output-type rpm \ - --package release/$(NAME)-$(VERSION)-1.x86_64.rpm \ + --package build/rpm/$(NAME)-$(VERSION)-1.x86_64.rpm \ --rpm-os linux \ --url "https://github.com/$(MAINTAINER)/$(REPOSITORY)" \ --version $(VERSION) \ build/linux/$(NAME)=/usr/local/bin/$(NAME) + +clean: + rm -rf build + +circleci: + docker version + rm -f ~/.gitconfig + sudo apt install ruby ruby-dev rubygems build-essential -y + sudo gem install --no-ri --no-rdoc fpm + +deps: + go get -u github.com/progrium/gh-release/... + dep ensure -vendor-only + +docker-image: + docker build -q -f Dockerfile.build -t $(IMAGE_NAME):$(BUILD_TAG) . + +release: build + rm -rf release && mkdir release + tar -zcf release/$(NAME)_$(VERSION)_linux_$(HARDWARE).tgz -C build/linux $(NAME) + tar -zcf release/$(NAME)_$(VERSION)_darwin_$(HARDWARE).tgz -C build/darwin $(NAME) + cp build/deb/$(NAME)_$(VERSION)_amd64.deb release/$(NAME)_$(VERSION)_amd64.deb + cp build/rpm/$(NAME)-$(VERSION)-1.x86_64.rpm release/$(NAME)-$(VERSION)-1.x86_64.rpm + gh-release create $(MAINTAINER)/$(REPOSITORY) $(VERSION) $(shell git rev-parse --abbrev-ref HEAD)