|
Michael Thomas |
6a90090 |
%define selinux_variants mls strict targeted
|
|
Michael Thomas |
6a90090 |
%define selinux_policyver %(sed -e 's,.*selinux-policy-\\([^/]*\\)/.*,\\1,' /usr/share/selinux/devel/policyhelp)
|
|
Michael Thomas |
6a90090 |
|
|
Michael Thomas |
6a90090 |
Name: cyphesis
|
|
Michael Thomas |
5a6f3ef |
Version: 0.5.10
|
|
Michael Thomas |
b885aa9 |
Release: 4%{?dist}
|
|
Michael Thomas |
6a90090 |
Summary: WorldForge game server
|
|
Michael Thomas |
6a90090 |
Group: System Environment/Libraries
|
|
Michael Thomas |
6a90090 |
License: GPL
|
|
Michael Thomas |
6a90090 |
URL: http://www.worldforge.org
|
|
Michael Thomas |
6a90090 |
Source0: http://dl.sourceforge.net/worldforge/%{name}-%{version}.tar.gz
|
|
Michael Thomas |
6a90090 |
Source1: cyphesis.te
|
|
Michael Thomas |
6a90090 |
Source2: cyphesis.if
|
|
Michael Thomas |
6a90090 |
Source3: cyphesis.fc
|
|
Michael Thomas |
5a6f3ef |
Patch0: cyphesis-0.5.8-init.patch
|
|
Michael Thomas |
b885aa9 |
Patch1: cyphesis-0.5.10-python2.5.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 |
BuildRequires: checkpolicy selinux-policy-devel hardlink
|
|
Michael Thomas |
6a90090 |
|
|
Michael Thomas |
6a90090 |
%if "%{selinux_policyver}" != ""
|
|
Michael Thomas |
6a90090 |
Requires: selinux-policy >= %{selinux_policyver}
|
|
Michael Thomas |
6a90090 |
%endif
|
|
Michael Thomas |
6a90090 |
Requires: postgresql-server
|
|
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 |
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 |
6a90090 |
|
|
Michael Thomas |
6a90090 |
%package selinux
|
|
Michael Thomas |
6a90090 |
Summary: SELinux policy files for the WorldForge game server
|
|
Michael Thomas |
6a90090 |
Group: Amusements/Games
|
|
Michael Thomas |
6a90090 |
Requires: %{name} = %{version}-%{release}
|
|
Michael Thomas |
6a90090 |
Requires(post): /usr/sbin/semodule /usr/sbin/semanage /sbin/fixfiles
|
|
Michael Thomas |
6a90090 |
Requires(preun): /sbin/service /usr/sbin/semodule /usr/sbin/semanage /sbin/fixfiles /usr/sbin/setsebool
|
|
Michael Thomas |
6a90090 |
Requires(postun): /usr/sbin/semodule
|
|
Michael Thomas |
6a90090 |
%description selinux
|
|
Michael Thomas |
6a90090 |
SELinux policy files for the WorldForge game server
|
|
Michael Thomas |
6a90090 |
|
|
Michael Thomas |
6a90090 |
|
|
Michael Thomas |
6a90090 |
%prep
|
|
Michael Thomas |
6a90090 |
%setup -q
|
|
Michael Thomas |
6a90090 |
%patch0
|
|
Michael Thomas |
b885aa9 |
touch -r configure.ac configure.ac.stamp
|
|
Michael Thomas |
b885aa9 |
%patch1
|
|
Michael Thomas |
b885aa9 |
touch -r configure.ac.stamp configure.ac
|
|
Michael Thomas |
6a90090 |
|
|
Michael Thomas |
6a90090 |
chmod a-x rulesets/basic/world/objects/*/*.py
|
|
Michael Thomas |
6a90090 |
chmod a-x rulesets/basic/mind/dictlist.py
|
|
Michael Thomas |
6a90090 |
mkdir SELinux
|
|
Michael Thomas |
6a90090 |
cp %{SOURCE1} %{SOURCE2} %{SOURCE3} SELinux/
|
|
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 |
6a90090 |
|
|
Michael Thomas |
6a90090 |
%build
|
|
Michael Thomas |
6a90090 |
%configure
|
|
Michael Thomas |
6a90090 |
make %{?_smp_mflags}
|
|
Michael Thomas |
6a90090 |
|
|
Michael Thomas |
6a90090 |
# Build the selinux policy file
|
|
Michael Thomas |
6a90090 |
pushd SELinux
|
|
Michael Thomas |
6a90090 |
for variant in %{selinux_variants}
|
|
Michael Thomas |
6a90090 |
do
|
|
Michael Thomas |
6a90090 |
make NAME=${variant} -f %{_datadir}/selinux/devel/Makefile
|
|
Michael Thomas |
6a90090 |
mv %{name}.pp %{name}.pp.${variant}
|
|
Michael Thomas |
6a90090 |
make NAME=${variant} -f %{_datadir}/selinux/devel/Makefile clean
|
|
Michael Thomas |
6a90090 |
done
|
|
Michael Thomas |
6a90090 |
popd
|
|
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 |
6a90090 |
# Install selinux policies
|
|
Michael Thomas |
6a90090 |
pushd SELinux
|
|
Michael Thomas |
6a90090 |
for variant in %{selinux_variants}
|
|
Michael Thomas |
6a90090 |
do
|
|
Michael Thomas |
6a90090 |
install -d %{buildroot}%{_datadir}/selinux/${variant}
|
|
Michael Thomas |
6a90090 |
install -p -m 644 %{name}.pp.${variant} \
|
|
Michael Thomas |
6a90090 |
%{buildroot}%{_datadir}/selinux/${variant}/%{name}.pp
|
|
Michael Thomas |
6a90090 |
done
|
|
Michael Thomas |
6a90090 |
popd
|
|
Michael Thomas |
6a90090 |
# Hardlink identical policy module packages together
|
|
Michael Thomas |
6a90090 |
/usr/sbin/hardlink -cv %{buildroot}%{_datadir}/selinux
|
|
Michael Thomas |
6a90090 |
|
|
Michael Thomas |
6a90090 |
%check
|
|
Michael Thomas |
6a90090 |
make check
|
|
Michael Thomas |
6a90090 |
|
|
Michael Thomas |
6a90090 |
%pre
|
|
Michael Thomas |
6a90090 |
user_uid=`id -u cyphesis 2>/dev/null`
|
|
Michael Thomas |
6a90090 |
if [ x"$user_uid" = x ] ; then
|
|
Michael Thomas |
6a90090 |
useradd -r -d %{_datadir}/%{name} -M -c 'Cyphesis Game Server' \
|
|
Michael Thomas |
6a90090 |
cyphesis >/dev/null || :
|
|
Michael Thomas |
6a90090 |
fi
|
|
Michael Thomas |
6a90090 |
|
|
Michael Thomas |
6a90090 |
%post
|
|
Michael Thomas |
6a90090 |
/sbin/chkconfig --add cyphesis
|
|
Michael Thomas |
6a90090 |
|
|
Michael Thomas |
6a90090 |
%post selinux
|
|
Michael Thomas |
6a90090 |
# Install SELinux policy modules
|
|
Michael Thomas |
6a90090 |
for selinuxvariant in %{selinux_variants}
|
|
Michael Thomas |
6a90090 |
do
|
|
Michael Thomas |
6a90090 |
/usr/sbin/semodule -s ${selinuxvariant} -i \
|
|
Michael Thomas |
6a90090 |
%{_datadir}/selinux/${selinuxvariant}/%{name}.pp &> /dev/null || :
|
|
Michael Thomas |
6a90090 |
done
|
|
Michael Thomas |
6a90090 |
/usr/sbin/semanage port -a -t %{name}_port_t -p tcp 6767 &> /dev/null || :
|
|
Michael Thomas |
6a90090 |
/usr/sbin/semanage port -a -t %{name}_port_t -p tcp 6769 &> /dev/null || :
|
|
Michael Thomas |
6a90090 |
/usr/sbin/semanage port -a -t %{name}_port_t -p udp 32771 &> /dev/null || :
|
|
Michael Thomas |
6a90090 |
/sbin/fixfiles -R %{name} restore || :
|
|
Michael Thomas |
6a90090 |
/sbin/service %{name} condrestart > /dev/null 2>&1 || :
|
|
Michael Thomas |
6a90090 |
|
|
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 |
%preun selinux
|
|
Michael Thomas |
6a90090 |
if [ "$1" -lt "1" ] ; then
|
|
Michael Thomas |
6a90090 |
# Disable the policy and restart the daemon
|
|
Michael Thomas |
6a90090 |
/usr/sbin/setsebool %{name}_disable_trans 1 &> /dev/null || :
|
|
Michael Thomas |
6a90090 |
/sbin/service %{name} condrestart > /dev/null 2>&1 || :
|
|
Michael Thomas |
6a90090 |
# Unload the module
|
|
Michael Thomas |
6a90090 |
/usr/sbin/semanage port -d -t %{name}_port_t -p tcp 6767 &> /dev/null || :
|
|
Michael Thomas |
6a90090 |
/usr/sbin/semanage port -d -t %{name}_port_t -p tcp 6769 &> /dev/null || :
|
|
Michael Thomas |
6a90090 |
/usr/sbin/semanage port -d -t %{name}_port_t -p udp 32771 &> /dev/null || :
|
|
Michael Thomas |
6a90090 |
for variant in %{selinux_variants} ; do
|
|
Michael Thomas |
6a90090 |
/usr/sbin/semodule -s ${variant} -r %{name} &> /dev/null || :
|
|
Michael Thomas |
6a90090 |
done
|
|
Michael Thomas |
6a90090 |
# Set the context back
|
|
Michael Thomas |
6a90090 |
/sbin/fixfiles -R %{name} restore || :
|
|
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 |
%postun selinux
|
|
Michael Thomas |
6a90090 |
if [ "$1" -ge "1" ] ; then
|
|
Michael Thomas |
6a90090 |
# Replace the module if it is already loaded. semodule -u also
|
|
Michael Thomas |
6a90090 |
# checks the module version
|
|
Michael Thomas |
6a90090 |
for variant in %{selinux_variants} ; do
|
|
Michael Thomas |
6a90090 |
/usr/sbin/semodule -u %{_datadir}/selinux/${variant}/%{name}.pp || :
|
|
Michael Thomas |
6a90090 |
done
|
|
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 |
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 |
6a90090 |
%{_datadir}/%{name}
|
|
Michael Thomas |
6a90090 |
|
|
Michael Thomas |
6a90090 |
%files selinux
|
|
Michael Thomas |
6a90090 |
%defattr(-,root,root,-)
|
|
Michael Thomas |
6a90090 |
%doc SELinux/*.??
|
|
Michael Thomas |
6a90090 |
%{_datadir}/selinux/*/%{name}.pp
|
|
Michael Thomas |
6a90090 |
|
|
Michael Thomas |
6a90090 |
|
|
Michael Thomas |
6a90090 |
%changelog
|
|
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
|