]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Add basic RPM build support
authorJaroslav Kysela <perex@perex.cz>
Mon, 13 Oct 2014 17:58:50 +0000 (19:58 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 13 Oct 2014 18:05:08 +0000 (20:05 +0200)
.gitignore
rpm/Makefile [new file with mode: 0644]
rpm/tvheadend.service [new file with mode: 0644]
rpm/tvheadend.spec.in [new file with mode: 0644]
rpm/tvheadend.sysconfig [new file with mode: 0644]

index 191c2fee7db8c5f50a62e688bb07d9dab62606cf..160ff5279c36f85cd3047831bfb4f09b8d576cab 100644 (file)
@@ -22,3 +22,6 @@ debian/tvheadend
 debian/tvheadend-dbg
 debian/tvheadend*substvars
 debian/tvheadend*.debhelper*
+
+rpm/tvheadend.spec
+rpm/test.patch
diff --git a/rpm/Makefile b/rpm/Makefile
new file mode 100644 (file)
index 0000000..5a9d889
--- /dev/null
@@ -0,0 +1,32 @@
+#
+#  RPM build
+#  Copyright (C) 2014 Jaroslav Kysela
+#
+#  This program is free software: you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation, either version 3 of the License, or
+#  (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+
+include $(dir $(lastword $(MAKEFILE_LIST)))../.config.mk
+
+COMMIT   ?= $(shell git rev-parse HEAD)
+COMMIT1   = $(shell git rev-parse $(COMMIT))
+VERSION   = $(shell cd .. && git describe --match "v*" $(COMMIT1) | sed 's/-/./g' )
+
+tvheadend.spec: tvheadend.spec.in
+       @sed -e 's/@VERSION@/$(VERSION)/g' \
+            -e 's/@COMMIT@/$(COMMIT1)/g' \
+               $< > $@
+
+build: tvheadend.spec
+       spectool --get-files --sourcedir tvheadend.spec
+       rpmbuild -ba tvheadend.spec
diff --git a/rpm/tvheadend.service b/rpm/tvheadend.service
new file mode 100644 (file)
index 0000000..78d4b07
--- /dev/null
@@ -0,0 +1,14 @@
+[Unit]
+Description=Tvheadend - a TV streaming server and DVR
+After=syslog.target network.target auditd.service
+
+[Service]
+EnvironmentFile=/etc/sysconfig/tvheadend
+ExecStart=/usr/bin/tvheadend -f -p /var/run/tvheadend.pid -u $OPTIONS
+PIDFile=/var/run/tvheadend.pid
+Type=forking
+Restart=on-failure
+RestartSec=54s
+
+[Install]
+WantedBy=multi-user.target
diff --git a/rpm/tvheadend.spec.in b/rpm/tvheadend.spec.in
new file mode 100644 (file)
index 0000000..c808f6d
--- /dev/null
@@ -0,0 +1,50 @@
+%global commit @COMMIT@
+%global shortcommit %(c=%{commit}; echo ${c:0:7})
+
+Summary:        Tvheadend - a TV streaming server and DVR
+Name:           tvheadend
+Version:        @VERSION@
+Release:        1
+
+License:        GPLv3
+Group:          Applications/Multimedia
+URL:            http://tvheadend.org
+
+Source:                https://github.com/tvheadend/tvheadend/archive/%{commit}/tvheadend-%{commit}.tar.gz
+#Patch999:      test.patch
+
+BuildRequires:  systemd-units >= 1
+BuildRequires:  dbus-devel
+BuildRequires:  avahi-libs
+BuildRequires:  openssl-devel
+BuildRequires:  git wget
+
+Requires:       systemd-units >= 1
+
+%description
+Tvheadend is a TV streaming server with DVR for Linux supporting
+DVB, ATSC, IPTV, SAT>IP as input sources. Can be used as a backend
+to Showtime, XBMC and various other clients.
+
+%prep
+%setup -q -n tvheadend-%{commit}
+#%patch999 -p1 -b .test
+
+%build
+%configure --disable-lockowner --enable-bundle --enable-libffmpeg_static
+%{__make}
+
+%install
+# binary
+mkdir -p -m755 %{buildroot}%{_bindir}
+install -p -m 755 build.linux/tvheadend %{buildroot}%{_bindir}
+# systemd
+mkdir -p -m755 %{buildroot}%{_sysconfdir}/sysconfig
+install -p -m 644 rpm/tvheadend.sysconfig %{buildroot}%{_sysconfdir}/sysconfig
+mkdir -p -m755 %{buildroot}%{_unitdir}
+install -p -m 644 rpm/tvheadend.service %{buildroot}%{_unitdir}
+
+%files
+%{_bindir}/*
+%{_sysconfdir}/sysconfig/*
+%{_unitdir}/*
diff --git a/rpm/tvheadend.sysconfig b/rpm/tvheadend.sysconfig
new file mode 100644 (file)
index 0000000..d62f751
--- /dev/null
@@ -0,0 +1,3 @@
+# Configuration file for the tvheadend service.
+
+OPTIONS="-u tvheadend -g tvheadend -6 --http_port=9981 --htsp_port=9982"