5ca3e4f56dac3b63b3358fd4fa358fd91a73125e
[scm/bb/meta-tizen.git] / recipes-tizen / security-server / security-server.inc
1 DESCRIPTION = "Security server and utilities"
2 HOMEPAGE = "http://nohomepage.org"
3 SECTION = "Security/Service"
4 LICENSE = "Apache-2.0"
5
6 SRC_URI = ""
7
8 S = "${WORKDIR}/git"
9
10 inherit autotools-brokensep
11
12 PROVIDES = ""
13
14 #PROVIDES by security-server-certs 
15
16
17 #PROVIDES by libsecurity-server-client 
18
19
20 #PROVIDES by security-server 
21
22
23 #PROVIDES by security-server-dev 
24
25
26 #PROVIDES by libsecurity-server-client-dev 
27
28
29 RDEPENDS = ""
30 #RDEPENDS of security-server-certs (${PN}-certs)
31 RDEPENDS_${PN}-certs += "security-server"
32
33 #RDEPENDS of libsecurity-server-client (lib${PN}-client)
34 RDEPENDS_lib${PN}-client += "eglibc"
35 RDEPENDS_lib${PN}-client += "security-server"
36
37 #RDEPENDS of libsecurity-server-client-dev (lib${PN}-client-dev)
38 RDEPENDS_lib${PN}-client-dev += "libprivilege-control-dev"
39 RDEPENDS_lib${PN}-client-dev += "libsecurity-server-client"
40
41 #RDEPENDS of security-server-dev (${PN}-dev)
42 RDEPENDS_${PN}-dev += "security-server"
43
44 #RDEPENDS of security-server (${PN})
45 RDEPENDS_${PN} += "systemd"
46
47
48 DEPENDS = ""
49 #DEPENDS of security-server 
50 DEPENDS += "systemd"
51 DEPENDS_append_class-native = " cmake-native"
52 DEPENDS_append_class-target = " cmake-native"
53 DEPENDS += "attr"
54 DEPENDS += "zip"
55 DEPENDS += "openssl"
56 DEPENDS += "dlog"
57 DEPENDS += "smack"
58 DEPENDS += "libcap"
59 DEPENDS += "libprivilege-control"
60
61 do_prep() {
62  cd ${S}
63  chmod -Rf a+rX,u+w,g-w,o-w ${S}
64  #setup -q
65  cp ${S}/packaging/security-server.manifest .
66  cp ${S}/packaging/libsecurity-server-client.manifest .
67  
68  
69 }
70 do_patch_append() {
71     bb.build.exec_func('do_prep', d)
72 }
73
74 do_configure() {
75 }
76
77 do_compile() {
78  cd ${S}
79  LANG=C
80  export LANG
81  unset DISPLAY
82  CFLAGS="-O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables" ; export CFLAGS ; 
83  CXXFLAGS="${CXXFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export CXXFLAGS ; 
84  FFLAGS="${FFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -I%_fmoddir}" ; export FFLAGS ; 
85  LD_AS_NEEDED=1; export LD_AS_NEEDED ; 
86  
87  
88  export LDFLAGS+="-Wl,--rpath=${prefix}/lib"
89  
90  
91    CFLAGS="${CFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export CFLAGS ; 
92    CXXFLAGS="${CXXFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export CXXFLAGS ; 
93    FFLAGS="${FFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export FFLAGS ; 
94    cmake \
95          -DCMAKE_VERBOSE_MAKEFILE=ON \
96          -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
97          -DCMAKE_INSTALL_LIBDIR:PATH=${prefix}/lib \
98          -DINCLUDE_INSTALL_DIR:PATH=${prefix}/include \
99          -DLIB_INSTALL_DIR:PATH=${prefix}/lib \
100          -DSYSCONF_INSTALL_DIR:PATH=${sysconfdir} \
101          -DSHARE_INSTALL_PREFIX:PATH=${prefix}/share \
102          -DCMAKE_SKIP_RPATH:BOOL=ON \
103          -DBUILD_SHARED_LIBS:BOOL=ON . -DVERSION=0.0.118 \
104          -DCMAKE_BUILD_TYPE=RELEASE \
105          -DCMAKE_VERBOSE_MAKEFILE=ON
106  make -j16
107  
108  
109  
110 }
111
112 do_install() {
113  echo export RPM_BUILD_ROOT=${D}
114  cd ${S}
115  LANG=C
116  export LANG
117  unset DISPLAY
118  rm -rf ${D} 
119  mkdir -p ${D} 
120  
121  rm -rf ${D}
122  mkdir -p ${D}/usr/share/license
123  cp LICENSE ${D}/usr/share/license/security-server
124  cp LICENSE ${D}/usr/share/license/libsecurity-server-client
125  mkdir -p ${D}/etc/security/
126  cp security-server-audit.conf ${D}/etc/security/
127  
128    oe_runmake \
129          DESTDIR=${D} \
130          INSTALL_ROOT=${D} \
131          BINDIR=${prefix}/bin \
132    install  
133    rm -f ${D}${infodir}/dir 
134    find ${D} -regex ".*\.la$" | xargs rm -f -- 
135    find ${D} -regex ".*\.a$" | xargs rm -f --
136  
137  mkdir -p ${D}/usr/lib/systemd/system/multi-user.target.wants
138  mkdir -p ${D}/usr/lib/systemd/system/sockets.target.wants
139  ln -s ../security-server.service ${D}/usr/lib/systemd/system/multi-user.target.wants/security-server.service
140  ln -s ../security-server-data-share.socket ${D}/usr/lib/systemd/system/sockets.target.wants/security-server-data-share.socket
141  ln -s ../security-server-get-gid.socket ${D}/usr/lib/systemd/system/sockets.target.wants/security-server-get-gid.socket
142  ln -s ../security-server-privilege-by-pid.socket ${D}/usr/lib/systemd/system/sockets.target.wants/security-server-privilege-by-pid.socket
143  ln -s ../security-server-cookie-get.socket ${D}/usr/lib/systemd/system/sockets.target.wants/security-server-cookie-get.socket
144  ln -s ../security-server-cookie-check.socket ${D}/usr/lib/systemd/system/sockets.target.wants/security-server-cookie-check.socket
145  ln -s ../security-server-app-privilege-by-name.socket ${D}/usr/lib/systemd/system/sockets.target.wants/security-server-app-privilege-by-name.socket
146  ln -s ../security-server-password-check.socket ${D}/usr/lib/systemd/system/sockets.target.wants/security-server-password-check.socket
147  ln -s ../security-server-password-set.socket ${D}/usr/lib/systemd/system/sockets.target.wants/security-server-password-set.socket
148  ln -s ../security-server-password-reset.socket ${D}/usr/lib/systemd/system/sockets.target.wants/security-server-password-reset.socket
149  
150  
151 }
152
153 PACKAGES += " libsecurity-server-client "
154 PACKAGES += " libsecurity-server-client-dev "
155
156 security-server_files = ""
157 security-server_files += "security-server.manifest"
158 security-server_files += "/usr/bin/security-server"
159 security-server_files += "${prefix}/lib/libsecurity-server-commons.so.*"
160 security-server_files += "/usr/lib/systemd/system/multi-user.target.wants/security-server.service"
161 security-server_files += "/usr/lib/systemd/system/security-server.service"
162 security-server_files += "/usr/lib/systemd/system/security-server.target"
163 security-server_files += "/usr/lib/systemd/system/sockets.target.wants/security-server-data-share.socket"
164 security-server_files += "/usr/lib/systemd/system/security-server-data-share.socket"
165 security-server_files += "/usr/lib/systemd/system/sockets.target.wants/security-server-get-gid.socket"
166 security-server_files += "/usr/lib/systemd/system/security-server-get-gid.socket"
167 security-server_files += "/usr/lib/systemd/system/sockets.target.wants/security-server-privilege-by-pid.socket"
168 security-server_files += "/usr/lib/systemd/system/security-server-privilege-by-pid.socket"
169 security-server_files += "/usr/lib/systemd/system/sockets.target.wants/security-server-cookie-get.socket"
170 security-server_files += "/usr/lib/systemd/system/security-server-cookie-get.socket"
171 security-server_files += "/usr/lib/systemd/system/sockets.target.wants/security-server-cookie-check.socket"
172 security-server_files += "/usr/lib/systemd/system/security-server-cookie-check.socket"
173 security-server_files += "/usr/lib/systemd/system/sockets.target.wants/security-server-app-privilege-by-name.socket"
174 security-server_files += "/usr/lib/systemd/system/security-server-app-privilege-by-name.socket"
175 security-server_files += "/etc/security/security-server-audit.conf"
176 security-server_files += "/usr/lib/systemd/system/sockets.target.wants/security-server-password-check.socket"
177 security-server_files += "/usr/lib/systemd/system/security-server-password-check.socket"
178 security-server_files += "/usr/lib/systemd/system/sockets.target.wants/security-server-password-set.socket"
179 security-server_files += "/usr/lib/systemd/system/security-server-password-set.socket"
180 security-server_files += "/usr/lib/systemd/system/sockets.target.wants/security-server-password-reset.socket"
181 security-server_files += "/usr/lib/systemd/system/security-server-password-reset.socket"
182 security-server_files += "${prefix}/share/license/security-server"
183
184 libsecurity-server-client_files = ""
185 libsecurity-server-client_files += "libsecurity-server-client.manifest"
186 libsecurity-server-client_files += "${prefix}/lib/libsecurity-server-client.so.*"
187 libsecurity-server-client_files += "${prefix}/share/license/libsecurity-server-client"
188
189 libsecurity-server-client-dev_files = ""
190 libsecurity-server-client-dev_files += "security-server.manifest"
191 libsecurity-server-client-dev_files += "${prefix}/lib/libsecurity-server-client.so"
192 libsecurity-server-client-dev_files += "${prefix}/lib/libsecurity-server-commons.so"
193 libsecurity-server-client-dev_files += "/usr/include/security-server/security-server.h"
194 libsecurity-server-client-dev_files += "${prefix}/lib/pkgconfig/*.pc"
195
196 FILES_${PN} = "${security-server_files}"
197 FILES_lib${PN}-client = "${libsecurity-server-client_files}"
198 FILES_lib${PN}-client-dev = "${libsecurity-server-client-dev_files}"
199
200 PKG_security-server= "security-server"
201 PKG_libsecurity-server-client= "libsecurity-server-client"
202 PKG_libsecurity-server-client-dev= "libsecurity-server-client-dev"
203
204 require security-server-extraconf.inc
205