aboutsummaryrefslogtreecommitdiff
path: root/Makefile.am
blob: c66d2895c3dcf4d9a36426274a4502309ef70072 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# guix-data-service - Mediocre, uh, mail interface
# Copyright © 2016, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
# Copyright © 2019 Christopher Baines <mail@cbaines.net>
#
# This file is part of guix-data-service.
#
# guix-data-service is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# guix-data-service is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with the guix-data-service.  If not, see
# <http://www.gnu.org/licenses/>.

include guile.am

bin_SCRIPTS =							\
  scripts/guix-data-service					\
  scripts/guix-data-service-process-job			\
  scripts/guix-data-service-process-jobs			\
  scripts/guix-data-service-process-branch-updated-email	\
  scripts/guix-data-service-process-branch-updated-mbox	\
  scripts/guix-data-service-manage-build-servers		\
  scripts/guix-data-service-query-build-servers

moddir = $(prefix)/share/guile/site/$(GUILE_EFFECTIVE_VERSION)
godir  = $(prefix)/lib/guile/$(GUILE_EFFECTIVE_VERSION)/site-ccache
assetsdir = $(datadir)/@PACKAGE@

README.html: README
	emacs -q --no-splash -batch -visit README \
		-eval "(progn (require 'org) (let ((org-export-htmlize-output-type 'css)) (org-html-export-to-html nil nil nil t nil)))"

install-data-local: README.html
	mkdir -p "$(DESTDIR)$(pkgdatadir)" || exit 1;
	cp -r assets "$(DESTDIR)$(pkgdatadir)/" || exit 1;
	cp -r sqitch "$(DESTDIR)$(pkgdatadir)/" || exit 1;
	mkdir -p "$(DESTDIR)$(docdir)";
	cp README "$(DESTDIR)$(docdir)/README"
	cp README.html "$(DESTDIR)$(docdir)/README.html"

install-data-hook:
# These files shouldn't be installed, but I have no idea how to specify that
# :(
	rm -r "$(DESTDIR)$(moddir)/tests"

check-with-tmp-database:
	$(eval TMP_DATABASE := $(shell mktemp -d -t guix-data-service-database-XXXX))
# -w 0 means that the database won't be automatically shutdown, and needs to
# -be stopped by running pg_tmp stop
	$(eval URI := $(shell pg_tmp -w 0 -d "$(TMP_DATABASE)"))
	$(eval GUIX_DATA_SERVICE_DATABASE_URI := $(patsubst postgresql:///test%,postgresql://guix_data_service@localhost/guix_data_service_test%,$(URI)))
	psql --no-psqlrc "$(URI)" --command="CREATE USER guix_data_service"
	psql --no-psqlrc "$(URI)" --command="CREATE DATABASE guix_data_service_test WITH OWNER guix_data_service"
# Set TZ and SQITCH_USER_CONFIG to avoid Sqitch tripping up in a minimal
# environment, like a Guix package
	TZ=UTC SQITCH_USER_CONFIG=/dev/null sqitch deploy --target="$(GUIX_DATA_SERVICE_DATABASE_URI)"
	GUIX_DATA_SERVICE_DATABASE_URI="$(GUIX_DATA_SERVICE_DATABASE_URI)" make check
	pg_tmp stop -w 1 -d "$(TMP_DATABASE)"

SOURCES =							\
  guix-data-service/branch-updated-emails.scm			\
  guix-data-service/builds.scm					\
  guix-data-service/comparison.scm				\
  guix-data-service/config.scm					\
  guix-data-service/database.scm				\
  guix-data-service/jobs.scm					\
  guix-data-service/jobs/load-new-guix-revision.scm		\
  guix-data-service/model/build-server.scm			\
  guix-data-service/model/build-server-token-seed.scm		\
  guix-data-service/model/build-status.scm			\
  guix-data-service/model/build.scm				\
  guix-data-service/model/channel-news.scm			\
  guix-data-service/model/derivation.scm			\
  guix-data-service/model/git-branch.scm			\
  guix-data-service/model/git-repository.scm			\
  guix-data-service/model/guix-revision-package-derivation.scm	\
  guix-data-service/model/guix-revision.scm			\
  guix-data-service/model/license-set.scm			\
  guix-data-service/model/license.scm				\
  guix-data-service/model/lint-checker.scm			\
  guix-data-service/model/lint-warning-message.scm		\
  guix-data-service/model/lint-warning.scm			\
  guix-data-service/model/location.scm				\
  guix-data-service/model/package-derivation.scm		\
  guix-data-service/model/package-metadata.scm			\
  guix-data-service/model/package.scm				\
  guix-data-service/model/utils.scm				\
  guix-data-service/web/compare/controller.scm			\
  guix-data-service/web/compare/html.scm			\
  guix-data-service/web/controller.scm				\
  guix-data-service/web/build/controller.scm			\
  guix-data-service/web/build/html.scm				\
  guix-data-service/web/build-server/controller.scm		\
  guix-data-service/web/jobs/controller.scm			\
  guix-data-service/web/jobs/html.scm				\
  guix-data-service/web/query-parameters.scm			\
  guix-data-service/web/render.scm				\
  guix-data-service/web/repository/controller.scm		\
  guix-data-service/web/repository/html.scm			\
  guix-data-service/web/revision/controller.scm		\
  guix-data-service/web/revision/html.scm			\
  guix-data-service/web/server.scm				\
  guix-data-service/web/sxml.scm				\
  guix-data-service/web/util.scm				\
  guix-data-service/web/view/html.scm				\
  tests/driver.scm						\
  tests/mock-inferior.scm

TEST_EXTENSIONS = .scm

TESTS =					\
  tests/branch-updated-emails.scm		\
  tests/jobs-load-new-guix-revision.scm	\
  tests/model-derivation.scm			\
  tests/model-git-branch.scm			\
  tests/model-git-repository.scm		\
  tests/model-license-set.scm			\
  tests/model-license.scm			\
  tests/model-lint-checker.scm			\
  tests/model-lint-warning-message.scm		\
  tests/model-package.scm			\
  tests/model-package-metadata.scm

AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)"

SCM_LOG_DRIVER = $(top_builddir)/test-env	\
  $(GUILE) --no-auto-compile -e main		\
      $(top_srcdir)/build-aux/test-driver.scm

AM_SCM_LOG_DRIVER_FLAGS = --brief=yes