Группа :: Сети/IRC
Пакет: ircd
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
# -*- rpm-spec -*-
# $Id: ircd,v 1.49 2005/02/02 12:53:40 grigory Exp $
%define chroot %_localstatedir/%name
%define preversion 02
Name: ircd
Version: 1.0.7
Release: alt5.%preversion
Summary: %name - is ircd daemon
License: GPL
Group: Networking/IRC
URL: http://www.ircd.ru/
Provides: ircd-chroot(%chroot)
Source0: %name-RU-%version-%preversion-stable.tar.bz2
Source1: %name.init
Source2: %name.chroot.all
Source3: %name.chroot.conf
Source4: %name.chroot.lib
Source5: %name.chroot.bin
Source6: %name.chroot.log
# Automatically added by buildreq on Wed Aug 13 2003
BuildRequires: libgmp-devel zlib-devel chrooted kernel-headers-std-up pmake
%description
ircd is the server (daemon) program for the Internet Relay
Chat Program. The ircd is a server in that its function
is to "serve" the client program irc(1) with messages and
commands. All commands and user messages are passed
directly to the ircd for processing and relaying to other
ircd sites. The irc(1) program depends upon there being
an ircd server running somewhere (either on your local
UNIX site or a remote ircd site) so that it will have
somewhere to connect to and thus allow the user to begin
talking to other users.
%prep
%setup -q -n %name-RU-%version-%preversion-stable
%build
%__subst "s|\[ -z|\[ -n|g" tools/install_%name.in
./configure --enable-encryption --prefix=/
%__subst "s|\"bin/ircd\"|\"%_sbindir/ircd\"|;
s|\"codepages\"|\"%_sysconfdir/%name/codepages\"|;
s|\"doc/|\"%_datadir/doc/|;
s|\(\"etc/\)|\1%name/|" include/paths.h
%__subst "s|#undef[\t ]\+\(SYSLOG_\)|#define \1|;" include/config.h
%__subst "s|\(extern void debug\)|//\1|" src/res.c
%make_build
%install
%__subst "s|\"/\"|\"%buildroot/\"|" include/paths.h
%__mkdir_p %buildroot{%_man1dir,%_man8dir}
%__mkdir_p %buildroot%chroot{/lib,/dev,/tmp,%_sysconfdir/%name/codepages,%_var/run,/bin,%_sbindir,%_datadir/doc}
%__make install
%__install -m 0755 -D %SOURCE1 %buildroot%_initdir/%name
%__mv -f doc/Bahamut/irc.1 %buildroot%_man1dir/
%__mv -f doc/Bahamut/ircd.8 %buildroot%_man8dir/
%__mv -f %buildroot%_sysconfdir/%name/ru_RU.KOI8-R/%name.conf-dist %buildroot%_sysconfdir/%name/%name.conf
iconv %buildroot%_sysconfdir/%name/ru_RU.CP1251/%name.motd-dist -f CP1251 -t KOI8-R -o %buildroot%_sysconfdir/%name/%name.motd
iconv %buildroot%_sysconfdir/%name/ru_RU.CP1251/%name.smotd-dist -f CP1251 -t KOI8-R -o %buildroot%_sysconfdir/%name/%name.smotd
%__install -m 0750 -D %SOURCE2 %buildroot%_sysconfdir/chroot.d/%name.all
%__install -m 0750 -D %SOURCE3 %buildroot%_sysconfdir/chroot.d/%name.conf
%__install -m 0750 -D %SOURCE4 %buildroot%_sysconfdir/chroot.d/%name.lib
%__install -m 0750 -D %SOURCE5 %buildroot%_sysconfdir/chroot.d/%name.bin
%__install -m 0750 -D %SOURCE6 %buildroot%_sysconfdir/chroot.d/%name.log
%__subst 's|%%ROOT|%chroot|g;
s|%%CONFDIR|%_sysconfdir/%name|g;
s|%%NAME|%name|g' %buildroot%_sysconfdir/chroot.d/%name.* %buildroot%_initdir/%name
# Delete unused files from buildroot
%__rm -rf %buildroot%_sysconfdir/%name/{ru_RU.*,%name.*-dist} %buildroot%_datadir/doc/{ru_RU.*,README*,opers*}
%pre
if [ $1 = 1 ]; then
%_sbindir/groupadd -r ircd >/dev/null 2>&1 ||:
%_sbindir/useradd -M -r ircd -g ircd -s /dev/null -c "IRC server" -d %_localstatedir/%name >/dev/null 2>&1 ||:
fi
%post
%post_service %name
%preun
%preun_service %name
if [ $1 = 0 ]; then
%_sbindir/userdel -r %name >/dev/null 2>&1 ||:
%_sbindir/groupdel %name >/dev/null 2>&1 ||:
%__subst 's|-a /var/lib/%name/dev/log||' /etc/sysconfig/syslogd
fi
%files
%doc doc/*
%dir %_sysconfdir/%name
%dir %_sysconfdir/%name/codepages
%config %_sysconfdir/chroot.d/*
%config(noreplace) %_sysconfdir/%name/%name.*
%config(noreplace) %_sysconfdir/%name/kline.conf
%_sysconfdir/%name/codepages/*
%_initdir/*
/bin/*
%_sbindir/*
%_man1dir/*
%_man8dir/*
%attr(0755,ircd,ircd) %dir %chroot
%dir %chroot%_sysconfdir/%name/codepages
%dir %chroot/dev
%dir %chroot%_var/run
%dir %chroot/lib
%dir %chroot/tmp
%dir %chroot/bin
%dir %chroot%_sbindir
%dir %chroot%_datadir/doc
%changelog
…
Полный changelog можно просмотреть здесь
# $Id: ircd,v 1.49 2005/02/02 12:53:40 grigory Exp $
%define chroot %_localstatedir/%name
%define preversion 02
Name: ircd
Version: 1.0.7
Release: alt5.%preversion
Summary: %name - is ircd daemon
License: GPL
Group: Networking/IRC
URL: http://www.ircd.ru/
Provides: ircd-chroot(%chroot)
Source0: %name-RU-%version-%preversion-stable.tar.bz2
Source1: %name.init
Source2: %name.chroot.all
Source3: %name.chroot.conf
Source4: %name.chroot.lib
Source5: %name.chroot.bin
Source6: %name.chroot.log
# Automatically added by buildreq on Wed Aug 13 2003
BuildRequires: libgmp-devel zlib-devel chrooted kernel-headers-std-up pmake
%description
ircd is the server (daemon) program for the Internet Relay
Chat Program. The ircd is a server in that its function
is to "serve" the client program irc(1) with messages and
commands. All commands and user messages are passed
directly to the ircd for processing and relaying to other
ircd sites. The irc(1) program depends upon there being
an ircd server running somewhere (either on your local
UNIX site or a remote ircd site) so that it will have
somewhere to connect to and thus allow the user to begin
talking to other users.
%prep
%setup -q -n %name-RU-%version-%preversion-stable
%build
%__subst "s|\[ -z|\[ -n|g" tools/install_%name.in
./configure --enable-encryption --prefix=/
%__subst "s|\"bin/ircd\"|\"%_sbindir/ircd\"|;
s|\"codepages\"|\"%_sysconfdir/%name/codepages\"|;
s|\"doc/|\"%_datadir/doc/|;
s|\(\"etc/\)|\1%name/|" include/paths.h
%__subst "s|#undef[\t ]\+\(SYSLOG_\)|#define \1|;" include/config.h
%__subst "s|\(extern void debug\)|//\1|" src/res.c
%make_build
%install
%__subst "s|\"/\"|\"%buildroot/\"|" include/paths.h
%__mkdir_p %buildroot{%_man1dir,%_man8dir}
%__mkdir_p %buildroot%chroot{/lib,/dev,/tmp,%_sysconfdir/%name/codepages,%_var/run,/bin,%_sbindir,%_datadir/doc}
%__make install
%__install -m 0755 -D %SOURCE1 %buildroot%_initdir/%name
%__mv -f doc/Bahamut/irc.1 %buildroot%_man1dir/
%__mv -f doc/Bahamut/ircd.8 %buildroot%_man8dir/
%__mv -f %buildroot%_sysconfdir/%name/ru_RU.KOI8-R/%name.conf-dist %buildroot%_sysconfdir/%name/%name.conf
iconv %buildroot%_sysconfdir/%name/ru_RU.CP1251/%name.motd-dist -f CP1251 -t KOI8-R -o %buildroot%_sysconfdir/%name/%name.motd
iconv %buildroot%_sysconfdir/%name/ru_RU.CP1251/%name.smotd-dist -f CP1251 -t KOI8-R -o %buildroot%_sysconfdir/%name/%name.smotd
%__install -m 0750 -D %SOURCE2 %buildroot%_sysconfdir/chroot.d/%name.all
%__install -m 0750 -D %SOURCE3 %buildroot%_sysconfdir/chroot.d/%name.conf
%__install -m 0750 -D %SOURCE4 %buildroot%_sysconfdir/chroot.d/%name.lib
%__install -m 0750 -D %SOURCE5 %buildroot%_sysconfdir/chroot.d/%name.bin
%__install -m 0750 -D %SOURCE6 %buildroot%_sysconfdir/chroot.d/%name.log
%__subst 's|%%ROOT|%chroot|g;
s|%%CONFDIR|%_sysconfdir/%name|g;
s|%%NAME|%name|g' %buildroot%_sysconfdir/chroot.d/%name.* %buildroot%_initdir/%name
# Delete unused files from buildroot
%__rm -rf %buildroot%_sysconfdir/%name/{ru_RU.*,%name.*-dist} %buildroot%_datadir/doc/{ru_RU.*,README*,opers*}
%pre
if [ $1 = 1 ]; then
%_sbindir/groupadd -r ircd >/dev/null 2>&1 ||:
%_sbindir/useradd -M -r ircd -g ircd -s /dev/null -c "IRC server" -d %_localstatedir/%name >/dev/null 2>&1 ||:
fi
%post
%post_service %name
%preun
%preun_service %name
if [ $1 = 0 ]; then
%_sbindir/userdel -r %name >/dev/null 2>&1 ||:
%_sbindir/groupdel %name >/dev/null 2>&1 ||:
%__subst 's|-a /var/lib/%name/dev/log||' /etc/sysconfig/syslogd
fi
%files
%doc doc/*
%dir %_sysconfdir/%name
%dir %_sysconfdir/%name/codepages
%config %_sysconfdir/chroot.d/*
%config(noreplace) %_sysconfdir/%name/%name.*
%config(noreplace) %_sysconfdir/%name/kline.conf
%_sysconfdir/%name/codepages/*
%_initdir/*
/bin/*
%_sbindir/*
%_man1dir/*
%_man8dir/*
%attr(0755,ircd,ircd) %dir %chroot
%dir %chroot%_sysconfdir/%name/codepages
%dir %chroot/dev
%dir %chroot%_var/run
%dir %chroot/lib
%dir %chroot/tmp
%dir %chroot/bin
%dir %chroot%_sbindir
%dir %chroot%_datadir/doc
%changelog
…
Полный changelog можно просмотреть здесь