File nufw.spec of Package nufw
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
#
# spec file for package
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
#%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
Name: nufw
Version: 2.2.23
Release: 1
License: GPLv2
Summary: Authentication Firewall Suite for Linux
Url: http://www.nufw.org/
Group: System Environment/Daemons
Source: http://www.nufw.org/download/nufw/%{name}-%{version}.tar.bz2
BuildRequires: libgnutls-devel libmysqlclient-devel pam-devel gcc gcc-c++ make
#PreReq:
#Provides:
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
NuFW is a firewall able to filter connection according to user uid or user
software, meaning you can allows port 80 for only one user, whatever ip he
uses, or only for konqueror.
NuFW performs an authentication of every single connection passing through the
IP filter, by transparently requesting user's credentials before any filtering
decision is taken. Practically, this means security policies can integrate with
the users directory, and bring the notion of user ID down to the IP layers.
%package -n libnuclient
Summary: Nuclient library
Group: System Environment/Libraries
%description -n libnuclient
Library needed by nufw for nuclient.
%package -n libnuclient-devel
Summary: Nuclient development library
Group: Development/Libraries
Requires: libnuclient = %{version}-%{release}
%description -n libnuclient-devel
Development file of the nuclient library, used to compile
client accessing to nufw.
%package -n nutcpc
Summary: Nufw client
Group: Applications/Internet
%description -n nutcpc
Nutcpc is the command line client used to authenticate on a firewall using
nufw.
%prep
%setup -q
#pushd "scripts"
#dos2unix -q --keepdate nutop
#popd
pushd "doc"
f=acls
iconv -f ISO8859-1 -t UTF-8 -o $f.new $f
touch -r $f $f.new
mv $f.new $f
popd
#perl -pi -e "s|postgresql|pgsql|" ./src/nuauth/modules/log_pgsql/Makefile*
#perl -pi -e 's|^(modulesdir\s*=\s*/)lib|$1%_lib|' ./src/clients/pam_nufw/Makefile*
#perl -pi -e 's|(\@modulesdir\s*=\s*/)lib|$1%_lib|' ./src/clients/pam_nufw/Makefile*
#perl -pi -e 's|\$\(prefix\)|\%\{buildroot\}|' ./scripts/nuauth_command/Makefile*
%build
%configure \
--with-ldap --with-system-auth --with-mysql-log --sysconfdir=%{_sysconfdir}/nufw --prefix=/usr --libdir=%{_libdir} --disable-nufw --disable-nuauth
perl -pi -e 's|(install -d \$\(localstatedir\)/run/nuauth/)|#$1|' ./src/nuauth/Makefile
make %{?_smp_mflags}
%install
rm -rf %{buildroot}
%make_install
mkdir -p %{buildroot}/%{_sysconfdir}/nufw
rm -rf %{buildroot}/%{python_sitelib}/nuauth*
%clean
%{?buildroot:%__rm -rf "%{buildroot}"}
#echo %{python_sitelib}
#rm -rf /usr/lib/python2.7/site-packages/*
%post -n libnuclient -p /sbin/ldconfig
%postun -n libnuclient -p /sbin/ldconfig
%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog NEWS README TODO COPYING
%{_libdir}/libnobuffer.a
%{_libdir}/libnobuffer.la
%{_libdir}/libnobuffer.so
%{_libdir}/libnobuffer.so.0
%{_libdir}/libnobuffer.so.0.0.0
%{_bindir}/nuauth_command
%files -n libnuclient
%defattr(-, root, root, -)
%{_libdir}/libnuclient.so.*
%{_mandir}/man8/*
%{_mandir}/man5/*
#%{_initrddir}/nufw
%dir %{_sysconfdir}/nufw/
%files -n libnuclient-devel
%defattr(-, root, root, -)
%exclude %{_libdir}/libnuclient.a
%exclude %{_libdir}/libnuclient.la
%{_libdir}/libnuclient.so
%{_includedir}/*
%{_mandir}/man3/libnuclient.3*
%files -n nutcpc
%defattr(-, root, root, -)
%{_bindir}/nutcpc
%{_mandir}/man1/nutcpc.1*
%changelog
* Thu Apr 14 2011 Andrew Hill <andrewroberthill@gmail.com> - 2.2.23-1
- Initial RPM for openSUSE - Modified from Fedora RPM with new upstream release