File tree Expand file tree Collapse file tree 2 files changed +59
-0
lines changed Expand file tree Collapse file tree 2 files changed +59
-0
lines changed Original file line number Diff line number Diff line change 3
3
[ ![ License] ( http://img.shields.io/:license-mit-blue.svg )] ( http://badges.mit-license.org )
4
4
[ ![ Docs] ( https://img.shields.io/badge/docs-latest-brightgreen.svg )] ( http://recodex.github.io/cleaner/ )
5
5
[ ![ Wiki] ( https://img.shields.io/badge/docs-wiki-orange.svg )] ( https://github.com/ReCodEx/wiki/wiki )
6
+ [ ![ COPR] ( https://copr.fedorainfracloud.org/coprs/semai/ReCodEx/package/recodex-cleaner/status_image/last_build.png )] ( )
6
7
7
8
Cleaner is script which should be cronned on machine on which worker is deployed. Its function is continuously delete cache folder from old files which are no longer used. To efectively do this filesystem should be able to display last access time.
8
9
Original file line number Diff line number Diff line change
1
+ %define name recodex-cleaner
2
+ %define version 1.0.0
3
+ %define unmangled_version 1.0.0
4
+ %define unmangled_version 1.0.0
5
+ %define release 1
6
+
7
+ Summary: Clean cache which is used by ReCodEx workers
8
+ Name: %{name }
9
+ Version: %{version }
10
+ Release: %{release }
11
+ Source0: %{name }-%{unmangled_version }.tar.gz
12
+ License: MIT
13
+ Group: Development/Libraries
14
+ BuildRoot: %{_tmppath }/%{name }-%{version }-%{release }-buildroot
15
+ Prefix: %{_prefix }
16
+ BuildArch: noarch
17
+ Vendor: ReCodEx Team < UNKNOWN>
18
+ Url: https://github.com/ReCodEx/cleaner
19
+
20
+ %description
21
+ UNKNOWN
22
+
23
+ %prep
24
+ %setup -n %{name }-%{unmangled_version } -n %{name }-%{unmangled_version }
25
+
26
+ %build
27
+ python3 setup.py build
28
+
29
+ %install
30
+ python3 setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES
31
+
32
+ %clean
33
+ rm -rf $RPM_BUILD_ROOT
34
+
35
+ %post
36
+ #!/bin/sh
37
+
38
+ CONF_DIR= /etc/recodex
39
+ LOG_DIR= /var/log/recodex
40
+
41
+ # Create 'recodex' user if not exist
42
+ id -u recodex > /dev/null 2> &1
43
+ if [ $? -eq 1 ]
44
+ then
45
+ useradd --system --shell /sbin/nologin recodex
46
+ fi
47
+
48
+ # Create default logging directory and set proper permission
49
+ mkdir -p ${LOG_DIR}
50
+ chown -R recodex:recodex ${LOG_DIR}
51
+
52
+ # Change owner of config files
53
+ chown -R recodex:recodex ${CONF_DIR}
54
+
55
+
56
+
57
+ %files -f INSTALLED_FILES
58
+ %defattr(-,root,root)
You can’t perform that action at this time.
0 commit comments