-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathowf-widget-cartridge.spec.new
76 lines (64 loc) · 2.09 KB
/
owf-widget-cartridge.spec.new
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
%global cartridgedir %{_libexecdir}/openshift/cartridges/v2/owf-widget/
Summary: Provides an Ozone Widget Quickstart Applications
Name: owf-widget-cartridge
Version: 0.8.14
Release: 1%{?dist}
Group: Development/Languages
License: ASL 2.0
URL: http://www.shadow-soft.com
Source0: https://github.com/Shadow-Soft/owf-widget-cartridge
Requires: rubygem(openshift-origin-node)
Requires: openshift-origin-cartridge-jbossews
%if 0%{?rhel}
Requires: maven3
%endif
%if 0%{?fedora}
Requires: maven
%endif
BuildRequires: jpackage-utils
BuildArch: noarch
%description
Provides an Ozone Widget template application for OpenShift. (Cartridge Format V2)
%prep
%setup -q
%build
%__rm %{name}.spec
%install
%__mkdir -p %{buildroot}%{cartridgedir}
%__cp -r * %{buildroot}%{cartridgedir}
%post
# To modify an alternative you should:
# - remove the previous version if it's no longer valid
# - install the new version with an increased priority
# - set the new version as the default to be safe
%if 0%{?rhel}
alternatives --install /etc/alternatives/maven-3.0 maven-3.0 /usr/share/java/apache-maven-3.0.3 100
alternatives --set maven-3.0 /usr/share/java/apache-maven-3.0.3
%endif
%if 0%{?fedora}
alternatives --remove maven-3.0 /usr/share/java/apache-maven-3.0.3
alternatives --install /etc/alternatives/maven-3.0 maven-3.0 /usr/share/maven 102
alternatives --set maven-3.0 /usr/share/maven
%endif
/usr/sbin/oo-admin-cartridge --action install -R -s %{cartridgedir}../
if [ -f /usr/sbin/oo-admin-broker-cache ]
then
echo "clearing broker cache"
/usr/sbin/oo-admin-broker-cache --clear --console
fi
%postun
/usr/sbin/oo-admin-cartridge --action erase --name widget --version 1.0 --cartridge_version 0.0.1
if [ -f /usr/sbin/oo-admin-broker-cache ]
then
echo "clearing broker cache"
/usr/sbin/oo-admin-broker-cache --clear --console
fi
%files
%dir %{cartridgedir}
%attr(0755,-,-) %{cartridgedir}/bin/
%attr(0755,-,-) %{cartridgedir}/hooks/
%{cartridgedir}
%doc %{cartridgedir}/README.md
%doc %{cartridgedir}/COPYRIGHT
%doc %{cartridgedir}/LICENSE
%changelog