summarylogtreecommitdiffstats
path: root/cms.patch
blob: 832fff422d608410ed0a0eeb7d09d10f1bc59c42 (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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
diff --git a/README.md b/README.md
index 3c5833d..4258339 100644
--- a/README.md
+++ b/README.md
@@ -57,8 +57,8 @@ proposals and critics, get opinions and reviews, etc.) is
 [github](https://github.com/cms-dev/cms/issues) instead.**
 
 To help with the troubleshooting, you can collect the complete log
-files that are placed in /var/local/log/cms/ (if CMS was running
-installed) or in ./log (if it was running from the local copy).
+files that are placed in /var/log/cms/ (if CMS was running installed) or
+in ./log (if it was running from the local copy).
 
 
 Testimonials
diff --git a/cms/conf.py b/cms/conf.py
index bf6446c..65535ba 100644
--- a/cms/conf.py
+++ b/cms/conf.py
@@ -127,12 +127,11 @@ class Config(object):
             sys.argv[0] != '/usr/bin/python'
 
         if self.installed:
-            self.log_dir = os.path.join("/", "var", "local", "log", "cms")
-            self.cache_dir = os.path.join("/", "var", "local", "cache", "cms")
-            self.data_dir = os.path.join("/", "var", "local", "lib", "cms")
-            self.run_dir = os.path.join("/", "var", "local", "run", "cms")
-            paths = [os.path.join("/", "usr", "local", "etc", "cms.conf"),
-                     os.path.join("/", "etc", "cms.conf")]
+            self.log_dir = os.path.join("/", "var", "log", "cms")
+            self.cache_dir = os.path.join("/", "var", "cache", "cms")
+            self.data_dir = os.path.join("/", "var", "lib", "cms")
+            self.run_dir = os.path.join("/", "var", "run", "cms")
+            paths = [os.path.join("/", "etc", "cms.conf")]
         else:
             self.log_dir = "log"
             self.cache_dir = "cache"
@@ -143,8 +142,7 @@ class Config(object):
                 paths += [os.path.abspath(os.path.join(
                           os.path.dirname(__file__),
                           '..', 'config', 'cms.conf'))]
-            paths += [os.path.join("/", "usr", "local", "etc", "cms.conf"),
-                      os.path.join("/", "etc", "cms.conf")]
+            paths += [os.path.join("/", "etc", "cms.conf")]
 
         # Allow user to override config file path using environment
         # variable 'CMS_CONFIG'.
diff --git a/cms/server/AdminWebServer.py b/cms/server/AdminWebServer.py
index 470eaf1..05f0b75 100644
--- a/cms/server/AdminWebServer.py
+++ b/cms/server/AdminWebServer.py
@@ -207,8 +207,7 @@ class BaseHandler(CommonRequestHandler):
         self.contest = None
 
         if config.installed:
-            localization_dir = os.path.join("/", "usr", "local", "share",
-                                            "locale")
+            localization_dir = os.path.join("/", "usr", "share", "locale")
         else:
             localization_dir = os.path.join(os.path.dirname(__file__), "mo")
         if os.path.exists(localization_dir):
diff --git a/cms/server/ContestWebServer.py b/cms/server/ContestWebServer.py
index 65df554..1dd87a3 100644
--- a/cms/server/ContestWebServer.py
+++ b/cms/server/ContestWebServer.py
@@ -440,7 +440,7 @@ class ContestWebServer(WebService):
         # Retrieve the available translations.
         if config.installed:
             self.localization_dir = os.path.join(
-                "/", "usr", "local", "share", "locale")
+                "/", "usr", "share", "locale")
         else:
             self.localization_dir = os.path.join(
                 os.path.dirname(__file__), "mo")
diff --git a/cmscontrib/PolygonLoader.py b/cmscontrib/PolygonLoader.py
index 76c668d..f79606d 100644
--- a/cmscontrib/PolygonLoader.py
+++ b/cmscontrib/PolygonLoader.py
@@ -330,7 +330,7 @@ class PolygonLoader(Loader):
             if os.path.exists(checker_src):
                 logger.info("Checker found, compiling")
                 checker_exe = os.path.join(task_path, "files", "checker")
-                testlib_path = "/usr/local/include/cms/testlib.h"
+                testlib_path = "/usr/include/cms/testlib.h"
                 if not config.installed:
                     testlib_path = os.path.join(os.path.dirname(__file__),
                                                 "polygon", "testlib.h")
diff --git a/cmsranking/Config.py b/cmsranking/Config.py
index 02f80b6..72432d9 100644
--- a/cmsranking/Config.py
+++ b/cmsranking/Config.py
@@ -60,19 +60,13 @@ class Config(object):
 
         self.web_dir = pkg_resources.resource_filename("cmsranking", "static")
         if self.installed:
-            self.log_dir = os.path.join("/", "var", "local", "log",
-                                        "cms", "ranking")
-            self.lib_dir = os.path.join("/", "var", "local", "lib",
-                                        "cms", "ranking")
-            paths = [os.path.join("/", "usr", "local", "etc",
-                                  "cms.ranking.conf"),
-                     os.path.join("/", "etc", "cms.ranking.conf")]
+            self.log_dir = os.path.join("/", "var", "log", "cms", "ranking")
+            self.lib_dir = os.path.join("/", "var", "lib", "cms", "ranking")
+            paths = [os.path.join("/", "etc", "cms.ranking.conf")]
         else:
             self.log_dir = os.path.join("log", "ranking")
             self.lib_dir = os.path.join("lib", "ranking")
             paths = [os.path.join(".", "config", "cms.ranking.conf"),
-                     os.path.join("/", "usr", "local", "etc",
-                                  "cms.ranking.conf"),
                      os.path.join("/", "etc", "cms.ranking.conf")]
 
         try:
diff --git a/cmstestsuite/RunFunctionalTests.py b/cmstestsuite/RunFunctionalTests.py
index 349fbf3..6e2975c 100755
--- a/cmstestsuite/RunFunctionalTests.py
+++ b/cmstestsuite/RunFunctionalTests.py
@@ -421,7 +421,7 @@ def main():
     CONFIG["TEST_DIR"] = git_root
     CONFIG["CONFIG_PATH"] = "%s/config/cms.conf" % CONFIG["TEST_DIR"]
     if CONFIG["TEST_DIR"] is None:
-        CONFIG["CONFIG_PATH"] = "/usr/local/etc/cms.conf"
+        CONFIG["CONFIG_PATH"] = "/etc/cms.conf"
     cms_config = get_cms_config()
 
     if not config_is_usable(cms_config):
diff --git a/cmstestsuite/RunUnitTests.py b/cmstestsuite/RunUnitTests.py
index b1d4249..c8df039 100755
--- a/cmstestsuite/RunUnitTests.py
+++ b/cmstestsuite/RunUnitTests.py
@@ -185,7 +185,7 @@ def main():
     CONFIG["TEST_DIR"] = git_root
     CONFIG["CONFIG_PATH"] = "%s/config/cms.conf" % CONFIG["TEST_DIR"]
     if CONFIG["TEST_DIR"] is None:
-        CONFIG["CONFIG_PATH"] = "/usr/local/etc/cms.conf"
+        CONFIG["CONFIG_PATH"] = "/etc/cms.conf"
 
     if CONFIG["TEST_DIR"] is not None:
         # Set up our expected environment.
diff --git a/docs/Internals.rst b/docs/Internals.rst
index 5ee50ce..0acb587 100644
--- a/docs/Internals.rst
+++ b/docs/Internals.rst
@@ -65,8 +65,8 @@ Setting the ``backdoor`` configuration key to true causes services to
 serve a Python console (accessible with netcat), running in the same
 interpreter instance as the service, allowing to inspect and modify its
 data, live. It will be bound to a local UNIX domain socket, usually at
-:file:`/var/local/run/cms/{service}_{shard}`. Access is granted only to
-users belonging to the cmsuser group.
+:file:`/var/run/cms/{service}_{shard}`. Access is granted only to users
+belonging to the cmsuser group.
 Although there's no authentication mechanism to prevent unauthorized
 access, the restrictions on the file should make it safe to run the
 backdoor everywhere, even on workers that are used as contestants'
@@ -76,7 +76,7 @@ following is a complete working connection command:
 
 .. sourcecode:: bash
 
-    rlwrap netcat -U /var/local/run/cms/EvaluationService_0
+    rlwrap netcat -U /var/run/cms/EvaluationService_0
 
 Substitute ``netcat`` with your implementation (``nc``, ``ncat``, etc.)
 if needed.
diff --git a/docs/RankingWebServer.rst b/docs/RankingWebServer.rst
index bcc3762..e24fcc0 100644
--- a/docs/RankingWebServer.rst
+++ b/docs/RankingWebServer.rst
@@ -48,7 +48,7 @@ You also need to make sure that RWS is able to keep enough simultaneously active
 Managing it
 ===========
 
-RWS doesn't use the PostgreSQL database. Instead, it stores its data in :file:`/var/local/lib/cms/ranking` (or whatever directory is given as ``lib_dir`` in the configuration file) as a collection of JSON files. Thus, if you want to backup the RWS data, just make a copy of that directory. RWS modifies this data in response to specific (authenticated) HTTP requests it receives.
+RWS doesn't use the PostgreSQL database. Instead, it stores its data in :file:`/var/lib/cms/ranking` (or whatever directory is given as ``lib_dir`` in the configuration file) as a collection of JSON files. Thus, if you want to backup the RWS data, just make a copy of that directory. RWS modifies this data in response to specific (authenticated) HTTP requests it receives.
 
 The intended way to get data to RWS is to have the rest of CMS send it. The service responsible for that is ProxyService (PS for short). When PS is started for a certain contest, it will send the data for that contest to all RWSs it knows about (i.e. those in its configuration). This data includes the contest itself (its name, its begin and end times, etc.), its tasks, its users and the submissions received so far. Then it will continue to send new submissions as soon as they are scored and it will update them as needed (for example when a user uses a token). Note that hidden users (and their submissions) will not be sent to RWS.
 
diff --git a/setup.py b/setup.py
index dc0d6fc..620befa 100755
--- a/setup.py
+++ b/setup.py
@@ -42,8 +42,10 @@ from setuptools import setup
 
 
 # Root directories for the /usr and /var trees.
-USR_ROOT = os.path.join("/", "usr", "local")
-VAR_ROOT = os.path.join("/", "var", "local")
+ROOT = "MAKEPKG_INSTALL_ROOT"
+USR_ROOT = os.path.join(ROOT, "usr")
+VAR_ROOT = os.path.join(ROOT, "var")
+ETC_ROOT = os.path.join(ROOT, "etc")
 
 
 def do_setup():
@@ -279,16 +281,16 @@ def install():
     root = pwd.getpwnam("root")
     cmsuser_grp = grp.getgrnam("cmsuser")
 
-    print("copying isolate to /usr/local/bin/.")
+    print("copying isolate to /usr/bin/.")
     makedir(os.path.join(USR_ROOT, "bin"), root, 0755)
     copyfile(os.path.join(".", "isolate", "isolate"),
              os.path.join(USR_ROOT, "bin", "isolate"),
              root, 04750, group=cmsuser_grp)
 
-    print("copying configuration to /usr/local/etc/.")
-    makedir(os.path.join(USR_ROOT, "etc"), root, 0755)
+    print("copying configuration to /etc/.")
+    makedir(ETC_ROOT, root, 0755)
     for conf_file_name in ["cms.conf", "cms.ranking.conf"]:
-        conf_file = os.path.join(USR_ROOT, "etc", conf_file_name)
+        conf_file = os.path.join(ETC_ROOT, conf_file_name)
         # Skip if destination is a symlink
         if os.path.islink(conf_file):
             continue
@@ -316,7 +318,7 @@ def install():
     dirs = [os.path.join(VAR_ROOT, "log"),
             os.path.join(VAR_ROOT, "cache"),
             os.path.join(VAR_ROOT, "lib"),
-            os.path.join(VAR_ROOT, "run"),
+            os.path.join(ROOT, "run"),  # On Archlinux /var/run is a symlink to /run
             os.path.join(USR_ROOT, "include"),
             os.path.join(USR_ROOT, "share")]
     for _dir in dirs: