summaryrefslogtreecommitdiff
path: root/packaging/tizen-platform-config.spec
blob: bc0b55180c527296d799d2f770471db1dd8a6aa4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
%define libname libtzplatform-config
%define keepstatic 1

Name:           tizen-platform-config
Version:        2.0
Release:        0
Summary:        Tizen Platform Configuration
License:        MIT
Url:            http://www.tizen.org
Group:          System/Configuration
Source0:        %{name}-%{version}.tar.gz
Source1:        %{name}-rpmlintrc
Source1001:     %{name}.manifest
BuildRequires:  tizen-platform-wrapper >= 2
Requires(post): smack

# the main package only contains a config file but other dependent packages
# will contain binary. So, we can't build a noarch package and have to avoid
# a rpmlint warning using a filter in xxx-rpmlintrc

%description
Tizen Platform Configuration - variables definitions

%package -n %{libname}
Summary:        Tizen Platform Configuration - helper library
Group:          System/Libraries
License:        LGPL-2.0
Requires:       %{name} = %{version}
%description -n %{libname}
Tizen Platform Configuration - helper library to lookup Tizen variables easily

%package -n %{libname}-devel
Summary:        Tizen Platform Configuration - helper libray headers, RPM macros
Group:          Development/Libraries
License:        LGPL-2.0
Requires:       %{libname} = %{version}
%description -n %{libname}-devel
Tizen Platform Configuration - helper library headers to include in source code,
RPM macros to call in spec files

%package -n %{name}-tools
Summary:        Tizen Platform Configuration - tools
Group:          System/Utilities
License:        LGPL-2.0
Requires:       %{libname} = %{version}
%description -n %{name}-tools
Tizen Platform Configuration - helper program to lookup Tizen variables easily

%prep
%setup -q
cp %{SOURCE1001} .

%build
%reconfigure --enable-static
%__make %{?_smp_mflags}

%check
%__make check

%install
%make_install

%post
##############################################
# BEGIN - creation of the /etc/skel/content
##############################################
saveHOME="$HOME"
HOME="%{_sysconfdir}/skel"
. "%{_sysconfdir}/tizen-platform.conf"
cat << ENDOFCAT |
$TZ_USER_HOME        User::Home           true
$TZ_USER_APPROOT     User::Home           true
$TZ_USER_CONTENT     User::Home           true
$TZ_USER_CAMERA      User::App::Shared    true
$TZ_USER_DOCUMENTS   User::App::Shared    true
$TZ_USER_DOWNLOADS   User::App::Shared    true
$TZ_USER_GAMES       User::App::Shared    true
$TZ_USER_IMAGES      User::App::Shared    true
$TZ_USER_OTHERS      User::App::Shared    true
$TZ_USER_SOUNDS      User::App::Shared    true
$TZ_USER_VIDEOS      User::App::Shared    true
$TZ_USER_SHARE       User::App::Shared    true
$TZ_USER_APP         User                 false
$TZ_USER_DB          User                 false
$TZ_USER_DESKTOP     User                 false
$TZ_USER_ICONS       User::Home           true
$TZ_USER_PACKAGES    User                 false
ENDOFCAT
LANG= sort | while read skelname context transmute; do
	mkdir -p "$skelname"
	chsmack -a "$context" "$skelname"
	[ "$transmute" = true ] && chsmack -t "$skelname"
done
chmod 700 $HOME
HOME="$saveHOME"
##############################################
# END - creation of the /etc/skel/content
##############################################

mkdir -p $TZ_SYS_STORAGE
chsmack -a 'System::Shared' -t $TZ_SYS_STORAGE
chmod 777 $TZ_SYS_STORAGE

%post -n %{libname} -p /sbin/ldconfig

%postun -n %{libname} -p /sbin/ldconfig

%files
%manifest %{name}.manifest
%license MIT
%config %{_sysconfdir}/tizen-platform.conf

%files -n %{libname}
%manifest %{name}.manifest
%{_libdir}/*.so.*

%files -n %{libname}-devel
%manifest %{name}.manifest
%license LGPL_2.0
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc
%{_includedir}/*.h
%config %{_sysconfdir}/rpm/macros.tizen-platform
%{_libdir}/*.a

%files -n %{name}-tools
%manifest %{name}.manifest
%{_bindir}/*