Compare commits
2 Commits
Release32-
...
Release32
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7af6f475da | ||
|
|
c3b6560b46 |
63
package/redhat/smartdns.spec
Normal file
63
package/redhat/smartdns.spec
Normal file
@@ -0,0 +1,63 @@
|
||||
Name: smartdns
|
||||
Version: 31
|
||||
Release: 1%{?dist}
|
||||
Summary: smartdns
|
||||
|
||||
License: GPL 3.0
|
||||
URL: https://github.com/pymumu/smartdns
|
||||
Source0: smartdns-Release31.tar.gz
|
||||
|
||||
BuildRequires: glibc
|
||||
Requires: glibc
|
||||
Requires: systemd
|
||||
|
||||
%description
|
||||
A local DNS server to obtain the fastest website IP for the best Internet experience.
|
||||
|
||||
%prep
|
||||
%setup -q -n smartdns-Release31
|
||||
|
||||
%build
|
||||
cd src
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%{__install} -D -m 755 src/smartdns $RPM_BUILD_ROOT%{_sbindir}/smartdns
|
||||
%{__install} -D -m 644 etc/smartdns/smartdns.conf $RPM_BUILD_ROOT%{_sysconfdir}/smartdns/smartdns.conf
|
||||
%{__install} -D -m 644 systemd/smartdns.service.in $RPM_BUILD_ROOT%{_unitdir}/smartdns.service
|
||||
|
||||
|
||||
cat > $RPM_BUILD_ROOT%{_unitdir}/smartdns.service <<EOF
|
||||
[Unit]
|
||||
Description=smartdns
|
||||
ConditionFileIsExecutable=/usr/sbin/smartdns
|
||||
After=syslog.target network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/sbin/smartdns -c /etc/smartdns/smartdns.conf -f
|
||||
PIDFile=/run/smartdns.pid
|
||||
Restart=on-failure
|
||||
KillMode=process
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%{_sbindir}/smartdns
|
||||
%config(noreplace) %{_sysconfdir}/smartdns/smartdns.conf
|
||||
%{_unitdir}/smartdns.service
|
||||
|
||||
%post
|
||||
%systemd_post %{name}.service
|
||||
|
||||
%preun
|
||||
%systemd_preun %{name}.service
|
||||
|
||||
%postun
|
||||
%systemd_postun_with_restart %{name}.service
|
||||
@@ -862,7 +862,7 @@ static int _dns_client_server_add(char *server_ip, char *server_host, int port,
|
||||
|
||||
SSL_CTX_set_options(server_info->ssl_ctx, SSL_OP_ALL | SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION);
|
||||
SSL_CTX_set_session_cache_mode(server_info->ssl_ctx, SSL_SESS_CACHE_CLIENT);
|
||||
SSL_CTX_sess_set_cache_size(server_info->ssl_ctx, 64);
|
||||
SSL_CTX_sess_set_cache_size(server_info->ssl_ctx, 1);
|
||||
if (_dns_client_set_trusted_cert(server_info->ssl_ctx) != 0) {
|
||||
tlog(TLOG_WARN, "disable check certificate for %s.", server_info->ip);
|
||||
server_info->skip_check_cert = 1;
|
||||
|
||||
Reference in New Issue
Block a user