%global commit 8887f01870fec2332c1f8eef919cf86fb439c2f3
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%global gitdate 20150810
## This macro activates/deactivates debug option
%global without_debug 1
Name: vdr-epg-daemon
Version: 0.2.2
Release: 5.%{gitdate}git%{shortcommit}%{?dist}
Summary: A daemon to download EPG data from internet and manage it in a mysql database
Group: Applications/Multimedia
License: GPL+ and GPLv2 and BSD
URL: http://projects.vdr-developer.org/projects/vdr-epg-daemon
Source0: http://projects.vdr-developer.org/git/vdr-epg-daemon.git/snapshot/vdr-epg-daemon-%{commit}.tar.bz2
# fix Optimization flags are not honored.
Patch0: vdr-epg-daemon-makefile.patch
# http://projects.vdr-developer.org/issues/2191
Patch1: epgd-tool-fedora.diff
BuildRequires: libcurl-devel
BuildRequires: libxslt-devel
BuildRequires: libxml2-devel
BuildRequires: libuuid-devel
BuildRequires: jansson-devel
BuildRequires: zlib-devel
BuildRequires: libjpeg-turbo-devel
BuildRequires: imlib2-devel
BuildRequires: libxslt-devel
BuildRequires: libxml2-devel
BuildRequires: openssl-devel
BuildRequires: mariadb-devel
BuildRequires: libarchive-devel
BuildRequires: systemd-units
Requires: mariadb-server
Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units
Requires: vdr
%description
epgd is part of the double team epgd+epg2vdr to effectively retrieve,
store and import epg data to vdr. It is designed to handle large amount of
data and pictures in a distributed environment with one epg-server and
many possible vdr-clients - therefore it relays on mysql.
Though it is possible to use epgd alone with mysql it only makes sense to
use it as backend to the vdr-plugin epg2vdr. That being said you need to
install, setup and configure mysql, epgd and epg2vdr in order to get a
working environment.
%prep
%setup -qn vdr-epg-daemon-%{commit}
%patch0 -p0
%patch1 -p1
iconv -f iso-8859-1 -t utf-8 README > README.utf8 ; mv README.utf8 README
## Optimization flags in 'Make.config' file
sed -i \
-e 's|PREFIX = /usr/local|PREFIX = %{_prefix}|' \
-e 's|PLGDEST = $(DESTDIR)$(PREFIX)/lib/epgd/plugins|PLGDEST = $(DESTDIR)%{_libdir}/epgd|' \
-e 's|@@OPTFLAGS | %{optflags}|' \
Make.config
%if 0%{?without_debug}
sed -i -e 's|DEBUG = 1||' Make.config
%else
##Nothing
%endif
## Optimization flags for ../epglv
sed -i \
-e 's|@@LIBDIR| %{_libdir}|' \
-e 's|@@OPTFLAGS | %{optflags}|' \
epglv/Makefile
##epglv readme file
mv epglv/README epglv/README-epglv
# add bash to beginning of file
sed -i '1 i\#!/bin/bash' scripts/epgd-showmerge
%build
make %{?_smp_mflags} all
%install
make install-scripts install-config install-plugins DESTDIR=%{buildroot}
# Fedora mysql plugindir /usr/lib64/mysql/plugin
install -dm 755 %{buildroot}%{_bindir}
install -dm 755 %{buildroot}%{_libdir}/mysql/plugin
install -pm 755 epgd %{buildroot}%{_bindir}
install -pm 755 epglv/mysqlepglv.so %{buildroot}%{_libdir}/mysql/plugin
# Systemd unit files
# copy epgd.service to unitdir /lib/systemd/system
mkdir -p %{buildroot}%{_unitdir}
install -Dpm 644 contrib/epgd.service %{buildroot}/%{_unitdir}/epgd.service
%post
%systemd_post epgd.service
%preun
%systemd_preun epgd.service
%postun
%systemd_postun_with_restart epgd.service
%files
%doc HISTORY* README epglv/README* contrib/README.fedora
%license COPYING
%{_bindir}/epg*
%dir %{_sysconfdir}/epgd
%config(noreplace) %{_sysconfdir}/epgd/*
%{_unitdir}/epgd.service
%dir %{_libdir}/epgd
%{_libdir}/epgd/libepgd-epgdata.so
%{_libdir}/mysql/plugin/mysqlepglv.so
%changelog
* Sun Aug 16 2015 Martin Gansser <martinkg@fedoraproject.org> - 0.2.2-5.20150810git8887f01
- Mark license files as %%license where available
- added epgd-tool-fedora.diff so mariadb is taken
* Sat Aug 15 2015 Martin Gansser <martinkg@fedoraproject.org> - 0.2.2-4.20150810git8887f01
- rebuild for new git release
* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.2-3.20150202git7927905
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 0.2.2-2.20150202git7927905
- Rebuilt for GCC 5 C++11 ABI change
* Mon Feb 02 2015 Martin Gansser <martinkg@fedoraproject.org> - 0.2.2-1.20150202git7927905
- Update to 0.2.2
* Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.1-8.20140526git006a005
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.1-7.20140526git006a005
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Mon May 26 2014 Martin Gansser <martinkg@fedoraproject.org> - 0.2.1-6.20140526git006a005
- rebuild for new git release
* Wed May 21 2014 Martin Gansser <martinkg@fedoraproject.org> - 0.2.1-5.20140520git356b6ac
- rebuild for new git release
* Thu May 15 2014 Martin Gansser <martinkg@fedoraproject.org> - 0.2.1-4.20140515git44e364a
- rebuild for new git release
* Wed May 14 2014 Martin Gansser <martinkg@fedoraproject.org> - 0.2.1-3.20140514gitbef6c18
- rebuild for new git release
* Tue May 13 2014 Martin Gansser <martinkg@fedoraproject.org> - 0.2.1-2.20140512git997069a
- rebuild for new git release
* Sat May 10 2014 Martin Gansser <martinkg@fedoraproject.org> - 0.2.1-1.20140510gite1d19b8
- rebuild for new git release
- Add BR libjpeg-turbo-devel
- Add BR imlib2-devel
- Add BR libxslt-devel
- Add BR libxml2-devel
* Wed May 07 2014 Martin Gansser <martinkg@fedoraproject.org> - 0.2.0-1.20140507gitd5f1b4d
- rebuild for new git release
* Mon May 05 2014 Martin Gansser <martinkg@fedoraproject.org> - 0.1.0-8.20140505gitd7fb6ca
- removed unnecessary BR: mariadb-server
- added mariadb-server to Requires
- used %%install for installing and fix perm of files from buildroot
- shortened summary text
* Mon May 05 2014 Martin Gansser <martinkg@fedoraproject.org> - 0.1.0-7.20140505gitd7fb6ca
- added macro for activate/deactivate debug option
- optflags settings
- added epglv README
- used 'cp -p' rather than 'mv' for copying files from buildroot
* Mon May 05 2014 Martin Gansser <martinkg@fedoraproject.org> - 0.1.0-6.20140505gitd7fb6ca
- rebuild for new git release
- replaced hardlinks by macro in %%prep section
- Fixed the License tag
- added %%dir %%{_libdir}/epgd because it's owned by the package
- added BR mariadb-server
- added BR systemd-units
- added comment about upstream patch
- added fedora optflags to Make.config
* Sat May 03 2014 Martin Gansser <martinkg@fedoraproject.org> - 0.1.0-5.20140428giteb7f12a
- fixed description
* Thu May 01 2014 Martin Gansser <martinkg@fedoraproject.org> - 0.1.0-4.20140428giteb7f12a
- added patch for epgd-tool.diff
* Mon Apr 28 2014 Martin Gansser <martinkg@fedoraproject.org> - 0.1.0-3.20140428giteb7f12a
- rebuild for new git release
* Fri Apr 25 2014 Martin Gansser <martinkg@fedoraproject.org> - 0.1.0-2.20140424gita9d880b
- added missing epgd binary
- removed vdr-devel dependencies
- placed libepg in %%{_libdir}
* Thu Apr 24 2014 Martin Gansser <martinkg@fedoraproject.org> - 0.1.0-1.20140424gita9d880b
- rebuild for initial release