Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
RPM build - config fixes
  • Loading branch information
perexg committed Oct 13, 2014
1 parent 45d00a3 commit 14a7de8
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion rpm/Makefile
Expand Up @@ -20,7 +20,7 @@ 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' )
VERSION = $(shell cd .. && git describe --match "v*" $(COMMIT1) | sed -e 's/-/./g' -e 's/^v//g' )

tvheadend.spec: tvheadend.spec.in
@sed -e 's/@VERSION@/$(VERSION)/g' \
Expand Down
24 changes: 23 additions & 1 deletion rpm/tvheadend.spec.in
Expand Up @@ -31,6 +31,7 @@ to Showtime, XBMC and various other clients.
#%patch999 -p1 -b .test

%build
echo %{version} > %{_builddir}/%{buildsubdir}/rpm/version
%configure --disable-lockowner --enable-bundle --enable-libffmpeg_static
%{__make}

Expand All @@ -40,10 +41,31 @@ 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
install -p -m 644 rpm/tvheadend.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/tvheadend
mkdir -p -m755 %{buildroot}%{_unitdir}
install -p -m 644 rpm/tvheadend.service %{buildroot}%{_unitdir}

%pre
getent group tvheadend >/dev/null || groupadd -f -g 283 -r tvheadend
if ! getent passwd tvheadend > /dev/null ; then
if ! getent passwd 283 > /dev/null ; then
useradd -r -l -u 283 -g tvheadend -d /home/tvheadend -s /sbin/nologin -c "Tvheadend TV server" tvheadend
else
useradd -r -l -g tvheadend -d /home/tvheadend -s /sbin/nologin -c "Tvheadend TV server" tvheadend
fi
fi
if ! test -d /home/tvheadend ; then
mkdir -m 0755 /home/tvheadend || exit 1
chown tvheadend.tvheadend /home/tvheadend || exit 1
fi
exit 0

%post
%systemd_post tvheadend.service

%postun
%systemd_postun_with_restart tvheadend.service

%files
%{_bindir}/*
%{_sysconfdir}/sysconfig/*
Expand Down
2 changes: 1 addition & 1 deletion rpm/tvheadend.sysconfig
@@ -1,3 +1,3 @@
# Configuration file for the tvheadend service.

OPTIONS="-u tvheadend -g tvheadend -6 --http_port=9981 --htsp_port=9982"
OPTIONS="-c /home/tvheadend/config -u tvheadend -g tvheadend -6 --http_port 9981 --htsp_port 9982"
2 changes: 2 additions & 0 deletions support/version
Expand Up @@ -17,6 +17,8 @@ if [ -d ".git" ]; then
VER=$(echo $VER | sed "s/^v//" | sed "s/-\([0-9]*\)-\(g[0-9a-f]*\)/.\1~\2/")
elif [ -f "$(dirname "$0")/../debian/changelog" ]; then
VER=$(head -1 "$(dirname "$0")/../debian/changelog" | awk '{ print $2 }' | tr -d '()' | cut -d '-' -f 1)
elif [ -r "$(dirname "$0")/rpm/version" ]; then
VER=$(cat "$(dirname "$0")/rpm/version")
else
VER="0.0.0~unknown"
fi
Expand Down

0 comments on commit 14a7de8

Please sign in to comment.