Skip to content

Commit

Permalink
Updates packaging script, adds package documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanprior committed Feb 17, 2017
1 parent cb8a846 commit bf219b1
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 21 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.bundle/config
/vendor
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# v0.1

The first version with an actual package!
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source 'https://rubygems.org'

group :development do
gem 'fpm'
end
48 changes: 48 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
GEM
remote: https://rubygems.org/
specs:
archive-tar-minitar (0.5.2)
arr-pm (0.0.10)
cabin (> 0)
backports (3.6.8)
cabin (0.9.0)
childprocess (0.6.1)
ffi (~> 1.0, >= 1.0.11)
clamp (1.0.1)
dotenv (2.2.0)
ffi (1.9.17)
fpm (1.8.1)
archive-tar-minitar (= 0.5.2)
arr-pm (~> 0.0.10)
backports (>= 2.6.2)
cabin (>= 0.6.0)
childprocess
clamp (~> 1.0.0)
ffi
json (>= 1.7.7, < 2.0)
pleaserun (~> 0.0.24)
ruby-xz
insist (1.0.0)
io-like (0.3.0)
json (1.8.6)
mustache (0.99.8)
pleaserun (0.0.28)
cabin (> 0)
clamp
dotenv
insist
mustache (= 0.99.8)
stud
ruby-xz (0.2.3)
ffi (~> 1.9)
io-like (~> 0.3)
stud (0.0.22)

PLATFORMS
ruby

DEPENDENCIES
fpm

BUNDLED WITH
1.11.2
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Home Row Control uses X11, which means no native Windows or Mac support. (help w
### Dependencies

* [Xcape](https://github.com/alols/xcape)
* xmodmap
* bash
* xmodmap (from `x11-server-utils`)
* posix sh (eg. `dash`)

## Usage

Expand Down Expand Up @@ -47,3 +47,18 @@ Run `_home_row_control` to activate for the current session. Optionally, set up
<kbd>Hyper</kbd> keys. If you know of a better option that does not
change the behavior of the normal control keys at all, please let
me know.

## Building packages

You can use the included `package` script to build your own packages.
The packaging dependencies are:

* `ruby`
* `fpm` (installed as a ruby gem)
* `bash`
* `debuild` and `rpmbuild`

### Running the packaging script

1. in the project directory, run `bundle install`
2. run `bundle exec ./package`
45 changes: 26 additions & 19 deletions package
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,29 @@ DOC_TARGET=/usr/share/doc/home-row-control/$DOC
SERVICE=home-row-control.service
SERVICE_TARGET=/usr/lib/systemd/user/$SERVICE

set -x
fpm -s dir \
-t deb \
-n $PACKAGE_NAME \
-v $VERSION \
--license "CC-0" \
--maintainer "Ryan Prior <ryanprior@gmail.com>" \
--vendor "Ryan Prior" \
--description "Use big modifier keys in the home row for Ctrl" \
-a all \
--url "https://github.com/ryanprior/home-row-control" \
"-d "{xcape,x11-xserver-utils,coreutils,dash} \
--config-files $CONF_DIR \
--deb-changelog $CHANGELOG \
--deb-no-default-config-files \
$SCRIPT=$SCRIPT_TARGET \
$DOC=$DOC_TARGET \
$SERVICE=$SERVICE_TARGET \
maps=$CONF_DIR
PACKAGE_TYPES=( deb rpm tar sh )

for pkg_type in "${PACKAGE_TYPES[@]}"
do
(
set -x
fpm -t $pkg_type \
-s dir \
-n $PACKAGE_NAME \
-v $VERSION \
--license "CC-0" \
--maintainer "Ryan Prior <ryanprior@gmail.com>" \
--vendor "Ryan Prior" \
--description "Use big modifier keys in the home row for Ctrl" \
-a all \
--url "https://github.com/ryanprior/home-row-control" \
"-d "{xcape,x11-xserver-utils,coreutils,dash} \
--config-files $CONF_DIR \
--deb-changelog $CHANGELOG \
--deb-no-default-config-files \
$SCRIPT=$SCRIPT_TARGET \
$DOC=$DOC_TARGET \
$SERVICE=$SERVICE_TARGET \
maps=$CONF_DIR
)
done

0 comments on commit bf219b1

Please sign in to comment.