packaging: Update to buxton v4 release
[platform/upstream/buxton.git] / packaging / buxton.spec
1 Name:           buxton
2 Version:        4
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 %package -n buxtonsimple
51 Summary: Simplified buxton API
52 Requires: %{name} = %{version}
53
54 %description -n buxtonsimple
55 Buxton is a security-enabled configuration management system. It
56 features a layered approach to configuration storage, with each
57 layer containing an arbitrary number of groups, each of which may
58 contain key-value pairs.  Mandatory Access Control (MAC) is
59 implemented at the group level and at the key-value level.
60
61 Buxton-simple provides a simplified C library (libbuxtonsimple)
62 for simple client applications.
63
64 %package -n buxtonsimple-devel
65 Summary: Simplified buxton API - development files
66 Requires: %{name} = %{version}
67
68 %description -n buxtonsimple-devel
69 Buxton is a security-enabled configuration management system. It
70 features a layered approach to configuration storage, with each
71 layer containing an arbitrary number of groups, each of which may
72 contain key-value pairs.  Mandatory Access Control (MAC) is
73 implemented at the group level and at the key-value level.
74
75 Buxton-simple provides a simplified C library (libbuxtonsimple)
76 for simple client applications.
77
78 This package provides development files for BuxtonSimple.
79
80 %prep
81 %setup -q
82 cp %{SOURCE1001} .
83
84 %build
85 %configure
86 make %{?_smp_mflags}
87
88 %install
89 %make_install
90 # TODO: need to define needed layers for Tizen in tizen.conf
91 install -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/buxton.conf
92
93 %post
94 /sbin/ldconfig
95 #buxtond runs as user buxton, which much be created
96 useradd buxton
97
98 buxtonctl create-db base
99 buxtonctl create-db isp
100 if [ "$1" -eq 1 ] ; then
101     # The initial DBs will not have the correct labels and
102     # permissions when created in postinstall during image
103     # creation, so we set these file attributes here.
104     chsmack -a System %{_localstatedir}/lib/buxton/*.db
105     chown buxton:buxton %{_localstatedir}/lib/buxton/*.db
106 fi
107
108 %postun -p /sbin/ldconfig
109
110 %docs_package
111 #%license docs/LICENSE.MIT
112
113 %files
114 %manifest %{name}.manifest
115 #%license LICENSE.LGPL2.1
116 %config(noreplace) %{_sysconfdir}/buxton.conf
117 %{_bindir}/buxtonctl
118 %{_libdir}/buxton/*.so
119 %{_libdir}/libbuxton.so.*
120 %{_prefix}/lib/systemd/system/buxton.service
121 %{_prefix}/lib/systemd/system/buxton.socket
122 %{_prefix}/lib/systemd/system/sockets.target.wants/buxton.socket
123 %{_sbindir}/buxtond
124 %attr(0700,buxton,buxton) %dir %{_localstatedir}/lib/buxton
125
126 %files devel
127 %manifest %{name}.manifest
128 %{_includedir}/buxton.h
129 %{_libdir}/libbuxton.so
130 %{_libdir}/pkgconfig/libbuxton.pc
131
132
133 %files -n buxtonsimple
134 %manifest %{name}.manifest
135 #%license LICENSE.LGPL2.1
136 %{_libdir}/libbuxtonsimple.so.*
137
138 %files -n buxtonsimple-devel
139 %manifest %{name}.manifest
140 %{_includedir}/buxtonsimple.h
141 %{_libdir}/libbuxtonsimple.so
142 %{_libdir}/pkgconfig/libbuxtonsimple.pc
143