Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > c990db8f43029911c3209147242b93af > files > 17

inn-2.4.4-1mdv2009.0.src.rpm

%define perl_version %(rpm -q --qf '%%{epoch}:%%{VERSION}' perl)

Summary:	The InterNetNews (INN) system, a Usenet news server
Name:		inn
Version:	2.4.4
Release:	%mkrel 1
License:	GPLv2+
Group:		System/Servers
Url:		http://www.isc.org/products/INN/
Source0:	ftp://ftp.isc.org/isc/inn/inn-%{version}.tar.gz
Source1:	inn-default-active
Source2:	inn-default-distributions
Source3:	inn-default-newsgroups
Source4:	inn-cron-expire
Source5:	inn-cron-rnews
Source6:	inn-etc-nnrp.access
Source7:	inn-cron-nntpsend
Source8:	innd.init
Source10:	inn-faq.tar.bz2
Patch0:		inn-2.4.3.rh.patch
Patch1:		inn-2.4.1.perl.patch
Patch2:		inn-2.4.1.pie.patch
Patch3:		inn-2.4.1.posix.patch
Patch4:		inn-2.4.3.warn.patch
Patch5:		inn-2.4.2-makedbz.patch
Patch6:		inn-2.4.3-lib64.patch
BuildRequires:	autoconf2.1
BuildRequires:	bison
BuildRequires:	db4-devel
BuildRequires:	e2fsprogs-devel
BuildRequires:	flex
BuildRequires:  openssl-devel
BuildRequires:	perl-devel
Requires(pre):	chkconfig grep coreutils sed rpm-helper
Requires:	cleanfeed, perl = %{perl_version}
Requires:	sendmail-command
Conflicts:	echelog jabber2
Buildroot:	%{_tmppath}/%{name}-%{version}-%{release}-buildroot

%define _requires_exceptions perl(bigint.pl)\\|perl(ftp.pl)

%description
INN (InterNetNews) is a complete system for serving Usenet news and/or
private newsfeeds.  INN includes innd, an NNTP (NetNews Transport
Protocol) server, and nnrpd, a newsreader that is spawned for each client. 
Both innd and nnrpd vary slightly from the NNTP protocol, but not in ways
that are easily noticed.

Install the inn package if you need a complete system for serving and
reading Usenet news.  You may also need to install inn-devel, if you are
going to use a separate program which interfaces to INN, like newsgate or
tin.

%package	devel
Summary:	The INN (InterNetNews) library
Group:		Development/C
Requires:	inn = %{version}

%description	devel
The inn-devel package contains the INN (InterNetNews) library, which
several programs that interface with INN need in order to work (for
example, newsgate and tin).

If you are installing a program which must interface with the INN
news system, you should install inn-devel.

%package -n	inews
Summary:	Sends Usenet articles to a local news server for distribution
Group:		System/Servers
Conflicts:	noffle

%description -n	inews
The inews program is used by some news programs (for example, inn and
trn) to post Usenet news articles to local news servers.  Inews reads an
article from a file or standard input, adds headers, performs some
consistency checks and then sends the article to the local news server
specified in the inn.conf file.

Install inews if you need a program for posting Usenet articles to local
news servers.

%prep

%setup -q -a 10
%patch0 -p1 -b .rh
%patch1 -p1 -b .perl
%patch2 -p1 -b .pie
%patch3 -p1 -b .posix
%patch4 -p1 -b .warn
%patch5 -p0 -b .makedbz
%patch6 -p1 -b .lib64

rm -f configure; autoconf-2.13

find -type f | xargs perl -pi -e '@meuh = qw(LOCK_READ LOCK_WRITE LOCK_UNLOCK); foreach $a (@meuh) { s/\b$a\b/INN_$a/g }'

%build
%serverbuild
export CFLAGS="$CFLAGS -DHAVE_ET_COM_ERR_H -fPIC"

rm -f config.cache
libtoolize --copy --force
./configure --prefix=/usr  \
	--libdir=%{_libdir} \
	--with-lib-dir=%{_libdir}/%{name} \
	--with-filter-dir=%{_libdir}/news/bin/filter \
	--with-control-dir=%{_libdir}/news/bin/control \
	--sysconfdir=/etc/news \
	--mandir=%{_mandir} \
	--libexecdir=%{_libdir}/%{name} \
	--with-log-dir=/var/log/news --with-spool-dir=/var/spool/news\
	--with-db-dir=/var/lib/news --with-run-dir=/var/run/news \
	--with-etc-dir=/etc/news --with-tmp-path=/var/spool/news/tmp \
	--with-perl --enable-shared --enable-static \
	--enable-tagged-hash --enable-merge-to-groups \
	--with-news-user=news --with-news-group=news \
	--with-news-master=news --enable-pgp-verify \
	--with-openssl \
	--with-sendmail=/usr/sbin/sendmail \
	--with-berkeleydb=/usr/include/db4

%make

%install
rm -rf %{buildroot}

mkdir -p %{buildroot}
perl -pi -e 's/^OWNER.*/OWNER = /; s/^ROWNER.*/ROWNER = /' Makefile.global

TMP_UID="`id -un`"
TMP_GID="`id -gn`"
perl -pi -e "s|^NEWSUSER.*|NEWSUSER=${TMP_UID}|g" Makefile.global
perl -pi -e "s|^NEWSGROUP.*|NEWSGROUP=${TMP_GID}|g" Makefile.global

make install DESTDIR=%{buildroot}

# -- Install man pages needed by suck et al.
mkdir -p %{buildroot}/usr/include/inn
for f in clibrary.h config.h dbz.h libinn.h storage.h
do
    install -c -m 0644 ./include/$f %{buildroot}/usr/include/inn
done

mkdir -p %{buildroot}/etc
mv %{buildroot}/usr/bin/rc.news %{buildroot}/etc
chmod 755 %{buildroot}/etc/rc.news

touch %{buildroot}/var/lib/news/subscriptions
chmod 644 %{buildroot}/var/lib/news/subscriptions

install -m 644 %{SOURCE1} \
        %{buildroot}/var/lib/news/active
install -m 644 %{SOURCE2} \
        %{buildroot}/var/lib/news/distributions
install -m 644 %{SOURCE3} \
        %{buildroot}/var/lib/news/newsgroups

mkdir -p %{buildroot}/etc/cron.hourly %{buildroot}/etc/cron.daily
install -m755 %{SOURCE4} \
        %{buildroot}/etc/cron.daily/inn-cron-expire
install -m755 %{SOURCE5} \
        %{buildroot}/etc/cron.hourly/inn-cron-rnews
install -m755 %{SOURCE7} \
        %{buildroot}/etc/cron.hourly/inn-cron-nntpsend

install -m440 %{SOURCE6} \
        %{buildroot}/etc/news/nnrp.access

mkdir -p %{buildroot}/etc/rc.d/init.d/
install -m 755 %{SOURCE8} \
	%{buildroot}/etc/rc.d/init.d/innd

rm -f %{buildroot}/var/lib/news/history
touch %{buildroot}/var/lib/news/history
touch %{buildroot}/var/lib/news/.news.daily
LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}/usr/bin/makehistory \
	-a %{buildroot}/var/lib/news/active \
	-r -f %{buildroot}/var/lib/news/history || :
chmod 644 %{buildroot}/var/lib/news/*
chmod 644 %{buildroot}/var/lib/news/.news.daily

mkdir -p %{buildroot}/var/spool/news/tmp

# we get this from cleanfeed
# (sb) true - but it's not being found by innd - fix this
rm -f %{buildroot}/%{_libdir}/news/bin/filter/filter_innd.pl
pushd %{buildroot}/%{_libdir}/news/bin/filter
ln -sf ../control/filter_innd.pl . 
popd

# fix location of real library files
mv %{buildroot}%{_libdir}/{inn/lib{inn,storage}.a,/}

#Fix perms in sample directory to avoid bogus dependencies
find samples -name "*.in" -exec chmod a-x {} \;

# (sb) doc install conflicts with rpm %%doc, even when config is setup
# correctly. Just rm these files and let %%doc take care of it
rm -fr %{buildroot}/%{_usr}/doc

# (sb) a portion of the header files are in /usr/include, while the rest
# are in /usr/include/inn - paths.h conflicts with glibc-devel
# right now inn-devel isn't used for anything, nor do the other header
# files seem to be looking for them a directory up - move them
mv %{buildroot}/%{_includedir}/*.h %{buildroot}/%{_includedir}/inn

#Build filelist
echo "%defattr(-,news,news)" > files.list
find %{buildroot} -type f -or -type l | \
	sed -e "s|%{buildroot}||g" | \
	sed 's|^%{_initrddir}/innd|%config(noreplace) %attr(755,root,root) &|' | \
	sed 's|^/etc/news/inn.conf|%attr(640,uucp,news) %config(noreplace) %verify(not size mtime md5) &|' | \
	sed 's|^/etc/news|%attr(640,root,news) %config(noreplace) %verify(not size mtime md5) &|' | \
	sed 's|^/etc/rc.news|%attr(755,root,news) %config(noreplace) %verify(not size mtime md5) &|' | \
	sed 's|^/etc/init.d|%attr(755,root,root) %config(noreplace) %verify(not size mtime md5) &|' | \
	sed 's|^/etc/cron.hourly/inn-cron-rnews|%config(noreplace) %attr(755,root,root) &|' | \
	sed 's|^/var/lib/news/|%attr(640,news,news) %config(noreplace) &|' | \
	sed 's|.*innshellvar|%config(noreplace) &|' | \
	sed 's|/var/log/news|%ghost &|' | \
	sed 's|/usr/bin/inndstart|%attr(4750,root,news) &|' | \
	sed 's|/usr/bin/startinnfeed$|%attr(4550,root,news) &|' | \
	sed 's|/usr/bin/rnews$|%attr(6550,uucp,news) /usr/bin/rnews|' |
	sed '/%attr(4550,uucp,news)/a\
%defattr(755,root,root)' > files.list

(echo "%defattr(755,root,root)" ; grep -v inews files.list | \
	egrep -v "\.(h|so|a|la)$" | \
	grep -v "/man/") > files.main
echo "%defattr(644,root,root)" > files.devel
egrep "\.(h|so|a|la)$" files.list >> files.devel
echo "%attr(-,root,root)" >> files.main
find %{buildroot}%{_mandir}/man[158] -type f | \
	sed -e "s|%{buildroot}||g" | \
	sed -e "s|\.[158]|&.\*|g" | \
	grep -v inews >> files.main

# (sb) file mode now prevents strip from working?
chmod u+w %{buildroot}/%{_bindir}/*
chmod u+w %{buildroot}/%{_bindir}/auth/resolv/*
chmod u+w %{buildroot}/%{_bindir}/auth/passwd/*
chmod u+w %{buildroot}/%{_bindir}/rnews.libexec/*

%clean
rm -rf %{buildroot}
rm -f files.list files.main files.devel files.inews

%post
%_post_service innd

umask 002
touch /var/log/news/news.notice
touch /var/log/news/news.crit
touch /var/log/news/news.err
[ -f /var/lib/news/active.times ] || {
    touch /var/lib/news/active.times
    chown news:news /var/lib/news/active.times
}
chown -R news:news /var/log/news*

if [ `hostname -f` ]; then
  if [ `cat /etc/news/inn.conf | grep '^server:' | wc -l` -lt 1 ]; then
    echo "server: `hostname -f`" >> /etc/news/inn.conf
  fi

  if [ -f /var/lib/news/history ]; then
        cd /var/lib/news
	%{_bindir}/makedbz -s `wc -l <history` -f history
        for i in dir hash index pag; do
                [ -f history.n.$i ] && mv history.n.$i history.$i
        done
        chown news:news history.*
        chmod 644 history.*
  else
        cd /var/lib/news
        cp /dev/null history
        %{_bindir}/makehistory 
	%{_bindir}/makedbz -s `wc -l <history` -f history
        for i in dir hash index pag; do
                [ -f history.n.$i ] && mv history.n.$i history.$i
        done
        chown news:news history history.*
        chmod 644 history history.*
  fi
else
  echo "Network misconfigured, manual setup required..."
fi

%triggerin -- sysklogd
if [ -f /etc/syslog.conf ]; then
  if grep -q "# News logging" /etc/syslog.conf; then
perl -pi -e "s!mail.none;authpriv.none!mail.none;news.none;authpriv.none!; \
	     s!/var/log/news/info!/var/log/news/news.notice!; \
	     s!/var/log/news/errors!/var/log/news/news.err!; \
	     s!/var/log/news/warnings!/var/log/news/news.crit!; \
	     s!^news.err!news.=err!; \
	     s!^news.=warn!news.=crit!; " /etc/syslog.conf 
	else
	cat <<EOF >> /etc/syslog.conf
# News logging
news.=debug;news.=info;news.=notice                             -/var/log/news/news.notice
news.=crit                                                      -/var/log/news/news.crit
news.err                                                        -/var/log/news/news.err
EOF
    fi
  if [ -f /var/run/syslog.pid ]; then
    kill -HUP `cat /var/run/syslog.pid` 2> /dev/null ||:
  fi
fi

%preun
%_preun_service innd

if [ $1 = 0 ]; then
    if [ -f /var/lib/news/history.dir ]; then
       rm -f /var/lib/news/history.*
    fi
fi

%postun
if [ "$1" -ge "1" ]; then
    service innd restart > /dev/null 2>&1
fi

%files -f files.main
%defattr(-,news,news)
%dir %{_libdir}/%{name}
%dir %{_libdir}/news
%dir %{_libdir}/news/bin
%dir %{_libdir}/news/bin/control
%dir %{_libdir}/news/bin/filter
%dir %{_bindir}/rnews.libexec
%dir %{_bindir}/auth
%dir %{_bindir}/auth/resolv
%dir %{_bindir}/auth/passwd
%dir %{_sysconfdir}/news
%dir /var/spool/news
%dir /var/spool/news/articles
%dir /var/spool/news/overview
%dir /var/spool/news/archive
%attr(775,news,news) %dir /var/spool/news/incoming
%attr(775,news,news) %dir /var/spool/news/incoming/bad
%dir /var/spool/news/outgoing
%dir /var/spool/news/innfeed
%attr(770,news,news) %dir /var/spool/news/tmp
%attr(770,news,news) %dir /var/log/news
%dir /var/log/news/OLD
%attr(770,news,news) %dir /var/lib/news
%attr(770,news,news) %dir /var/run/news

%attr(-,root,root) %doc HACKING LICENSE MANIFEST TODO
%attr(-,root,root) %doc README* ChangeLog CONTRIBUTORS INSTALL NEWS
%attr(-,root,root) %doc faq
%attr(-,root,root) %doc doc/hook* doc/config* doc/compliance-nntp 
%attr(-,root,root) %doc doc/sample-control doc/GPL doc/history

%files devel -f files.devel
%defattr(-,root,root)
%{_mandir}/man3/*
%dir %{_includedir}/%{name}

%files -n inews
%defattr(-,root,root)
%attr(755,root,root) /usr/bin/inews
%{_mandir}/man1/inews*


%changelog
* Wed Aug 06 2008 Thierry Vignaud <tvignaud@mandriva.com> 2.4.4-1mdv2009.0
+ Revision: 264710
- rebuild early 2009.0 package (before pixel changes)

* Tue May 20 2008 Oden Eriksson <oeriksson@mandriva.com> 2.4.4-0mdv2009.0
+ Revision: 209584
- 2.4.4
- build it against db4.6-devel

* Fri Feb 01 2008 Funda Wang <fundawang@mandriva.org> 2.4.3-9mdv2008.1
+ Revision: 161204
- rebuild for new perl

  + Thierry Vignaud <tvignaud@mandriva.com>
    - rebuild
    - kill re-definition of %%buildroot on Pixel's request

  + Olivier Blin <oblin@mandriva.com>
    - restore BuildRoot

* Tue Sep 04 2007 Oden Eriksson <oeriksson@mandriva.com> 2.4.3-7mdv2008.0
+ Revision: 79277
- sync with inn-2.4.3-6.fc6.src.rpm
- make it build
- conform to the 2008 specs

  + Thierry Vignaud <tvignaud@mandriva.com>
    - kill file require on chkconfig


* Sun Dec 31 2006 Crispin Boylan <crisb@mandriva.org> 2.4.3-6mdv2007.0
+ Revision: 102944
- Fix db4 patch
- Import inn

  + Stew Benedict <sbenedict@mandriva.com>
    - fix %%configure, drop buildconflicts
    - add the patch
    - don't require db2 (#27857, Cris B)

* Thu Sep 07 2006 Stew Benedict <sbenedict@mandriva.com> 2.4.3-5mdv2007.0
- conflicts with jabber2

* Tue Jul 11 2006 Stew Benedict <sbenedict@mandriva.com> 2.4.3-4mdv2007.0
- requires sendmail-command (#10294, QA)

* Tue Jul 04 2006 Stew Benedict <sbenedict@mandriva.com> 2.4.3-3mdv2007.0
- drop forced db1 linkage (#23450, Cris B)

* Sat Apr 15 2006 Stew Benedict <sbenedict@mandriva.com> 2.4.3-2mdk
- fix group for inn-devel

* Fri Mar 31 2006 Stew Benedict <sbenedict@mandriva.com> 2.4.3-1mdk
- 2.4.3: replace P1 with a buildrequires/compile define, redo P3
- include files don't need to be executable

* Wed Feb 15 2006 Stew Benedict <sbenedict@mandriva.com> 2.4.2-9mdk
- parallel init, Requires(pre)

* Fri Jan 20 2006 Rafael Garcia-Suarez <rgarciasuarez@mandriva.com> 2.4.2-8mdk
- rebuild for new perl

* Fri Nov 18 2005 Oden Eriksson <oeriksson@mandriva.com> 2.4.2-7mdk
- rebuilt against openssl-0.9.8a

* Thu Jul 28 2005 Stew Benedict <sbenedict@mandriva.com> 2.4.2-6mdk
- try to catch broken network config and skip %%post activities (#17070)

* Tue Jun 14 2005 Buchan Milne <bgmilne@linux-mandrake.com> 2.4.2-5mdk
- Rebuild for libkrb53-devel 1.4.1

* Sat May 21 2005 Buchan Milne <bgmilne@linux-mandrake.com> 2.4.2-4mdk
- Rebuild for new libperl.so

* Sat Apr 23 2005 Stew Benedict <sbenedict@mandrakesoft.com> 2.4.2-3mdk
- Re-fix uucp issue (Bugzilla #15037)

* Thu Apr 07 2005 Stew Benedict <sbenedict@mandrakesoft.com> 2.4.2-2mdk
- Fix uucp issue (Bugzilla #15037)

* Sat Jan 29 2005 Stew Benedict <sbenedict@mandrakesoft.com> 2.4.2-1mdk
- 2.4.2, redo patch2,3

* Thu Dec 30 2004 Stefan van der Eijk <stefan@mandrake.org> 2.4.1-7mdk
- BuildRequires: byacc --> bison

* Tue Dec 21 2004 Stew Benedict <sbenedict@mandrakesoft.com> 2.4.1-6mdk
- rebuild for new perl

* Thu Jul 08 2004 Stew Benedict <sbenedict@mandrakesoft.com> 2.4.1-5mdk
- rebuild for new perl, relax binary perms so strip works

* Wed Jun 09 2004 Per Øyvind Karlsen <peroyvind@linux-mandrake.com> 2.4.1-4mdk
- fix buildrequires

* Wed Apr 07 2004 Michael Scherer <misc@mandrake.org> 2.4.1-3mdk 
- rebuild for new perl

* Wed Jan 21 2004 Pixel <pixel@mandrakesoft.com> 2.4.1-2mdk
- rebuild for new perl

* Thu Jan 08 2004 Stew Benedict <sbenedict@mandrakesoft.com> 2.4.1-1mdk
- 2.4.1, rework patch 2,3