Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Makefile for easier distribution packaging #327

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# This file is intended for installation in UNIX based systems
SHELL = /bin/sh
INSTALL = install
INSTALL_DATA = $(INSTALL) -m 0555
INSTALL_DIR = $(INSTALL) -d -m 0755

software_name = tmux-resurrect
prefix = /usr/local
datadir = $(prefix)/share
srcdir = $(prefix)/src
software_srcdir = $(srcdir)/$(software_name)
software_datadir = $(DESTDIR)$(datadir)/$(software_name)

files = \
resurrect.tmux \
save_command_strategies/gdb.sh \
save_command_strategies/linux_procfs.sh \
save_command_strategies/pgrep.sh \
save_command_strategies/ps.sh \
scripts/check_tmux_version.sh \
scripts/helpers.sh \
scripts/process_restore_helpers.sh \
scripts/restore.exp \
scripts/restore.sh \
scripts/save.sh \
scripts/spinner_helpers.sh \
scripts/tmux_spinner.sh \
scripts/variables.sh \
strategies/irb_default_strategy.sh \
strategies/mosh-client_default_strategy.sh \
strategies/nvim_session.sh \
strategies/vim_session.sh

subdirs = \
save_command_strategies \
scripts \
strategies

# It is important to leave two empty lines between define and endef.
# Between those there is a newline character that gets inserted when ${\n} is used.
define \n


endef

.PHONY: all
all:
@echo "This is the default target and does nothing. Use 'make install' to install"

.PHONY: install
install: installdirs
$(foreach filename, $(files), $(INSTALL_DATA) $(software_srcdir)/$(filename) $(software_datadir)/$(filename)${\n})
@echo "$(software_name) is installed :)"

.PHONY: uninstall
uninstall:
$(foreach filename, $(files), rm $(software_datadir)/$(filename)${\n})
$(foreach dirname, $(subdirs), rmdir $(software_datadir)/$(dirname)${\n})
@echo "$(software_name) is uninstalled :)"

.PHONY: installdirs
installdirs:
$(INSTALL_DIR) $(software_datadir)
$(foreach dirname, $(subdirs), $(INSTALL_DIR) $(software_datadir)/$(dirname)${\n})
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,30 @@ Add plugin to the list of TPM plugins in `.tmux.conf`:
Hit `prefix + I` to fetch the plugin and source it. You should now be able to
use the plugin.

### Makefile

Download the ZIP archive and extract the contents into the source file directory.

$ wget https://github.com/tmux-plugins/tmux-resurrect/archive/master.zip
$ unzip -n master.zip
$ sudo mv tmux-resurrect-master /usr/local/src/tmux-resurrect
$ cd /usr/local/src/tmux-resurrect
$ sudo make install

It will copy the needed files into the expected directory on your system, following https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard.

Add this line to the bottom of `.tmux.conf`:

run-shell /usr/local/share/tmux-resurrect/resurrect.tmux

Reload TMUX environment with: `$ tmux source-file ~/.tmux.conf`.
You should now be able to use the plugin.

To uninstall, execute

$ cd /usr/local/src/tmux-resurrect
$ sudo make uninstall

### Manual Installation

Clone the repo:
Expand Down