]> git.pld-linux.org Git - SPECS.git/blob - hitch.spec
SPECS updated Sat 31 Jul 20:26:02 CEST 2021
[SPECS.git] / hitch.spec
1 #
2 # Conditional build:
3 %bcond_with     tests           # run tests. needs internet connection
4 %bcond_without  doc             # build documentation (man page)
5
6 Summary:        Network proxy that terminates TLS/SSL connections
7 Name:           hitch
8 Version:        1.4.6
9 Release:        3
10 License:        BSD
11 Group:          Daemons
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
24 %if %{with doc}
25 BuildRequires:  docutils
26 %endif
27 Provides:       group(hitch)
28 Provides:       user(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
37 Requires:       rc-scripts
38 Requires:       systemd-units >= 0.38
39 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40
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
46
47 %description
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
51 machines.
52
53 %prep
54 %setup -q
55 cp -p hitch.conf.example hitch.conf
56 %patch0
57 %patch1
58 %patch2 -p1
59
60 %build
61 CFLAGS="%{rpmcflags} -fPIE"
62 LDFLAGS="-pie"
63 %configure \
64         --disable-silent-rules
65 %{__make}
66
67 %if %{with tests}
68 cd src/tests
69 ./runtests
70 %endif
71
72 %install
73 rm -rf $RPM_BUILD_ROOT
74 %{__make} install \
75         DESTDIR=$RPM_BUILD_ROOT
76
77 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
78
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
88
89 %clean
90 rm -rf $RPM_BUILD_ROOT
91
92 %pre
93 %groupadd -g 334 %{hitch_group}
94 %useradd -u 334 -g %{hitch_group} -s /sbin/nologin -d %{hitch_homedir} %{hitch_user}
95
96 %post
97 %systemd_post hitch.service
98 %tmpfiles_create %{systemdtmpfilesdir}/hitch.conf
99 /sbin/chkconfig --add hitch
100 %service hitch restart
101
102 %preun
103 %systemd_preun hitch.service
104 %service hitch stop
105 /sbin/chkconfig --del hitch
106
107 %postun
108 %systemd_postun_with_restart hitch.service
109 if [ "$1" = "0" ]; then
110         %userremove %{hitch_user}
111         %groupremove %{hitch_group}
112 fi
113
114 %files
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
121 %if %{with doc}
122 %{_mandir}/man5/hitch.conf.5*
123 %{_mandir}/man8/hitch.8*
124 %endif
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
This page took 0.251941 seconds and 3 git commands to generate.