version
[opensuse:yast-rest-service.git] / plugins / administrator / package / webyast-root-user-ws.spec
1 #
2 # spec file for package webyast-root-user-ws
3 #
4 # Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
5 # This file and all modifications and additions to the pristine
6 # package are under the same license as the package itself.
7 #
8 # Please submit bugfixes or comments via http://bugs.opensuse.org/
9 #
10
11
12 Name:           webyast-root-user-ws
13 Provides:       WebYaST(org.opensuse.yast.modules.yapi.administrator)
14 Provides:       yast2-webservice-administrator = %{version}
15 Obsoletes:      yast2-webservice-administrator < %{version}
16 PreReq:         yast2-webservice
17 License:        GPL v2 only
18 Group:          Productivity/Networking/Web/Utilities
19 Autoreqprov:    on
20 Version:        0.2.0
21 Release:        0
22 Summary:        WebYaST - service for configuration of root account
23 Source:         www.tar.bz2
24 Source1:        org.opensuse.yast.modules.yapi.administrator.policy
25
26 Source3:        webyastAdministratorService.rb
27 Source4:        webyast.administrator.conf
28 Source5:        webyast.administrator.service.service
29
30 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
31 BuildArch:      noarch
32 BuildRequires:  rubygem-yast2-webservice-tasks rubygem-restility
33
34 BuildRequires:  webyast-base-ws-testsuite
35 BuildRequires:  rubygem-test-unit rubygem-mocha
36
37 #
38 %define plugin_name administrator
39 %define plugin_dir %{webyast_ws_dir}/vendor/plugins/%{plugin_name}
40 #
41
42 %package testsuite
43 Group:    Productivity/Networking/Web/Utilities
44 Requires: %{name} = %{version}
45 Requires: webyast-base-ws-testsuite
46 Summary:  Testsuite for webyast-root-user-ws package
47
48 %description
49 WebYaST - Plugin providing REST service for configuration of root user account
50
51 Authors:
52 --------
53     Jiri Suchomel <jsuchome@novell.com>
54
55 %description testsuite
56 This package contains complete testsuite for webyast-root-ws webservice package.
57 It's only needed for verifying the functionality of the module and it's not
58 needed at runtime.
59
60 %prep
61 %setup -q -n www
62
63 %build
64 # build restdoc documentation
65 mkdir -p public/administrator/restdoc
66 %webyast_ws_restdoc
67
68 # do not package restdoc sources
69 rm -rf restdoc
70
71 %check
72 # run the testsuite
73 %webyast_ws_check
74
75 %install
76
77 #
78 # Install all web and frontend parts.
79 #
80 mkdir -p $RPM_BUILD_ROOT%{plugin_dir}
81 cp -a * $RPM_BUILD_ROOT%{plugin_dir}/
82 rm -f $RPM_BUILD_ROOT%{plugin_dir}/COPYING
83
84 # Policies
85 mkdir -p $RPM_BUILD_ROOT/usr/share/PolicyKit/policy
86 install -m 0644 %SOURCE1 $RPM_BUILD_ROOT/usr/share/PolicyKit/policy/
87
88
89 # install administrator service
90 mkdir -p $RPM_BUILD_ROOT/usr/sbin/
91 install -m 0500 %SOURCE3 $RPM_BUILD_ROOT/usr/sbin/
92 mkdir -p $RPM_BUILD_ROOT/etc/dbus-1/system.d/
93 install -m 0644 %SOURCE4 $RPM_BUILD_ROOT/etc/dbus-1/system.d/
94 mkdir -p $RPM_BUILD_ROOT/usr/share/dbus-1/system-services/
95 install -m 0444 %SOURCE5 $RPM_BUILD_ROOT/usr/share/dbus-1/system-services/
96
97
98 %clean
99 rm -rf $RPM_BUILD_ROOT
100
101 %post
102 # granting all permissions for the web user
103 /usr/sbin/grantwebyastrights --user root --action grant > /dev/null
104 /usr/sbin/grantwebyastrights --user %{webyast_ws_user} --action grant > /dev/null
105
106 %postun
107
108 %files 
109 %defattr(-,root,root)
110 %dir %{webyast_ws_dir}
111 %dir %{webyast_ws_dir}/vendor
112 %dir %{webyast_ws_dir}/vendor/plugins
113 %dir %{plugin_dir}
114
115 %{plugin_dir}/README
116 %{plugin_dir}/Rakefile
117 %{plugin_dir}/init.rb
118 %{plugin_dir}/install.rb
119 %{plugin_dir}/uninstall.rb
120 %{plugin_dir}/app
121 %{plugin_dir}/config
122 %{plugin_dir}/doc
123 %{plugin_dir}/public
124 %dir /usr/share/PolicyKit
125 %dir /usr/share/PolicyKit/policy
126 %attr(644,root,root) %config /usr/share/PolicyKit/policy/org.opensuse.yast.modules.yapi.administrator.policy
127 %doc COPYING
128 %attr(500,root,root) /usr/sbin/webyastAdministratorService.rb
129 %attr(444,root,root) /usr/share/dbus-1/system-services/webyast.administrator.service.service
130 %attr(644,root,root) %config /etc/dbus-1/system.d/webyast.administrator.conf
131
132 %files testsuite
133 %defattr(-,root,root)
134 %{webyast_ws_dir}/vendor/plugins/%{plugin_name}/test
135
136 %changelog