update orchestration restapi
[platform/core/system/edge-orchestration.git] / packaging / edge-orchestration.spec
1 Name: edge-orchestration
2 Version: 0.0.1
3 Release: 0
4 License: Apache-2.0
5 Summary: edge orchestration
6
7 ExclusiveArch: armv7l
8 Source0: %{name}-%{version}.tar.gz
9 Source1: %{name}.manifest
10 Source2: %{name}.service
11
12 Requires(post): /sbin/ldconfig, /usr/bin/systemctl
13 Requires(postun): /sbin/ldconfig, /usr/bin/systemctl
14
15 BuildRequires: go
16
17 %description
18 Technologies for Device/Service management.
19 Edge service deployment/monitoring and data sharing in home environment with limited available H/W resources.
20
21 %prep
22 %setup -q
23
24 chmod g-w %_sourcedir/*
25 cp %{SOURCE1} ./%{name}.manifest
26 cp %{SOURCE2} ./%{name}.services
27
28 %build
29 ORG_VENDOR_DIR='vendor'
30 CUR_VENDOR_DIR='vendor/src'
31 ln -s %{_builddir}/%{name}-%{version}/${ORG_VENDOR_DIR} %{_builddir}/%{name}-%{version}/${CUR_VENDOR_DIR}
32
33 export GOARCH=arm GOARM=7
34 export GOROOT=/usr/local/go
35 export PATH=$PATH:/usr/local/go/bin/linux_arm
36 export GOPATH=%{_builddir}/%{name}-%{version}:%{_builddir}/%{name}-%{version}/vendor
37 go build -a -v -ldflags '-extldflags "-static"' -o ./bin/%{name} orchestration
38
39 %install
40 rm -rf %{buildroot}
41 install -d $RPM_BUILD_ROOT%{_bindir}
42 install -p -m 755 ./bin/%{name} $RPM_BUILD_ROOT%{_bindir}/%{name}
43 mkdir -p %{buildroot}/usr/lib/systemd/system/multi-user.target.wants
44 install -m 0644 %SOURCE2 %{buildroot}/usr/lib/systemd/system/%{name}.service
45 ln -s ../%{name}.service %{buildroot}/usr/lib/systemd/system/multi-user.target.wants/
46
47 %files
48 %manifest %{name}.manifest
49 %defattr(-,root,root,-)
50 %{_bindir}/%{name}
51 %{_unitdir}/%{name}.service
52 %{_unitdir}/multi-user.target.wants/%{name}.service