Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > 144f4aaf0419e31ada731c56c214695c > files > 5

tntnet-2.1-13.fc16.src.rpm

Name:             tntnet
Version:          2.1
Release:          13%{?dist}
Summary:          A web application server for web applications

# GPLv2+: framework/common/gcryptinit.c
# zlib:   framework/common/unzip.h
License:          LGPLv2+ and GPLv2+ and zlib
URL:              http://www.tntnet.org/
Source0:          http://www.tntnet.org/download/%{name}-%{version}.tar.gz
# http://sourceforge.net/tracker/?func=detail&aid=3542704&group_id=119301&atid=684050
Source1:          %{name}.service
# http://sourceforge.net/tracker/?func=detail&aid=3542910&group_id=119301&atid=684050
Patch0:           %{name}-gcc47_fixes.patch
# http://sourceforge.net/tracker/?func=detail&aid=3542913&group_id=119301&atid=684050
Patch1:           %{name}-conf-fedora.patch

BuildRequires:    kernel-headers openssl-devel zlib-devel cxxtools-devel zip systemd-units
Requires(pre):    shadow-utils
Requires(post):   systemd-units
Requires(preun):  systemd-units
Requires(postun): systemd-units

%description
%{summary}

%package          devel
Summary:          Development files for %{name}
Group:            Development/Libraries
Requires:         %{name}%{?_isa} = %{version}-%{release}

%description devel
Development files for %{name}

%prep
%setup -q
%patch0 -p0
%patch1 -p1

%build
%configure --disable-static
make %{?_smp_mflags}

%install
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"

# Systemd unit files
# copy tntnet.service to unitdir /lib/systemd/system
mkdir -p $RPM_BUILD_ROOT%{_unitdir}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/doc/
install -Dpm 644 %{SOURCE1} $RPM_BUILD_ROOT/%{_unitdir}/%{name}.service

# Find and remove all la files
find $RPM_BUILD_ROOT -type f -name "*.la" -exec rm -f {} ';'

# remove sysv init script
rm  $RPM_BUILD_ROOT/etc/init.d/%{name}

%pre
getent group %{name} > /dev/null || groupadd -r %{name}
getent passwd %{name} > /dev/null || \
    useradd -r -g %{name} -d %{_localstatedir}/lib/%{name} -s /sbin/nologin \
    -c "User" %{name}
exit 0

%post
/sbin/ldconfig
if [ $1 -eq 1 ] ; then 
    # Initial installation 
    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi

%preun
if [ $1 -eq 0 ] ; then
    # Package removal, not upgrade
    /bin/systemctl --no-reload disable %{name}.service > /dev/null 2>&1 || :
    /bin/systemctl stop %{name}.service > /dev/null 2>&1 || :
fi

%postun
/sbin/ldconfig
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
    # Package upgrade, not uninstall
    /bin/systemctl try-restart %{name}.service >/dev/null 2>&1 || :
fi

%files
%defattr (-, root, root)
%doc AUTHORS ChangeLog COPYING README
%dir %{_sysconfdir}/tntnet
%config(noreplace) %{_sysconfdir}/%{name}/*.conf
%config(noreplace) %{_sysconfdir}/%{name}/*.properties
%{_unitdir}/%{name}.service
%{_bindir}/ecppc
%{_bindir}/ecppl
%{_bindir}/ecppll
%{_bindir}/tntnet
%{_libdir}/libtntnet*.so.*
%{_libdir}/tntnet/
%{_mandir}/man1/ecppc.1.gz
%{_mandir}/man1/ecppl.1.gz
%{_mandir}/man1/ecppll.1.gz
%{_mandir}/man1/tntnet-config.1.gz
%{_mandir}/man7/ecpp.7.gz
%{_mandir}/man7/tntnet.conf.7.gz
%{_mandir}/man7/tntnet.properties.7.gz
%{_mandir}/man8/tntnet.8.gz

%files devel
%defattr (-, root, root)
%{_bindir}/tntnet-config
%{_libdir}/libtntnet*.so
%{_includedir}/tnt/

%changelog
* Thu Jul 26 2012 Martin Gansser <linux4martin@gmx.de> - 2.1-13
- added missing BuildRequires systemd-units 

* Thu Jul 26 2012 Martin Gansser <linux4martin@gmx.de> - 2.1-12
- spec file cleanup
- changed changelog readability

* Wed Jul 18 2012 Martin Gansser <linux4martin@gmx.de> - 2.1-11
- added missing build requirement kernel-headers

* Fri Jul 13 2012 Martin Gansser <linux4martin@gmx.de> - 2.1-10
- added upstream link for gcc 4.7 patch
- changed license type
- make install preserve timestamps 

* Thu Jul 3 2012 Martin Gansser <linux4martin@gmx.de> - 2.1-9
- removed rm in install section
- removed systemd readme file
- added link to upstream systemd patch

* Sun Jun 24 2012 Martin Gansser <linux4martin@gmx.de> - 2.1-8
- removed group and user apache from tntnet.conf
- added own group tntnet to tntnet.conf
- added creation of users and groups in pre section

* Thu Jun 21 2012 Martin Gansser <linux4martin@gmx.de> - 2.1-7
- added systemd-fedora-readme

* Wed Jun 20 2012 Martin Gansser <linux4martin@gmx.de> - 2.1-6
- changed group and user for fedora to apache

* Sun Jun 17 2012 Martin Gansser <linux4martin@gmx.de> - 2.1-5
- fixed more missing slash in path
- fixed missing system unit file

* Sun Jun 17 2012 Martin Gansser <linux4martin@gmx.de> - 2.1-4
- fixed missing slash in path

* Sat Jun 16 2012 Martin Gansser <linux4martin@gmx.de> - 2.1-3
- gcc-4.7 patch
- added systemd service file
- removed sysv init stuff
- cleanup spec file 

* Tue May 29 2012 Martin Gansser <linux4martin@gmx.de> - 2.1-2
- removed license comment
- removed empty files
- fixed Requires and Group tag

* Sun Apr 29 2012 Martin Gansser <linux4martin@gmx.de> - 2.1-1
- new release

* Mon Sep 19 2011 Sebastian Vahl <fedora@deadbabylon.de> - 2.0-2
- cleanup spec a bit

* Sun Sep 18 2011 Sebastian Vahl <fedora@deadbabylon.de> - 2.0-1
- initial release