Initial commit
[ta/start-menu.git] / start-menu.spec
1 # Copyright 2019 Nokia
2
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 Name:       start-menu
16 Version:    %{_version}
17 Release:    1%{?dist}
18 Summary:    Contains code for start menu.
19 License:    %{_platform_licence}
20 Source0:    %{name}-%{version}.tar.gz
21 Vendor:     %{_platform_vendor}
22 BuildArch:  noarch
23
24 Requires: dialog
25 BuildRequires: rsync
26
27 %description
28 This RPM contains code and support files for installing start menu
29
30 %prep
31 %autosetup
32
33 %build
34
35 %install
36 mkdir -p %{buildroot}/opt/start-menu/
37 mkdir -p %{buildroot}/etc/userconfig/
38 mkdir -p %{buildroot}/usr/lib/systemd/system/
39
40 rsync -av src/*  %{buildroot}/opt/start-menu
41 rsync -av services/start-menu.service %{buildroot}/usr/lib/systemd/system/start-menu.service
42
43 find
44
45 %files
46 %defattr(0755,root,root,0755)
47 /opt/start-menu*
48 /etc/userconfig
49 %attr(0644, root, root) /usr/lib/systemd/system/start-menu.service
50
51 %pre
52
53 %post
54 # Only enable the service, if it is a new installation or it will break the upgrade
55 if [ $1 -eq 1 ]
56 then
57     systemctl enable start-menu.service
58 fi
59
60 %preun
61
62 %postun
63 systemctl disable start-menu.service
64
65 %clean
66 rm -rf %{buildroot}
67