upgrade: removing scripts that are not needed when upgrading 4.0 -> 5.0
[platform/core/system/tizen-platform-config.git] / packaging / tizen-platform-config.spec
1 %define libname libtzplatform-config
2 %define keepstatic 1
3
4 Name:           tizen-platform-config
5 Version:        5.0
6 Release:        1
7 Summary:        Tizen Platform Configuration
8 License:        MIT and LGPL-2.0+
9 Url:            http://www.tizen.org
10 Group:          System/Configuration
11 Source0:        %{name}-%{version}.tar.gz
12 Source1:        %{name}-rpmlintrc
13 Source1001:     %{name}.manifest
14 BuildRequires:  tizen-platform-config-meta
15 BuildRequires:  gperf
16 # for sha256sum
17 BuildRequires:  coreutils
18 Requires(post): smack
19 Requires(post): coreutils
20
21 # the main package only contains a config file but other dependent packages
22 # will contain binary. So, we can't build a noarch package and have to avoid
23 # a rpmlint warning using a filter in xxx-rpmlintrc
24
25 %description
26 Tizen Platform Configuration - variables definitions
27
28 %package -n %{libname}
29 Summary:        Tizen Platform Configuration - helper library
30 Group:          System/Libraries
31 License:        LGPL-2.0+
32 Requires:       %{name} = %{version}
33 %description -n %{libname}
34 Tizen Platform Configuration - helper library to lookup Tizen variables easily
35
36 %package -n %{libname}-devel
37 Summary:        Tizen Platform Configuration - helper libray headers, RPM macros
38 Group:          Development/Libraries
39 License:        LGPL-2.0+
40 Requires:       %{libname} = %{version}
41 %description -n %{libname}-devel
42 Tizen Platform Configuration - helper library headers to include in source code,
43 RPM macros to call in spec files
44
45 %package -n %{name}-tools
46 Summary:        Tizen Platform Configuration - tools
47 Group:          System/Utilities
48 License:        LGPL-2.0+
49 Requires:       %{libname} = %{version}
50 %description -n %{name}-tools
51 Tizen Platform Configuration - helper program to lookup Tizen variables easily
52
53 %prep
54 %setup -q
55 cp %{SOURCE1001} .
56
57 %build
58 %reconfigure --enable-static
59 %__make %{?_smp_mflags}
60
61 %check
62 %__make check
63
64 %install
65 %make_install
66 rm %{buildroot}%{_libdir}/*.a
67
68 %post
69 ##############################################
70 # BEGIN - setting of predefined directories (also /etc/skel)
71 ##############################################
72 saveHOME="$HOME"
73 HOME="/opt/etc/skel"
74 . "%{_sysconfdir}/tizen-platform.conf"
75 cat << ENDOFCAT |
76 MODE 755
77 SMACK System::Shared true
78 $TZ_SYS_STORAGE
79 $TZ_SYS_MEDIA
80
81 MODE 700
82 SMACK _ true
83 $TZ_USER_HOME
84
85 SMACK User::Home true
86 $TZ_USER_APPROOT
87 $TZ_USER_DB
88 $TZ_USER_PACKAGES
89 $TZ_USER_ICONS
90 $TZ_USER_APP
91
92 MODE 775
93 SMACK User::Home false
94 $TZ_SYS_DB
95 $TZ_SYS_RO_APP
96
97 MODE 775
98 SMACK User::Home true
99 $TZ_SYS_RW_ICONS
100 $TZ_SYS_RW_ICONS/default
101 $TZ_SYS_RW_ICONS/default/small
102 $TZ_SYS_RW_APP
103
104 SMACK User::App::Shared true
105 $TZ_USER_CONTENT
106 $TZ_USER_CAMERA
107 $TZ_USER_DOCUMENTS
108 $TZ_USER_DOWNLOADS
109 $TZ_USER_GAMES
110 $TZ_USER_IMAGES
111 $TZ_USER_OTHERS
112 $TZ_USER_SOUNDS
113 $TZ_USER_MUSIC
114 $TZ_USER_VIDEOS
115 $TZ_USER_SHARE
116 $TZ_USER_CACHE
117 $TZ_USER_CONFIG
118 $TZ_USER_DATA
119 $TZ_USER_HOME/.pki/nssdb
120 $TZ_USER_APP/xwalk-service
121
122 SMACK System::Shared true
123 $TZ_USER_DESKTOP
124
125 SMACK System::Shared false
126 $TZ_SYS_ETC
127
128 SMACK System true
129 $TZ_SYS_RO_PACKAGES
130 $TZ_SYS_RW_PACKAGES
131
132 MODE 2770
133 SMACK User::App::Shared true
134 $TZ_SYS_MEDIASHARED
135
136 ENDOFCAT
137 while read s1 s2 s3; do
138   case "$s1" in
139     MODE) m="$s2";;
140     SMACK) c="$s2"; t="$s3";;
141     "") ;;
142     *) echo "$s1 ${m:-700} ${c:-_} ${t:-false}";;
143   esac
144 done |
145 LANG=C sort |
146 while read dirname mode context transmute; do
147         if [ -e "$dirname" ]; then
148                 chmod "$mode" "$dirname"
149         else
150                 mkdir -p -m "$mode" "$dirname"
151         fi
152         if [ "$transmute" = true ]; then
153                 chsmack -a "$context" -t "$dirname"
154         else
155                 chsmack -a "$context" "$dirname"
156         fi >&2
157 done
158 ln -s $TZ_SYS_MEDIASHARED $TZ_USER_MEDIASHARED
159 HOME="$saveHOME"
160 ##############################################
161 # END - setting of predefined directories (also /etc/skel)
162 ##############################################
163
164 %post -n %{libname} -p /sbin/ldconfig
165
166 %postun -n %{libname} -p /sbin/ldconfig
167
168 %files
169 %manifest %{name}.manifest
170 %license LICENSE.MIT LICENSE.LGPL-2.0+
171 %config %{_sysconfdir}/tizen-platform.conf
172
173 %files -n %{libname}
174 %manifest %{name}.manifest
175 %license LICENSE.LGPL-2.0+
176 %{_libdir}/*.so.*
177
178 %files -n %{libname}-devel
179 %manifest %{name}.manifest
180 %{_libdir}/*.so
181 %{_libdir}/pkgconfig/*.pc
182 %{_includedir}/*.h
183 %config %{_sysconfdir}/rpm/macros.tizen-platform
184
185 %files -n %{name}-tools
186 %manifest %{name}.manifest
187 %license LICENSE.LGPL-2.0+
188 %{_bindir}/*