LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File bip.spec of Package bip (Project server:irc)

#
# spec file for package bip
#
# Copyright (c) 2013 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/
#


# (specfile based on Mandriva's which is based on Fedora's)

Name:           bip
Version:        0.8.8
Release:        0.1git1
Summary:        IRC Bouncer (proxy)
License:        GPL-2.0+
Group:          Productivity/Networking/IRC
Url:            http://bip.t1r.net
Source0:        bip-%version.tar.gz
Source1:        bip.init
Patch0:         bip-conf.patch
Patch1:         bip-0.8.8-lex-unistd.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  byacc
BuildRequires:  flex
BuildRequires:  openssl-devel

%description
Bip is an IRC proxy, which means it keeps connected to your preferred IRC
servers, can store the logs for you, and even send them back to your IRC
client(s) upon connection.
You may want to use bip to keep your logfiles (in a unique format and on a
unique computer) whatever your client is, when you connect from multiple
workstations, or when you simply want to have a playback of what was said
while you were away.

%prep
%setup -q
%patch0 -p0
%patch1 -p1
iconv -f iso-8859-1 -t utf-8 -o ChangeLog{.utf8,}
mv ChangeLog{.utf8,}

%build
export CFLAGS="%{optflags} -DPIC -fPIC -Wno-error"
%configure
make CFLAGS="%{optflags} -DPIC -fPIC -Wno-error"

%install
rm -rf %{buildroot}
%makeinstall examplesdir=%{_docdir}/%name/examples/
# Remove misplaced files
rm -rf %{buildroot}%{_defaultdocdir}/bip
mkdir -p %{buildroot}%{_sysconfdir}
# Install bip.conf
install -m 644 samples/bip.conf %{buildroot}%{_sysconfdir}/bip.conf
# Install initscript
mkdir -p %{buildroot}%{_initrddir}
install -m755 %{SOURCE1} %{buildroot}%{_initrddir}/bip
mkdir -p %{buildroot}%{_localstatedir}/run/bip
mkdir -p %{buildroot}%{_localstatedir}/log/bip
install -d %{buildroot}%{_sbindir}
ln -s %{_initddir}/bip %{buildroot}%{_sbindir}/rcbip
install -d %{buildroot}%{_localstatedir}/lib/bip

%clean
rm -rf %{buildroot}

%pre
%{_sbindir}/groupadd -r bip 2> /dev/null || :
%{_sbindir}/useradd -r -o -s /bin/false -c "User for the bip IRC proxy" -m -d %{_localstatedir}/lib/bip -g bip bip 2> /dev/null || :

%post
%{fillup_and_insserv -f -y bip}

%preun
%{stop_on_removal bip}

%postun
%{restart_on_update bip}

%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog README TODO
%{_bindir}/bip
%{_bindir}/bipmkpw
%{_sbindir}/rcbip
%{_mandir}/man1/bip.1*
%{_mandir}/man1/bipmkpw.1*
%{_mandir}/man5/bip.conf.5*
%config(noreplace) %{_sysconfdir}/bip.conf
%{_initrddir}/bip
%ghost %attr(-,bip,bip) %dir %{_localstatedir}/run/bip
%attr(-,bip,bip) %dir %{_localstatedir}/lib/bip
%attr(-,bip,bip) %dir %{_localstatedir}/log/bip

%changelog