Skip to content

Commit

Permalink
Added Makefile to generate RPM and Deb packages
Browse files Browse the repository at this point in the history
With fpm (https://github.com/jordansissel/fpm) it is easily
possible to generate packages for various operating systems.

This Makefile includes tasks to generate RPM and Debian packages:
    * make package_deb
    * make package_rpm
  • Loading branch information
brejoc committed Aug 2, 2015
1 parent 0faceae commit 168f3d6
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
_obj
_test

# Package building
build
*.deb
*.rpm

# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out
Expand Down
62 changes: 62 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
SHELL := /bin/bash

NAME=gosgp
VERSION=0.1

# Dependencies: golang

.PHONY: all clean clean_all prepare package_deb package_rpm
.SILENT: desc

all: desc

desc:
echo "usage: please use either 'make package_deb' or 'make package_rpm'"

clean:
rm -f $(NAME)*.deb
rm -f $(NAME)*.rpm
rm -rf ./build

clean_all: clean
rm -rf /tmp/gosgp

prepare: clean
mkdir -p ./build/usr/bin/
GOPATH=/tmp/gosgp go get -d
GOPATH=/tmp/gosgp go build -o gosgp
mv gosgp ./build/usr/bin/.

package_deb: prepare
fpm -s dir \
-t deb \
-n $(NAME) \
-m "Jochen Breuer <brejoc@gmail.com>" \
--url "https://github.com/brejoc/gosgp" \
--license "GPLv2" \
--description "Command line SuperGenPass password generator written in go." \
-v $(VERSION) \
--deb-user root \
--deb-group root \
-C ./build \
usr
#############################################################
### Don't forget to 'make clean_all' to delete GOPATH dir ###
#############################################################

package_rpm: prepare
fpm -s dir \
-t rpm \
-n $(NAME) \
-m "Jochen Breuer <brejoc@gmail.com>" \
--url "https://github.com/brejoc/gosgp" \
--license "GPLv2" \
--description "Command line SuperGenPass password generator written in go." \
-v $(VERSION) \
--rpm-user root \
--rpm-group root \
-C ./build \
usr
#############################################################
### Don't forget to 'make clean_all' to delete GOPATH dir ###
#############################################################

0 comments on commit 168f3d6

Please sign in to comment.