]> git.pld-linux.org Git - packages/bindprivs.git/blob - bindprivs.spec
- tabs in preamble
[packages/bindprivs.git] / bindprivs.spec
1 #
2 # Conditional build:
3 %bcond_without  dist_kernel     # without distribution kernel
4 #
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
7 Name:           bindprivs
8 Version:        0.6
9 Release:        1
10 License:        GPL v2
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)
19
20 %description
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.
24
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).
29
30 %package -n kernel-misc-bindprivs
31 Summary:        bindprivs Linux kernel module
32 Summary(pl.UTF-8):      Moduł jądra Linuksa bindprivs
33 Group:          Base/Kernel
34 %{?with_dist_kernel:%requires_releq_kernel_up}
35 Requires(post,postun):  /sbin/depmod
36
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.
40
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
44 użytkowników.
45
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
49 Group:          Base/Kernel
50 %{?with_dist_kernel:%requires_releq_kernel_smp}
51 Requires(post,postun):  /sbin/depmod
52
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.
56
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
60 użytkowników.
61
62 %prep
63 %setup -q
64
65 %build
66 %{__make} bindprivs.o \
67         CC="%{kgcc}" \
68         CFLAGS="%{rpmcflags} -fomit-frame-pointer -Wall -D__SMP__"
69 mv -f bindprivs.o bindprivs-smp.o
70
71 %{__make} bindprivs.o \
72         CC="%{kgcc}" \
73         CFLAGS="%{rpmcflags} -fomit-frame-pointer -Wall"
74
75 %{__make} bpset \
76         CC="%{__cc}" \
77         CFLAGS="%{rpmcflags} -Wall"
78
79 %install
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
83
84 cat > $RPM_BUILD_ROOT%{_sysconfdir}/bindprivs.conf << EOF
85 # Sample configuration
86
87 ## let's allow ,,root'' and ,,jack'' using 10.0.2.5
88 #allow 10.0.2.5 root jack
89 #deny 10.0.2.5 all
90
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
94
95 ## reject all network connections from group ,,nonetwork''
96 #deny all all
97 EOF
98
99 cat > $RPM_BUILD_ROOT%{_bindir}/bpload << EOF
100 /sbin/insmod bindprivs
101 EOF
102
103 cat > $RPM_BUILD_ROOT%{_bindir}/bpremove << EOF
104 bpset -u
105 /sbin/rmmod bindprivs
106 EOF
107
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
110
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
114
115 %clean
116 rm -rf $RPM_BUILD_ROOT
117
118 %post   -n kernel-misc-bindprivs
119 %depmod %{_kernel_ver}
120
121 %postun -n kernel-misc-bindprivs
122 %depmod %{_kernel_ver}
123
124 %post   -n kernel-smp-misc-bindprivs
125 %depmod %{_kernel_ver}smp
126
127 %postun -n kernel-smp-misc-bindprivs
128 %depmod %{_kernel_ver}smp
129
130 %files
131 %defattr(644,root,root,755)
132 %doc README
133 %attr(755,root,root) %{_bindir}/bp*
134 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bindprivs.conf
135 %{_mandir}/man?/*
136
137 %files -n kernel-misc-bindprivs
138 %defattr(644,root,root,755)
139 /lib/modules/%{_kernel_ver}/misc/bindprivs.o*
140
141 %files -n kernel-smp-misc-bindprivs
142 %defattr(644,root,root,755)
143 /lib/modules/%{_kernel_ver}smp/misc/bindprivs.o*
This page took 0.125371 seconds and 3 git commands to generate.