summaryrefslogtreecommitdiff
path: root/trustees.spec
blob: c49ca2c7a8a080fc564e220fa865b63cb347b294 (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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#
# Conditional build:
%bcond_without	dist_kernel	# without distribution kernel
%bcond_without	kernel		# don't build kernel modules
%bcond_without	smp		# don't build SMP module
%bcond_without	userspace	# don't build userspace module
#
%define rel	0.1
Summary:	Trustees LSM
Summary(pl):	Moduł LSM Trustees
Name:		trustees
Version:	3.0
Release:	%{rel}
License:	GPL
Group:		Base/Kernel
Source0:	http://dl.sourceforge.net/trustees/%{name}-%{version}.tar.bz2
# Source0-md5:	45b7e894f9fe2321d671a5272dac76c2
URL:		http://trustees.sourceforge.net/
%{?with_dist_kernel:BuildRequires:	kernel-module-build >= 3:2.6.0}
BuildRequires:	rpmbuild(macros) >= 1.153
BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)

%description
Trustees is an advanced Linux permission system inspired by Netware.

%description -l pl
Trustees jest zaawansowanym systemem linuksowych praw dostępu
zainspirowanym przez Netware.

%package -n kernel-misc-trustees
Summary:	Trustees kernel module
Summary(pl):	Moduł jądra Trustees
Release:	%{rel}@%{_kernel_ver_str}
Group:		Base/Kernel
%{?with_dist_kernel:%requires_releq_kernel_up}
Requires(post,postun):	/sbin/depmod
Requires:	trustees

%description -n kernel-misc-trustees
Trustees is an advanced Linux permission system inspired by Netware.
This package contains Trustees kernel module.

%description -n kernel-misc-trustees -l pl
Trustees jest zaawansowanym systemem linuksowych praw dostępu
zainspirowanym przez Netware. Ten pakiet zawiera moduł jądra Trustees.

%package -n kernel-smp-misc-trustees
Summary:	Trustees SMP kernel module
Summary(pl):	Moduł SMP jądra Trustees
Release:	%{rel}@%{_kernel_ver_str}
Group:		Base/Kernel
%{?with_dist_kernel:%requires_releq_kernel_smp}
Requires(post,postun):	/sbin/depmod
Requires:	trustees

%description -n kernel-smp-misc-trustees
Trustees is an advanced Linux permission system inspired by Netware.
This package contains Trustees kernel module.

%description -n kernel-smp-misc-trustees -l pl
Trustees jest zaawansowanym systemem linuksowych praw dostępu
zainspirowanym przez Netware. Ten pakiet zawiera moduł jądra Trustees.

%prep
%setup -q

%build
%if %{with userspace}
%{__make} -C src
%endif

%if %{with kernel}
cd module
for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}; do
	mkdir -p modules/$cfg
	if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then
		exit 1
	fi
	rm -rf include
	chmod 000 modules
	install -d include/{linux,config}
	%{__make} -C %{_kernelsrcdir} clean \
		SUBDIRS=$PWD \
		O=$PWD \
		%{?with_verbose:V=1}
	install -d include/config
	chmod 700 modules
	ln -sf %{_kernelsrcdir}/config-$cfg .config
	ln -sf %{_kernelsrcdir}/include/linux/autoconf-${cfg}.h include/linux/autoconf.h
	ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} include/asm
	ln -sf %{_kernelsrcdir}/Module.symvers-$cfg Module.symvers
	cp ../include/*.h include/
	touch include/config/MARKER
	%{__make} -C %{_kernelsrcdir} modules \
		SUBDIRS=$PWD \
		O=$PWD \
		%{?with_verbose:V=1}
	mv *.ko modules/$cfg/
done
%endif

%install
rm -rf $RPM_BUILD_ROOT

%if %{with kernel}
install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/misc
install module/modules/%{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}/*.ko \
		$RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc
%if %{with smp} && %{with dist_kernel}
install module/modules/smp/*.ko \
		$RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/misc
%endif
%endif

%if %{with userspace}
install -d $RPM_BUILD_ROOT/sbin
install src/settrustees $RPM_BUILD_ROOT/sbin
%endif

%clean
rm -rf $RPM_BUILD_ROOT

%post	-n kernel-misc-trustees
%depmod %{_kernel_ver}

%postun	-n kernel-misc-trustees
%depmod %{_kernel_ver}

%post	-n kernel-smp-misc-trustees
%depmod %{_kernel_ver}smp

%postun	-n kernel-smp-misc-trustees
%depmod %{_kernel_ver}smp

%if %{with userspace}
%files
%defattr(644,root,root,755)
%doc README examples/*
%attr(755,root,root) /sbin/settrustees
%endif

%if %{with kernel}
%files -n kernel-misc-trustees
%defattr(644,root,root,755)
/lib/modules/%{_kernel_ver}/misc/*

%if %{with smp} && %{with dist_kernel}
%files -n kernel-smp-misc-trustees
%defattr(644,root,root,755)
/lib/modules/%{_kernel_ver}smp/misc/*
%endif
%endif