6c96bada6723b5fdf0be883a9597c9f9c1243b85
[platform/upstream/buxton.git] / packaging / buxton.spec
1 Name:           buxton
2 Version:        3
3 Release:        0
4 License:        LGPL-2.1+
5 Summary:        A security-enabled configuration system
6 Url:            https://github.com/sofar/buxton
7 Group:          System/Configuration
8 Source0:        %{name}-%{version}.tar.xz
9 Source1:        tizen.conf
10 Source1001:     %{name}.manifest
11 BuildRequires:  libattr-devel
12 BuildRequires:  gdbm-devel
13 BuildRequires:  pkgconfig(check)
14 BuildRequires:  pkgconfig(systemd)
15 BuildRequires:  pkgconfig(libsystemd-daemon)
16 Requires(post): buxton
17 Requires(post): smack
18 Requires(post): /usr/bin/chown
19
20 %description
21 Buxton is a security-enabled configuration management system. It
22 features a layered approach to configuration storage, with each
23 layer containing an arbitrary number of groups, each of which may
24 contain key-value pairs.  Mandatory Access Control (MAC) is
25 implemented at the group level and at the key-value level.
26
27 Buxton provides a C library (libbuxton) for client applications to
28 use.  Internally, buxton uses a daemon (buxtond) for processing
29 client requests and enforcing MAC. Also, a CLI (buxtonctl) is
30 provided for interactive use and for use in shell scripts.
31
32 %package devel
33 Summary: A security-enabled configuration system - development files
34 Requires: %{name} = %{version}
35
36 %description devel
37 Buxton is a security-enabled configuration management system. It
38 features a layered approach to configuration storage, with each
39 layer containing an arbitrary number of groups, each of which may
40 contain key-value pairs.  Mandatory Access Control (MAC) is
41 implemented at the group level and at the key-value level.
42
43 Buxton provides a C library (libbuxton) for client applications to
44 use.  Internally, buxton uses a daemon (buxtond) for processing
45 client requests and enforcing MAC. Also, a CLI (buxtonctl) is
46 provided for interactive use and for use in shell scripts.
47
48 This package provides development files for Buxton.
49
50 %prep
51 %setup -q
52 cp %{SOURCE1001} .
53
54 %build
55 %configure
56 make %{?_smp_mflags}
57
58 %install
59 %make_install
60 # TODO: need to define needed layers for Tizen in tizen.conf
61 install -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/buxton.conf
62
63 %post
64 /sbin/ldconfig
65 #buxtond runs as user buxton, which much be created
66 useradd buxton
67
68 buxtonctl create-db base
69 buxtonctl create-db isp
70 if [ "$1" -eq 1 ] ; then
71     # The initial DBs will not have the correct labels and
72     # permissions when created in postinstall during image
73     # creation, so we set these file attributes here.
74     chsmack -a System %{_localstatedir}/lib/buxton/*.db
75     chown buxton:buxton %{_localstatedir}/lib/buxton/*.db
76 fi
77
78 %postun -p /sbin/ldconfig
79
80 %docs_package
81 #%license docs/LICENSE.MIT
82
83 %files
84 %manifest %{name}.manifest
85 #%license LICENSE.LGPL2.1
86 %config(noreplace) %{_sysconfdir}/buxton.conf
87 %{_bindir}/buxtonctl
88 %{_libdir}/buxton/*.so
89 %{_libdir}/libbuxton.so.*
90 %{_prefix}/lib/systemd/system/buxton.service
91 %{_prefix}/lib/systemd/system/buxton.socket
92 %{_prefix}/lib/systemd/system/sockets.target.wants/buxton.socket
93 %{_sbindir}/buxtond
94 %attr(0700,buxton,buxton) %dir %{_localstatedir}/lib/buxton
95
96 %files devel
97 %manifest %{name}.manifest
98 %{_includedir}/buxton.h
99 %{_libdir}/libbuxton.so
100 %{_libdir}/pkgconfig/*.pc