Michael Thomas 79a2e4
%define logwatch_root %{_datadir}/logwatch
Michael Thomas 79a2e4
%define logwatch_conf %{logwatch_root}/dist.conf
Michael Thomas 79a2e4
%define logwatch_scripts %{logwatch_root}/scripts
Michael Thomas 79a2e4
Michael Thomas 6a9009
Name:           cyphesis
Michael Thomas 6c1f0c
Version:        0.5.15
Michael Thomas 71ce1c
Release:        7%{?dist}
Michael Thomas 6a9009
Summary:        WorldForge game server
Michael Thomas 6a9009
Group:          System Environment/Libraries
Michael Thomas 09ff06
# Would be GPLv2+, except server/protocol_instructions.h is GPLv2 only.
Michael Thomas 09ff06
License:        GPLv2
Michael Thomas 6a9009
URL:            http://www.worldforge.org
Michael Thomas 36713b
Source0:        http://downloads.sourceforge.net/worldforge/%{name}-%{version}.tar.gz
Michael Thomas 79a2e4
Source4:        logwatch.logconf.cyphesis
Michael Thomas 79a2e4
Source5:        logwatch.script.cyphesis
Michael Thomas 79a2e4
Source6:        logwatch.serviceconf.cyphesis
Michael Thomas 79a2e4
Source7:        logwatch.shared.applycyphesisdate
Michael Thomas b720ef
Patch0:         cyphesis-0.5.15-init.patch
Michael Thomas b720ef
Patch1:         cyphesis-0.5.11-logdir.patch
Michael Thomas 603c7b
Patch2:         cyphesis-0.5.15-gcc43.patch
Michael Thomas 71ce1c
Patch3:         cyphesis-0.5.15-sockpath.patch
Michael Thomas 6a9009
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Michael Thomas 6a9009
BuildRequires:  python-devel libgcrypt-devel pkgconfig atlascpp-devel
Michael Thomas 6a9009
BuildRequires:  varconf-devel libsigc++20-devel mercator-devel skstream-devel
Michael Thomas 6a9009
BuildRequires:  postgresql-devel readline-devel avahi-devel
Michael Thomas 6a9009
Michael Thomas 6a9009
Requires:       postgresql-server
Michael Thomas 09ff06
Requires(pre): shadow-utils
Michael Thomas 6a9009
Requires(post): /sbin/chkconfig
Michael Thomas 6a9009
Requires(post): /sbin/service
Michael Thomas 6a9009
Requires(preun): /sbin/chkconfig
Michael Thomas 6a9009
Requires(preun): /sbin/service
Michael Thomas 6a9009
Requires(postun): /sbin/service
Michael Thomas 6a9009
Michael Thomas 7eeb95
Obsoletes: cyphesis-selinux <= 0.5.15-6
Michael Thomas 7eeb95
Michael Thomas 6a9009
%description
Michael Thomas 6a9009
Cyphesis is a WorldForge server suitable running small games. It is also
Michael Thomas 6a9009
designed by be used as an AI subsystem in a network of distributed servers. It
Michael Thomas 6a9009
includes a terrain engine based on the Mercator library, a persistence system
Michael Thomas 6a9009
based on PostgreSQL, and an AI engine using goal trees implemented in Python.
Michael Thomas 6a9009
It is the server used in most current WorldForge games.
Michael Thomas 6a9009
Michael Thomas 79a2e4
%package logwatch
Michael Thomas 79a2e4
Summary: logwatch scripts for the WorldForge game server
Michael Thomas 79a2e4
Group: Amusements/Games
Michael Thomas 79a2e4
Requires: %{name} = %{version}-%{release} logwatch
Michael Thomas 79a2e4
%description logwatch
Michael Thomas 79a2e4
logwatch scripts for the WorldForge game server
Michael Thomas 79a2e4
Michael Thomas 6a9009
Michael Thomas 6a9009
%prep
Michael Thomas 6a9009
%setup -q
Michael Thomas b720ef
%patch0 -p1
Michael Thomas b720ef
%patch1 -p0
Michael Thomas 603c7b
%patch2 -p1
Michael Thomas 71ce1c
%patch3 -p1
Michael Thomas 6a9009
Michael Thomas f2790d
# Fix a bug where DESTDIR is added twice to some files during the
Michael Thomas f2790d
# install step.  Upstream has been notified.
Michael Thomas f2790d
sed -i -e 's#moduledir = $(DESTDIR)#moduledir = #' rulesets/Makefile.in
Michael Thomas f2790d
Michael Thomas 6a9009
chmod a-x rulesets/basic/mind/dictlist.py
Michael Thomas f2790d
chmod a-x rulesets/mason/world/objects/buildings/House.py
Michael Thomas f2790d
chmod a-x rulesets/mason/world/objects/elements/Fire.py
Michael Thomas 6a9009
Michael Thomas 6a9009
# Use a /etc/sysconfig/cyphesis variable to determine if
Michael Thomas 6a9009
# we should load the world data into the cyphesis server
Michael Thomas 6a9009
# via cyclient or not.  This should allow us to use a single
Michael Thomas 6a9009
# init.d script for both starting cyphesis and populating the world.
Michael Thomas 6a9009
echo "POPULATE_WORLD=1" >> cyphesis.sysconfig
Michael Thomas 6a9009
Michael Thomas 603c7b
# Use a /etc/sysconfig/cyphesis variable to determine if
Michael Thomas 603c7b
# we should load the rules into the cyphesis server
Michael Thomas 603c7b
# via cyloadrules or not.  This flag will be reset by the
Michael Thomas 603c7b
# rpm whenever the game rules have changed and need to be reloaded
Michael Thomas 603c7b
# after an upgrade/install.
Michael Thomas 603c7b
echo "LOAD_RULES=1" >> cyphesis.sysconfig
Michael Thomas 603c7b
Michael Thomas 6a9009
Michael Thomas 6a9009
%build
Michael Thomas 6a9009
%configure
Michael Thomas 6a9009
make %{?_smp_mflags}
Michael Thomas 6a9009
Michael Thomas 6a9009
%install
Michael Thomas 6a9009
rm -rf %{buildroot}
Michael Thomas 6a9009
make install DESTDIR=%{buildroot}
Michael Thomas 6a9009
Michael Thomas 6a9009
install -d %{buildroot}%{_sysconfdir}/init.d
Michael Thomas 6a9009
install -m 755 %{name}.init %{buildroot}%{_sysconfdir}/init.d/%{name}
Michael Thomas 6a9009
Michael Thomas 6a9009
install -d %{buildroot}%{_sysconfdir}/sysconfig
Michael Thomas 6a9009
install -m 644 %{name}.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/%{name}
Michael Thomas 6a9009
Michael Thomas 79a2e4
# Install logwatch files
Michael Thomas 79a2e4
install -pD -m 0644 %{SOURCE4} %{buildroot}%{logwatch_conf}/logfiles/%{name}.conf
Michael Thomas 79a2e4
install -pD -m 0755 %{SOURCE5} %{buildroot}%{logwatch_scripts}/services/%{name}
Michael Thomas 79a2e4
install -pD -m 0644 %{SOURCE6} %{buildroot}%{logwatch_conf}/services/%{name}.conf
Michael Thomas 79a2e4
install -pD -m 0755 %{SOURCE7} %{buildroot}%{logwatch_scripts}/shared/applycyphesisdate
Michael Thomas 79a2e4
Michael Thomas b720ef
mkdir -p %{buildroot}%{_var}/log/%{name}
Michael Thomas 71ce1c
mkdir -p %{buildroot}%{_var}/run/%{name}
Michael Thomas b720ef
Michael Thomas 71ce1c
sed -i -e 's#unixport="#unixport="/var/run/cyphesis/#' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cyphesis.vconf
Michael Thomas 79a2e4
Michael Thomas 6a9009
Michael Thomas 6a9009
%check
Michael Thomas 6a9009
make check
Michael Thomas 6a9009
Michael Thomas 6a9009
%pre
Michael Thomas 09ff06
getent group cyphesis >/dev/null || groupadd -r cyphesis
Michael Thomas 09ff06
getent passwd cyphesis >/dev/null || \
Michael Thomas 14871f
       useradd -r -g cyphesis -d %{_datadir}/%{name} \
Michael Thomas 14871f
       -c "Cyphesis game server" cyphesis
Michael Thomas 14871f
cyphesis_shell=`getent passwd cyphesis | cut -d: -f 7`
Michael Thomas 14871f
if [ "$cyphesis_shell" == "/sbin/nologin" ] ; then
Michael Thomas 14871f
    chsh cyphesis -s /bin/bash
Michael Thomas 14871f
fi
Michael Thomas 09ff06
exit 0
Michael Thomas 6a9009
Michael Thomas 6a9009
%post
Michael Thomas 6a9009
/sbin/chkconfig --add cyphesis
Michael Thomas 603c7b
# Make sure any new game rules are loaded into the database after
Michael Thomas 603c7b
# an install or upgrade.
Michael Thomas 603c7b
if ! grep -q LOAD_RULES %{_sysconfdir}/%{name} ; then
Michael Thomas 603c7b
    sed -i -e 's/LOAD_RULES=.*/LOAD_RULES=1/' %{_sysconfdir}/sysconfig/%{name} 
Michael Thomas 603c7b
else
Michael Thomas 603c7b
    echo "LOAD_RULES=1" >> %{_sysconfdir}/sysconfig/%{name}
Michael Thomas 603c7b
fi
Michael Thomas 6a9009
Michael Thomas 6a9009
%preun
Michael Thomas 6a9009
if [ "$1" = "0" ]; then
Michael Thomas 6a9009
    /sbin/service cyphesis stop > /dev/null 2>&1
Michael Thomas 6a9009
    /sbin/chkconfig --del cyphesis
Michael Thomas 6a9009
fi
Michael Thomas 6a9009
Michael Thomas 6a9009
%postun
Michael Thomas 6a9009
if [ "$1" -ge "1" ]; then
Michael Thomas 6a9009
    /sbin/service cyphesis condrestart >/dev/null 2>&1
Michael Thomas 6a9009
fi
Michael Thomas 6a9009
Michael Thomas 6a9009
%clean
Michael Thomas 6a9009
rm -rf %{buildroot}
Michael Thomas 6a9009
Michael Thomas 6a9009
Michael Thomas 6a9009
%files
Michael Thomas 6a9009
%defattr(-,root,root,-)
Michael Thomas 6a9009
%doc AUTHORS ChangeLog COPYING README NEWS THANKS TODO
Michael Thomas 6a9009
%{_bindir}/cy*
Michael Thomas f2790d
%{_datadir}/%{name}
Michael Thomas 6a9009
%{_mandir}/man1/*.1.gz
Michael Thomas 6a9009
%dir %{_sysconfdir}/%{name}
Michael Thomas 6a9009
%config(noreplace) %{_sysconfdir}/%{name}/*
Michael Thomas 6a9009
%{_sysconfdir}/init.d/%{name}
Michael Thomas 6a9009
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
Michael Thomas 71ce1c
# Package up the log and sock directory with special permissions so that the
Michael Thomas b720ef
# service can write to it.
Michael Thomas b720ef
%dir %attr(0755,cyphesis,cyphesis) %{_var}/log/%{name}
Michael Thomas 71ce1c
%dir %attr(0755,cyphesis,cyphesis) %{_var}/run/%{name}
Michael Thomas 6a9009
Michael Thomas 79a2e4
%files logwatch
Michael Thomas 79a2e4
%defattr(-,root,root,-)
Michael Thomas 79a2e4
%{logwatch_conf}/logfiles/%{name}.conf
Michael Thomas 79a2e4
%{logwatch_conf}/services/%{name}.conf
Michael Thomas 79a2e4
%{logwatch_scripts}/services/%{name}
Michael Thomas 79a2e4
%{logwatch_scripts}/shared/applycyphesisdate
Michael Thomas 79a2e4
Michael Thomas 6a9009
Michael Thomas 6a9009
%changelog
Michael Thomas 71ce1c
* Wed Apr 10 2008 Wart <wart at="" kobold.org=""> 0.5.15-7
Michael Thomas 71ce1c
- Remove selinux subpackage; it's been merged into the main
Michael Thomas 71ce1c
  selinux-policy package.
Michael Thomas 71ce1c
- Add patch for using a full socket path in cyphesis.vconf
Michael Thomas 71ce1c
Michael Thomas d1ec57
* Thu Feb 21 2008 Wart <wart at="" kobold.org=""> 0.5.15-6
Michael Thomas d1ec57
- Add patch to fix gcc4.3 build errors
Michael Thomas d1ec57
8c4fb6
* Wed Feb 20 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 0.5.15-5
8c4fb6
- Autorebuild for GCC 4.3
8c4fb6
Michael Thomas 603c7b
* Sun Feb 10 2008 Wart <wart at="" kobold.org=""> 0.5.15-4
Michael Thomas 603c7b
- Rebuild for gcc 4.3
Michael Thomas 603c7b
- Add 'LOAD_RULES' setting in /etc/sysconfig/cyphesis to control
Michael Thomas 603c7b
  reloading of the game rules data.
Michael Thomas 603c7b
Michael Thomas 21228e
* Tue Dec 18 2007 Wart <wart at="" kobold.org=""> 0.5.15-3
Michael Thomas 21228e
- Fix selinux permissions so that cyphesis can create its own
Michael Thomas 21228e
  log file.
Michael Thomas 21228e
Michael Thomas b720ef
* Tue Dec 18 2007 Wart <wart at="" kobold.org=""> 0.5.15-2
Michael Thomas b720ef
- Move log files so they get they get the correct context
Michael Thomas b720ef
Michael Thomas 6c1f0c
* Sun Dec 16 2007 Wart <wart at="" kobold.org=""> 0.5.15-1
Michael Thomas 6c1f0c
- Update to 0.5.15
Michael Thomas 6c1f0c
Michael Thomas 14871f
* Sat Dec 15 2007 Wart <wart at="" kobold.org=""> 0.5.14-2
Michael Thomas 14871f
- Change shell for cyphesis user on existing installs (BZ #425798)
Michael Thomas 14871f
Michael Thomas dbdb26
* Sat Nov 3 2007 Wart <wart at="" kobold.org=""> 0.5.14-1
Michael Thomas dbdb26
- Update to 0.5.14
Michael Thomas dbdb26
Michael Thomas 09ff06
* Sun Aug 19 2007 Wart <wart at="" kobold.org=""> 0.5.13-2
Michael Thomas 09ff06
- License tag clarification
Michael Thomas 09ff06
- Update user creation to conform to guidelines
Michael Thomas 09ff06
Michael Thomas f2790d
* Tue Jul 17 2007 Wart <wart at="" kobold.org=""> 0.5.13-1
Michael Thomas f2790d
- Update to 0.5.13
Michael Thomas f2790d
Michael Thomas 36713b
* Mon May 7 2007 Wart <wart at="" kobold.org=""> 0.5.12-1
Michael Thomas 36713b
- Update to 0.5.12
Michael Thomas 36713b
Michael Thomas 79a2e4
* Sat Feb 24 2007 Wart <wart at="" kobold.org=""> 0.5.11-2
Michael Thomas 79a2e4
- Add logwatch subpackage
Michael Thomas 79a2e4
- Move log file to /var/log directory
Michael Thomas 79a2e4
Michael Thomas 461912
* Wed Jan 24 2007 Wart <wart at="" kobold.org=""> 0.5.11-1
Michael Thomas 79a2e4
- Update to 0.5.11 with builtin python 2.5 support
Michael Thomas 461912
- Updated selinux policy
Michael Thomas 461912
Michael Thomas b885aa
* Thu Dec 14 2006 Wart <wart at="" kobold.org=""> 0.5.10-4
Michael Thomas b885aa
- Patch and rebuild for python 2.5
Michael Thomas b885aa
Michael Thomas 75c10a
* Wed Dec 6 2006 Wart <wart at="" kobold.org=""> 0.5.10-3
Michael Thomas 75c10a
- Rebuild for new postgresql
Michael Thomas 75c10a
Michael Thomas e7dc01
* Fri Dec 1 2006 Wart <wart at="" kobold.org=""> 0.5.10-2
Michael Thomas e7dc01
- Rebuild for new readline-devel
Michael Thomas e7dc01
Michael Thomas e7dc01
* Fri Oct 20 2006 Wart <wart at="" kobold.org=""> 0.5.10-1
Michael Thomas e7dc01
- Update to 0.5.10
Michael Thomas e7dc01
Michael Thomas 6a9009
* Mon Aug 28 2006 Wart <wart at="" kobold.org=""> 0.5.9-2
Michael Thomas 6a9009
- Use more globs in %%files section
Michael Thomas 6a9009
- Remove unused -devel subpackage declaration
Michael Thomas 6a9009
Michael Thomas 6a9009
* Sat Aug 26 2006 Wart <wart at="" kobold.org=""> 0.5.9-1
Michael Thomas 6a9009
- Update to 0.5.9
Michael Thomas 6a9009
Michael Thomas 6a9009
* Sat Aug 5 2006 Wart <wart at="" kobold.org=""> 0.5.8-5
Michael Thomas 6a9009
- Move semanage calls to the init script so that we can be sure they are
Michael Thomas 6a9009
  called if a system manager turns selinux on or off between installing
Michael Thomas 6a9009
  the package and starting it.
Michael Thomas 6a9009
- Remove FC4 bits from the spec file
Michael Thomas 6a9009
- unghost the .pyo files per the recent packaging committee decision
Michael Thomas 6a9009
- Don't bother explicitly creating a group for the cyphesis user
Michael Thomas 6a9009
Michael Thomas 6a9009
* Thu Aug 3 2006 Wart <wart at="" kobold.org=""> 0.5.8-4
Michael Thomas 6a9009
- Use find+sed in %%install instead of enumerating directories in %%files
Michael Thomas 6a9009
- Remove the use of fedora-usermgmt.  There's no need.
Michael Thomas 6a9009
Michael Thomas 6a9009
* Tue Aug 1 2006 Wart <wart at="" kobold.org=""> 0.5.8-3
Michael Thomas 6a9009
- Clean up %%files
Michael Thomas 6a9009
Michael Thomas 6a9009
* Tue Aug 1 2006 Wart <wart at="" kobold.org=""> 0.5.8-2
Michael Thomas 6a9009
- Fix -init patch that was missing some key changes.
Michael Thomas 6a9009
Michael Thomas 6a9009
* Tue Aug 1 2006 Wart <wart at="" kobold.org=""> 0.5.8-1
Michael Thomas 6a9009
- Initial spec file for Fedora Extras