3 %bcond_with tests # run tests. needs internet connection
4 %bcond_without doc # build documentation (man page)
6 Summary: Network proxy that terminates TLS/SSL connections
12 Source0: https://hitch-tls.org/source/%{name}-%{version}.tar.gz
13 # Source0-md5: 3ae020bb5bd2b1f23c860519a89c2e35
14 Patch0: %{name}.systemd.service.patch
15 Patch1: %{name}.initrc.redhat.patch
16 Patch2: %{name}-openssl-1.1.patch
17 URL: https://hitch-tls.org/
18 BuildRequires: libev-devel >= 4
19 BuildRequires: libtool
20 BuildRequires: openssl
21 BuildRequires: openssl-devel >= 1.0.0
22 BuildRequires: pkgconfig
23 BuildRequires: rpmbuild(macros) >= 1.647
25 BuildRequires: docutils
27 Provides: group(hitch)
29 Requires(post,preun): /sbin/chkconfig
30 Requires(post,preun,postun): systemd-units >= 38
31 Requires(postun): /usr/sbin/groupdel
32 Requires(postun): /usr/sbin/userdel
33 Requires(pre): /bin/id
34 Requires(pre): /usr/bin/getgid
35 Requires(pre): /usr/sbin/groupadd
36 Requires(pre): /usr/sbin/useradd
38 Requires: systemd-units >= 0.38
39 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41 %define hitch_user hitch
42 %define hitch_group hitch
43 %define hitch_homedir %{_localstatedir}/lib/hitch
44 %define hitch_confdir %{_sysconfdir}/%{name}
45 %define hitch_datadir %{_datadir}/hitch
48 hitch is a network proxy that terminates TLS/SSL connections and
49 forwards the unencrypted traffic to some backend. It is designed to
50 handle 10s of thousands of connections efficiently on multicore
55 cp -p hitch.conf.example hitch.conf
61 CFLAGS="%{rpmcflags} -fPIE"
64 --disable-silent-rules
73 rm -rf $RPM_BUILD_ROOT
75 DESTDIR=$RPM_BUILD_ROOT
77 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
79 install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
80 cp -p hitch.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
81 install -d $RPM_BUILD_ROOT%{hitch_homedir}
82 install -d $RPM_BUILD_ROOT%{hitch_datadir}
83 install -p -D hitch.service $RPM_BUILD_ROOT%{systemdunitdir}/hitch.service
84 install -p -D hitch.tmpfilesd.conf $RPM_BUILD_ROOT%{systemdtmpfilesdir}/hitch.conf
85 install -p -D hitch.initrc.redhat $RPM_BUILD_ROOT%{_initrddir}/hitch
86 install -d $RPM_BUILD_ROOT%{_localstatedir}/run/hitch
87 touch $RPM_BUILD_ROOT%{_localstatedir}/run/hitch/hitch.pid
90 rm -rf $RPM_BUILD_ROOT
93 %groupadd -g 334 %{hitch_group}
94 %useradd -u 334 -g %{hitch_group} -s /sbin/nologin -d %{hitch_homedir} %{hitch_user}
97 %systemd_post hitch.service
98 %tmpfiles_create %{systemdtmpfilesdir}/hitch.conf
99 /sbin/chkconfig --add hitch
100 %service hitch restart
103 %systemd_preun hitch.service
105 /sbin/chkconfig --del hitch
108 %systemd_postun_with_restart hitch.service
109 if [ "$1" = "0" ]; then
110 %userremove %{hitch_user}
111 %groupremove %{hitch_group}
115 %defattr(644,root,root,755)
116 %doc README.md LICENSE CHANGES.rst hitch.conf.example
117 %dir %{_sysconfdir}/%{name}
118 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/hitch.conf
119 %attr(754,root,root) /etc/rc.d/init.d/hitch
120 %attr(755,root,root) %{_sbindir}/hitch
122 %{_mandir}/man5/hitch.conf.5*
123 %{_mandir}/man8/hitch.8*
125 %{systemdunitdir}/hitch.service
126 %{systemdtmpfilesdir}/hitch.conf
127 %define no_install_post_check_tmpfiles 1
128 %attr(755,hitch,hitch) %dir %{_localstatedir}/run/hitch
129 %attr(644,hitch,hitch) %ghost %verify(not md5 mtime size) %{_localstatedir}/run/hitch/hitch.pid