From 5efa3bf0a7ee6b931c04611ed679cbb899f3861b093cf7ee142cd917dae60f1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= Date: Tue, 6 Nov 2012 14:06:54 +0000 Subject: [PATCH] Accepting request 140288 from home:elvigia:branches:Base:System - Add Native systemd units OBS-URL: https://build.opensuse.org/request/show/140288 OBS-URL: https://build.opensuse.org/package/show/Base:System/hostapd?expand=0&rev=16 --- hostapd.changes | 5 +++++ hostapd.service | 10 ++++++++++ hostapd.spec | 14 ++++++++++++-- 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 hostapd.service diff --git a/hostapd.changes b/hostapd.changes index 9eaeb86..cf463e4 100644 --- a/hostapd.changes +++ b/hostapd.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Nov 6 04:41:17 UTC 2012 - crrodriguez@opensuse.org + +- Add Native systemd units + ------------------------------------------------------------------- Tue May 15 04:55:22 UTC 2012 - glin@suse.com diff --git a/hostapd.service b/hostapd.service new file mode 100644 index 0000000..02a394e --- /dev/null +++ b/hostapd.service @@ -0,0 +1,10 @@ +[Unit] +Description=Hostapd IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator +After=network.target + +[Service] +ExecStart=/usr/sbin/hostapd /etc/hostapd.conf +ExecReload=/bin/kill -HUP $MAINPID + +[Install] +WantedBy=multi-user.target diff --git a/hostapd.spec b/hostapd.spec index f4a35ff..b327d57 100644 --- a/hostapd.spec +++ b/hostapd.spec @@ -23,8 +23,9 @@ BuildRequires: libnl-1_1-devel BuildRequires: libnl-devel %endif BuildRequires: openssl-devel +BuildRequires: pkgconfig(systemd) Summary: Turns Your WLAN Card into a WPA capable Access Point -License: BSD-3-Clause ; GPL-2.0+ +License: BSD-3-Clause and GPL-2.0+ Group: Hardware/Wifi Version: 1.0 Release: 0 @@ -33,8 +34,10 @@ Url: http://hostap.epitest.fi/ PreReq: %insserv_prereq Source: http://hostap.epitest.fi/releases/hostapd-%{version}.tar.gz Source1: hostapd.init +Source2: hostapd.service Patch: hostapd.dif Patch1: hostapd-tmp.diff +%{?systemd_requires} %description hostapd is a user space daemon for access point and authentication @@ -60,7 +63,7 @@ cp defconfig .config %build cd hostapd -CFLAGS="$RPM_OPT_FLAGS" CC="%{__cc}" make %{?_smp_mflags} V=1 +CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE $(getconf LFS_CFLAGS)" CC="%{__cc}" make %{?_smp_mflags} V=1 %install cd hostapd @@ -80,14 +83,20 @@ install -m 644 hostapd.sim_db %{buildroot}/etc install -m 644 hostapd.vlan %{buildroot}/etc install -m 600 hostapd.wpa_psk %{buildroot}/etc install -m 644 hostapd.8 %{buildroot}/%{_mandir}/man8 +install -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/hostapd.service +%pre +%service_add_pre hostapd.service %post +%service_add_post hostapd.service %insserv_cleanup %preun +%service_del_preun hostapd.service %{stop_on_removal hostapd} %postun +%service_del_postun hostapd.service %{restart_on_update hostapd} %insserv_cleanup @@ -101,5 +110,6 @@ rm -rf $RPM_BUILD_ROOT %{_sbindir}/* %doc hostapd/ChangeLog COPYING hostapd/README hostapd/wired.conf hostapd/hostapd.conf %doc %{_mandir}/man8/* +%{_unitdir}/hostapd.service %changelog