blob: cc3356364816a7e08cdefe8afdca7d3573f87182 [file] [log] [blame]
Summary: Netopeer-GUI (backend)
Name: mod_netconf
Version: @VERSION@
Release: @RELEASE@
URL: https://github.com/CESNET/mod_netconf
Source: %{name}-%{version}-%{release}.tar.gz
Group: Liberouter
License: BSD
Vendor: CESNET, z.s.p.o.
Packager: @USERNAME@ <@USERMAIL@>
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
BuildRequires: apr apr-util libxml2-devel json-c-devel libwebsockets-devel libnetconf-devel
Requires: json-c libwebsockets libnetconf httpd libxml2
%description
Backend for Netopeer-GUI, available at https://github.com/CESNET/Netopeer-GUI
%prep
%setup
%build
%configure --prefix="$RPM_BUILD_ROOT" httpdmoduledir="/usr/lib64/httpd/modules" httpdconfddir="/etc/httpd/conf.d"
make
%install
#make DESTDIR=$RPM_BUILD_ROOT RUN="RPM" install
make install
%post
#add device module to configuration only when installing, not on update or reinstall.
#https://fedoraproject.org/wiki/Packaging:Guidelines?rd=Packaging/Guidelines#Running_scriptlets_only_in_certain_situations
[ -d /var/run/httpd ] || { mkdir -p /var/run/httpd && chown apache:apache /var/run/httpd; }
chcon system_u:object_r:httpd_modules_t:s0 /etc/httpd/modules/mod_netconf.so
service httpd restart
%postun
#delete device module from configuration only when erasing, not on update.
#https://fedoraproject.org/wiki/Packaging:Guidelines?rd=Packaging/Guidelines#Running_scriptlets_only_in_certain_situations
service httpd restart
rm -f /tmp/mod_netconf.sock
%files
%doc README
%{_libdir}/httpd/modules/*.so
%config(noreplace) %{_sysconfdir}/httpd/conf.d/*.conf