LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File wicd.spec of Package wicd (Project system:wicd)

#  
# spec file for package wicd (version 1.7.0)  
#  
# Copyright (c) 2009 Adam Blackburn <compwiz18@gmail.com>  
# Copyright (c) 2009-2010 Andrew Psaltis <ampsaltis@gmail.com>  
# All rights reserved.  
#  
# Redistribution and use of this script, with or without modification, is  
# permitted provided that the following conditions are met:  
#  
# 1. Redistributions of this script must retain the above copyright  
#    notice, this list of conditions and the following disclaimer.  
#  
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED  
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF  
# MERCHANTABILITY AND FITNESS OR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO  
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,  
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,  
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;  
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,  
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR  
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF  
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  
#norootforbuild

# Big thanks to sda00 for helping with getting this working!

%define name wicd
%define version 1.7.0
%define unmangled_version 1.7.0
%define release 1
%define python_sitelib %(%{__python} -c 'from distutils import sysconfig; print sysconfig.get_python_lib()')

Summary: A wireless and wired network manager
Name: %{name}
Version: %{version}
Release: %{release}
Source0: %{name}-%{unmangled_version}.tar.bz2
License: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
Group: Productivity/Networking/System
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
#Prefix: %{_prefix}
#BuildArch: noarch
Vendor: Adam Blackburn, Dan O'Reilly, Andrew Psaltis <compwiz18@gmail.com, oreilldf@gmail.com, ampsaltis@gmail.com>
Url: http://wicd.net

BuildRequires: python >= 2.4 python-devel >= 2.4
Requires: python >= 2.4 ethtool net-tools wpa_supplicant pm-utils wireless-tools urwid

# These only work on the OBS (except the suse and sles one)
# Vendors will probably work best for the rest of these suckers:
# Fedora/Redhat/Centos: vendor = redhat
# Mandriva: vendor = Mandriva
%if 0%{?suse_version} || 0%{?sles_version}
BuildRequires: update-desktop-files
Requires: dhcpcd iproute2 dbus-1-python python-gtk 
%define DISTRO suse
%endif

%if 0%{?centos_version} || 0%{?fedora_version}
BuildRequires: redhat-rpm-config
Requires: dhclient iproute dbus-python dbus-python pygtk2
%define DISTRO redhat
%endif

%if 0%{?rhel_version}
Requires: dhclient iproute dbus-python dbus-python pygtk2
%define DISTRO redhat
%endif

%if 0%{?mandriva_version}
Requires: dhclient iproute2 python-dbus pygtk2.0 dhcp-client
%ifarch x86_64
BuildRequires:  lib64python2.5-devel
%else
BuildRequires:  libpython2.5-devel
%endif
%define DISTRO redhat
%endif

%description
A complete network connection manager
Wicd supports wired and wireless networks, and capable of
creating and tracking profiles for both.  It has a 
template-based wireless encryption system, which allows the user
to easily add encryption methods used.  It ships with some common
encryption types, such as WPA and WEP. Wicd will automatically
connect at startup to any preferred network within range.


%prep
%setup -n %{name}-%{unmangled_version}

%build
python setup.py configure --distro=%{DISTRO}
python setup.py build

%install
python setup.py install --prefix=/usr --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES
# Fix up the compiled python files
%if 0%{?centos_version} || 0%{?fedora_version}
cat INSTALLED_FILES | grep site-packages | egrep '.py$'  | sed 's/py$/pyo/' >> INSTALLED_FILES
#cat INSTALLED_FILES | grep '/lib/wicd' | egrep '.py$'  | sed 's/py$/pyc/' >> INSTALLED_FILES
#cat INSTALLED_FILES | grep '/lib/wicd' | egrep '.py$'  | sed 's/py$/pyo/' >> INSTALLED_FILES
%endif
# Make sure rpm knows that it compressed its own man pages.
#sed -i -e's:^.*/man/.*:&%{MAN_EXT}:' INSTALLED_FILES
grep -v '/man/' INSTALLED_FILES > INSTALLED_FILES2
%if 0%{?suse_version}
%suse_update_desktop_file -r wicd System Network
%endif

%clean
rm -rf $RPM_BUILD_ROOT

%post
%if %{DISTRO} == suse
%fillup_and_insserv -f wicd  
chkconfig wicd on  
chkconfig -f network off  
service network stop  
service wicd start 
%endif
%if %{DISTRO} == redhat
chkconfig wicd on
chkconfig -f NetworkManager off
service NetworkManager stop
service wicd start
%endif

%files -f INSTALLED_FILES2
%defattr(-,root,root)
%{_mandir}/man?/*
%{_mandir}/nl/man?/*
%if 0%{?centos_version} || 0%{?fedora_version}
/usr/lib/wicd/*.pyo
/usr/lib/wicd/*.pyc
/usr/lib/wicd/backends/*.pyc
/usr/lib/wicd/backends/*.pyo
#%{python_sitelib}/wicd/*.pyo
/usr/share/applications/wicd.desktop
%endif
%if 0%{?suse_version}
%dir /etc/acpi
%dir /etc/acpi/*.d
%dir /etc/dbus-1
%dir /etc/dbus-1/system.d
%dir /usr/lib/pm-utils
%dir /usr/lib/pm-utils/sleep.d
%dir %{python_sitelib}/wicd/
%dir /usr/share/wicd
%dir /usr/share/wicd/backends
%dir %{_datadir}/doc/wicd
%dir %{_datadir}/icons/hicolor
%dir %{_datadir}/icons/hicolor/*
%dir %{_datadir}/icons/hicolor/*/apps
%dir %{_datadir}/pixmaps/wicd
%dir %{_datadir}/wicd
%dir /var/lib/wicd
%dir %{_datadir}/locale/ar_EG/
%dir %{_datadir}/locale/ar_EG/LC_MESSAGES
%dir %{_datadir}/locale/nl_NL/
%dir %{_datadir}/locale/nl_NL/LC_MESSAGES
%endif

%changelog
* Wed Oct 27 2010 Andrew Psaltis <ampsaltis@gmail.com> 1.7.0-1
- Updated to 1.7.0
* Thu Oct 29 2009 Andrew Psaltis <ampsaltis@gmail.com> 1.6.2.2-3
- Added postinstall stuff for SUSE and Fedora and friends
* Sun Sep 6 2009 Andrew Psaltis <ampsaltis@gmail.com> 1.6.2.2-2
- Version bump to 1.6.2.2, fixing an ESSID bug created in 1.6.2.1.
* Wed Aug 5 2009 Andrew Psaltis <ampsaltis@gmail.com> 1.6.2.1-2
- Version bump to 1.6.2.1, fixing hidden network support
* Wed Aug 5 2009 Andrew Psaltis <ampsaltis@gmail.com> 1.6.2-2
- Switch source to one that seems to make hidden network support more functional
* Sun Jul 5 2009 Andrew Psaltis <ampsaltis@gmail.com> 1.6.2-2
- Version bump to 1.6.2
* Sun Jun 21 2009 Andrew Psaltis <ampsaltis@gmail.com> 1.6.1-2
- Version bump to 1.6.1
* Mon Jun 8 2009 Andrew Psaltis <ampsaltis@gmail.com> 1.6.0-2
- Version bump to 1.6.0 :)
* Thu May 28 2009 Andrew Psalits <ampsaltis@gmail.com> 1.6.0b3-2
- Version bump to 1.6.0b3
* Sat May 23 2009 Andrew Psalits <ampsaltis@gmail.com> 1.6.0b2-2
- Added locale directories for nl_NL to placate OpenSUSE >= 11.1
* Sat May 23 2009 Andrew Psalits <ampsaltis@gmail.com> 1.6.0b2-2
- Version bump to 1.6.0b2
- Forced OpenSUSE to use dhcpcd
* Thu May 14 2009 Andrew Psaltis <ampsaltis@gmail.com> 1.6.0b1-2
- Added missing /usr/share/hicolor directory to make OpenSUSE >= 11.1 happy
* Thu May 14 2009 Andrew Psaltis <ampsaltis@gmail.com> 1.6.0b1-2
- Version bump to 1.6.0b1
- Added support for the --distro tag in setup.py
- Cleaned up some of the SUSE directory code
* Wed May 13 2009 Andrew Psaltis <ampsaltis@gmail.com 1.6.0a3-1  
- Switched over to gzipped source tarball  
* Wed May 5 2009 Adam Blackburn <comwpiz18@gmail.com> 1.6.0a3-1
- Version bump to 1.6.0a3
* Thu Apr 23 2009 Andrew Psaltis <ampsaltis@gmail.com> 1.6.0a2-1
- Version bump to 1.6.0a2
* Tue Apr 21 2009 Andrew Psaltis <ampsaltis@gmail.com> 1.6.0a1-1
- Version bump to 1.6.0a1
* Mon Apr 20 2009 Andrew Psaltis <ampsaltis@gmail.com> r357-1
- First really working copy of wicd.spec :)