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