forked from F5Networks/f5-appsvcs-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproject.spec
45 lines (39 loc) · 1.43 KB
/
project.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
Summary: %{_name} %{_version}
Name: %{_name}
Version: %{_version}
Release: %{_release}
BuildArch: noarch
License: Commercial
Group: Development/Tools
Packager: F5 Networks <[email protected]>
%description
Framework for deploying configuration on BIG-IP using mustache templates
%define IAPP_INSTALL_DIR /var/config/rest/iapps/%{name}
%prep
# Metadata
echo -n %{version}-%{release} > %{_builddir}/version
# REST worker
mkdir -p %{_builddir}/nodejs
npx babel %{main}/nodejs -d %{_builddir}/nodejs --copy-files --config-file %{main}/babel.config.js
mkdir -p %{_builddir}/lib
npx babel %{main}/lib -d %{_builddir}/lib --copy-files --config-file %{main}/babel.config.js
cp %{main}/package.json %{_builddir}
%{main}/scripts/copy-node-modules.sh %{main} %{_builddir}/node_modules
# Presentation layer
mkdir -p %{_builddir}/presentation
cp %{main}/presentation/*.html %{_builddir}/presentation
cp %{main}/presentation/bundle.js %{_builddir}/presentation
cp -r %{main}/presentation/img %{_builddir}/presentation
cp -r %{main}/presentation/css %{_builddir}/presentation
cp -r %{main}/presentation/js %{_builddir}/presentation
cp -r %{main}/presentation/webfonts %{_builddir}/presentation
# Default template sets
cp -r %{main}/templates/ %{_builddir}/templatesets
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{IAPP_INSTALL_DIR}
cp -r %{_builddir}/* $RPM_BUILD_ROOT%{IAPP_INSTALL_DIR}
%clean rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%{IAPP_INSTALL_DIR}