Add TZ_SYS_MEDIA directory
[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:        2.0
6 Release:        0
7 Summary:        Tizen Platform Configuration
8 License:        MIT
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-wrapper >= 2
15 Requires(post): smack
16 Requires(post): coreutils
17
18 # the main package only contains a config file but other dependent packages
19 # will contain binary. So, we can't build a noarch package and have to avoid
20 # a rpmlint warning using a filter in xxx-rpmlintrc
21
22 %description
23 Tizen Platform Configuration - variables definitions
24
25 %package -n %{libname}
26 Summary:        Tizen Platform Configuration - helper library
27 Group:          System/Libraries
28 License:        LGPL-2.0
29 Requires:       %{name} = %{version}
30 %description -n %{libname}
31 Tizen Platform Configuration - helper library to lookup Tizen variables easily
32
33 %package -n %{libname}-devel
34 Summary:        Tizen Platform Configuration - helper libray headers, RPM macros
35 Group:          Development/Libraries
36 License:        LGPL-2.0
37 Requires:       %{libname} = %{version}
38 %description -n %{libname}-devel
39 Tizen Platform Configuration - helper library headers to include in source code,
40 RPM macros to call in spec files
41
42 %package -n %{name}-tools
43 Summary:        Tizen Platform Configuration - tools
44 Group:          System/Utilities
45 License:        LGPL-2.0
46 Requires:       %{libname} = %{version}
47 %description -n %{name}-tools
48 Tizen Platform Configuration - helper program to lookup Tizen variables easily
49
50 %prep
51 %setup -q
52 cp %{SOURCE1001} .
53
54 %build
55 %reconfigure --enable-static
56 %__make %{?_smp_mflags}
57
58 %check
59 %__make check
60
61 %install
62 %make_install
63
64 %post
65 ##############################################
66 # BEGIN - creation of the /etc/skel/content
67 ##############################################
68 saveHOME="$HOME"
69 HOME="%{_sysconfdir}/skel"
70 . "%{_sysconfdir}/tizen-platform.conf"
71 cat << ENDOFCAT |
72 $TZ_USER_HOME        User::Home           true
73 $TZ_USER_APPROOT     User::Home           true
74 $TZ_USER_CONTENT     User::Home           true
75 $TZ_USER_CAMERA      User::App::Shared    true
76 $TZ_USER_DOCUMENTS   User::App::Shared    true
77 $TZ_USER_DOWNLOADS   User::App::Shared    true
78 $TZ_USER_GAMES       User::App::Shared    true
79 $TZ_USER_IMAGES      User::App::Shared    true
80 $TZ_USER_OTHERS      User::App::Shared    true
81 $TZ_USER_SOUNDS      User::App::Shared    true
82 $TZ_USER_VIDEOS      User::App::Shared    true
83 $TZ_USER_SHARE       User::App::Shared    true
84 $TZ_USER_APP         User                 false
85 $TZ_USER_DB          User                 false
86 $TZ_USER_DESKTOP     User                 false
87 $TZ_USER_ICONS       User::Home           true
88 $TZ_USER_PACKAGES    User                 false
89 ENDOFCAT
90 LANG= sort | while read skelname context transmute; do
91         mkdir -p "$skelname"
92         chsmack -a "$context" "$skelname"
93         [ "$transmute" = true ] && chsmack -t "$skelname"
94 done
95 chmod 700 $HOME
96 HOME="$saveHOME"
97 ##############################################
98 # END - creation of the /etc/skel/content
99 ##############################################
100
101 mkdir -p $TZ_SYS_STORAGE
102 chsmack -a 'System::Shared' -t $TZ_SYS_STORAGE
103 chmod 777 $TZ_SYS_STORAGE
104
105 mkdir -p $TZ_SYS_MEDIA
106 chsmack -a 'System::Shared' -t $TZ_SYS_MEDIA
107 chmod 777 $TZ_SYS_MEDIA
108
109 %post -n %{libname} -p /sbin/ldconfig
110
111 %postun -n %{libname} -p /sbin/ldconfig
112
113 %files
114 %manifest %{name}.manifest
115 %license MIT
116 %config %{_sysconfdir}/tizen-platform.conf
117
118 %files -n %{libname}
119 %manifest %{name}.manifest
120 %{_libdir}/*.so.*
121
122 %files -n %{libname}-devel
123 %manifest %{name}.manifest
124 %license LGPL_2.0
125 %{_libdir}/*.so
126 %{_libdir}/pkgconfig/*.pc
127 %{_includedir}/*.h
128 %config %{_sysconfdir}/rpm/macros.tizen-platform
129 %{_libdir}/*.a
130
131 %files -n %{name}-tools
132 %manifest %{name}.manifest
133 %{_bindir}/*
134