fc9e498fef8d91e24efa085fb94b5cc8ab23053f
[scm/bb/meta-tizen.git] / meta-tizen-common-base / recipes-security / buxton / buxton.inc
1 DESCRIPTION = "A security-enabled configuration system"
2 HOMEPAGE = "https://github.com/sofar/buxton"
3 SECTION = "System/Configuration"
4 LICENSE = "LGPL-2.1+"
5 PV = "5"
6
7 SRC_URI = ""
8
9 S = "${WORKDIR}/git"
10
11 inherit manifest autotools-brokensep
12
13 BBCLASSEXTEND = ""
14 PROVIDES = ""
15
16 #PROVIDES by buxton-dev
17 PROVIDES += "buxton-dev"
18
19
20 #PROVIDES by buxtonsimple
21 PROVIDES += "buxtonsimple"
22
23
24 #PROVIDES by buxton-docs
25 PROVIDES += "buxton-docs "
26
27
28 #PROVIDES by buxtonsimple-dev
29 PROVIDES += "buxtonsimple-dev"
30
31
32 #PROVIDES by buxton
33
34
35 RDEPENDS = ""
36 #RDEPENDS of buxton-dev (${PN}-dev)
37 RDEPENDS_${PN}-dev += "buxton"
38
39 #RDEPENDS of buxtonsimple (${PN}simple)
40 RDEPENDS_${PN}simple += "buxton"
41
42 #RDEPENDS of buxtonsimple-dev (${PN}simple-dev)
43 RDEPENDS_${PN}simple-dev += "buxton"
44
45 #RDEPENDS of buxton (${PN})
46 RDEPENDS_${PN} += "coreutils"
47 RDEPENDS_${PN} += "smack"
48 RDEPENDS_${PN} += "buxton"
49
50
51 DEPENDS = ""
52 #DEPENDS of buxton
53 inherit pkgconfig
54 DEPENDS += "libcheck"
55 DEPENDS += "systemd"
56 DEPENDS += "attr"
57 DEPENDS += "gdbm"
58
59 do_prep() {
60  cd ${S}
61  chmod -Rf a+rX,u+w,g-w,o-w ${S}
62  #setup -q
63  cp ${S}/packaging/buxton.manifest .
64  
65  
66 }
67 do_patch_append() {
68     bb.build.exec_func('do_prep', d)
69 }
70
71 do_configure() {
72 }
73
74 do_compile() {
75  cd ${S}
76   LANG=C
77   export LANG
78   unset DISPLAY
79   LD_AS_NEEDED=1; export LD_AS_NEEDED ;
80   
81   
82   autotools_do_configure
83   make -j16
84   
85   
86   
87 }
88 EXTRA_OECONF += ""
89
90 do_install() {
91  export RPM_BUILD_ROOT=${D}
92  cd ${S}
93  LANG=C
94  export LANG
95  unset DISPLAY
96  rm -rf ${D}
97  mkdir -p ${D}
98  
99  
100    oe_runmake \
101          DESTDIR=${D} \
102          INSTALL_ROOT=${D} \
103          BINDIR=${prefix}/bin \
104    install  
105    rm -f ${D}${infodir}/dir 
106    find ${D} -regex ".*\.la$" | xargs rm -f -- 
107    find ${D} -regex ".*\.a$" | xargs rm -f --
108  # TODO: need to define needed layers for Tizen in tizen.conf
109  install -m 0644 ${S}/packaging/tizen.conf ${D}${sysconfdir}/buxton.conf
110  
111  
112 }
113
114 pkg_postinst_${PN}() {
115     #!/bin/sh -e
116
117     [ "x$D" == "x" ] && ldconfig
118     #buxtond runs as user buxton, which much be created
119     useradd buxton
120     buxtonctl create-db base
121     buxtonctl create-db isp
122     if [ "$1" -eq 1 ] ; then
123         # The initial DBs will not have the correct labels and
124         # permissions when created in postinstall during image
125         # creation, so we set these file attributes here.
126         chsmack -a System ${localstatedir}/lib/buxton/*.db
127         chown buxton:buxton ${localstatedir}/lib/buxton/*.db
128     fi
129
130 }
131
132 pkg_postrm_${PN}() {
133     #!/bin/sh -e
134
135     [ "x$D" == "x" ] && ldconfig
136 }
137
138 PACKAGES = "${PN}-dbg ${PN}-doc ${PN}-locale"
139 PACKAGES += " buxton-dev "
140 PACKAGES += " buxtonsimple "
141 PACKAGES += " buxton-docs "
142 PACKAGES += " buxtonsimple-dev "
143 PACKAGES += " buxton "
144
145 buxton-dev_files = ""
146 buxton-dev_files += "${prefix}/include/buxton.h"
147 buxton-dev_files += "${prefix}/lib/libbuxton.so"
148 buxton-dev_files += "${prefix}/lib/pkgconfig/buxton.pc"
149 MANIFESTFILES_${PN}-dev = "buxton.manifest"
150
151 buxtonsimple_files = ""
152 buxtonsimple_files += "${prefix}/lib/libbuxtonsimple.so.*"
153 MANIFESTFILES_${PN}simple = "buxton.manifest"
154
155 buxton-docs_files = ""
156
157 buxtonsimple-dev_files = ""
158 buxtonsimple-dev_files += "${prefix}/include/buxtonsimple.h"
159 buxtonsimple-dev_files += "${prefix}/lib/libbuxtonsimple.so"
160 buxtonsimple-dev_files += "${prefix}/lib/pkgconfig/buxtonsimple.pc"
161 MANIFESTFILES_${PN}simple-dev = "buxton.manifest"
162
163 buxton_files = ""
164 buxton_files += "${sysconfdir}/buxton.conf"
165 buxton_files += "${prefix}/bin/buxtonctl"
166 buxton_files += "${prefix}/lib/buxton/*.so"
167 buxton_files += "${prefix}/lib/libbuxton.so.*"
168 buxton_files += "${prefix}/lib/systemd/system/buxton.service"
169 buxton_files += "${prefix}/lib/systemd/system/buxton.socket"
170 buxton_files += "${prefix}/lib/systemd/system/sockets.target.wants/buxton.socket"
171 buxton_files += "${prefix}/sbin/buxtond"
172 buxton_files += "%dir ${localstatedir}/lib/buxton"
173 MANIFESTFILES_${PN} = "buxton.manifest"
174
175 FILES_${PN}-dev = "${buxton-dev_files}"
176 FILES_${PN}simple = "${buxtonsimple_files}"
177 FILES_${PN}-docs = "${buxton-docs_files}"
178 FILES_${PN}simple-dev = "${buxtonsimple-dev_files}"
179 FILES_${PN} = "${buxton_files}"
180
181 PKG_buxton-dev= "buxton-dev"
182 PKG_buxtonsimple= "buxtonsimple"
183 PKG_buxton-docs= "buxton-docs"
184 PKG_buxtonsimple-dev= "buxtonsimple-dev"
185 PKG_buxton= "buxton"
186
187 require buxton-extraconf.inc
188