SRS 6.0-b0 源码 + danmaku 后端(排除 objs/3rdparty/测试媒体)
This commit is contained in:
Executable
+11
@@ -0,0 +1,11 @@
|
||||
for /f "tokens=2*" %%i in ('REG QUERY "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\srs\ins_dir"') do set srs_home=%%j
|
||||
|
||||
echo %srs_home%
|
||||
|
||||
for %%I in ("%srs_home%") do set srs_disk=%%~dI
|
||||
|
||||
cd %srs_home%
|
||||
@%srs_disk%
|
||||
|
||||
objs\srs.exe -c conf\console.conf
|
||||
cmd
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
for /f "tokens=2*" %%i in ('REG QUERY "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\srs\ins_dir"') do set srs_home=%%j
|
||||
|
||||
echo %srs_home%
|
||||
|
||||
for %%I in ("%srs_home%") do set srs_disk=%%~dI
|
||||
|
||||
cd %srs_home%
|
||||
@%srs_disk%
|
||||
|
||||
objs\srs.exe -c conf\live.conf
|
||||
cmd
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
for /f "tokens=2*" %%i in ('REG QUERY "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\srs\ins_dir"') do set srs_home=%%j
|
||||
|
||||
echo %srs_home%
|
||||
|
||||
for %%I in ("%srs_home%") do set srs_disk=%%~dI
|
||||
|
||||
cd %srs_home%
|
||||
@%srs_disk%
|
||||
|
||||
objs\srs.exe -c conf\rtc.conf
|
||||
cmd
|
||||
Executable
+153
@@ -0,0 +1,153 @@
|
||||
; Script generated by the HM NIS Edit Script Wizard.
|
||||
; See https://nsis.sourceforge.io/Download
|
||||
; "C:\Program Files (x86)\NSIS\makensis.exe" /DSRS_VERSION=5.0.89 /DCYGWIN_DIR="C:\tools\cygwin" srs.nsi
|
||||
; "/cygdrive/c/Program Files (x86)/NSIS/makensis.exe" /DSRS_VERSION=5.0.89 /DCYGWIN_DIR="C:\cygwin64" srs.nsi
|
||||
; "/cygdrive/c/Program Files (x86)/NSIS/makensis.exe" /DSRS_VERSION=$(./objs/srs.exe -v 2>&1) /DCYGWIN_DIR="C:\cygwin64" packaging/nsis/srs.nsi
|
||||
|
||||
; HM NIS Edit Wizard helper defines
|
||||
!define PRODUCT_NAME "SRS"
|
||||
!define PRODUCT_VERSION "${SRS_VERSION}"
|
||||
!define PRODUCT_PUBLISHER "ossrs"
|
||||
!define PRODUCT_WEB_SITE "https://ossrs.io"
|
||||
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\srs.exe"
|
||||
!define PRODUCT_INSTALL_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\srs\ins_dir"
|
||||
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
|
||||
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
|
||||
|
||||
; MUI 1.67 compatible ------
|
||||
!include "MUI.nsh"
|
||||
|
||||
; MUI Settings
|
||||
!define MUI_ABORTWARNING
|
||||
!define MUI_ICON "..\..\doc\srs-logo.ico"
|
||||
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
|
||||
|
||||
; Welcome page
|
||||
!insertmacro MUI_PAGE_WELCOME
|
||||
; License page
|
||||
!insertmacro MUI_PAGE_LICENSE "..\..\..\LICENSE"
|
||||
; Directory page
|
||||
!insertmacro MUI_PAGE_DIRECTORY
|
||||
; Instfiles page
|
||||
!insertmacro MUI_PAGE_INSTFILES
|
||||
; Finish page
|
||||
;!define MUI_FINISHPAGE_RUN "$INSTDIR\srs-cli.bat"
|
||||
!insertmacro MUI_PAGE_FINISH
|
||||
|
||||
; Uninstaller pages
|
||||
!insertmacro MUI_UNPAGE_INSTFILES
|
||||
|
||||
; Language files
|
||||
!insertmacro MUI_LANGUAGE "English"
|
||||
|
||||
; MUI end ------
|
||||
|
||||
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
|
||||
OutFile "SRS-Windows-x86_64-${PRODUCT_VERSION}-setup.exe"
|
||||
InstallDir "$PROGRAMFILES\SRS"
|
||||
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
|
||||
ShowInstDetails show
|
||||
ShowUnInstDetails show
|
||||
|
||||
Section "MainSection" SEC01
|
||||
SetOutPath "$INSTDIR"
|
||||
SetOverwrite ifnewer
|
||||
File "..\..\..\LICENSE"
|
||||
File ".\*.bat"
|
||||
SetOutPath "$INSTDIR\conf"
|
||||
SetOverwrite try
|
||||
File "..\..\conf\*.conf"
|
||||
SetOutPath "$INSTDIR\logo"
|
||||
File "..\..\doc\srs-logo.ico"
|
||||
SetOutPath "$INSTDIR\objs"
|
||||
File "${CYGWIN_DIR}\bin\cyggcc_s-seh-1.dll"
|
||||
File "${CYGWIN_DIR}\bin\cygstdc++-6.dll"
|
||||
File "${CYGWIN_DIR}\bin\cygwin1.dll"
|
||||
SetOutPath "$INSTDIR\objs\nginx\html"
|
||||
File "..\..\objs\nginx\html\nginx.html"
|
||||
File "..\..\objs\nginx\html\favicon.ico"
|
||||
File "..\..\objs\nginx\html\index.html"
|
||||
SetOutPath "$INSTDIR\objs\nginx\html\live"
|
||||
File "..\..\objs\nginx\html\live\livestream.html"
|
||||
SetOutPath "$INSTDIR\objs\nginx\html\console"
|
||||
File /r "..\..\objs\nginx\html\console\"
|
||||
SetOutPath "$INSTDIR\objs\nginx\html\demos"
|
||||
File /r "..\..\objs\nginx\html\demos\"
|
||||
SetOutPath "$INSTDIR\objs\nginx\html\players"
|
||||
File /r "..\..\objs\nginx\html\players\"
|
||||
SetOutPath "$INSTDIR\objs"
|
||||
File "..\..\objs\srs.exe"
|
||||
File ".\srs.pid"
|
||||
SetOutPath "$INSTDIR"
|
||||
CreateDirectory "$SMPROGRAMS\SRS"
|
||||
CreateShortCut "$SMPROGRAMS\SRS\SRS.lnk" "$INSTDIR\srs-cli.bat" "" "$INSTDIR\logo\srs-logo.ico"
|
||||
CreateShortCut "$DESKTOP\SRS.lnk" "$INSTDIR\srs-cli.bat" "" "$INSTDIR\logo\srs-logo.ico"
|
||||
SectionEnd
|
||||
|
||||
Section -AdditionalIcons
|
||||
SetOutPath $INSTDIR
|
||||
CreateShortCut "$SMPROGRAMS\SRS\Uninstall.lnk" "$INSTDIR\uninst.exe"
|
||||
SectionEnd
|
||||
|
||||
Section -Post
|
||||
WriteUninstaller "$INSTDIR\uninst.exe"
|
||||
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\objs\srs.exe"
|
||||
WriteRegStr HKLM "${PRODUCT_INSTALL_REGKEY}" "" "$INSTDIR"
|
||||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
|
||||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
|
||||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\objs\srs.exe"
|
||||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
|
||||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
|
||||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
|
||||
SectionEnd
|
||||
|
||||
|
||||
Function un.onUninstSuccess
|
||||
HideWindow
|
||||
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) is removed from your computer."
|
||||
FunctionEnd
|
||||
|
||||
Function un.onInit
|
||||
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Uninstall $(^Name) from your computer?" IDYES +2
|
||||
Abort
|
||||
FunctionEnd
|
||||
|
||||
Section Uninstall
|
||||
Delete "$INSTDIR\uninst.exe"
|
||||
Delete "$INSTDIR\objs\srs.pid"
|
||||
Delete "$INSTDIR\objs\srs.exe"
|
||||
Delete "$INSTDIR\objs\nginx\html\nginx.html"
|
||||
Delete "$INSTDIR\objs\nginx\html\live\livestream.html"
|
||||
Delete "$INSTDIR\objs\nginx\html\index.html"
|
||||
Delete "$INSTDIR\objs\nginx\html\favicon.ico"
|
||||
Delete "$INSTDIR\objs\cygwin1.dll"
|
||||
Delete "$INSTDIR\objs\cygstdc++-6.dll"
|
||||
Delete "$INSTDIR\objs\cyggcc_s-seh-1.dll"
|
||||
Delete "$INSTDIR\logo\srs-logo.ico"
|
||||
Delete "$INSTDIR\conf\*.conf"
|
||||
Delete "$INSTDIR\LICENSE"
|
||||
Delete "$INSTDIR\srs-cli.bat"
|
||||
Delete "$INSTDIR\srs-live.bat"
|
||||
Delete "$INSTDIR\srs-rtc.bat"
|
||||
|
||||
Delete "$SMPROGRAMS\SRS\Uninstall.lnk"
|
||||
Delete "$DESKTOP\SRS.lnk"
|
||||
Delete "$SMPROGRAMS\SRS\SRS.lnk"
|
||||
|
||||
RMDir "$SMPROGRAMS\SRS"
|
||||
RMDir /r "$INSTDIR\objs\nginx\html\players"
|
||||
RMDir /r "$INSTDIR\objs\nginx\html\demos"
|
||||
RMDir /r "$INSTDIR\objs\nginx\html\console"
|
||||
RMDir "$INSTDIR\objs\nginx\html\live"
|
||||
RMDir "$INSTDIR\objs\nginx\html"
|
||||
RMDir "$INSTDIR\objs\nginx"
|
||||
RMDir "$INSTDIR\objs"
|
||||
RMDir "$INSTDIR\logo"
|
||||
RMDir "$INSTDIR\conf"
|
||||
RMDir "$INSTDIR"
|
||||
|
||||
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
|
||||
DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
|
||||
DeleteRegKey HKLM "${PRODUCT_INSTALL_REGKEY}"
|
||||
SetAutoClose true
|
||||
SectionEnd
|
||||
Executable
Executable
+50
@@ -0,0 +1,50 @@
|
||||
# main config for srs.
|
||||
# @see full.conf for detail config.
|
||||
|
||||
daemon off;
|
||||
pid /var/lib/srs/srs.pid;
|
||||
work_dir /var/lib/srs;
|
||||
listen 1935;
|
||||
max_connections 1000;
|
||||
srs_log_tank file;
|
||||
srs_log_file /var/log/srs/srs.log;
|
||||
|
||||
http_api {
|
||||
enabled on;
|
||||
listen 1985;
|
||||
}
|
||||
|
||||
http_server {
|
||||
enabled on;
|
||||
listen 8080;
|
||||
dir /usr/share/srs/html;
|
||||
}
|
||||
|
||||
rtc_server {
|
||||
enabled on;
|
||||
listen 8000;
|
||||
# @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#config-candidate
|
||||
candidate $CANDIDATE;
|
||||
}
|
||||
|
||||
stats {
|
||||
network 0;
|
||||
disk sda sdb xvda xvdb;
|
||||
}
|
||||
|
||||
vhost __defaultVhost__ {
|
||||
hls {
|
||||
enabled on;
|
||||
}
|
||||
http_remux {
|
||||
enabled on;
|
||||
mount [vhost]/[app]/[stream].flv;
|
||||
}
|
||||
rtc {
|
||||
enabled on;
|
||||
# @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#rtmp-to-rtc
|
||||
rtmp_to_rtc off;
|
||||
# @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#rtc-to-rtmp
|
||||
rtc_to_rtmp off;
|
||||
}
|
||||
}
|
||||
Executable
+76
@@ -0,0 +1,76 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# srs - a simple, high efficiency and realtime video server
|
||||
#
|
||||
# chkconfig: <default runlevel(s)> <start> <stop>
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: srs
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Description: a simple, high efficiency and realtime video server
|
||||
### END INIT INFO
|
||||
|
||||
# Source function library.
|
||||
. /etc/rc.d/init.d/functions
|
||||
|
||||
exec="/usr/bin/srs"
|
||||
prog=${exec##*/}
|
||||
configfile=/etc/srs/srs.conf
|
||||
|
||||
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
|
||||
|
||||
lockfile=/var/lock/subsys/$prog
|
||||
|
||||
start() {
|
||||
echo -n $"Starting $prog: "
|
||||
daemon --user nobody $exec -c $configfile
|
||||
retval=$?
|
||||
echo
|
||||
[ $retval -eq 0 ] && touch $lockfile
|
||||
return $retval
|
||||
}
|
||||
|
||||
stop() {
|
||||
echo -n $"Stopping $prog: "
|
||||
killproc $exec -TERM
|
||||
retval=$?
|
||||
echo
|
||||
[ $retval -eq 0 ] && rm -f $lockfile
|
||||
return $retval
|
||||
}
|
||||
|
||||
reload() {
|
||||
echo -n $"reloading $prog: "
|
||||
killproc $exec -HUP
|
||||
retval=$?
|
||||
echo
|
||||
[ $retval -eq 0 ] && rm -f $lockfile
|
||||
return $retval
|
||||
}
|
||||
|
||||
rotate() {
|
||||
echo -n $"logrotate $prog: "
|
||||
killproc $exec -USR1
|
||||
retval=$?
|
||||
echo
|
||||
[ $retval -eq 0 ] && rm -f $lockfile
|
||||
return $retval
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start|stop|restart|reload|rotate)
|
||||
$1
|
||||
;;
|
||||
status)
|
||||
status $prog
|
||||
;;
|
||||
*)
|
||||
echo $"Usage: $0 {start|stop|status|restart|reload|rotate}"
|
||||
exit 2
|
||||
esac
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
/var/log/srs/*.log {
|
||||
daily
|
||||
missingok
|
||||
rotate 30
|
||||
compress
|
||||
delaycompress
|
||||
notifempty
|
||||
create 640 root nobody
|
||||
sharedscripts
|
||||
postrotate
|
||||
if [ -f /var/lib/srs/srs.pid ]; then
|
||||
kill -USR1 `cat /var/lib/srs/srs.pid`
|
||||
fi
|
||||
endscript
|
||||
}
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
[Unit]
|
||||
Description=srs - a simple, high efficiency and realtime video server
|
||||
Documentation=https://github.com/ossrs/srs/wiki
|
||||
After=network-online.target remote-fs.target nss-lookup.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=nobody
|
||||
Group=nobody
|
||||
WorkingDirectory=/var/lib/srs
|
||||
EnvironmentFile=-/etc/sysconfig/srs
|
||||
PIDFile=/var/lib/srs/srs.pid
|
||||
ExecStartPre=/usr/bin/srs -c /etc/srs/srs.conf -t
|
||||
ExecStart=/usr/bin/srs -c /etc/srs/srs.conf
|
||||
ExecReload=/bin/kill -s HUP $MAINPID
|
||||
ExecStop=/bin/kill -s TERM $MAINPID
|
||||
Restart=on-failure
|
||||
PrivateTmp=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
Executable
+103
@@ -0,0 +1,103 @@
|
||||
%define use_systemd (0%{?fedora} && 0%{?fedora} >= 18) || (0%{?rhel} && 0%{?rhel} >= 7) || (0%{?suse_version} == 1315)
|
||||
|
||||
Name: srs
|
||||
Version: 3.0.168
|
||||
Release: 1%{?dist}
|
||||
Summary: a simple, high efficiency and realtime video server
|
||||
|
||||
License: MIT
|
||||
URL: https://github.com/ossrs/srs
|
||||
Source0: %{name}-3.0-r8.tar.gz
|
||||
Source1: srs.conf
|
||||
Source2: srs.service
|
||||
Source3: srs.init
|
||||
Source4: srs.logrotate
|
||||
|
||||
BuildRequires: python
|
||||
BuildRequires: rsync
|
||||
|
||||
%if %{use_systemd}
|
||||
BuildRequires: systemd
|
||||
Requires: systemd
|
||||
%else
|
||||
BuildRequires: initscripts
|
||||
Requires: initscripts
|
||||
%endif
|
||||
|
||||
%description
|
||||
SRS is a simple, high efficiency and realtime video server, supports RTMP/WebRTC/HLS/HTTP-FLV/SRT.
|
||||
|
||||
%prep
|
||||
%setup -q -n srs-3.0-r8
|
||||
|
||||
%build
|
||||
cd trunk
|
||||
./configure --prefix=/usr
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%{__mkdir_p} $RPM_BUILD_ROOT%{_bindir}
|
||||
%{__mkdir_p} $RPM_BUILD_ROOT%{_initrddir}
|
||||
%{__mkdir_p} $RPM_BUILD_ROOT%{_datadir}/%{name}
|
||||
%{__mkdir_p} $RPM_BUILD_ROOT%{_sharedstatedir}/%{name}
|
||||
%{__mkdir_p} $RPM_BUILD_ROOT%{_localstatedir}/log/%{name}
|
||||
|
||||
%{__install} -m 755 trunk/objs/srs $RPM_BUILD_ROOT%{_bindir}
|
||||
|
||||
#http_server file
|
||||
rsync -aqL --delete trunk/objs/nginx/ $RPM_BUILD_ROOT%{_datadir}/%{name}/
|
||||
|
||||
#%{__mkdir_p} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
|
||||
%{__install} -D -m 644 trunk/packaging/redhat/srs.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/srs.conf
|
||||
|
||||
#init files
|
||||
%if %{use_systemd}
|
||||
%{__mkdir} -p $RPM_BUILD_ROOT%{_unitdir}
|
||||
%{__install} -p -m 644 trunk/packaging/redhat/srs.service $RPM_BUILD_ROOT%{_unitdir}/srs.service
|
||||
%else
|
||||
%{__mkdir} -p $RPM_BUILD_ROOT%{_initrddir}
|
||||
%{__install} -p -m 755 trunk/packaging/redhat/srs.init $RPM_BUILD_ROOT%{_initrddir}/srs
|
||||
sed -i 's/daemon/{s/off/on/g}' %{_sysconfdir}/%{name}/srs.conf
|
||||
%endif
|
||||
|
||||
#logrotate
|
||||
%{__install} -D -p -m 644 trunk/packaging/redhat/srs.logrotate $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/srs
|
||||
|
||||
|
||||
%pre
|
||||
# Add the "srs" user
|
||||
# getent group srs >/dev/null || groupadd -r srs
|
||||
# getent passwd srs >/dev/null || useradd -r -g srs -s /sbin/nologin -d /var/lib/srs srs
|
||||
|
||||
%post
|
||||
%if %{use_systemd}
|
||||
%systemd_post %{name}.service
|
||||
%endif
|
||||
|
||||
%preun
|
||||
%if %{use_systemd}
|
||||
%systemd_preun %{name}.service
|
||||
%endif
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%{_bindir}/*
|
||||
%config(noreplace) %{_sysconfdir}/srs/srs.conf
|
||||
%{_sysconfdir}/logrotate.d/srs
|
||||
%{_datadir}/%{name}
|
||||
%dir %attr(0755, nobody, nobody) %{_localstatedir}/log/%{name}
|
||||
%dir %attr(0755, nobody, nobody) %{_sharedstatedir}/%{name}
|
||||
%doc trunk/conf
|
||||
%license LICENSE
|
||||
|
||||
%if %{use_systemd}
|
||||
%{_unitdir}/srs.service
|
||||
%else
|
||||
%{_initrddir}/%{name}
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Mon Nov 1 2021 Purple Grape <purplegrape4@gmail.com>
|
||||
- rpm init
|
||||
Reference in New Issue
Block a user