diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..3da1e8f
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/.bundle/config
+/vendor
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..99b0a1c
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,3 @@
+# v0.1
+
+The first version with an actual package!
diff --git a/Gemfile b/Gemfile
new file mode 100644
index 0000000..d1b93fc
--- /dev/null
+++ b/Gemfile
@@ -0,0 +1,5 @@
+source 'https://rubygems.org'
+
+group :development do
+ gem 'fpm'
+end
diff --git a/Gemfile.lock b/Gemfile.lock
new file mode 100644
index 0000000..dca0b40
--- /dev/null
+++ b/Gemfile.lock
@@ -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
diff --git a/README.md b/README.md
index e57f1c3..3afd690 100644
--- a/README.md
+++ b/README.md
@@ -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
@@ -47,3 +47,18 @@ Run `_home_row_control` to activate for the current session. Optionally, set up
Hyper 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`
diff --git a/package b/package
index 15bf738..f240269 100755
--- a/package
+++ b/package
@@ -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 " \
- --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 " \
+ --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