forked from nasa-gibs/worldview
-
Notifications
You must be signed in to change notification settings - Fork 0
/
worldview.spec
95 lines (76 loc) · 2.19 KB
/
worldview.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
86
87
88
89
90
91
92
93
94
95
Name: @WORLDVIEW@
Version: @BUILD_VERSION@
Release: @BUILD_RELEASE@.@BUILD_NUMBER@%{?dist}
Summary: Browse full-resolution, near real-time satellite imagery.
License: NASA-1.3
URL: http://earthdata.nasa.gov
Source0: site-@[email protected]
Source1: site-@[email protected]
Source3: httpd.conf
Source4: httpd-debug.conf
BuildArch: noarch
Requires: httpd
# Turn off the brp-python-bytecompile script
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
# Set httpd configuration
%global httpdconfdir %{_sysconfdir}/httpd/conf.d
%description
%{summary}
%package debug
Summary: Non-minified version of Worldview for debugging
%description debug
%{summary}
%prep
%setup -c -T
tar xf %{SOURCE0}
tar xf %{SOURCE1}
cp %{SOURCE3} .
cp %{SOURCE4} .
%install
rm -rf %{buildroot}
# Install Apache configuration for release
install -m 755 -d %{buildroot}/%{httpdconfdir}
install -m 644 httpd.conf %{buildroot}/%{httpdconfdir}/@[email protected]
rm httpd.conf
# Install Apache configuration for debug
install -m 644 httpd-debug.conf %{buildroot}/%{httpdconfdir}/@[email protected]
rm httpd-debug.conf
# Install release application
install -m 755 -d %{buildroot}/%{_datadir}/@WORLDVIEW@
cp -r site-@WORLDVIEW@/* %{buildroot}/%{_datadir}/@WORLDVIEW@
# Install debug application
install -m 755 -d %{buildroot}/%{_datadir}/@WORLDVIEW@-debug
cp -r site-@WORLDVIEW@-debug/* %{buildroot}/%{_datadir}/@WORLDVIEW@-debug
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%{_datadir}/@WORLDVIEW@
%config(noreplace) %{httpdconfdir}/@[email protected]
%files debug
%{_datadir}/@WORLDVIEW@-debug
%config(noreplace) %{httpdconfdir}/@[email protected]
%post
if [ $1 -gt 0 ] ; then
if /sbin/service httpd status >/dev/null ; then
/sbin/service httpd reload
fi
fi
%post debug
if [ $1 -gt 0 ] ; then
if /sbin/service httpd status >/dev/null ; then
/sbin/service httpd reload
fi
fi
%postun
if [ $1 -eq 0 ] ; then
if /sbin/service httpd status >/dev/null ; then
/sbin/service httpd reload
fi
fi
%postun debug
if [ $1 -eq 0 ] ; then
if /sbin/service httpd status >/dev/null ; then
/sbin/service httpd reload
fi
fi