install everything in /usr
This patch is needed for the /usr-move feature https://fedoraproject.org/wiki/Features/UsrMove This package requires now 'filesystem' >= 3, which is only installable on a system which has /bin, /sbin, /lib, /lib64 as symlinks to /usr and not regular directories. The 'filesystem' package acts as a guard, to prevent *this* package to be installed on old unconverted systems. New installations will have the 'filesystem' >=3 layout right away, old installations need to be converted with anaconda or dracut first; only after that, the 'filesystem' package, and also *this* package can be installed. Packages *should* not install files in /bin, /sbin, /lib, /lib64, but only in the corresponding directories in /usr. Packages *must* not install conflicting files with the same names in the corresponding directories in / and /usr. Especially compatibilty symlinks must not be installed. Feel free to modify any of the changes to the spec file, but keep the above in mind.
This commit is contained in:
parent
ba28c6a8b0
commit
f586a1b819
@ -34,6 +34,8 @@ Requires(post): systemd-units
|
|||||||
Requires(post): systemd-sysv
|
Requires(post): systemd-sysv
|
||||||
Requires(preun): systemd-units
|
Requires(preun): systemd-units
|
||||||
Requires(postun): systemd-units
|
Requires(postun): systemd-units
|
||||||
|
Conflicts: systemd < 38
|
||||||
|
Conflicts: filesystem < 3
|
||||||
%else
|
%else
|
||||||
Requires(post): chkconfig
|
Requires(post): chkconfig
|
||||||
Requires(preun): chkconfig
|
Requires(preun): chkconfig
|
||||||
@ -71,8 +73,8 @@ stable and may change with every new version. It is therefore unsupported.
|
|||||||
%patch5 -p1 -b .cloexec
|
%patch5 -p1 -b .cloexec
|
||||||
|
|
||||||
%build
|
%build
|
||||||
CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \
|
CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing " \
|
||||||
./configure --enable-devel --enable-libipq --bindir=/bin --sbindir=/sbin --sysconfdir=/etc --libdir=/%{_lib} --libexecdir=/%{_lib} --mandir=%{_mandir} --includedir=%{_includedir} --with-kernel=/usr --with-kbuild=/usr --with-ksource=/usr
|
./configure --enable-devel --enable-libipq --bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=/etc --libdir=%{_libdir} --libexecdir=%{_libdir} --mandir=%{_mandir} --includedir=%{_includedir} --with-kernel=/usr --with-kbuild=/usr --with-ksource=/usr
|
||||||
|
|
||||||
# do not use rpath
|
# do not use rpath
|
||||||
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
|
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
|
||||||
@ -87,7 +89,7 @@ rm -rf %{buildroot}
|
|||||||
|
|
||||||
make install DESTDIR=%{buildroot}
|
make install DESTDIR=%{buildroot}
|
||||||
# remove la file(s)
|
# remove la file(s)
|
||||||
rm -f %{buildroot}/%{_lib}/*.la
|
rm -f %{buildroot}/%{_libdir}/*.la
|
||||||
|
|
||||||
# install ip*tables.h header files
|
# install ip*tables.h header files
|
||||||
install -m 644 include/ip*tables.h %{buildroot}%{_includedir}/
|
install -m 644 include/ip*tables.h %{buildroot}%{_includedir}/
|
||||||
@ -98,15 +100,6 @@ install -m 644 include/iptables/internal.h %{buildroot}%{_includedir}/iptables/
|
|||||||
install -d -m 755 %{buildroot}%{_includedir}/libipulog/
|
install -d -m 755 %{buildroot}%{_includedir}/libipulog/
|
||||||
install -m 644 include/libipulog/*.h %{buildroot}%{_includedir}/libipulog/
|
install -m 644 include/libipulog/*.h %{buildroot}%{_includedir}/libipulog/
|
||||||
|
|
||||||
# create symlinks for devel so libs
|
|
||||||
install -d -m 755 %{buildroot}%{_libdir}
|
|
||||||
for i in %{buildroot}/%{_lib}/*.so; do
|
|
||||||
ln -s ../../%{_lib}/${i##*/} %{buildroot}%{_libdir}/${i##*/}
|
|
||||||
done
|
|
||||||
|
|
||||||
# move pkgconfig to %{_libdir}
|
|
||||||
mv %{buildroot}/%{_lib}/pkgconfig %{buildroot}/%{_libdir}/
|
|
||||||
|
|
||||||
# install init scripts and configuration files
|
# install init scripts and configuration files
|
||||||
install -d -m 755 %{buildroot}%{script_path}
|
install -d -m 755 %{buildroot}%{script_path}
|
||||||
install -c -m 755 %{SOURCE1} %{buildroot}%{script_path}/iptables.init
|
install -c -m 755 %{SOURCE1} %{buildroot}%{script_path}/iptables.init
|
||||||
@ -119,10 +112,10 @@ install -c -m 755 ip6tables-config %{buildroot}/etc/sysconfig/ip6tables-config
|
|||||||
|
|
||||||
%if %{with systemd}
|
%if %{with systemd}
|
||||||
# install systemd service files
|
# install systemd service files
|
||||||
install -d -m 755 %{buildroot}/lib/systemd/system
|
install -d -m 755 %{buildroot}/%{_unitdir}
|
||||||
install -c -m 755 %{SOURCE3} %{buildroot}/lib/systemd/system/
|
install -c -m 755 %{SOURCE3} %{buildroot}/%{_unitdir}
|
||||||
sed -e 's;iptables;ip6tables;g' -e 's;IPv4;IPv6;g' < %{SOURCE3} > ip6tables.service
|
sed -e 's;iptables;ip6tables;g' -e 's;IPv4;IPv6;g' < %{SOURCE3} > ip6tables.service
|
||||||
install -c -m 755 ip6tables.service %{buildroot}/lib/systemd/system/
|
install -c -m 755 ip6tables.service %{buildroot}/%{_unitdir}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
@ -208,23 +201,23 @@ fi
|
|||||||
%config(noreplace) %attr(0600,root,root) /etc/sysconfig/iptables-config
|
%config(noreplace) %attr(0600,root,root) /etc/sysconfig/iptables-config
|
||||||
%config(noreplace) %attr(0600,root,root) /etc/sysconfig/ip6tables-config
|
%config(noreplace) %attr(0600,root,root) /etc/sysconfig/ip6tables-config
|
||||||
%if %{with systemd}
|
%if %{with systemd}
|
||||||
/lib/systemd/system/iptables.service
|
%{_unitdir}/iptables.service
|
||||||
/lib/systemd/system/ip6tables.service
|
%{_unitdir}/ip6tables.service
|
||||||
%endif
|
%endif
|
||||||
/sbin/iptables*
|
%{_sbindir}/iptables*
|
||||||
/sbin/ip6tables*
|
%{_sbindir}/ip6tables*
|
||||||
/sbin/xtables-multi
|
%{_sbindir}/xtables-multi
|
||||||
/bin/iptables-xml
|
%{_bindir}/iptables-xml
|
||||||
%{_mandir}/man1/iptables-xml*
|
%{_mandir}/man1/iptables-xml*
|
||||||
%{_mandir}/man8/iptables*
|
%{_mandir}/man8/iptables*
|
||||||
%{_mandir}/man8/ip6tables*
|
%{_mandir}/man8/ip6tables*
|
||||||
%dir /%{_lib}/xtables
|
%dir %{_libdir}/xtables
|
||||||
/%{_lib}/xtables/libipt*
|
%{_libdir}/xtables/libipt*
|
||||||
/%{_lib}/xtables/libip6t*
|
%{_libdir}/xtables/libip6t*
|
||||||
/%{_lib}/xtables/libxt*
|
%{_libdir}/xtables/libxt*
|
||||||
/%{_lib}/libip*tc.so.*
|
%{_libdir}/libip*tc.so.*
|
||||||
/%{_lib}/libipq.so.*
|
%{_libdir}/libipq.so.*
|
||||||
/%{_lib}/libxtables.so.*
|
%{_libdir}/libxtables.so.*
|
||||||
|
|
||||||
%files devel
|
%files devel
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
@ -236,9 +229,6 @@ fi
|
|||||||
%dir %{_includedir}/libipulog
|
%dir %{_includedir}/libipulog
|
||||||
%{_includedir}/libipulog/*.h
|
%{_includedir}/libipulog/*.h
|
||||||
%{_mandir}/man3/*
|
%{_mandir}/man3/*
|
||||||
/%{_lib}/libip*tc.so
|
|
||||||
/%{_lib}/libipq.so
|
|
||||||
/%{_lib}/libxtables.so
|
|
||||||
%{_libdir}/libip*tc.so
|
%{_libdir}/libip*tc.so
|
||||||
%{_libdir}/libipq.so
|
%{_libdir}/libipq.so
|
||||||
%{_libdir}/libxtables.so
|
%{_libdir}/libxtables.so
|
||||||
|
Loading…
Reference in New Issue
Block a user