3 %bcond_without dist_kernel # without distribution kernel
5 Summary: Little silly kernel module and utility to restrict virtual hosts
6 Summary(pl.UTF-8): Proste narzędzie do ustawiania restrykcji używania wirtualnych hostów
11 Group: Networking/Utilities
12 Source0: http://toxygen.net/bindprivs/%{name}-%{version}.tar.gz
13 # Source0-md5: 0846e1094480728440ec46d273cc0815
14 %{?with_dist_kernel:BuildRequires: kernel-headers}
15 URL: http://toxygen.net/bindprivs/
16 BuildRequires: %{kgcc_package}
17 BuildRequires: rpmbuild(macros) >= 1.118
18 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
21 bindprivs is a little silly kernel module can be used to restrict
22 virtual host to some particular users. Read bindprivs.conf(5) and
23 bpset(8) for more details.
25 %description -l pl.UTF-8
26 bindprivs to prosty moduł jądra służący do ograniczenia używania
27 wirtualnych hostów dla poszczególnych użytkowników. Informacje na
28 temat używania go można znaleźć w bindprivs.conf(5) oraz bpset(8).
30 %package -n kernel-misc-bindprivs
31 Summary: bindprivs Linux kernel module
32 Summary(pl.UTF-8): Moduł jądra Linuksa bindprivs
34 %{?with_dist_kernel:%requires_releq_kernel_up}
35 Requires(post,postun): /sbin/depmod
37 %description -n kernel-misc-bindprivs
38 bindprivs Linux kernel module - a little silly kernel module which can
39 be used to restrict virtual host to some particular users.
41 %description -n kernel-misc-bindprivs -l pl.UTF-8
42 Moduł jądra Linuksa bindprivs - prosty moduł jądra służący do
43 ograniczenia używania wirtualnych hostów dla poszczególnych
46 %package -n kernel-smp-misc-bindprivs
47 Summary: bindprivs Linux SMP kernel module
48 Summary(pl.UTF-8): Moduł jądra Linuksa SMP bindprivs
50 %{?with_dist_kernel:%requires_releq_kernel_smp}
51 Requires(post,postun): /sbin/depmod
53 %description -n kernel-smp-misc-bindprivs
54 bindprivs Linux SMP kernel module - a little silly kernel module which
55 can be used to restrict virtual host to some particular users.
57 %description -n kernel-smp-misc-bindprivs -l pl.UTF-8
58 Moduł jądra Linuksa SMP bindprivs - prosty moduł jądra służący do
59 ograniczenia używania wirtualnych hostów dla poszczególnych
66 %{__make} bindprivs.o \
68 CFLAGS="%{rpmcflags} -fomit-frame-pointer -Wall -D__SMP__"
69 mv -f bindprivs.o bindprivs-smp.o
71 %{__make} bindprivs.o \
73 CFLAGS="%{rpmcflags} -fomit-frame-pointer -Wall"
77 CFLAGS="%{rpmcflags} -Wall"
80 rm -rf $RPM_BUILD_ROOT
81 install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man{5,8},%{_sysconfdir}} \
82 $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/misc
84 cat > $RPM_BUILD_ROOT%{_sysconfdir}/bindprivs.conf << EOF
85 # Sample configuration
87 ## let's allow ,,root'' and ,,jack'' using 10.0.2.5
88 #allow 10.0.2.5 root jack
91 ## only the group ,,irc'' can use our IPv6 class
92 #allowgroup 3ffe:1281:102:ffff::/48 irc
93 #deny 3ffe:1281:102:ffff::/48 all
95 ## reject all network connections from group ,,nonetwork''
99 cat > $RPM_BUILD_ROOT%{_bindir}/bpload << EOF
100 /sbin/insmod bindprivs
103 cat > $RPM_BUILD_ROOT%{_bindir}/bpremove << EOF
105 /sbin/rmmod bindprivs
108 install bindprivs-smp.o $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/misc/bindprivs.o
109 install bindprivs.o $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc
111 install bpset $RPM_BUILD_ROOT%{_bindir}
112 install bindprivs.conf.5 $RPM_BUILD_ROOT%{_mandir}/man5
113 install bpset.8 $RPM_BUILD_ROOT%{_mandir}/man8
116 rm -rf $RPM_BUILD_ROOT
118 %post -n kernel-misc-bindprivs
119 %depmod %{_kernel_ver}
121 %postun -n kernel-misc-bindprivs
122 %depmod %{_kernel_ver}
124 %post -n kernel-smp-misc-bindprivs
125 %depmod %{_kernel_ver}smp
127 %postun -n kernel-smp-misc-bindprivs
128 %depmod %{_kernel_ver}smp
131 %defattr(644,root,root,755)
133 %attr(755,root,root) %{_bindir}/bp*
134 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bindprivs.conf
137 %files -n kernel-misc-bindprivs
138 %defattr(644,root,root,755)
139 /lib/modules/%{_kernel_ver}/misc/bindprivs.o*
141 %files -n kernel-smp-misc-bindprivs
142 %defattr(644,root,root,755)
143 /lib/modules/%{_kernel_ver}smp/misc/bindprivs.o*