File schooltool.spec of Package schooltool
Name: schooltool
Summary: A free student information system for schools around the world
Version: 1.0
Release: 1
Source0: %{name}-%{version}.tar.bz2
Source1: schooltool.init
Source2: schooltool.conf
Source3: schooltool.logrotate
Source4: schooltool-cert.cnf
Source5: %{name}-install-fonts
Source6: py-compile
License: GPL
Group: Development/Libraries
Requires: libxml2 libxml2-python
# schoolbell = 1.2.4
Url: http://www.schooltool.org/
BuildRoot: %{_tmppath}/%{name}-buildroot
%define installdir %_datadir/%name
%description
SchoolTool is free administrative software for schools around the world. The
goals of the project are to create a simple turnkey student information system,
including demographics, gradebook, attendance, calendaring and reporting for
primary and secondary schools, as well as a framework for building customized
applications and configurations for individual schools or states.
%prep
%setup -q
%build
make build update-translations
python setup.py build
%install
python setup.py install_scripts \
--install-dir=%{buildroot}/%{_bindir} \
--default-config=%{_sysconfdir}/schooltool/schooltool.conf\
--paths=%{installdir}
python setup.py install --no-compile\
--install-lib=$RPM_BUILD_ROOT%{installdir}\
--install-data=$RPM_BUILD_ROOT%{installdir}
mkdir -p $RPM_BUILD_ROOT/etc/schooltool/fonts
mkdir -p $RPM_BUILD_ROOT/etc/init.d
mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
mkdir -p $RPM_BUILD_ROOT/var/lib/schooltool
mkdir -p $RPM_BUILD_ROOT/var/run/schooltool
mkdir -p $RPM_BUILD_ROOT/var/log/schooltool
install %{SOURCE1} $RPM_BUILD_ROOT/etc/init.d/schooltool
install %{SOURCE2} $RPM_BUILD_ROOT/etc/schooltool/schooltool.conf
install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/schooltool
install %{SOURCE4} $RPM_BUILD_ROOT/etc/schooltool/ssl-cert.cnf
install -m755 %{SOURCE5} $RPM_BUILD_ROOT/etc/schooltool/fonts/install-fonts
install schooltool.conf.in $RPM_BUILD_ROOT/etc/schooltool/schooltool.conf.example
cd $RPM_BUILD_ROOT/usr/lib/libschoolbell
%{SOURCE6} --basedir $RPM_BUILD_ROOT/usr/lib/libschoolbell `find . -type f -name "*.py"`
find $RPM_BUILD_ROOT/usr/lib/libschoolbell -type f -name "*.pyo" -print0 | xargs -0 rm -f
cd $RPM_BUILD_ROOT/etc/schooltool/fonts
FONTDIR=$RPM_BUILD_ROOT/etc/schooltool/fonts ./install-fonts
%clean
rm -rf $RPM_BUILD_ROOT
%pre
/usr/sbin/useradd -M -r -s /sbin/false schooltool > /dev/null 2>&1
%files
%defattr(-,root,root)
%config(noreplace) %{sysconfdir}etc/schooltool/schooltool.conf
%config %{sysconfdir}etc/schooltool/schooltool.conf.example
%dir %{sysconfdir}/schooltool
%{_sysconfdir}/schooltool/fonts
%{_sysconfdir}/schooltool/ssl-cert.cnf
%{_sysconfdir}/logrotate.d/schooltool
%{_sysconfdir}/init.d/schooltool
%{installdir}
%{_bindir}/schooltool
%{_bindir}/schooltool-rest-client
%attr(0700,schooltool,root) /var/lib/schooltool
%attr(-,schooltool,root) /var/run/schooltool
%attr(-,schooltool,root) /var/log/schooltool