SPECS: bnc.spec - added bnc service

Elan Ruusamäe glen at delfi.ee
Fri Feb 4 04:06:57 CET 2005


hi

maybe it should be subpackage instead?
if yes, then under what name?

On Thursday 03 February 2005 17:20, glen wrote:
> Author: glen                         Date: Thu Feb  3 15:20:30 2005 GMT
> Module: SPECS                         Tag: HEAD
> ---- Log message:
> - added bnc service
>
> ---- Files affected:
> SPECS:
>    bnc.spec (1.25 -> 1.26)
>
> ---- Diffs:
>
> ================================================================
> Index: SPECS/bnc.spec
> diff -u SPECS/bnc.spec:1.25 SPECS/bnc.spec:1.26
> --- SPECS/bnc.spec:1.25 Thu Feb  3 13:51:07 2005
> +++ SPECS/bnc.spec Thu Feb  3 16:20:25 2005
> @@ -5,21 +5,34 @@
>  Summary(pl): Proste narzędzie do tunelowania irc
>  Name:  bnc
>  Version: 2.9.3
> -Release: 0.1
> +Release: 0.9
>  License: GPL
>  Group:  Networking/Utilities
>  # http://gotbnc.com/files/%{name}%{version}.tar.gz - doesn't work with
> distfiles, reason unknown
> #Source0: ftp://distfiles.pld-linux.org/src/%{name}%{version}.tar.gz
> Source0: http://www.gotbnc.com/files/%{name}%{version}.tar.gz
>  # Source0-md5: 5012f3eb112f0fda545b1aaf66a06150
> +Source1: %{name}.sysconfig
> +Source2: %{name}.init
> +Source3: %{name}.conf
>  Patch0:  %{name}-setup.patch
> -URL:  http://gotbnc.com/
> +Patch1:  %{name}-typo.patch
> +URL:  http://www.gotbnc.com/
>  BuildRequires: autoconf
>  BuildRequires: automake
>  BuildRequires: openssl-devel
> -Requires: dialog >= 1:0.70
> +BuildRequires: rpmbuild(macros) >= 1.177
> +Provides: group(bnc)
> +Provides: user(bnc)
> +Requires: dialog >= 1:0.69
> +Requires: /sbin/start-stop-daemon
>  BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
>
> +%define _sysconfdir /etc/%{name}
> +
> +%define userid 142
> +%define groupid 142
> +
>  %description
>  BNC is a great IRC (Internet Relay Chat) proxying server under the GPL
>  (General Public License). It allows users to connect to chat servers
> @@ -36,6 +49,7 @@
>  %prep
>  %setup -q -n %{name}%{version}
>  %patch0 -p1
> +%patch1 -p1
>
>  %build
>  cp -f /usr/share/automake/config.sub .
> @@ -46,24 +60,88 @@
>  %{__make} \
>   CFLAGS="%{rpmcflags}" \
>   OFLAGS="%{rpmcflags}" \
> - LIBS="-lcrypt"
>
>  %install
>  rm -rf $RPM_BUILD_ROOT
> -install -d $RPM_BUILD_ROOT%{_bindir}
> +install -d
> $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{_bindir},%{_sysconfdir},/var
>/{log,run/%{name}}}
>
>  install bnc $RPM_BUILD_ROOT%{_bindir}
> -install bncchk $RPM_BUILD_ROOT%{_bindir}
>  install bncsetup $RPM_BUILD_ROOT%{_bindir}/bncsetup
>  install mkpasswd $RPM_BUILD_ROOT%{_bindir}/bncmkpasswd
> +install motd $RPM_BUILD_ROOT%{_sysconfdir}/motd
> +install %{SOURCE1} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
> +install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
> +install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.conf
> +> $RPM_BUILD_ROOT/var/log/%{name}.log
>
>  %clean
>  rm -rf $RPM_BUILD_ROOT
>
> +%pre
> +if [ -n "`/usr/bin/getgid %{name}`" ]; then
> + if [ "`/usr/bin/getgid %{name}`" != %{groupid} ]; then
> +  echo "Error: group %{name} doesn't have gid=%{groupid}. Correct this
> before installing %{name}." 1>&2 +  exit 1
> + fi
> +else
> + /usr/sbin/groupadd -g %{groupid} %{name}
> +fi
> +if [ -n "`/bin/id -u %{name} 2>/dev/null`" ]; then
> + if [ "`/bin/id -u %{name}`" != %{userid} ]; then
> +  echo "Error: user %{name} doesn't have uid=%{userid}. Correct this
> before installing %{name}." 1>&2 +  exit 1
> + fi
> +else
> + /usr/sbin/useradd -u %{userid} -d /var/run/%{name} -s /bin/false \
> +  -c "%{name} User" -g %{name} %{name} 1>&2
> +fi
> +
> +%post
> +if ! egrep -q '^(adminpass|password)' /etc/bnc/bnc.conf; then
> +%banner %{name} -e <<EOF
> +You need to setup passwords in /etc/bnc/bnc.conf!
> +The daemon will not start unless you've set them!
> +
> +EOF
> +# ' vim
> +
> +fi
> +
> +# add service just once
> +[ "$1" = "1" ] && /sbin/chkconfig --add %{name}
> +
> +if [ -f /var/lock/subsys/%{name} ]; then
> + /etc/rc.d/init.d/%{name} restart 1>&2
> +else
> + echo "Run \"/etc/rc.d/init.d/%{name} start\" to start %{name} daemon."
> +fi
> +
> +%preun
> +if [ "$1" = "0" ]; then
> + if [ -f /var/lock/subsys/%{name} ]; then
> +  /etc/rc.d/init.d/%{name} stop 1>&2
> + fi
> + /sbin/chkconfig --del %{name}
> +fi
> +
> +%postun
> +if [ "$1" = "0" ]; then
> + %userremove bnc
> + %groupremove bnc
> +fi
> +
>  %files
>  %defattr(644,root,root,755)
> -%doc README Changelog motd example.conf
> +%doc README Changelog motd example.conf bncchk
> +%dir %attr(750,bnc,bnc) %{_sysconfdir}
> +%config(noreplace) %verify(not size mtime md5) %attr(640,bnc,bnc)
> %{_sysconfdir}/* +
>  %attr(755,root,root) %{_bindir}/*
> +%attr(754,root,root) /etc/rc.d/init.d/%{name}
> +%config(noreplace) %verify(not size mtime md5) /etc/sysconfig/%{name}
> +
> +%dir %attr(750,bnc,bnc) /var/run/%{name}
> +%attr(620,bnc,bnc) %ghost /var/log/%{name}.log
>
>  %define date %(echo `LC_ALL="C" date +"%a %b %d %Y"`)
>  %changelog
> @@ -71,10 +149,13 @@
>  All persons listed below can be reached at <cvs_login>@pld-linux.org
>
>  $Log$
> +Revision 1.26  2005/02/03 15:20:25  glen
> +- added bnc service
> +
>  Revision 1.25  2005/02/03 12:51:07  glen
>  - updated to 2.9.3 (security; ssl support)
> - - patch bncsetup, rather having it's copy, this way it won't go outdated
> (hopefully) -- bncsetup still not workig
> +- patch bncsetup, rather having it's copy, this way it won't go outdated
> (hopefully) +- bncsetup still not working
>
>  Revision 1.24  2004/11/26 18:35:55  qboosh
>  - noted original Source0 URL
> ================================================================
>
> ---- CVS-web:
>     http://cvs.pld-linux.org/SPECS/bnc.spec?r1=1.25&r2=1.26&f=u
>
>
> _______________________________________________
> pld-cvs-commit mailing list
> pld-cvs-commit at pld-linux.org
> http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

-- 
glen




More information about the pld-devel-en mailing list