add Music 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 - setting of predefined directories (also /etc/skel)
67 ##############################################
68 saveHOME="$HOME"
69 HOME="%{_sysconfdir}/skel"
70 . "%{_sysconfdir}/tizen-platform.conf"
71 cat << ENDOFCAT |
72 MODE 777
73 SMACK System::Shared true
74 $TZ_SYS_STORAGE
75 $TZ_SYS_MEDIA
76
77 MODE 700
78 SMACK User::Home true
79 $TZ_USER_HOME
80 $TZ_USER_APPROOT
81 $TZ_USER_ICONS
82 $TZ_USER_CONTENT
83
84 SMACK User::App::Shared true
85 $TZ_USER_CAMERA
86 $TZ_USER_DOCUMENTS
87 $TZ_USER_DOWNLOADS
88 $TZ_USER_GAMES
89 $TZ_USER_IMAGES
90 $TZ_USER_OTHERS
91 $TZ_USER_SOUNDS
92 $TZ_USER_MUSIC
93 $TZ_USER_VIDEOS
94 $TZ_USER_SHARE
95
96 SMACK User false
97 $TZ_USER_APP
98 $TZ_USER_DB
99 $TZ_USER_DESKTOP
100 $TZ_USER_PACKAGES
101 ENDOFCAT
102 while read s1 s2 s3; do
103   case "$s1" in
104     MODE) m="$s2";;
105     SMACK) c="$s2"; t="$s3";;
106     "") ;;
107     *) echo "$s1 ${m:-700} ${c:-_} ${t:-false}";;
108   esac
109 done |
110 LANG=C sort |
111 while read dirname mode context transmute; do
112         mkdir -p -m "$mode" "$dirname"
113         if [ "$transmute" = true ]; then
114                 chsmack -a "$context" "$dirname"
115         else
116                 chsmack -t -a "$context" "$dirname"
117         fi >&2
118 done
119 HOME="$saveHOME"
120 ##############################################
121 # END - setting of predefined directories (also /etc/skel)
122 ##############################################
123
124 %post -n %{libname} -p /sbin/ldconfig
125
126 %postun -n %{libname} -p /sbin/ldconfig
127
128 %files
129 %manifest %{name}.manifest
130 %license MIT
131 %config %{_sysconfdir}/tizen-platform.conf
132
133 %files -n %{libname}
134 %manifest %{name}.manifest
135 %{_libdir}/*.so.*
136
137 %files -n %{libname}-devel
138 %manifest %{name}.manifest
139 %license LGPL_2.0
140 %{_libdir}/*.so
141 %{_libdir}/pkgconfig/*.pc
142 %{_includedir}/*.h
143 %config %{_sysconfdir}/rpm/macros.tizen-platform
144 %{_libdir}/*.a
145
146 %files -n %{name}-tools
147 %manifest %{name}.manifest
148 %{_bindir}/*