From cec807ab5a3bd9b78f3b51016e7d03625ae754c5d83c69ec2d2971874c8d8438 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Wed, 13 Mar 2019 10:03:05 +0000 Subject: [PATCH 1/2] Accepting request 684560 from home:jmoellers:branches:network OBS-URL: https://build.opensuse.org/request/show/684560 OBS-URL: https://build.opensuse.org/package/show/network/pen?expand=0&rev=5 --- pen.changes | 6 ++++++ pen.service | 9 +++++++++ pen.spec | 29 ++++++++++++++++++----------- 3 files changed, 33 insertions(+), 11 deletions(-) create mode 100644 pen.service diff --git a/pen.changes b/pen.changes index dee0670..e93de89 100644 --- a/pen.changes +++ b/pen.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Mar 12 14:48:32 UTC 2019 - josef.moellers@suse.com + +- Added systemd support. + [bsc#1116032, pen.service] + ------------------------------------------------------------------- Tue Feb 10 18:02:56 UTC 2015 - sfalken@opensuse.org diff --git a/pen.service b/pen.service new file mode 100644 index 0000000..9d9f3db --- /dev/null +++ b/pen.service @@ -0,0 +1,9 @@ +[Unit] +Description=A simple load balancer for tcp based protocols +After=time-sync.target nss-lookup.target syslog.socket remote-fs.target +[Service] +Type=forking +ExecStart=/usr/share/pen/scripts/rcpen start +ExecStop=/usr/share/pen/scripts/rcpen stop +[Install] +WantedBy=multi-user.system diff --git a/pen.spec b/pen.spec index 20ef8a8..7889e0c 100644 --- a/pen.spec +++ b/pen.spec @@ -1,7 +1,7 @@ # # spec file for package pen # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -27,6 +27,7 @@ Source0: http://siag.nu/pub/pen/%{name}-%{version}.tar.gz Source1: %{name}.cfg Source2: init.%{name} Source3: runpen.sh +Source4: pen.service PreReq: %insserv_prereq %fillup_prereq BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -72,32 +73,38 @@ mkdir -p $RPM_BUILD_ROOT/%_sbindir #make DESTDIR="$RPM_BUILD_ROOT" install %makeinstall # Install pen init script -mkdir -p $RPM_BUILD_ROOT/etc/init.d -install -m 0744 %SOURCE2 $RPM_BUILD_ROOT/etc/init.d/%{name} +install -d $RPM_BUILD_ROOT%{_datadir}/pen/scripts +install -m 0744 %SOURCE2 $RPM_BUILD_ROOT%{_datadir}/pen/scripts/rcpen +install -d $RPM_BUILD_ROOT%{_unitdir} +install -m 0444 %SOURCE4 $RPM_BUILD_ROOT%{_unitdir}/pen.service install -m 0744 %SOURCE3 $RPM_BUILD_ROOT/usr/bin/runpen.sh +install -d $RPM_BUILD_ROOT/etc install -m 0644 %SOURCE1 $RPM_BUILD_ROOT/etc/%{name}.cfg -ln -sf ../../etc/init.d/%{name} $RPM_BUILD_ROOT/usr/sbin/rc%{name} +ln -sf service $RPM_BUILD_ROOT/usr/sbin/rcpen mkdir -p ${RPM_BUILD_ROOT}%{_docdir} mv $RPM_BUILD_ROOT/usr/doc/pen ${RPM_BUILD_ROOT}%{_docdir} %clean rm -rf ${RPM_BUILD_ROOT} -%post -%{fillup_and_insserv -n pen pen} +%pre +%service_add_pre pen.service -%postun -%restart_on_update %{name} -%insserv_cleanup +%post +%service_add_post pen.service %preun -%stop_on_removal %{name} +%service_del_preun pen.service + +%postun +%service_del_postun pen.service %files %defattr(-,root,root) %{_docdir}/* %{_mandir}/man1/*.1.gz -/etc/init.d/%{name} +%{_datadir}/pen +%{_unitdir}/pen.service /usr/bin/%{name} /usr/bin/runpen.sh /usr/bin/mergelogs From d3dd09a8ece590a4e2cb82cc7fd9affc52de9af2da52f385e8ec7c06c73e6f4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Thu, 14 Mar 2019 12:36:22 +0000 Subject: [PATCH 2/2] Accepting request 684994 from home:jengelh:branches:network - Feed through spec-cleaner. Trim undesirable author list. - Drop unused PreReq, and add needed systemd-rpm-macros instead. OBS-URL: https://build.opensuse.org/request/show/684994 OBS-URL: https://build.opensuse.org/package/show/network/pen?expand=0&rev=6 --- pen.changes | 6 +++++ pen.service | 9 ------- pen.spec | 75 +++++++++++++++++++++++------------------------------ 3 files changed, 38 insertions(+), 52 deletions(-) delete mode 100644 pen.service diff --git a/pen.changes b/pen.changes index e93de89..34ef7f0 100644 --- a/pen.changes +++ b/pen.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Mar 14 12:08:47 UTC 2019 - Jan Engelhardt + +- Feed through spec-cleaner. Trim undesirable author list. +- Drop unused PreReq, and add needed systemd-rpm-macros instead. + ------------------------------------------------------------------- Tue Mar 12 14:48:32 UTC 2019 - josef.moellers@suse.com diff --git a/pen.service b/pen.service deleted file mode 100644 index 9d9f3db..0000000 --- a/pen.service +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description=A simple load balancer for tcp based protocols -After=time-sync.target nss-lookup.target syslog.socket remote-fs.target -[Service] -Type=forking -ExecStart=/usr/share/pen/scripts/rcpen start -ExecStop=/usr/share/pen/scripts/rcpen stop -[Install] -WantedBy=multi-user.system diff --git a/pen.spec b/pen.spec index 7889e0c..863ef84 100644 --- a/pen.spec +++ b/pen.spec @@ -12,28 +12,28 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # Name: pen -Summary: A simple load balancer for tcp based protocols -License: GPL-2.0+ -Group: Productivity/Clustering/HA -Url: http://siag.nu/pen/ Version: 0.26.1 Release: 0 +Summary: A simple load balancer for TCP-based protocols +License: GPL-2.0-or-later +Group: Productivity/Clustering/HA +URL: http://siag.nu/pen/ Source0: http://siag.nu/pub/pen/%{name}-%{version}.tar.gz Source1: %{name}.cfg Source2: init.%{name} Source3: runpen.sh Source4: pen.service -PreReq: %insserv_prereq %fillup_prereq -BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildRequires: systemd-rpm-macros +%systemd_requires %description -Pen is a load balancer for "simple" tcp based protocols such as http or -smtp. It allows several servers to appear as one to the outside and +Pen is a load balancer for "simple" TCP-based protocols such as HTTP or +SMTP. It allows several servers to appear as one to the outside and automatically detects servers that are down and distributes clients among the available servers. This gives high availability and scalable performance. @@ -52,13 +52,7 @@ available, even when individual servers are brought down for maintenance or reconfiguration. The final single point of failure, pen itself, can be eliminated by -running pen on several servers, using vrrp to decide which is active. - - - -Authors: --------- - Ulric Eriksson +running pen on several servers, using VRRP to decide which is active. %prep %setup -q @@ -66,26 +60,22 @@ Authors: %build %configure \ --with-daemon -make %{?jobs:-j%jobs} +make %{?_smp_mflags} %install -mkdir -p $RPM_BUILD_ROOT/%_sbindir -#make DESTDIR="$RPM_BUILD_ROOT" install -%makeinstall +mkdir -p %{buildroot}/%{_sbindir} +%make_install # Install pen init script -install -d $RPM_BUILD_ROOT%{_datadir}/pen/scripts -install -m 0744 %SOURCE2 $RPM_BUILD_ROOT%{_datadir}/pen/scripts/rcpen -install -d $RPM_BUILD_ROOT%{_unitdir} -install -m 0444 %SOURCE4 $RPM_BUILD_ROOT%{_unitdir}/pen.service -install -m 0744 %SOURCE3 $RPM_BUILD_ROOT/usr/bin/runpen.sh -install -d $RPM_BUILD_ROOT/etc -install -m 0644 %SOURCE1 $RPM_BUILD_ROOT/etc/%{name}.cfg -ln -sf service $RPM_BUILD_ROOT/usr/sbin/rcpen -mkdir -p ${RPM_BUILD_ROOT}%{_docdir} -mv $RPM_BUILD_ROOT/usr/doc/pen ${RPM_BUILD_ROOT}%{_docdir} - -%clean -rm -rf ${RPM_BUILD_ROOT} +install -d %{buildroot}/%{_datadir}/pen/scripts +install -m 0744 %{SOURCE2} %{buildroot}/%{_datadir}/pen/scripts/rcpen +install -d %{buildroot}/%{_unitdir} +install -m 0444 %{SOURCE4} %{buildroot}/%{_unitdir}/pen.service +install -m 0744 %{SOURCE3} %{buildroot}%{_bindir}/runpen.sh +install -d %{buildroot}%{_sysconfdir} +install -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/%{name}.cfg +ln -sf service %{buildroot}%{_sbindir}/rcpen +mkdir -p %{buildroot}/%{_docdir} +mv %{buildroot}%{_prefix}/doc/pen %{buildroot}/%{_docdir} %pre %service_add_pre pen.service @@ -100,18 +90,17 @@ rm -rf ${RPM_BUILD_ROOT} %service_del_postun pen.service %files -%defattr(-,root,root) %{_docdir}/* -%{_mandir}/man1/*.1.gz +%{_mandir}/man1/*.1%{?ext_man} %{_datadir}/pen %{_unitdir}/pen.service -/usr/bin/%{name} -/usr/bin/runpen.sh -/usr/bin/mergelogs -/usr/bin/penctl -/usr/bin/penlog -/usr/bin/penlogd -/usr/sbin/rc%{name} -%config(noreplace) /etc/%{name}.cfg +%{_bindir}/%{name} +%{_bindir}/runpen.sh +%{_bindir}/mergelogs +%{_bindir}/penctl +%{_bindir}/penlog +%{_bindir}/penlogd +%{_sbindir}/rc%{name} +%config(noreplace) %{_sysconfdir}/%{name}.cfg %changelog