aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Kellermann <kellerben@users.noreply.github.com>2018-01-03 17:51:54 +0100
committerGitHub <noreply@github.com>2018-01-03 17:51:54 +0100
commitd5f0050cc205218142a223146f727e192e685e48 (patch)
treef43210570316c62829d3fdc1ad0397d2daf10626
parentd89f4198bf89aa7dbe0271d878ddc1b742686440 (diff)
parentdaadd38426726944e940f7e7b16dae7d9ace0b14 (diff)
Merge pull request #84 from josch/make_install
Make install
-rw-r--r--Makefile30
1 files changed, 30 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 40d8268..42ecb9e 100644
--- a/Makefile
+++ b/Makefile
@@ -17,8 +17,17 @@
# along with dudle. If not, see <http://www.gnu.org/licenses/>. #
############################################################################
+.DELETE_ON_ERROR:
+.POSIX:
+
DOMAIN=dudle
+INSTALL=install -p
+INSTALL_DATA=$(INSTALL) -m 644
+prefix=/usr/local
+datadir=$(prefix)/share
+localstatedir=$(prefix)/var
+.PHONY: locale
locale: $(foreach p,$(wildcard locale/*/$(DOMAIN).po), $(addsuffix .mo,$(basename $p)))
RGETTEXT=$(firstword $(shell which rgettext rxgettext))
@@ -43,3 +52,24 @@ locale/%/$(DOMAIN).po: locale/$(DOMAIN).pot
poedit $@;\
fi;\
fi
+
+.PHONY: install
+install: locale
+ $(INSTALL) -d $(DESTDIR)$(localstatedir)/lib/$(DOMAIN)
+ for f in .htaccess about.cgi access_control.rb advanced.rb atom.rb \
+ authorization_required.cgi charset.rb check.cgi classic.css \
+ config_defaults.rb customize.cgi customize.rb date_locale.rb \
+ default.css delete_poll.rb dudle.rb edit_columns.rb error.cgi \
+ example.cgi favicon.ico hash.rb history.rb html.rb index.cgi \
+ invite_participants.rb log.rb maintenance.cgi not_found.cgi \
+ overview.rb participate.rb poll.rb pollhead.rb print.css \
+ timepollhead.rb timestring.rb vcs_git.rb vcs_test.rb; do \
+ $(INSTALL_DATA) -D -t $(DESTDIR)$(datadir)/$(DOMAIN) $$f; \
+ ln -s $$(realpath --relative-to=$(DESTDIR)$(localstatedir)/lib/$(DOMAIN) $(DESTDIR)$(datadir)/$(DOMAIN))/$$f $(DESTDIR)$(localstatedir)/lib/$(DOMAIN)/$$f; \
+ done
+ for mo in locale/*/$(DOMAIN).mo; do \
+ lang=$$(dirname $$mo); \
+ $(INSTALL_DATA) -D -t $(DESTDIR)$(datadir)/$(DOMAIN)/$$lang $$lang/$(DOMAIN).mo; \
+ done
+ $(INSTALL) -d $(DESTDIR)$(localstatedir)/lib/$(DOMAIN)/$$lang; \
+ ln -s $$(realpath --relative-to=$(DESTDIR)$(localstatedir)/lib/$(DOMAIN) $(DESTDIR)$(datadir)/$(DOMAIN))/locale $(DESTDIR)$(localstatedir)/lib/$(DOMAIN)/locale; \