forked from perfsonar/psconfig-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
perfsonar-psconfig-web-admin-shared.spec
86 lines (62 loc) · 2.57 KB
/
perfsonar-psconfig-web-admin-shared.spec
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
%define install_base /usr/lib/perfsonar/psconfig-web-admin/shared
%define config_base /etc/perfsonar/psconfig-web
# cron/apache entries are located in the 'etc' directory
%define apache_base /etc/httpd/conf.d
%define perfsonar_auto_version 4.4.4
%define perfsonar_auto_relnum 1
%define debug_package %{nil}
Name: perfsonar-psconfig-web-admin-shared
Version: %{perfsonar_auto_version}
Release: %{perfsonar_auto_relnum}%{?dist}
Summary: perfSONAR pSConfig Web Administrator: Shared components
License: ASL 2.0
Group: Applications/Communications
URL: http://www.perfsonar.net
Source0: perfsonar-psconfig-web-admin-shared-%{version}.%{perfsonar_auto_relnum}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: x86_64
Requires: nodejs
Requires: httpd
Requires: mod_ssl
%description
Shared libraries and configs for pSConfig Web Administrator (PWA).
%pre
/usr/sbin/groupadd perfsonar 2> /dev/null || :
/usr/sbin/useradd -g perfsonar -r -s /sbin/nologin -c "perfSONAR User" -d /tmp perfsonar 2> /dev/null || :
%prep
%setup -q -n perfsonar-psconfig-web-admin-shared-%{version}.%{perfsonar_auto_relnum}
%build
%install
rm -rf %{buildroot}
make ROOTPATH=%{buildroot}/%{install_base} CONFIGPATH=%{buildroot}/%{config_base} install
rm -rf %{buildroot}/etc/perfsonar/psconfig-web
rm -rf %{buildroot}/%{apache_base}/%{apacheconf}
rm -rf %{buildroot}/%{install_base}/api/pub
mkdir -p %{buildroot}/etc/perfsonar/psconfig-web/shared
mkdir -p %{buildroot}/%{install_base}/dist
mkdir -p %{buildroot}/%{install_base}/node_modules
install -D -m 0644 etc/index.js %{buildroot}/etc/perfsonar/psconfig-web/index.js
install -D -m 0644 etc/shared/pwa.ui.js %{buildroot}/etc/perfsonar/psconfig-web/shared/pwa.ui.js
install -D -m 0644 etc/shared/config.js %{buildroot}/etc/perfsonar/psconfig-web/shared/config.js
cp -R node_modules/* %{buildroot}/%{install_base}/node_modules/
rm -f %{buildroot}/%{apache}/%{apacheconf}
%clean
rm -rf %{buildroot}
%post
mkdir -p /var/log/perfsonar
chown perfsonar:perfsonar /var/log/perfsonar
chown -R perfsonar:perfsonar %{install_base}
chown -R apache:apache %{apache_base}
service httpd restart &> /dev/null || :
%files
%defattr(-,perfsonar,perfsonar,-)
%license LICENSE
%config(noreplace) /etc/perfsonar/psconfig-web/index.js
%config(noreplace) /etc/perfsonar/psconfig-web/shared/pwa.ui.js
%config(noreplace) /etc/perfsonar/psconfig-web/shared/config.js
%{install_base}/node_modules/*
%{install_base}/api/*.js
%{install_base}/api/models/*.js
%changelog
* Fri Mar 1 2019 [email protected] 4.2.0.1-1.a1
- Initial release as an RPM